[][src]Trait polyhorn_ui::assets::Asset

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

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

Required methods

pub fn package(&self) -> &str[src]

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.

pub fn name(&self) -> &str[src]

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...