pub struct Barrier {
pub expected: usize,
}Expand description
Count-based barrier: accumulates writes into a JSON array and is ready only
once it has collected at least expected arrivals. Allows concurrent
same-step writes (fan-in is the whole point).
Fields§
§expected: usizeNumber of arrivals required before Channel::is_ready returns true.
Implementations§
Trait Implementations§
Source§impl Channel for Barrier
impl Channel for Barrier
Source§fn kind(&self) -> &'static str
fn kind(&self) -> &'static str
A short, stable kind tag used for debugging and topology export.
Source§fn merge(&self, current: Option<Value>, incoming: Value) -> Result<Value>
fn merge(&self, current: Option<Value>, incoming: Value) -> Result<Value>
Folds
incoming into the channel’s current value, returning the new
value. current is None the first time the channel is written. Read moreSource§fn allows_concurrent(&self) -> bool
fn allows_concurrent(&self) -> bool
Whether more than one concurrent branch may write this channel within a
single superstep. Aggregates (append/fold/accumulate/barrier) return
true; overwrite-style channels return false and trigger
crate::TinyAgentsError::InvalidConcurrentUpdate on a same-step clash.Source§fn is_ready(&self, current: Option<&Value>) -> bool
fn is_ready(&self, current: Option<&Value>) -> bool
Barrier readiness: whether the channel has received all the inputs it is
waiting for. Non-barrier channels are always ready.
Source§fn clone_box(&self) -> Box<dyn Channel>
fn clone_box(&self) -> Box<dyn Channel>
Clones the channel into a fresh box (enables
Clone for ChannelSet).Source§fn is_ephemeral(&self) -> bool
fn is_ephemeral(&self) -> bool
Whether the channel’s value is cleared at the start of the next step.
Source§fn is_tracked(&self) -> bool
fn is_tracked(&self) -> bool
impl Copy for Barrier
Auto Trait Implementations§
impl Freeze for Barrier
impl RefUnwindSafe for Barrier
impl Send for Barrier
impl Sync for Barrier
impl Unpin for Barrier
impl UnsafeUnpin for Barrier
impl UnwindSafe for Barrier
Blanket Implementations§
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
Mutably borrows from an owned value. Read more