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.
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
impl Clone for AssetMetadata
Source§fn clone(&self) -> AssetMetadata
fn clone(&self) -> AssetMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more