pub struct Receiver { /* private fields */ }Expand description
The receiving half: what a Receiver may accept next, and what it owes the Sender.
Implementations§
Source§impl Receiver
impl Receiver
Sourcepub const fn new(params: Parameters) -> Self
pub const fn new(params: Parameters) -> Self
A Receiver that has agreed params and taken nothing.
Sourcepub const fn parameters(&self) -> &Parameters
pub const fn parameters(&self) -> &Parameters
The negotiated parameters.
Sourcepub const fn is_complete(&self) -> bool
pub const fn is_complete(&self) -> bool
Whether the session has ended with a BlockAckEOF (§11.22.2.8).
Sourcepub fn query(&mut self) -> Rejected<u32>
pub fn query(&mut self) -> Rejected<u32>
The Block Counter for the next BlockQuery or BlockQueryWithSkip (§11.22.6.2).
A query “implies a BlockAck of the previous block if no BlockAck was explicitly sent”, so asking for the next block also clears the outstanding acknowledgement.
Sourcepub fn on_block(&mut self, counter: u32, len: usize, eof: bool) -> Rejected<()>
pub fn on_block(&mut self, counter: u32, len: usize, eof: bool) -> Rejected<()>
Takes a Block or BlockEOF (§11.22.6.4, §11.22.6.5).
len is the data length, which the caller has in hand either way; the data itself is
the application’s to store.
Sourcepub fn ack(&mut self) -> Rejected<(MessageType, u32)>
pub fn ack(&mut self) -> Rejected<(MessageType, u32)>
Acknowledges the block just taken: the opcode to send and the counter to put in it.
§11.22.6.6: the Block Counter “SHALL correspond to the Block Counter which was embedded in the Block being acknowledged”, so it is never the caller’s to choose.