Skip to main content

Module tokio

Module tokio 

Source
Available on crate feature tokio only.
Expand description

Tokio async adapter — drives the sans-I/O core over an AsyncRead + AsyncWrite transport.

Mirrors adapters::blocking one-for-one, returning the same UploadStats / UploadError types.

§Read timeout

Every inbound read is wrapped in tokio::time::timeout keyed to Session::response_timeout. On Elapsed the adapter falls through to tick() so retransmits and the total-budget timeout still fire on a quiet transport. Without this wrapping a stalled peer would leave the future Pending forever.

§Lifecycle handled for you

  1. Send M28 B1 to enter binary mode.
  2. SYNC handshake.
  3. QUERY → compression negotiation.
  4. OPEN, WRITE × N, CLOSE.
  5. Control CLOSE (proto=0, type=2) so the device exits binary mode.

Re-exports§

pub use crate::adapters::common::Progress;
pub use crate::adapters::common::ProgressCallback;
pub use crate::adapters::common::UploadError;
pub use crate::adapters::common::UploadOptions;
pub use crate::adapters::common::UploadStats;

Functions§

upload
Async equivalent of adapters::blocking::upload.