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