pub struct SMap<K, V>{ /* private fields */ }Expand description
Implementations§
Source§impl<K, V> SMap<K, V>
impl<K, V> SMap<K, V>
Sourcepub fn insert(&mut self, k: K, v: V) -> Option<V>
pub fn insert(&mut self, k: K, v: V) -> Option<V>
Insert an entry into the map, returning the previous value, if it exists.
Sourcepub fn get_mut(&mut self, key: &K) -> Option<&mut V>
pub fn get_mut(&mut self, key: &K) -> Option<&mut V>
Get a mutable reference to an item in the map.
Sourcepub fn into_schema_map(self) -> SchemaMap
pub fn into_schema_map(self) -> SchemaMap
Convert into an untyped SchemaMap.
Sourcepub fn contains_key(&self, key: &K) -> bool
pub fn contains_key(&self, key: &K) -> bool
Returns true if the map contains a value for the specified key.
Source§impl<K, V> SMap<K, V>
impl<K, V> SMap<K, V>
Sourcepub fn iter(
&self,
) -> Map<Iter<'_, SchemaBox, SchemaBox>, for<'a> fn((&'a SchemaBox, &'a SchemaBox)) -> (&'a K, &'a V)> ⓘ
pub fn iter( &self, ) -> Map<Iter<'_, SchemaBox, SchemaBox>, for<'a> fn((&'a SchemaBox, &'a SchemaBox)) -> (&'a K, &'a V)> ⓘ
Iterate over entries in the map.
Sourcepub fn iter_mut(
&mut self,
) -> Map<IterMut<'_, SchemaBox, SchemaBox>, for<'a> fn((&'a SchemaBox, &'a mut SchemaBox)) -> (&'a K, &'a mut V)> ⓘ
pub fn iter_mut( &mut self, ) -> Map<IterMut<'_, SchemaBox, SchemaBox>, for<'a> fn((&'a SchemaBox, &'a mut SchemaBox)) -> (&'a K, &'a mut V)> ⓘ
Iterate over entries in the map.
Sourcepub fn keys(
&self,
) -> Map<Keys<'_, SchemaBox, SchemaBox>, for<'a> fn(&'a SchemaBox) -> &'a K> ⓘ
pub fn keys( &self, ) -> Map<Keys<'_, SchemaBox, SchemaBox>, for<'a> fn(&'a SchemaBox) -> &'a K> ⓘ
Iterate over keys in the map.
Trait Implementations§
Source§impl<K, V> FromIterator<(K, V)> for SMap<K, V>
impl<K, V> FromIterator<(K, V)> for SMap<K, V>
Source§impl<K, V> HasSchema for SMap<K, V>
impl<K, V> HasSchema for SMap<K, V>
Source§fn register_schema()
fn register_schema()
Register this schema with the global schema registry. Read more
Source§fn cast<T>(this: &Self) -> &Twhere
T: HasSchema,
fn cast<T>(this: &Self) -> &Twhere
T: HasSchema,
Cast a reference of this type to a reference of another type with the same memory layout. Read more
Source§fn try_cast<T>(this: &Self) -> Result<&T, SchemaMismatchError>where
T: HasSchema,
fn try_cast<T>(this: &Self) -> Result<&T, SchemaMismatchError>where
T: HasSchema,
Cast a reference of this type to a reference of another type with the same memory layout. Read more
Source§fn cast_mut<T>(this: &mut Self) -> &mut Twhere
T: HasSchema,
fn cast_mut<T>(this: &mut Self) -> &mut Twhere
T: HasSchema,
Cast a mutable reference of this type to a reference of another type with the same memory
layout. Read more
Source§fn try_cast_mut<T>(this: &mut Self) -> Result<&mut T, SchemaMismatchError>where
T: HasSchema,
fn try_cast_mut<T>(this: &mut Self) -> Result<&mut T, SchemaMismatchError>where
T: HasSchema,
Cast a mutable reference of this type to a reference of another type with the same memory
layout. Read more
Source§fn as_schema_ref(&self) -> SchemaRef<'_>where
Self: Sized,
fn as_schema_ref(&self) -> SchemaRef<'_>where
Self: Sized,
Converts a reference of
T to a SchemaRefSource§fn as_schema_mut(&mut self) -> SchemaRefMut<'_>where
Self: Sized,
fn as_schema_mut(&mut self) -> SchemaRefMut<'_>where
Self: Sized,
Converts a reference of
T to a SchemaRefMutSource§impl<'a, K, V> IntoIterator for &'a SMap<K, V>
impl<'a, K, V> IntoIterator for &'a SMap<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for SMap<K, V>
impl<K, V> !RefUnwindSafe for SMap<K, V>
impl<K, V> Send for SMap<K, V>
impl<K, V> Sync for SMap<K, V>
impl<K, V> Unpin for SMap<K, V>
impl<K, V> !UnwindSafe for SMap<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &World) -> T
fn from_world(_world: &World) -> T
Creates
Self using data from the given World.