pub struct AssetLoader;Expand description
Provides access to the assets compiled into the application binary,
through the registered IAssetLoader.
Implementations§
Source§impl AssetLoader
impl AssetLoader
Sourcepub fn set_default_assembly(assembly: &AssetAssembly)
pub fn set_default_assembly(assembly: &AssetAssembly)
Sets the default assembly from which to load embedded-resource
(resm:) assets for which no assembly is specified.
Sourcepub fn exists(uri: &Uri, base_uri: Option<&Uri>) -> bool
pub fn exists(uri: &Uri, base_uri: Option<&Uri>) -> bool
Checks if an asset with the specified URI exists.
Sourcepub fn open(uri: &Uri, base_uri: Option<&Uri>) -> Result<Box<dyn AssetStream>>
pub fn open(uri: &Uri, base_uri: Option<&Uri>) -> Result<Box<dyn AssetStream>>
Opens the asset with the requested URI.
Sourcepub fn open_and_get_assembly(
uri: &Uri,
base_uri: Option<&Uri>,
) -> Result<(Box<dyn AssetStream>, AssetAssembly)>
pub fn open_and_get_assembly( uri: &Uri, base_uri: Option<&Uri>, ) -> Result<(Box<dyn AssetStream>, AssetAssembly)>
Opens the asset with the requested URI and returns the asset stream along with the assembly containing the asset.
Sourcepub fn get_assembly(uri: &Uri, base_uri: Option<&Uri>) -> Option<AssetAssembly>
pub fn get_assembly(uri: &Uri, base_uri: Option<&Uri>) -> Option<AssetAssembly>
Extracts the assembly information from a URI.
Sourcepub fn get_assets(uri: &Uri, base_uri: Option<&Uri>) -> Vec<Uri>
pub fn get_assets(uri: &Uri, base_uri: Option<&Uri>) -> Vec<Uri>
Gets all assets of a folder and its subfolders that match the specified URI.
Sourcepub fn invalidate_assembly_cache(name: &str)
pub fn invalidate_assembly_cache(name: &str)
Removes the cached descriptor of the assembly with the given name.
Sourcepub fn invalidate_assembly_cache_all()
pub fn invalidate_assembly_cache_all()
Removes all cached assembly descriptors.
Auto Trait Implementations§
impl Freeze for AssetLoader
impl RefUnwindSafe for AssetLoader
impl Send for AssetLoader
impl Sync for AssetLoader
impl Unpin for AssetLoader
impl UnsafeUnpin for AssetLoader
impl UnwindSafe for AssetLoader
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more