pub struct Resources { /* private fields */ }
Implementations§
Source§impl Resources
impl Resources
pub fn new() -> Self
pub fn init<R>(&mut self) -> ResourceId
pub fn insert<R>(&mut self, resource: R) -> ResourceIdwhere
R: Resource + 'static,
pub fn remove<R>(&mut self)where
R: Resource + 'static,
pub fn get<R>(&self) -> Option<&R>where
R: Resource + 'static,
pub fn get_or_init<R>(&mut self) -> Option<&R>
pub fn get_mut<R>(&mut self) -> Option<&mut R>where
R: Resource + 'static,
pub fn get_or_init_mut<R>(&mut self) -> Option<&mut R>
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