Skip to main content

Module placeholders

Module placeholders 

Source
Expand description

Role-method dispatch slot placeholders. Each *Slot unit struct is a generic slot bound at compile time via Compiler::new().bind_<role>::<T>("slot"). DSL methods record NodeProtos stamped with (required_trait, slot_id) for binding-resolution routing.

pub struct MyModule {
    backend: BackendSlot,       // bind any BackendRuntime
    data:    DataLoaderSlot,    // bind any DataSourceRuntime
}

Structs§

AggregatorSlot
Generic Aggregator slot placeholder. Bind a concrete AggregatorRuntime at compile time via Compiler::new().bind_aggregator::<T>("slot"). Exposes Contribute + Aggregate.
BackendSlot
Generic Backend slot. Carries the ai.onnx v1 DSL catalog (48 methods). Outputs are typed &TYPE_TENSOR_F32. The BackendSubgraph carrier is compiler-emitted, not a DSL method.
CodecSlot
Generic Codec slot placeholder. Embed as codec: CodecSlot in your Module struct; bind a concrete CodecRuntime via Compiler::new().bind_codec::<T>("slot")….
DataLoaderSlot
Generic DataSource slot placeholder. Bind a concrete DataSourceRuntime via Node::with_data_source(...). Exposes NextBatch, Reset, OnDataLoaded per docs/IR_AND_DSL.md §5c.2.
IndexSlot
Generic Index slot placeholder. Bind a concrete IndexRuntime via Node::with_index(...). Exposes the three role-method DSL operations: Add, Search, Remove.
ModelSlot
Generic Model slot placeholder. Bind a concrete ModelRuntime via Node::with_model(...). Exposes the six role-method DSL operations: Forward, Backward, ComputeLoss, ApplyDelta, LoadParameters, Params.
PeerSelectorSlot
Generic PeerSelector slot placeholder. Bind a concrete PeerSelectorRuntime via Node::with_peer_selector(...). Exposes Sample, CurrentView
ProtocolSlot
Generic Protocol slot placeholder. Bind a concrete protocol at this slot via the compiler chain (Compiler::new().bind_protocol::<T>("slot").compile(...)).