Skip to main content

Asset

Trait Asset 

Source
pub trait Asset {
    // Required methods
    fn id(&self) -> &str;
    fn path(&self) -> &str;
    fn hash(&self) -> &DocumentId;
    fn size(&self) -> u64;
    fn mime_type(&self) -> &str;
}
Expand description

Common trait for all asset types.

Required Methods§

Source

fn id(&self) -> &str

Get the asset’s unique identifier.

Source

fn path(&self) -> &str

Get the path to the asset file within the archive.

Source

fn hash(&self) -> &DocumentId

Get the content hash of the asset.

Source

fn size(&self) -> u64

Get the size in bytes.

Source

fn mime_type(&self) -> &str

Get the MIME type.

Implementors§