pub struct LimitAdapter<'a> { /* private fields */ }Expand description
Exclusively owns the guard engine while a limit may be retried by that engine. Drop on timeout or disconnect. This discards queued frames and retransmission timers. The local journal retains the consumed dispatch for reconciliation.
Implementations§
Source§impl<'a> LimitAdapter<'a>
impl<'a> LimitAdapter<'a>
Sourcepub fn new(
local: &'a mut LocalDevice,
engine: Engine,
client: FeatureAddress,
server: FeatureAddress,
) -> Result<Self, AdapterError>
pub fn new( local: &'a mut LocalDevice, engine: Engine, client: FeatureAddress, server: FeatureAddress, ) -> Result<Self, AdapterError>
Bind a SPINE engine holding exactly two complete LoadControl read replies (descriptions and current limits) to one authenticated session and route. On construction failure the supplied SPINE engine is discarded.
Sourcepub fn dispatch(
&mut self,
request_id: &str,
now: Clock,
) -> Result<MsgCounter, AdapterError>
pub fn dispatch( &mut self, request_id: &str, now: Clock, ) -> Result<MsgCounter, AdapterError>
Queue one authorized write with its current remaining duration. Discovery and binding errors leave the one-shot dispatch authorization available.
Sourcepub fn poll_transmit(&mut self) -> Option<Datagram>
pub fn poll_transmit(&mut self) -> Option<Datagram>
Take the write for immediate delivery on this authenticated session.
Sourcepub fn deadline(&self) -> Option<Duration>
pub fn deadline(&self) -> Option<Duration>
First SPINE response deadline in the elapsed clock domain. On timeout, discard this adapter, then reconcile the outstanding CLS.EEDI operation.
Sourcepub fn handle_datagram(
&mut self,
packet: &Datagram,
now: Clock,
) -> Result<Option<Completion>, AdapterError>
pub fn handle_datagram( &mut self, packet: &Datagram, now: Clock, ) -> Result<Option<Completion>, AdapterError>
Accept a single result delivered by the authenticated, directly connected
peer. Unrelated frames return None. A device component omitted in simple
addressing resolves to its authenticated endpoint (SPINE §5.2.2.1).
Sourcepub fn finish(&mut self, now: Clock) -> Result<Option<Completion>, AdapterError>
pub fn finish(&mut self, now: Clock) -> Result<Option<Completion>, AdapterError>
Retry the local journal transition if, for example, recording a definitive equipment result failed due to an invalid local clock.
Sourcepub fn into_engine(self) -> Result<Engine, AdapterError>
pub fn into_engine(self) -> Result<Engine, AdapterError>
Recover a clean engine. An unresolved write destroys the engine, including its SPINE retry buffer, and remains pending on the local device.