Skip to main content

compile_asset

Function compile_asset 

Source
pub fn compile_asset(
    source_bytes: &[u8],
    hint: Option<&str>,
    asset_uri: &str,
    source_format: &str,
) -> Result<CompiledAsset, Compile10dError>
Expand description

The end-to-end asset-compile step: source asset bytes → CompiledAsset.

Runs the full pipeline — import the source (import_asset), compile the dense .10d (compile_mesh_to_10d), hash both layers, then emit the q42 manifest that binds them ([mesh_to_nquins_with_digests]). Deterministic: identical (source_bytes, asset_uri, source_format) → byte-identical container and identical digests, so the manifest→container citation is attestable.

hint is the source-format hint forwarded to import_asset (e.g. Some("glb")); source_format is the value recorded in the manifest and should agree with the real format of source_bytes.