pub struct ResourceTable { /* private fields */ }Implementations§
Source§impl ResourceTable
impl ResourceTable
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn add<T: Resource>(&self, rid: ResourceId, resource: T)
pub fn add_arc<T: Resource>(&self, rid: ResourceId, resource: Arc<T>)
pub fn add_arc_dyn(&self, rid: ResourceId, resource: Arc<dyn Resource>)
pub fn has(&self, rid: ResourceId) -> bool
pub fn get<T: Resource>(&self, rid: ResourceId) -> Option<Arc<T>>
pub fn get_any(&self, rid: ResourceId) -> Option<Arc<dyn Resource>>
pub fn take<T: Resource>(&self, rid: ResourceId) -> Option<Arc<T>>
pub fn take_any(&self, rid: ResourceId) -> Option<Arc<dyn Resource>>
Trait Implementations§
Source§impl Debug for ResourceTable
impl Debug for ResourceTable
Source§impl Default for ResourceTable
impl Default for ResourceTable
Source§fn default() -> ResourceTable
fn default() -> ResourceTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ResourceTable
impl !RefUnwindSafe for ResourceTable
impl Send for ResourceTable
impl Sync for ResourceTable
impl Unpin for ResourceTable
impl !UnwindSafe for ResourceTable
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more