pub trait BaseChannel:
Send
+ Sync
+ Debug {
// Required methods
fn get(&self) -> Result<Option<Value>>;
fn update(&mut self, values: Vec<Value>) -> Result<()>;
fn checkpoint(&self) -> Result<Value>;
fn from_checkpoint(data: Value) -> Result<Box<dyn BaseChannel>>
where Self: Sized;
fn type_name(&self) -> &'static str;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
The base trait for all channels.
Channels manage how state flows through the graph. Each channel has its own semantics for how it handles multiple writes in a single superstep.
Required Methods§
Sourcefn update(&mut self, values: Vec<Value>) -> Result<()>
fn update(&mut self, values: Vec<Value>) -> Result<()>
Update the channel with new values
If multiple values are provided, the channel applies its reduction logic (e.g., last-write-wins, sum, append).
Sourcefn checkpoint(&self) -> Result<Value>
fn checkpoint(&self) -> Result<Value>
Serialize the channel state for checkpointing
Sourcefn from_checkpoint(data: Value) -> Result<Box<dyn BaseChannel>>where
Self: Sized,
fn from_checkpoint(data: Value) -> Result<Box<dyn BaseChannel>>where
Self: Sized,
Restore the channel state from a checkpoint