Expand description
The resource database and everything related to querying, loading, and using assets from it.
Modules§
- audio_
clip - Asset type for individual tracks of audio.
- sprite
- Asset type for individual images that can be rendered as-is.
Structs§
- Chunk
Data - Loaded memory for a single regular chunk. Contains
CHUNK_SIZEbytes. - Chunk
Descriptor - Metadata for loading in a
ChunkData. - File
Reader - File reading utility.
- Named
Asset - A unique name and a
T. Used inResourceDatabaseand when creating the db file. - Resource
Database - The resource database.
- Resource
Database Header - Basic info about a
ResourceDatabaseused in its initialization and for de/serializing the db file. - Resource
Loader - Asynchronous loader for resource chunks.
- Sprite
Chunk Data - Loaded (video) memory for a single sprite chunk. Contains a reference to a
loaded sprite, ready for drawing, with the size and format
SPRITE_CHUNK_DIMENSIONSandSPRITE_CHUNK_FORMAT. - Sprite
Chunk Descriptor - Metadata for loading in a
SpriteChunkData.
Constants§
- ASSET_
NAME_ LENGTH - Maximum length for the unique names of assets.
- AUDIO_
SAMPLES_ PER_ CHUNK - The amount of audio samples that fit in each chunk.
- CHUNK_
SIZE - Amount of bytes in the regular dynamically allocated chunks.
- RESOURCE_
DB_ MAGIC_ NUMBER - Magic number used when de/serializing
ResourceDatabaseHeader. - SPRITE_
CHUNK_ DIMENSIONS - Width and height of the dynamically allocated sprite chunks.
- SPRITE_
CHUNK_ FORMAT - Pixel format of the dynamically allocated sprite chunks.
Traits§
- Asset
- Trait for operations relevant to any assets, for writing asset management code which is generic over the particular asset type.
- Deserialize
- Trait for describing how a type can be parsed from a constant-size byte slice.
- Serialize
- Trait for describing how a type can be serialized into a constant-size byte slice.
Functions§
- deserialize
- Deserializes the data from a byte slice into
D, reading from the given cursor, and advancing it by the amount of bytes read. - serialize
- Serializes the data into a byte slice, with the write starting from the cursor, and advances the cursor by the amount of bytes written.