pub struct Asset { /* private fields */ }Expand description
A compile-time asset handle — the typed, typo-proof way to refer to a
bundled asset. The assets module generated from your assets/ dir (by
rosace-asset-codegen in build.rs) is full of const Assets:
assets::LOGO, assets::icons::HOME. Passing assets::LGO won’t compile,
and your editor autocompletes the real names.
It’s a thin newtype over the logical name, so it costs nothing at runtime
and interops with the raw-string escape hatch through AssetRef.
Implementations§
Trait Implementations§
Source§impl AssetRef for &Asset
impl AssetRef for &Asset
Source§fn asset_name(&self) -> &str
fn asset_name(&self) -> &str
The logical asset name to resolve.
impl Copy for Asset
impl Eq for Asset
impl StructuralPartialEq for Asset
Auto Trait Implementations§
impl Freeze for Asset
impl RefUnwindSafe for Asset
impl Send for Asset
impl Sync for Asset
impl Unpin for Asset
impl UnsafeUnpin for Asset
impl UnwindSafe for Asset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more