IAssetLoader
trait · ferroui-base · v0.5.0
trait IAssetLoader: 'static
Loads assets compiled into the application binary.
The interface and its service registration are considered unstable; use
the functions of AssetLoader instead.
Members
set_default_assemblyexistsopenopen_and_get_assemblyget_assemblyget_assetsinvalidate_assembly_cacheinvalidate_assembly_cache_all
set_default_assembly
fn set_default_assembly(self: &Self, assembly: &AssetAssembly)
Sets the default assembly from which to load embedded-resource
(resm:) assets for which no assembly is specified.
exists
fn exists(self: &Self, uri: &UriRef, base_uri: Option<&url::Url>) -> bool
Checks if an asset with the specified URI exists.
base_uri is a base URI to use if uri is relative: the reference
resolves against it with UriRef::resolve.
open
fn open(self: &Self, uri: &UriRef, base_uri: Option<&url::Url>) -> std::io::Result<Box<dyn AssetStream>>
Opens the asset with the requested URI.
Fails with std::io::ErrorKind::NotFound when the asset could not
be found.
open_and_get_assembly
fn open_and_get_assembly(self: &Self, uri: &UriRef, base_uri: Option<&url::Url>) -> std::io::Result<(Box<dyn AssetStream>, AssetAssembly)>
Opens the asset with the requested URI and returns the asset stream along with the assembly containing the asset.
get_assembly
fn get_assembly(self: &Self, uri: &UriRef, base_uri: Option<&url::Url>) -> Option<AssetAssembly>
Extracts the assembly information from a URI.
get_assets
fn get_assets(self: &Self, uri: &UriRef, base_uri: Option<&url::Url>) -> Vec<url::Url>
Gets all assets of a folder and its subfolders that match the specified URI.
invalidate_assembly_cache
fn invalidate_assembly_cache(self: &Self, name: &str)
Removes the cached descriptor of the assembly with the given name, so that assets it registered afterwards become visible.
invalidate_assembly_cache_all
fn invalidate_assembly_cache_all(self: &Self)
Removes all cached assembly descriptors.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.