Skip to main content

Module codec

Module codec 

Source
Expand description

bb::Codec — bidirectional storage-type bridge.

Each method takes the engine’s &mut RuntimeResourceRef<'_> ctx plus a CompletionHandle AND returns ContractResponse. See crate::contracts::index for the sync (Now) vs async (Later) semantics.

ctx exposes ctx.dependency::<T>("<slot>") so a codec impl can reach any concrete declared in #[depends(...)] (e.g. a Backend that materializes a quantizer’s calibration tensors on-device).

Library makers implement Codec when they want to bridge two positions in the storage tree (f32 ↔ u8 quantization, f32 ↔ f16 half-precision lift, f32 ↔ opaque-bytes compression, …).

Traits§

Codec
User-facing Contract trait for a typed in/out storage codec.