Struct AssetMetadata

Source
pub struct AssetMetadata {
    pub uuid: AssetUUID,
    pub source_path: PathBuf,
    pub asset_type_name: String,
    pub dependencies: Vec<AssetUUID>,
    pub variants: HashMap<String, AssetSource>,
    pub tags: Vec<String>,
}
Expand description

Serializable metadata that describes an asset and its relationships.

This structure serves as the “identity card” for each asset within the engine’s Virtual File System (VFS). It contains all the information needed by the AssetAgent to make intelligent loading and management decisions without having to load the actual asset data from disk.

A collection of these metadata entries forms the VFS “Index”.

Fields§

§uuid: AssetUUID

The unique, stable identifier for this asset. This is the primary key.

§source_path: PathBuf

The canonical path to the original source file (e.g., a .blend or .png). This is primarily used by the asset importer and editor tooling.

§asset_type_name: String

A string identifier for the asset’s type (e.g., “texture”, “mesh”, “material”). This is used by the loading system to select the correct AssetLoader trait object.

§dependencies: Vec<AssetUUID>

A list of other assets that this asset directly depends on. For example, a material asset would list its required texture assets here. This information is crucial for tracking dependencies and ensuring all necessary assets are loaded.

§variants: HashMap<String, AssetSource>

A map of available, pre-processed asset variants ready for runtime use.

The key is a variant identifier (e.g., “LOD0”, “4K”, “low_quality”), and the value is the source of the compiled, engine-ready file for that variant. (Which contains the necessary metadata for loading the asset.) This map allows the AssetAgent to make strategic choices, such as loading a lower-quality texture to stay within a VRAM budget.

§tags: Vec<String>

A collection of semantic tags for advanced querying and organization. Tags can be used to group assets for collective operations, such as loading all assets for a specific game level or character.

Trait Implementations§

Source§

impl Clone for AssetMetadata

Source§

fn clone(&self) -> AssetMetadata

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AssetMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AssetMetadata

Source§

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 Serialize for AssetMetadata

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,