Expand description
Load and store assets and resources for Apps.
Modules
- Rusty Object Notation
Macros
- Creates a new
embedded
asset by embedding the bytes of the given path into the current binary and registering those bytes with theembedded
AssetSource
. - Returns the
Path
for a givenembedded
asset. This is used internally byembedded_asset
and can be used to get aPath
that matches theAssetPath
used by that asset. - Loads an “internal” asset by embedding the string stored in the given
path_str
and associates it with the given handle. - Loads an “internal” binary asset by embedding the bytes stored in the given
path_str
and associates it with the given handle.
Structs
- Provides
Handle
andUntypedHandle
for a specific asset type. This should only be used for one specific asset type. - An event emitted when a specific
Asset
fails to load. - Represents a path to an asset in a “virtual filesystem”.
- Provides “asset” loading and processing functionality. An
Asset
is a “runtime value” that is loaded from anAssetSource
, which can be something like a filesystem, a network, etc. - Loads and tracks the state of
Asset
values from a configuredAssetReader
. This can be used to kick off new asset loads and retrieve their current load states. - A mutable iterator over
Assets
. - A “type erased / boxed” counterpart to
LoadedAsset
. This is used in places where the loaded type is not statically known. - A context that provides access to assets in
AssetLoader
s, tracks dependencies, and collects asset load state. Any asset state accessed byLoadContext
will be tracked and stored for use in dependency events and asset preprocessing. - An error that occurs when attempting to call
LoadContext::load_direct
- The successful result of an
AssetLoader::load
call. This contains the loaded “root” asset and any other “labeled” assets produced by the loader. It also holds the inputAssetMeta
(if it exists) and tracks dependencies: - A “loaded folder” containing handles for all assets stored in a given
AssetPath
. - A “loaded asset” containing the untyped handle for an asset stored in a given
AssetPath
. - An error that occurs when an
AssetLoader
is not registered for a given extension. - An error that occurs when an
AssetLoader
is not registered for a givenstd::any::type_name
. - Type data for the
TypeRegistry
used to operate on reflectedAsset
s. - Reflect type data struct relating a
Handle<T>
back to theT
asset type. - The internal “strong”
Asset
handle storage forHandle::Strong
andUntypedHandle::Strong
. When this is dropped, theAsset
will be freed. It also stores some asset metadata for easy access from handles. - A system set that holds all “track asset” operations.
- An untyped version of
AssetLoadFailedEvent
. - Schedule where
Assets
resources are updated.
Enums
- Events that occur for a specific loaded
Asset
, such as “value changed” events and “dependency” events. - An error that occurs during an
Asset
load. - Configures how / if meta files will be checked. If an asset’s meta file is not checked, the default meta for the asset will be used.
- The “asset mode” the server is currently in.
- The load state of an asset’s dependencies.
- An error that occurs while deserializing
AssetMeta
. - A strong or weak handle to a specific
Asset
. If aHandle
isHandle::Strong
, theAsset
will be kept alive until theHandle
is dropped. If aHandle
isHandle::Weak
, it does not necessarily reference a liveAsset
, nor will it keep assets alive. - The load state of an asset.
- An error that occurs when parsing a string type to create an
AssetPath
fails, such as duringAssetPath::parse
or [AssetPath::from<'static str>
]. - An error produced when calling
LoadContext::read_asset_bytes
- The recursive load state of an asset’s dependencies.
- Errors preventing the conversion of to/from an
UntypedHandle
and anHandle
. - Errors preventing the conversion of to/from an
UntypedAssetId
and anAssetId
.
Traits
- Adds asset-related builder methods to
App
. - Loads an
Asset
from a given byteReader
. This can acceptAssetLoader::Settings
, which configure how theAsset
should be loaded. - Extension trait for
AsyncRead
. - Extension trait for
AsyncWrite
. - Provides type-erased access to an
AssetLoader
.
Functions
- A system that manages internal
AssetServer
events, such as finalizing asset loads.
Type Aliases
- An owned and dynamically typed Future used when you can’t statically type your result or need to add some indirection.