pub struct Resources { /* private fields */ }
Expand description
A collection of resources.
Resources
is essentially a type-map
Implementations§
§impl Resources
impl Resources
pub fn contains<T>(&self) -> boolwhere
T: HasSchema,
pub fn contains<T>(&self) -> boolwhere T: HasSchema,
Check whether or not a resource is in the store.
See get()
pub fn remove<T>(&self) -> Option<T>where
T: HasSchema,
pub fn remove<T>(&self) -> Option<T>where T: HasSchema,
Remove a resource from the store, if it is present.
pub fn get_cell<T>(&self) -> AtomicResource<T>where
T: HasSchema,
pub fn get_cell<T>(&self) -> AtomicResource<T>where T: HasSchema,
Gets a clone of the resource cell for the resource of the given type.
pub fn untyped(&self) -> &UntypedResources
pub fn untyped(&self) -> &UntypedResources
Borrow the underlying UntypedResources
store.
pub fn into_untyped(self) -> UntypedResources
pub fn into_untyped(self) -> UntypedResources
Consume Resources
and extract the underlying UntypedResources
.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Resources
impl Send for Resources
impl Sync for Resources
impl Unpin for Resources
impl !UnwindSafe for Resources
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
§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
.