pub enum AssetEntry {
Image(ImageAsset),
Font(FontAsset),
Embed(EmbedAsset),
Alias(AssetAlias),
}Expand description
Generic asset entry that can represent any asset type.
Variants§
Image(ImageAsset)
Image asset.
Font(FontAsset)
Font asset.
Embed(EmbedAsset)
Embedded file asset.
Alias(AssetAlias)
Alias to another asset (for deduplication).
When two assets have identical content (same hash), one can be stored as an alias pointing to the canonical asset. This saves storage space while maintaining separate logical identities.
Implementations§
Source§impl AssetEntry
impl AssetEntry
Sourcepub fn path(&self) -> &str
pub fn path(&self) -> &str
Get the asset path.
For aliases, this returns an empty string as aliases don’t have their own path.
Use resolve_path with the asset index to get the canonical asset’s path.
Sourcepub fn hash(&self) -> &DocumentId
pub fn hash(&self) -> &DocumentId
Get the asset hash.
Trait Implementations§
Source§impl Clone for AssetEntry
impl Clone for AssetEntry
Source§fn clone(&self) -> AssetEntry
fn clone(&self) -> AssetEntry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AssetEntry
impl Debug for AssetEntry
Source§impl<'de> Deserialize<'de> for AssetEntry
impl<'de> Deserialize<'de> for AssetEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AssetEntry
impl PartialEq for AssetEntry
Source§impl Serialize for AssetEntry
impl Serialize for AssetEntry
impl StructuralPartialEq for AssetEntry
Auto Trait Implementations§
impl Freeze for AssetEntry
impl RefUnwindSafe for AssetEntry
impl Send for AssetEntry
impl Sync for AssetEntry
impl Unpin for AssetEntry
impl UnsafeUnpin for AssetEntry
impl UnwindSafe for AssetEntry
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