pub struct BlackboardBus {
pub board: SemanticBlackboard,
}Expand description
A bus connecting DAG nodes to a SemanticBlackboard.
This is the R5 wiring: DAG nodes declare inputs/outputs as channel names,
Fields§
§board: SemanticBlackboardThe underlying blackboard.
Implementations§
Source§impl BlackboardBus
impl BlackboardBus
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a bus over a fresh, empty SemanticBlackboard.
Sourcepub fn from_board(board: SemanticBlackboard) -> Self
pub fn from_board(board: SemanticBlackboard) -> Self
Create a bus wrapping an existing board, preserving its
channels, constraints, and Lamport state.
Sourcepub fn read_inputs(&self, inputs: &[String]) -> Vec<(String, Vec<NQuin>)>
pub fn read_inputs(&self, inputs: &[String]) -> Vec<(String, Vec<NQuin>)>
Read all inputs for a DAG node from the blackboard.
Returns a map of channel_name → Vec<NQuin> for each input channel. Channels that don’t exist or have no data are included as empty Vecs.
Sourcepub fn write_outputs(
&mut self,
outputs: &[(String, Vec<NQuin>)],
) -> Result<(), String>
pub fn write_outputs( &mut self, outputs: &[(String, Vec<NQuin>)], ) -> Result<(), String>
Write outputs from a DAG node to the blackboard.
outputs is a list of (channel_name, quins) pairs. Each quin is
written to the named channel.
Sourcepub fn write_output(&mut self, channel: &str, quin: NQuin) -> Result<(), String>
pub fn write_output(&mut self, channel: &str, quin: NQuin) -> Result<(), String>
Write a single quin to a named output channel.
Sourcepub fn propagate_constraints(
&mut self,
upstream_channels: &[String],
downstream_channels: &[String],
) -> Result<(), String>
pub fn propagate_constraints( &mut self, upstream_channels: &[String], downstream_channels: &[String], ) -> Result<(), String>
Propagate pinned constraints from upstream channels to downstream channels. This ensures that hard constraints (e.g., a budget pinned by the principal) are inherited by downstream DAG nodes.
upstream_channels are the output channels of the upstream node.
downstream_channels are the input channels of the downstream node.
Pinned constraints from the upstream channels are propagated to the
downstream channels.
Sourcepub fn check_constraints(&self) -> Vec<ConstraintViolation>
pub fn check_constraints(&self) -> Vec<ConstraintViolation>
Check all constraints on all channels. Returns violations.
Sourcepub fn missing_inputs(&self, inputs: &[String]) -> Vec<String>
pub fn missing_inputs(&self, inputs: &[String]) -> Vec<String>
Check if all input channels for a DAG node have data ready. Returns the names of channels that are empty/missing.
Sourcepub fn freeze_output(&mut self, channel: &str) -> Result<(), String>
pub fn freeze_output(&mut self, channel: &str) -> Result<(), String>
Freeze a channel (make read-only) after a node has written its final output. This prevents downstream nodes from overwriting upstream results.
Sourcepub fn board(&self) -> &SemanticBlackboard
pub fn board(&self) -> &SemanticBlackboard
Get the underlying blackboard (immutable).
Sourcepub fn board_mut(&mut self) -> &mut SemanticBlackboard
pub fn board_mut(&mut self) -> &mut SemanticBlackboard
Get the underlying blackboard (mutable).
Trait Implementations§
Source§impl Debug for BlackboardBus
impl Debug for BlackboardBus
Source§impl Default for BlackboardBus
impl Default for BlackboardBus
Source§fn default() -> Self
fn default() -> Self
Equivalent to BlackboardBus::new.
Auto Trait Implementations§
impl Freeze for BlackboardBus
impl RefUnwindSafe for BlackboardBus
impl Send for BlackboardBus
impl Sync for BlackboardBus
impl Unpin for BlackboardBus
impl UnsafeUnpin for BlackboardBus
impl UnwindSafe for BlackboardBus
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more