pub struct NestedProtocolMachineHandler { /* private fields */ }Expand description
Effect handler that dispatches to inner ProtocolMachines keyed by outer role name.
Implementations§
Source§impl NestedProtocolMachineHandler
impl NestedProtocolMachineHandler
Sourcepub fn with_rounds_per_step(self, rounds: usize) -> Self
pub fn with_rounds_per_step(self, rounds: usize) -> Self
Set how many inner ProtocolMachine rounds to advance per outer handler call.
Sourcepub fn rounds_per_step(&self) -> usize
pub fn rounds_per_step(&self) -> usize
Number of inner ProtocolMachine rounds attempted per outer handler call.
Sourcepub fn add_site(
&mut self,
name: impl Into<String>,
machine: ProtocolMachine,
handler: Box<dyn EffectHandler>,
)
pub fn add_site( &mut self, name: impl Into<String>, machine: ProtocolMachine, handler: Box<dyn EffectHandler>, )
Register a site by name with its inner ProtocolMachine and handler.
Sourcepub fn site_trace(&self, name: &str) -> Option<Vec<ObsEvent>>
pub fn site_trace(&self, name: &str) -> Option<Vec<ObsEvent>>
Get a copy of the inner ProtocolMachine trace for a site.
§Panics
Panics if the site ProtocolMachine mutex is poisoned.
Sourcepub fn site_all_done(&self, name: &str) -> Option<bool>
pub fn site_all_done(&self, name: &str) -> Option<bool>
Check whether all coroutines in a site ProtocolMachine are terminal.
§Panics
Panics if the site ProtocolMachine mutex is poisoned.
Sourcepub fn site_semantic_objects(
&self,
name: &str,
) -> Option<ProtocolMachineSemanticObjects>
pub fn site_semantic_objects( &self, name: &str, ) -> Option<ProtocolMachineSemanticObjects>
Get a copy of the canonical semantic-object bundle for a site.
§Panics
Panics if the site ProtocolMachine mutex is poisoned.
Trait Implementations§
Source§impl EffectHandler for NestedProtocolMachineHandler
impl EffectHandler for NestedProtocolMachineHandler
Source§fn handle_send(
&self,
role: &str,
_partner: &str,
_label: &str,
_state: &[Value],
) -> EffectResult<Value>
fn handle_send( &self, role: &str, _partner: &str, _label: &str, _state: &[Value], ) -> EffectResult<Value>
Compute the payload for a send instruction. Read more
Source§fn handle_recv(
&self,
role: &str,
_partner: &str,
_label: &str,
_state: &mut Vec<Value>,
_payload: &Value,
) -> EffectResult<()>
fn handle_recv( &self, role: &str, _partner: &str, _label: &str, _state: &mut Vec<Value>, _payload: &Value, ) -> EffectResult<()>
Process a received value. Read more
Source§fn handle_choose(
&self,
_role: &str,
_partner: &str,
labels: &[String],
_state: &[Value],
) -> EffectResult<String>
fn handle_choose( &self, _role: &str, _partner: &str, labels: &[String], _state: &[Value], ) -> EffectResult<String>
Choose which branch to take for internal choice (select). Read more
Source§fn step(&self, role: &str, _state: &mut Vec<Value>) -> EffectResult<()>
fn step(&self, role: &str, _state: &mut Vec<Value>) -> EffectResult<()>
Perform an integration step after a protocol round. Read more
Source§fn handler_identity(&self) -> String
fn handler_identity(&self) -> String
Stable identifier for effect-trace attribution.
Source§fn handle_effect(&self, request: EffectRequest) -> EffectOutcome
fn handle_effect(&self, request: EffectRequest) -> EffectOutcome
Canonical typed effect boundary for guest-runtime execution. Read more
Source§fn send_decision(
&self,
input: SendDecisionInput<'_>,
) -> EffectResult<SendDecision>
fn send_decision( &self, input: SendDecisionInput<'_>, ) -> EffectResult<SendDecision>
Decide how to handle a send, optionally with a precomputed payload. Read more
Source§fn handle_acquire(
&self,
_sid: SessionId,
_role: &str,
_layer: &str,
_state: &[Value],
) -> EffectResult<Value>
fn handle_acquire( &self, _sid: SessionId, _role: &str, _layer: &str, _state: &[Value], ) -> EffectResult<Value>
Attempt to acquire a guard layer. Read more
Source§fn handle_release(
&self,
_sid: SessionId,
_role: &str,
_layer: &str,
_evidence: &Value,
_state: &[Value],
) -> EffectResult<()>
fn handle_release( &self, _sid: SessionId, _role: &str, _layer: &str, _evidence: &Value, _state: &[Value], ) -> EffectResult<()>
Release a guard layer using previously acquired evidence.
Source§fn supports_wal_sync(&self) -> bool
fn supports_wal_sync(&self) -> bool
Whether this handler can service the internal
wal_sync effect.Source§fn wal_sync(&self, _sync: &WalSyncRequest) -> EffectResult<()>
fn wal_sync(&self, _sync: &WalSyncRequest) -> EffectResult<()>
Confirm that the agreement WAL has been durably synchronized.
Source§fn topology_events(&self, _tick: u64) -> EffectResult<Vec<TopologyPerturbation>>
fn topology_events(&self, _tick: u64) -> EffectResult<Vec<TopologyPerturbation>>
Topology perturbations injected by the environment for this scheduler tick. Read more
Source§fn output_condition_hint(
&self,
_sid: SessionId,
_role: &str,
_state: &[Value],
) -> Option<OutputConditionHint>
fn output_condition_hint( &self, _sid: SessionId, _role: &str, _state: &[Value], ) -> Option<OutputConditionHint>
Optional output-condition metadata for commit gating. Read more
Auto Trait Implementations§
impl Freeze for NestedProtocolMachineHandler
impl !RefUnwindSafe for NestedProtocolMachineHandler
impl Send for NestedProtocolMachineHandler
impl Sync for NestedProtocolMachineHandler
impl Unpin for NestedProtocolMachineHandler
impl UnsafeUnpin for NestedProtocolMachineHandler
impl !UnwindSafe for NestedProtocolMachineHandler
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Casts the value.
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.