Struct bones_asset::SMap
pub struct SMap<K, V>where
K: HasSchema,
V: HasSchema,{ /* private fields */ }
Expand description
Implementations§
§impl<K, V> SMap<K, V>where
K: HasSchema,
V: HasSchema,
impl<K, V> SMap<K, V>where K: HasSchema, V: HasSchema,
pub 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.
pub fn into_schema_map(self) -> SchemaMap
pub fn into_schema_map(self) -> SchemaMap
Convert into an untyped SchemaMap
.
§impl<K, V> SMap<K, V>where
K: HasSchema,
V: HasSchema,
impl<K, V> SMap<K, V>where K: HasSchema, V: HasSchema,
pub 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.
pub 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.
pub 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§
§impl<K, V> HasSchema for SMap<K, V>where
K: HasSchema,
V: HasSchema,
impl<K, V> HasSchema for SMap<K, V>where K: HasSchema, V: HasSchema,
§fn register_schema()
fn register_schema()
Register this schema with the global schema registry. Read more
§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
§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
§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
§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
§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 SchemaRef
§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 SchemaRefMut
§impl<'a, K, V> IntoIterator for &'a SMap<K, V>where
K: HasSchema,
V: HasSchema,
impl<'a, K, V> IntoIterator for &'a SMap<K, V>where K: HasSchema, V: HasSchema,
Auto Trait Implementations§
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>where K: Unpin, V: Unpin,
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