pub struct MapView<'msg, K: ?Sized, V: ?Sized> { /* private fields */ }Expand description
A view of a map field.
This is a proxy type that is conceptually similar to a &Map<K, V>
Implementations§
Source§impl<'msg, K: MapKey, V: MapValue> MapView<'msg, K, V>
impl<'msg, K: MapKey, V: MapValue> MapView<'msg, K, V>
pub fn get<'a>(self, key: impl Into<View<'a, K>>) -> Option<View<'msg, V>>where
K: 'a,
pub fn len(self) -> usize
pub fn is_empty(self) -> bool
pub fn contains_key<'a>(self, key: impl Into<View<'a, K>>) -> boolwhere
K: 'a,
Sourcepub fn iter(self) -> MapIter<'msg, K, V> ⓘ
pub fn iter(self) -> MapIter<'msg, K, V> ⓘ
Returns an iterator visiting all key-value pairs in arbitrary order.
The iterator element type is (View<K>, View<V>).
This is an alias for <Self as IntoIterator>::into_iter.
Trait Implementations§
impl<'msg, K: ?Sized, V: ?Sized> Copy for MapView<'msg, K, V>
Source§impl<'msg, K: MapKey, V: MapValue> IntoIterator for MapView<'msg, K, V>
impl<'msg, K: MapKey, V: MapValue> IntoIterator for MapView<'msg, K, V>
Source§type Item = (<K as ProtoObject>::View<'msg>, <V as ProtoObject>::View<'msg>)
type Item = (<K as ProtoObject>::View<'msg>, <V as ProtoObject>::View<'msg>)
The type of the elements being iterated over.
Source§impl<'a, 'msg, K: MapKey, V: MapValue> IntoIterator for &'a MapView<'msg, K, V>where
'msg: 'a,
impl<'a, 'msg, K: MapKey, V: MapValue> IntoIterator for &'a MapView<'msg, K, V>where
'msg: 'a,
Source§type Item = (<K as ProtoObject>::View<'msg>, <V as ProtoObject>::View<'msg>)
type Item = (<K as ProtoObject>::View<'msg>, <V as ProtoObject>::View<'msg>)
The type of the elements being iterated over.
impl<'msg, K: MapKey, V: MapValue> IntoProxied<Map<K, V>> for MapView<'msg, K, V>where
View<'msg, V>: IntoProxied<V>,
impl<'msg, K: MapKey, V: MapValue> SealedInternal for MapView<'msg, K, V>
impl<'msg, K: ?Sized, V: ?Sized> Send for MapView<'msg, K, V>
impl<'msg, K: ?Sized, V: ?Sized> Sync for MapView<'msg, K, V>
Auto Trait Implementations§
impl<'msg, K, V> Forget for MapView<'msg, K, V>
impl<'msg, K, V> Freeze for MapView<'msg, K, V>
impl<'msg, K, V> Move for MapView<'msg, K, V>
impl<'msg, K, V> RefUnwindSafe for MapView<'msg, K, V>
impl<'msg, K, V> Unpin for MapView<'msg, K, V>
impl<'msg, K, V> UnsafeUnpin for MapView<'msg, K, V>
impl<'msg, K, V> UnwindSafe for MapView<'msg, K, V>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more