Skip to main content

Resource

Trait Resource 

Source
pub trait Resource: RustEmbed {
    // Provided methods
    fn by_path(path: &str) -> Option<Cow<'static, [u8]>> { ... }
    fn has(path: &str) -> bool { ... }
    fn list(prefix: Option<&str>) -> Vec<String> { ... }
}
Expand description

Trait for types that can serve as embedded asset sources

Provided Methods§

Source

fn by_path(path: &str) -> Option<Cow<'static, [u8]>>

Get an asset by path

Source

fn has(path: &str) -> bool

Check if an asset exists

Source

fn list(prefix: Option<&str>) -> Vec<String>

List all assets

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§