[][src]Trait polyhorn_ios::assets::Asset

pub trait Asset {
    fn package(&self) -> &str;
fn name(&self) -> &str; }

Trait that is implemented by all static-typed asset in the assets/ folder of a package.

Required methods

fn package(&self) -> &str

This function returns the name of the package that an asset originates from. Different packages are allowed to have assets with an identical name. Conversely, packages cannot access assets that originate from a different package. If you want to know the name of the package that an asset originated from, you can use this function.

fn name(&self) -> &str

This function returns the name of this asset (without any file extension). Assets must be unique regardless of their suffix / extension. For multi-DPI assets, the name does never include the DPI suffix. The asset!(...) macro does not accept providing a name that includes a DPI suffix anyway.

Loading content...

Implementors

impl Asset for ImageAsset[src]

Loading content...