• Home
  • Raw
  • Download

Lines Matching full:k

17 pub struct MapView<'msg, K: ?Sized, V: ?Sized> {
19 _phantom: PhantomData<(&'msg K, &'msg V)>,
22 impl<'msg, K: ?Sized, V: ?Sized> Copy for MapView<'msg, K, V> {}
23 impl<'msg, K: ?Sized, V: ?Sized> Clone for MapView<'msg, K, V> {
29 unsafe impl<'msg, K: ?Sized, V: ?Sized> Sync for MapView<'msg, K, V> {}
30 unsafe impl<'msg, K: ?Sized, V: ?Sized> Send for MapView<'msg, K, V> {}
32 impl<'msg, K: ?Sized, V: ?Sized> std::fmt::Debug for MapView<'msg, K, V> {
35 .field(&std::any::type_name::<K>()) in fmt()
41 pub struct MapMut<'msg, K: ?Sized, V: ?Sized> {
43 _phantom: PhantomData<(&'msg mut K, &'msg mut V)>,
46 impl<'msg, K: ?Sized, V: ?Sized> MapMut<'msg, K, V> {
52 unsafe impl<'msg, K: ?Sized, V: ?Sized> Sync for MapMut<'msg, K, V> {}
54 impl<'msg, K: ?Sized, V: ?Sized> std::fmt::Debug for MapMut<'msg, K, V> {
57 .field(&std::any::type_name::<K>()) in fmt()
63 pub struct Map<K: Proxied, V: ProxiedInMapValue<K>> {
65 _phantom: PhantomData<(PhantomData<K>, PhantomData<V>)>,
69 unsafe impl<K: Proxied, V: ProxiedInMapValue<K>> Sync for Map<K, V> {}
73 unsafe impl<K: Proxied, V: ProxiedInMapValue<K>> Send for Map<K, V> {}
75 impl<K: Proxied, V: ProxiedInMapValue<K>> SealedInternal for Map<K, V> {}
77 impl<K: Proxied, V: ProxiedInMapValue<K>> Drop for Map<K, V> {
86 pub trait ProxiedInMapValue<K>: Proxied
88 K: Proxied,
90 fn map_new(_private: Private) -> Map<K, Self>; in map_new() argument
94 unsafe fn map_free(_private: Private, map: &mut Map<K, Self>); in map_free() argument
96 fn map_clear(map: MapMut<K, Self>); in map_clear() argument
97 fn map_len(map: MapView<K, Self>) -> usize; in map_len() argument
98 fn map_insert(map: MapMut<K, Self>, key: View<'_, K>, value: impl IntoProxied<Self>) -> bool; in map_insert() argument
99 fn map_get<'a>(map: MapView<'a, K, Self>, key: View<'_, K>) -> Option<View<'a, Self>>; in map_get() argument
100 fn map_remove(map: MapMut<K, Self>, key: View<'_, K>) -> bool; in map_remove() argument
102 fn map_iter(map: MapView<K, Self>) -> MapIter<K, Self>; in map_iter() argument
103 fn map_iter_next<'a>(iter: &mut MapIter<'a, K, Self>) -> Option<(View<'a, K>, View<'a, Self>)>; in map_iter_next() argument
106 impl<K: Proxied, V: ProxiedInMapValue<K>> Proxied for Map<K, V> {
107 type View<'msg> = MapView<'msg, K, V> where K: 'msg, V: 'msg;
110 impl<K: Proxied, V: ProxiedInMapValue<K>> AsView for Map<K, V> {
113 fn as_view(&self) -> MapView<'_, K, V> { in as_view() argument
118 impl<K: Proxied, V: ProxiedInMapValue<K>> MutProxied for Map<K, V> {
119 type Mut<'msg> = MapMut<'msg, K, V> where K: 'msg, V: 'msg;
122 impl<K: Proxied, V: ProxiedInMapValue<K>> AsMut for Map<K, V> {
125 fn as_mut(&mut self) -> MapMut<'_, K, V> { in as_mut() argument
130 impl<'msg, K: Proxied, V: ProxiedInMapValue<K>> SealedInternal for MapView<'msg, K, V> {}
132 impl<'msg, K: Proxied, V: ProxiedInMapValue<K>> Proxy<'msg> for MapView<'msg, K, V> {}
134 impl<'msg, K: Proxied, V: ProxiedInMapValue<K>> AsView for MapView<'msg, K, V> {
135 type Proxied = Map<K, V>;
137 fn as_view(&self) -> MapView<'_, K, V> { in as_view() argument
142 impl<'msg, K: Proxied, V: ProxiedInMapValue<K>> IntoView<'msg> for MapView<'msg, K, V> {
143 fn into_view<'shorter>(self) -> MapView<'shorter, K, V> in into_view() argument
151 impl<'msg, K: Proxied, V: ProxiedInMapValue<K>> ViewProxy<'msg> for MapView<'msg, K, V> {}
153 impl<'msg, K: Proxied, V: ProxiedInMapValue<K>> SealedInternal for MapMut<'msg, K, V> {}
155 impl<'msg, K: Proxied, V: ProxiedInMapValue<K>> Proxy<'msg> for MapMut<'msg, K, V> {}
157 impl<'msg, K: Proxied, V: ProxiedInMapValue<K>> AsView for MapMut<'msg, K, V> {
158 type Proxied = Map<K, V>;
160 fn as_view(&self) -> MapView<'_, K, V> { in as_view() argument
165 impl<'msg, K: Proxied, V: ProxiedInMapValue<K>> IntoView<'msg> for MapMut<'msg, K, V> {
166 fn into_view<'shorter>(self) -> MapView<'shorter, K, V> in into_view() argument
174 impl<'msg, K: Proxied, V: ProxiedInMapValue<K>> AsMut for MapMut<'msg, K, V> {
175 type MutProxied = Map<K, V>;
177 fn as_mut(&mut self) -> MapMut<'_, K, V> { in as_mut() argument
182 impl<'msg, K: Proxied, V: ProxiedInMapValue<K>> IntoMut<'msg> for MapMut<'msg, K, V> {
183 fn into_mut<'shorter>(self) -> MapMut<'shorter, K, V> in into_mut() argument
191 impl<'msg, K: Proxied, V: ProxiedInMapValue<K>> MutProxy<'msg> for MapMut<'msg, K, V> {}
193 impl<K, V> Map<K, V>
195 K: Proxied,
196 V: ProxiedInMapValue<K>,
202 pub fn as_mut(&mut self) -> MapMut<'_, K, V> { in as_mut() argument
206 pub fn as_view(&self) -> MapView<'_, K, V> { in as_view() argument
220 impl<K, V> Default for Map<K, V>
222 K: Proxied,
223 V: ProxiedInMapValue<K>,
231 impl<'msg, K: ?Sized, V: ?Sized> MapView<'msg, K, V> {
245 impl<'msg, K, V> MapView<'msg, K, V>
247 K: Proxied + 'msg,
248 V: ProxiedInMapValue<K> + 'msg,
250 pub fn get<'a>(self, key: impl Into<View<'a, K>>) -> Option<View<'msg, V>> in get()
252 K: 'a, in get()
267 /// The iterator element type is `(View<K>, View<V>)`.
269 pub fn iter(self) -> MapIter<'msg, K, V> { in iter() argument
275 /// The iterator element type is `View<K>`.
276 pub fn keys(self) -> impl Iterator<Item = View<'msg, K>> + 'msg { in keys()
277 self.into_iter().map(|(k, _)| k) in keys()
289 impl<'msg, K: ?Sized, V: ?Sized> MapMut<'msg, K, V> {
303 impl<'msg, K, V> MapMut<'msg, K, V>
305 K: Proxied + 'msg,
306 V: ProxiedInMapValue<K> + 'msg,
319 pub fn insert<'a>(&mut self, key: impl Into<View<'a, K>>, value: impl IntoProxied<V>) -> bool in insert() argument
321 K: 'a, in insert()
326 pub fn remove<'a>(&mut self, key: impl Into<View<'a, K>>) -> bool in remove()
328 K: 'a, in remove()
337 pub fn get<'a>(&self, key: impl Into<View<'a, K>>) -> Option<View<V>> in get()
339 K: 'a, in get()
346 src: impl IntoIterator<Item = (impl Into<View<'a, K>>, impl IntoProxied<V>)>, in copy_from() argument
348 K: 'a, in copy_from()
352 for (k, v) in src.into_iter() { in copy_from()
353 self.insert(k, v); in copy_from()
359 /// The iterator element type is `(View<K>, View<V>)`.
360 pub fn iter(&self) -> MapIter<K, V> { in iter() argument
366 /// The iterator element type is `View<K>`.
367 pub fn keys(&self) -> impl Iterator<Item = View<'_, K>> + '_ { in keys()
379 impl<'msg, K, V> IntoProxied<Map<K, V>> for MapView<'msg, K, V>
381 K: Proxied,
382 V: ProxiedInMapValue<K>,
385 fn into_proxied(self, _private: Private) -> Map<K, V> { in into_proxied() argument
386 let mut m = Map::<K, V>::new(); in into_proxied()
392 impl<'msg, K, V> IntoProxied<Map<K, V>> for MapMut<'msg, K, V>
394 K: Proxied,
395 V: ProxiedInMapValue<K>,
398 fn into_proxied(self, _private: Private) -> Map<K, V> { in into_proxied() argument
406 pub struct MapIter<'msg, K: ?Sized, V: ?Sized> {
408 _phantom: PhantomData<(&'msg K, &'msg V)>,
411 impl<'msg, K: ?Sized, V: ?Sized> MapIter<'msg, K, V> {
414 /// - The untyped `raw` iterator must be for a map of `K,V`.
427 impl<'msg, K, V> Iterator for MapIter<'msg, K, V>
429 K: Proxied + 'msg,
430 V: ProxiedInMapValue<K> + 'msg,
432 type Item = (View<'msg, K>, View<'msg, V>);
439 impl<'msg, K, V> IntoIterator for MapView<'msg, K, V>
441 K: Proxied + 'msg,
442 V: ProxiedInMapValue<K> + 'msg,
444 type IntoIter = MapIter<'msg, K, V>;
445 type Item = (View<'msg, K>, View<'msg, V>);
447 fn into_iter(self) -> MapIter<'msg, K, V> { in into_iter() argument
452 impl<'msg, K, V> IntoIterator for &'msg Map<K, V>
454 K: Proxied + 'msg,
455 V: ProxiedInMapValue<K> + 'msg,
457 type IntoIter = MapIter<'msg, K, V>;
458 type Item = (View<'msg, K>, View<'msg, V>);
460 fn into_iter(self) -> MapIter<'msg, K, V> { in into_iter() argument
465 impl<'a, 'msg, K, V> IntoIterator for &'a MapView<'msg, K, V>
468 K: Proxied + 'msg,
469 V: ProxiedInMapValue<K> + 'msg,
471 type IntoIter = MapIter<'msg, K, V>;
472 type Item = (View<'msg, K>, View<'msg, V>);
474 fn into_iter(self) -> MapIter<'msg, K, V> { in into_iter() argument
479 impl<'a, 'msg, K, V> IntoIterator for &'a MapMut<'msg, K, V>
482 K: Proxied + 'msg,
483 V: ProxiedInMapValue<K> + 'msg,
485 type IntoIter = MapIter<'a, K, V>;
488 type Item = (View<'a, K>, View<'a, V>);
490 fn into_iter(self) -> MapIter<'a, K, V> { in into_iter() argument
495 impl<'msg, 'k, 'v, KView, VView, K, V> Extend<(KView, VView)> for MapMut<'msg, K, V>
497 K: Proxied + 'msg + 'k,
498 V: ProxiedInMapValue<K> + 'msg + 'v,
499 KView: Into<View<'k, K>>,
503 for (k, v) in iter.into_iter() { in extend()
504 self.insert(k, v); in extend()