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§
§impl TypeDatas
impl TypeDatas
pub fn insert<T>(&self, data: T) -> Result<(), TypeDataAlreadyInserted>where
T: HasSchema,
pub fn insert<T>(&self, data: T) -> Result<(), TypeDataAlreadyInserted>where T: HasSchema,
Insert data into the store.
pub fn insert_box(&self, data: SchemaBox) -> Result<(), TypeDataAlreadyInserted>
pub fn insert_box(&self, data: SchemaBox) -> Result<(), TypeDataAlreadyInserted>
Insert boxed data into the store.
pub 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.
pub fn iter(&self) -> impl DoubleEndedIterator
pub fn iter(&self) -> impl DoubleEndedIterator
Iterate over type datas.
Trait Implementations§
Auto Trait Implementations§
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> 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
.