pub struct LoReAll<'a> { /* private fields */ }Implementations§
Methods from Deref<Target = LocalResourceStorage>§
Sourcepub fn insert<R>(&mut self, resource: R)where
R: LocalResource,
pub fn insert<R>(&mut self, resource: R)where
R: LocalResource,
Inserts a new resource into the storage.
If a resource of the same type already exists, it will be replaced.
Sourcepub fn fetch<R>(&self) -> &Rwhere
R: LocalResource,
pub fn fetch<R>(&self) -> &Rwhere
R: LocalResource,
Sourcepub fn fetch_mut<R>(&mut self) -> &mut Rwhere
R: LocalResource,
pub fn fetch_mut<R>(&mut self) -> &mut Rwhere
R: LocalResource,
Retrieves a mutable reference to a resource of type R.
§Panics
Panics if the resource does not exist.
Sourcepub fn get<R>(&self) -> Option<&R>where
R: LocalResource + 'static,
pub fn get<R>(&self) -> Option<&R>where
R: LocalResource + 'static,
Retrieves an immutable reference to a resource of type R.
Returns Some(&R) if the resource exists, otherwise returns None.
Sourcepub fn get_mut<R>(&mut self) -> Option<&mut R>where
R: LocalResource + 'static,
pub fn get_mut<R>(&mut self) -> Option<&mut R>where
R: LocalResource + 'static,
Retrieves a mutable reference to a resource of type R.
Returns Some(&mut R) if the resource exists, otherwise returns None.
Sourcepub fn remove<R>(&mut self) -> Option<R>where
R: LocalResource,
pub fn remove<R>(&mut self) -> Option<R>where
R: LocalResource,
Removes a resource of type R from the storage.
Returns Some(R) if the resource was present, otherwise None.
§Panics
Panics if the resource stored is not of the expected type R. Should be very unlikely.
Sourcepub fn contains<R>(&self) -> boolwhere
R: LocalResource,
pub fn contains<R>(&self) -> boolwhere
R: LocalResource,
Checks if a resource of type R exists in the storage.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for LoReAll<'a>
impl<'a> !RefUnwindSafe for LoReAll<'a>
impl<'a> !Send for LoReAll<'a>
impl<'a> !Sync for LoReAll<'a>
impl<'a> Unpin for LoReAll<'a>
impl<'a> !UnwindSafe for LoReAll<'a>
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