pub struct NodeManager<M: MacBackend> { /* private fields */ }Expand description
One administrator’s dealings with one device.
Implementations§
Source§impl<M: MacBackend> NodeManager<M>
impl<M: MacBackend> NodeManager<M>
Sourcepub fn new(peer: PeerConnection<LocalNode<M>>, seed: u16) -> Self
pub fn new(peer: PeerConnection<LocalNode<M>>, seed: u16) -> Self
Watch peer for Node Management responses.
seed picks the first token; anything unpredictable will do.
Sourcepub fn send_options_mut(&mut self) -> &mut SendOptions
pub fn send_options_mut(&mut self) -> &mut SendOptions
How requests go out. An acknowledgment is requested by default: it is what completes a reset, and elsewhere it turns an unreachable path into an early answer rather than four silent retries.
Sourcepub fn counter(&self) -> u16
pub fn counter(&self) -> u16
The counter behind the last token any exchange here consumed, the outstanding one included.
A caller that builds one manager per operation seeds the next one from this, so no token is ever issued twice against a device that holds answered tokens against retransmission.
Sourcepub fn remaining(&self) -> Option<u32>
pub fn remaining(&self) -> Option<u32>
The device’s most recent estimate of octets not yet returned, present only during a continued read.
Sourcepub fn begin(&mut self, request: &[u8], now_ms: u64) -> Result<(), BeginError>
pub fn begin(&mut self, request: &[u8], now_ms: u64) -> Result<(), BeginError>
Begin an operation carrying request, one ULCP frame.
The frame’s TID is ignored over this binding; the envelope token is what correlates the response.
Sourcepub async fn service(
&mut self,
now_ms: u64,
) -> Result<Progress, ManagementError<<LocalNode<M> as Transport>::Error>>
pub async fn service( &mut self, now_ms: u64, ) -> Result<Progress, ManagementError<<LocalNode<M> as Transport>::Error>>
Carry the outstanding exchange as far as it will go right now: take in whatever arrived, then send if an attempt is due.
A Done clears the exchange, leaving Self::reply readable
until the next Self::begin.