pub struct DuplexChannel { /* private fields */ }Expand description
The daemon-side floor state machine (ADR-068 D1). One per conversation. Pure
logic — no I/O, no async: it turns stream observations and ECC verdicts into a
state trajectory plus concrete EdgeCommands.
Implementations§
Source§impl DuplexChannel
impl DuplexChannel
Sourcepub fn new(payload: PayloadKind) -> Self
pub fn new(payload: PayloadKind) -> Self
A new channel in DuplexState::Idle for the given payload axis.
Sourcepub fn state(&self) -> DuplexState
pub fn state(&self) -> DuplexState
The current floor state.
Sourcepub fn payload(&self) -> PayloadKind
pub fn payload(&self) -> PayloadKind
The payload axis this channel was constructed with.
Sourcepub fn last_erl(&self) -> Option<f32>
pub fn last_erl(&self) -> Option<f32>
The last ERL confidence the edge streamed up (None until first observed).
Sourcepub fn observe(
&mut self,
obs: StreamObservation,
) -> (Option<DuplexImpulse>, Vec<EdgeCommand>)
pub fn observe( &mut self, obs: StreamObservation, ) -> (Option<DuplexImpulse>, Vec<EdgeCommand>)
Apply a daemon-local stream observation (ADR-068 D1). Returns the floor-pressure impulse to lift onto the ECC queue (if any) plus the edge commands to send. Cannot grant the floor — see the module docs.
Sourcepub fn apply(&mut self, verdict: FloorVerdict) -> Vec<EdgeCommand>
pub fn apply(&mut self, verdict: FloorVerdict) -> Vec<EdgeCommand>
Apply an ECC floor verdict (ADR-068 D1). The only floor-bearing mutator: it consumes the one type that carries a grant. Returns the edge commands the verdict actuates.
Trait Implementations§
Source§impl Clone for DuplexChannel
impl Clone for DuplexChannel
Auto Trait Implementations§
impl Freeze for DuplexChannel
impl RefUnwindSafe for DuplexChannel
impl Send for DuplexChannel
impl Sync for DuplexChannel
impl Unpin for DuplexChannel
impl UnsafeUnpin for DuplexChannel
impl UnwindSafe for DuplexChannel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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