Expand description
Readers and writers for byte streams that represent assets.
These are implemented for a variety of backends. See the submodules for details on those.
Modules§
- embedded
- Support for embedded assets, which are assets that are included inside the application executable instead of being deployed alongside it.
- file
- A backend for
Assetstorage in the local filesystem. - memory
- In-memory
Assetstorage backend. - processor_
gated - Tools for waiting for the
AssetProcessorbefore loading anAsset.
Structs§
- Asset
Source - A collection of unprocessed and processed
AssetReader,AssetWriter, andAssetWatcherinstances for a specific asset source, identified by anAssetSourceId. - Asset
Source Builder - Metadata about an “asset source”, such as how to construct the
AssetReaderandAssetWriterfor the source, and whether or not the source is processed. - Asset
Source Builders - A
Resourcethat hold (repeatable) functions capable of producing newAssetReaderandAssetWriterinstances for a given asset source. - Asset
Sources - A collection of
AssetSources. - Missing
Asset Source Error - An error returned when an
AssetSourcedoes not exist for a given id. - Missing
Asset Writer Error - An error returned when an
AssetWriterdoes not exist for a given id. - Missing
Processed Asset Reader Error - An error returned when a processed
AssetReaderdoes not exist for a given id. - Missing
Processed Asset Writer Error - An error returned when a processed
AssetWriterdoes not exist for a given id. - Reader
NotSeekable Error - Error returned by
Reader::seekablewhen the reader implementation does not supportAsyncSeekbehavior. - Slice
Reader - An
AsyncReadimplementation capable of reading a [&[u8]]. - Stack
Future - A wrapper that stores a future in space allocated by the container
- VecReader
- An
AsyncReadimplementation capable of reading aVec<u8>.
Enums§
- Asset
Reader Error - Errors that occur while loading assets.
- Asset
Source Event - An “asset source change event” that occurs whenever asset (or asset metadata) is created/added/removed
- Asset
Source Id - A reference to an “asset source”, which maps to an
AssetReaderand/orAssetWriter. - Asset
Writer Error - Errors that occur while loading assets.
Constants§
- STACK_
FUTURE_ SIZE - The maximum size of a future returned from
Reader::read_to_end. This is large enough to fit ten references.
Traits§
- Asset
Reader - Performs read operations on an asset storage.
AssetReaderexposes a “virtual filesystem” API, where asset bytes and asset metadata bytes are both stored and accessible for a givenpath. This trait is not object safe, if needed use a dynErasedAssetReaderinstead. - Asset
Reader Future - A future that returns a value or an
AssetReaderError - Asset
Watcher - A handle to an “asset watcher” process, that will listen for and emit
AssetSourceEventvalues for as long asAssetWatcherhas not been dropped. - Asset
Writer - Performs write operations on an asset storage.
AssetWriterexposes a “virtual filesystem” API, where asset bytes and asset metadata bytes are both stored and accessible for a givenpath. This trait is not object safe, if needed use a dynErasedAssetWriterinstead. - Async
Write Ext - Extension trait for
AsyncWrite. - Erased
Asset Reader - Equivalent to an
AssetReaderbut using boxed futures, necessary eg. when using adyn AssetReader, asAssetReaderisn’t currently object safe. - Erased
Asset Writer - Equivalent to an
AssetWriterbut using boxed futures, necessary eg. when using adyn AssetWriter, asAssetWriterisn’t currently object safe. - Reader
- A type returned from
AssetReader::read, which is used to read the contents of a file (or virtual file) corresponding to an asset. - Seekable
Reader - A
Readerthat also hasAsyncSeekfunctionality. SeeReader::seekablefor details.
Type Aliases§
- Path
Stream - A convenience type for a stream of pathnames plus the traits it needs to satisfy.
- Writer
- A convenience type for an
AsyncWriteobject plus the traits it needs to satisfy.