pub struct Receiver { /* private fields */ }Expand description
ZMODEM receiver state machine.
Implementations§
Source§impl Receiver
impl Receiver
Sourcepub fn new() -> Result<Self, Error>
pub fn new() -> Result<Self, Error>
Create a new receiver instance.
§Errors
OutOfMemorywhen the outgoing buffer cannot hold the handshake
Sourcepub fn submit_wire(&mut self, input: &[u8]) -> Result<usize, Error>
pub fn submit_wire(&mut self, input: &[u8]) -> Result<usize, Error>
Submits incoming wire data into the state machine.
Returns the number of bytes consumed.
§Errors
UnexpectedCrc16orUnexpectedCrc32when corrupted data has been detected
Sourcepub fn wire_written(&mut self, n: usize)
pub fn wire_written(&mut self, n: usize)
Reports that n outgoing bytes from the last Action::WriteWire were
written to the transport.
Sourcepub fn file_written(&mut self, n: usize) -> Result<(), Error>
pub fn file_written(&mut self, n: usize) -> Result<(), Error>
Reports that n file bytes from the last Action::WriteFile were
persisted to storage.
§Errors
Backpressurewhen outgoing bytes are still pending
Sourcepub fn timeout(&mut self) -> Result<(), Error>
pub fn timeout(&mut self) -> Result<(), Error>
Signals that the protocol response timeout expired.
While waiting for a session or file to begin, this re-queues the
ZRINIT handshake.
§Errors
Backpressurewhen outgoing bytes are still pending
Sourcepub fn poll(&mut self) -> Action<'_>
pub fn poll(&mut self) -> Action<'_>
Returns the next action the caller must perform.
Pending events take priority, followed by outgoing wire bytes, then
received file bytes, and finally Action::Idle when there is no
immediate work.
Auto Trait Implementations§
impl Freeze for Receiver
impl RefUnwindSafe for Receiver
impl Send for Receiver
impl Sync for Receiver
impl Unpin for Receiver
impl UnsafeUnpin for Receiver
impl UnwindSafe for Receiver
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