pub struct BuiltInResourcesContainer { /* private fields */ }Expand description
A container for built-in resources. Every built-in resource is registered using its id defined at the creation stage.
Implementations§
Source§impl BuiltInResourcesContainer
impl BuiltInResourcesContainer
Sourcepub fn add<T>(
&mut self,
resource: BuiltInResource<T>,
) -> Option<UntypedBuiltInResource>where
T: TypedResourceData,
pub fn add<T>(
&mut self,
resource: BuiltInResource<T>,
) -> Option<UntypedBuiltInResource>where
T: TypedResourceData,
Adds a new typed built-in resource and removes the previous one with the same id (if any).
Sourcepub fn add_untyped(
&mut self,
resource: UntypedBuiltInResource,
) -> Option<UntypedBuiltInResource>
pub fn add_untyped( &mut self, resource: UntypedBuiltInResource, ) -> Option<UntypedBuiltInResource>
Adds a new untyped built-in resource and removes the previous one with the same id (if any).
Sourcepub fn remove(&mut self, id: impl AsRef<Path>) -> Option<UntypedBuiltInResource>
pub fn remove(&mut self, id: impl AsRef<Path>) -> Option<UntypedBuiltInResource>
Tries to remove a built-in resource by its path.
Sourcepub fn find_by_uuid(&self, uuid: Uuid) -> Option<&UntypedBuiltInResource>
pub fn find_by_uuid(&self, uuid: Uuid) -> Option<&UntypedBuiltInResource>
Tries to find a built-in resource by its uuid.
Sourcepub fn is_built_in_resource_path(&self, resource: impl AsRef<Path>) -> bool
pub fn is_built_in_resource_path(&self, resource: impl AsRef<Path>) -> bool
Checks whether the given resource path corresponds to a built-in resource or not.
Sourcepub fn is_built_in_resource(
&self,
resource: impl AsRef<UntypedResource>,
) -> bool
pub fn is_built_in_resource( &self, resource: impl AsRef<UntypedResource>, ) -> bool
Checks whether the given resource is a built-in resource instance or not.
Trait Implementations§
Source§impl Clone for BuiltInResourcesContainer
impl Clone for BuiltInResourcesContainer
Source§fn clone(&self) -> BuiltInResourcesContainer
fn clone(&self) -> BuiltInResourcesContainer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for BuiltInResourcesContainer
impl Default for BuiltInResourcesContainer
Source§fn default() -> BuiltInResourcesContainer
fn default() -> BuiltInResourcesContainer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BuiltInResourcesContainer
impl !RefUnwindSafe for BuiltInResourcesContainer
impl Send for BuiltInResourcesContainer
impl Sync for BuiltInResourcesContainer
impl Unpin for BuiltInResourcesContainer
impl UnsafeUnpin for BuiltInResourcesContainer
impl !UnwindSafe for BuiltInResourcesContainer
Blanket Implementations§
Source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
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§impl<T, U> ObjectOrVariant<T> for Uwhere
PhantomData<U>: ObjectOrVariantHelper<T, U>,
impl<T, U> ObjectOrVariant<T> for Uwhere
PhantomData<U>: ObjectOrVariantHelper<T, U>,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.