Expand description
§amethyst_assets
Asset management crate. Designed with the following goals in mind:
- Extensibility
- Asynchronous & Parallel using Rayon
- Allow different sources
Macros§
- register_
format - Register a dynamically deserializable format for given asset data type.
Note that provided asset data type must also be registered using
register_format_typemacro. - register_
format_ type - Register specific asset data types that can be deserialized with dynamic formats. This is very useful for all assets that have any format types explicitly implemented. Registered assets are used during loading of nested assets to determine format type which will be used to deserialize that asset.
Structs§
- Asset
Loader System Data - Helper type for loading assets
- Asset
Storage - An asset storage, storing the actual assets and allocating handles to them.
- Cache
- A simple cache for asset handles of type
A. This storesWeakHandle, so it doesn’t keep the assets alive. - Directory
- Directory source.
- Format
Value - The
Okreturn value ofFormat::importfor a given asset typeA. - Handle
- A handle to an asset. This is usually what the
user deals with, the actual asset (
A) is stored in anAssetStorage. - HotReload
Bundle - This bundle activates hot reload for the
Loader, adds aHotReloadStrategyand theHotReloadSystem. - HotReload
Strategy - An ECS resource which allows to configure hot reloading.
- HotReload
System - System for updating
HotReloadStrategy. - Loader
- The asset loader, holding the sources and a reference to the
ThreadPool. - Prefab
- Main
Prefabstructure, containing all data loaded in a single prefab. - Prefab
Loader - Helper structure for loading prefabs.
- Prefab
Loader System - System that load
Prefabs forPrefabDataT. - Prefab
Loader System Desc - Builds a
PrefabLoaderSystem. - Processor
- A default implementation for an asset processing system
which converts data to assets and maintains the asset storage
for
A. - Progress
Counter - A progress tracker which is passed to the
Loaderin order to check how many assets are loaded. - RonFormat
- Format for loading from RON files. Mostly useful for prefabs. This type cannot be used for tagged deserialization. It is meant to be used at top-level loading, manually specified to the loader.
- Single
File - An implementation of
Reloadwhich just stores the modification time and the path of the file. - Thread
Pool - Represents a user created thread-pool.
- Weak
Handle - A weak handle, which is useful if you don’t directly need the asset like in caches. This way, the asset can still get dropped (if you want that).
Enums§
- Asset
Prefab - Convenience
PrefabDatafor loading assets of typeAusingFormatF. - Completion
- Completion status, returned by
ProgressCounter::complete. - Processing
State - Returned by processor systems, describes the loading state of the asset.
Traits§
- Asset
- One of the three core traits of this crate.
- Format
- A format, providing a conversion from bytes to asset data, which is then
in turn accepted by
Asset::from_data. Examples for formats arePng,ObjandWave. - Format
Registered Data - A trait for all asset types that have their format types.
Use this as a bound for asset data types when used inside boxed format types intended for deserialization.
registered with
register_format_typemacro. - Prefab
Data - Trait for loading a prefabs data for a single entity
- Processable
Asset - Defines a way to process asset’s data into the asset. This allows
using default
Processorsystem to process assets that implement that type. - Progress
- The
Progresstrait, allowing to track which assets are imported already. - Reload
- The
Reloadtrait provides a method which checks if an asset needs to be reloaded. - Serializable
Format - SerializableFormat is a marker trait which is required for Format types that are supposed
to be serialized. This trait implies both
SerializeandDeserializeimplementation. - Source
- A trait for asset sources, which provides methods for loading bytes.
- Tracker
- The
Trackertrait which will be used by the loader to report back toProgress.