Trait Asset
Source pub trait Asset {
// Required methods
fn fetch(&self) -> Vec<u8> ⓘ;
fn fetch_static(&self) -> &'static [u8] ⓘ;
}
Expand description
Trait to be derived by asset-derive macro.
Method responsible for fetching requested resource.
§Example
ⓘlet data = Icon::Select.fetch();
Method responsible for fetching requested static resource.
NOTE: this returns an Option<&'static [u8]> because it will
only be useable for compile-time loaded resources. Dynamic
will return None.
§Example
ⓘlet static_data = Icon::Select.fetch_static().unwrap();