Skip to main content

Module asset

Module asset 

Source
Expand description

Asset I/O and decoding services.

Re-exports§

pub use decoders::*;

Modules§

decoders
Concrete AssetDecoder implementations: bytes → typed asset.

Structs§

AssetChangeEvent
One filesystem change against an asset under the watched root.
AssetIdRegistry
Maps forward-slash relative asset paths to their frozen [AssetUUID].
AssetService
The asset management service.
AssetWatcher
Drains filesystem-change events under a project’s assets/ directory.
DecoderRegistration
Inventory entry for an AssetDecoder that wants to be auto-registered against an AssetService at startup.
DecoderRegistry
Registry of asset decoders, keyed by type name.
FileLoader
File-based asset loader for editor/development mode.
IndexBuilder
Recursive scanner that turns a project’s assets/ directory into an AssetMetadata list ready for the VFS.
ManifestEntry
One row of manifest.bin — pre-computed integrity record.
PackBuilder
Builds a release pack from a project’s assets/ directory.
PackHeader
Decoded form of the 24-byte header at the start of data.pack.
PackLoader
Pack-based asset loader for release mode.
PackManifest
In-memory manifest for fast verify(uuid, &bytes) lookups.
PackOutput
Output of a successful PackBuilder::build.

Enums§

AssetChangeKind
What kind of change happened to an asset on disk.
PackProgress
One step of a pack build, suitable for driving a UI progress bar.

Constants§

EXTENSIONLESS_ASSET_TYPE
Asset type assigned to files with no extension at all. These still enter the VFS so they’re visible in the asset browser, but the engine has no way to dispatch a decoder until the user renames or re-classifies them.
PACK_FLAG_LZ4
Bit flag — at least one entry in this pack uses LZ4 compression. Diagnostics-only: per-entry compression is decided by AssetSource::Packed.compression. The flag is set when the writer applied LZ4 to any entry, so a quick header scan can tell whether the pack as a whole is mostly compressed.
PACK_FLAG_MANIFEST
Bit flag — a manifest.bin BLAKE3 sidecar accompanies this pack. (Set by PackBuilder when integrity manifest emission is enabled.)
PACK_FORMAT_VERSION
Current pack format version. Bumped when the on-disk layout changes in a non-additive way; older runtimes refuse newer packs by reading the version from the header.
PACK_HEADER_SIZE
Total size in bytes of the leading PackHeader in data.pack. Asset offsets recorded in index.bin are relative to the start of the asset region, not to byte 0 — PackLoader adds this constant when seeking.
PACK_MAGIC
8-byte magic prefix that identifies a Khora pack archive on disk.
REGISTRY_DIR
Project-root subdirectory that holds engine-authored project metadata.
REGISTRY_FILE
File name of the asset-identity registry inside REGISTRY_DIR.

Traits§

AssetDecoder
A trait for types that can decode a specific kind of asset from raw bytes.
AssetIo
Trait for asset I/O backends (file system or pack archive).
AssetWriter
Sibling trait to AssetIo for editor-time writing of assets back to storage. Implemented only by crate::asset::FileLoader — release builds (PackLoader) are intentionally read-only, which is why AssetWriter lives separately rather than extending AssetIo.

Functions§

asset_type_for_extension
Returns the canonical asset type name for a file extension.
extract_dependencies
Extracts the direct asset dependencies encoded in bytes, dispatching on the canonical asset_type name.
should_skip_file
true if a file with the given name should be excluded from the VFS scan and from hot-reload events. Catches OS scratch files (.DS_Store, .gitkeep, …) and editor swap / backup files (*.tmp, *.swp, *.bak, *~).
type_has_dependency_extractor
true if extract_dependencies can extract references from this asset type, i.e. the type has a real extractor rather than the empty fallback.