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 moreSource§impl Debug for AssetMetadata
impl Debug for AssetMetadata
Source§impl<'de> Deserialize<'de> for AssetMetadata
impl<'de> Deserialize<'de> for AssetMetadata
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AssetMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AssetMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for AssetMetadata
impl Serialize for AssetMetadata
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for AssetMetadata
impl RefUnwindSafe for AssetMetadata
impl Send for AssetMetadata
impl Sync for AssetMetadata
impl Unpin for AssetMetadata
impl UnwindSafe for AssetMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.