Struct bones_ecs::resources::UntypedResources
source · pub struct UntypedResources { /* private fields */ }
Expand description
Implementations§
source§impl UntypedResources
impl UntypedResources
sourcepub fn new() -> Self
pub fn new() -> Self
Create an empty UntypedResources
.
sourcepub fn contains_cell(&self, id: SchemaId) -> bool
pub fn contains_cell(&self, id: SchemaId) -> bool
Check whether or not a cell for the given resource has been initialized yet.
sourcepub fn contains(&self, id: SchemaId) -> bool
pub fn contains(&self, id: SchemaId) -> bool
Check whether or not the resource with the given ID is present.
sourcepub fn insert_cell(
&self,
cell: AtomicUntypedResource,
) -> Result<(), CellAlreadyPresentError>
pub fn insert_cell( &self, cell: AtomicUntypedResource, ) -> Result<(), CellAlreadyPresentError>
This is an advanced use-case function that allows you to insert a resource cell directly.
Normally this is completely unnecessary, because cells are automatically inserted lazily as requested.
Inserting this manually is used internally for shared resources, by inserting the same cell into multiple worlds.
§Errors
This will error if there is already a cell for the resource present. You cannot add a new cell once one has already been inserted.
sourcepub fn get(&self, schema: &'static Schema) -> &UntypedResource
pub fn get(&self, schema: &'static Schema) -> &UntypedResource
Borrow the resource for the given schema.
sourcepub fn get_cell(&self, schema: &'static Schema) -> AtomicUntypedResource
pub fn get_cell(&self, schema: &'static Schema) -> AtomicUntypedResource
Get a cell for the resource with the given schema.
Trait Implementations§
source§impl Clone for UntypedResources
impl Clone for UntypedResources
source§impl Default for UntypedResources
impl Default for UntypedResources
source§fn default() -> UntypedResources
fn default() -> UntypedResources
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for UntypedResources
impl !RefUnwindSafe for UntypedResources
impl Send for UntypedResources
impl Sync for UntypedResources
impl Unpin for UntypedResources
impl !UnwindSafe for UntypedResources
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
)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
.