Struct bones_lib::prelude::UntypedResources
pub struct UntypedResources { /* private fields */ }
Expand description
Implementations§
§impl UntypedResources
impl UntypedResources
pub fn new() -> UntypedResources
pub fn new() -> UntypedResources
Create an empty UntypedResources
.
pub 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.
pub 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.
pub fn insert_cell(
&self,
cell: Arc<UntypedResource>,
) -> Result<(), CellAlreadyPresentError>
pub fn insert_cell( &self, cell: Arc<UntypedResource>, ) -> 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.
pub fn get(&self, schema: &'static Schema) -> &UntypedResource
pub fn get(&self, schema: &'static Schema) -> &UntypedResource
Borrow the resource for the given schema.
pub fn get_cell(&self, schema: &'static Schema) -> Arc<UntypedResource>
pub fn get_cell(&self, schema: &'static Schema) -> Arc<UntypedResource>
Get a cell for the resource with the given schema.
Trait Implementations§
§impl Clone for UntypedResources
impl Clone for UntypedResources
§fn clone(&self) -> UntypedResources
fn clone(&self) -> UntypedResources
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Default for UntypedResources
impl Default for UntypedResources
§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
)§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
.