Struct bones_lib::prelude::bones_schema::alloc::SMap
pub struct SMap<K, V>{ /* private fields */ }
Expand description
Implementations§
§impl<K, V> SMap<K, V>
impl<K, V> SMap<K, V>
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
.
pub 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.
§impl<K, V> SMap<K, V>
impl<K, V> SMap<K, V>
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> FromIterator<(K, V)> for SMap<K, V>
impl<K, V> FromIterator<(K, V)> for SMap<K, V>
§impl<K, V> HasSchema for SMap<K, V>
impl<K, V> HasSchema for SMap<K, V>
§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>
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &World) -> T
fn from_world(_world: &World) -> T
Creates
Self
using data from the given World
.