FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    get_assembly

    fn get_assembly(self: &Self, uri: &UriRef, base_uri: Option<&url::Url>) -> Option<AssetAssembly>
    

    Extracts the assembly information from a URI.

    Source

    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.

    Source

    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.

    Source

    invalidate_assembly_cache_all

    fn invalidate_assembly_cache_all(self: &Self)
    

    Removes all cached assembly descriptors.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.