Struct bones_schema::alloc::TypeDatas
source · pub struct TypeDatas(/* private fields */);
Expand description
A TypeMap
-like structure, that does not allow removing entries or updating exisintg
entries.
This structure doesn’t require a mutable reference to insert records
Implementations§
source§impl TypeDatas
impl TypeDatas
sourcepub fn insert<T: HasSchema>(
&self,
data: T,
) -> Result<(), TypeDataAlreadyInserted>
pub fn insert<T: HasSchema>( &self, data: T, ) -> Result<(), TypeDataAlreadyInserted>
Insert data into the store.
sourcepub fn insert_box(&self, data: SchemaBox) -> Result<(), TypeDataAlreadyInserted>
pub fn insert_box(&self, data: SchemaBox) -> Result<(), TypeDataAlreadyInserted>
Insert boxed data into the store.
sourcepub fn get_ref(&self, id: SchemaId) -> Option<SchemaRef<'_>>
pub fn get_ref(&self, id: SchemaId) -> Option<SchemaRef<'_>>
Borrow data from the store, if it exists.
sourcepub fn iter(&self) -> impl DoubleEndedIterator<Item = &SchemaBox>
pub fn iter(&self) -> impl DoubleEndedIterator<Item = &SchemaBox>
Iterate over type datas.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TypeDatas
impl !RefUnwindSafe for TypeDatas
impl Send for TypeDatas
impl Sync for TypeDatas
impl Unpin for TypeDatas
impl !UnwindSafe for TypeDatas
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
)