Skip to main content

Module slot_value

Module slot_value 

Source
Expand description

The universal SlotValue trait. The universal SlotValue trait — every value flowing through slot sites (DSL outputs, wire payloads, syscall returns, role-method returns) implements it via the blanket impl<T: Tensor> SlotValue and per-primitive impls.

Canonical home for bb-runtime. Also hosts engine-side carriers that step outside the serde-driven blanket impl path (today: [BackendTensorCarrier], which holds a type-erased backend-owned tensor handle).

Structs§

BackendMaterializeError
Typed error surfaced by crate::roles::BackendRuntime::materialize_from_wire. The derive bridge converts the backend’s typed <T as crate::contracts::Backend>::Error to this through Display; the engine maps it onto crate::bus::WireReceiveErrorKind::BackendMaterializeFailed.
BackendTensorCarrier
Engine-internal SlotValue wrapping a backend-native tensor behind a type-erased handle. Built by the engine’s wire-decode path (decode_typed_fill backend-mediated branch) from the Backend::materialize_from_wire result; downstream graph ops downcast inner to the backend’s Self::Tensor to read the value.
ChargedBytesBinding
Inventory entry mapping TypeId → ChargedBytesFn. Submitted by [register_charged_bytes!].
RuntimeTypeBinding
Inventory entry mapping TypeId → &'static TypeNode. Submitted by [register_type_node!].
WireDecoderBinding
Inventory entry mapping type_hash → WireDecodeFn. Emitted by [register_type_node!].

Enums§

SlotValueError
Wire-coding failure for a SlotValue. The default bincode path is infallible for vanilla serde derives; custom Serialize impls and missing receiver-side decoders surface here.

Traits§

SlotValue
Universal slot value. Slot-table values, op outputs, and dispatch_atomic inputs are all Box<dyn SlotValue> / &dyn SlotValue. Local forwarding uses clone_boxed; wire + snapshot paths use to_wire_bytes.

Functions§

charged_bytes_registry
Startup-built TypeId → ChargedBytesFn map driving SlotValue::charged_bytes.
fnv1a_64
const-callable FNV-1a 64-bit. Used by type_hash_of and compile-time TY_* constant builders.
runtime_type_registry
Startup-built TypeId → &TypeNode map driving SlotValue::runtime_type.
type_hash_of
FNV-1a 64-bit hash of std::any::type_name::<T>(). Deterministic across runs of the same Rust toolchain; stamped onto SlotFill.type_hash and matched on the receive side.
wire_decoder_registry
Startup-built type_hash → WireDecodeFn map used by CompositeValue’s wire codec to materialise typed children.

Type Aliases§

ChargedBytesFn
Per-type charged-bytes resolver. Takes the carrier’s erased &dyn Any and returns the byte count.
WireDecodeFn
Wire-decode fn for a known concrete type.