Module utils

Module utils 

Source
Expand description

Various network IO-related utilities

Structs§

AsyncReadStreamer
Converts a [AsyncRead] into futures::Stream by reading at most S bytes in each call to Stream::poll_next.
AsyncWriteSink
Wraps a [futures::Sink] that accepts Box<[u8]> with an [AsyncWrite] interface, with each write to the underlying Sink being at most C bytes.
DuplexIO
Joins [futures::AsyncRead] and [futures::AsyncWrite] into a single object.

Functions§

copy_duplex
This is a proper re-implementation of Tokio’s copy_bidirectional_with_sizes, which does not leave the stream in half-open-state when one side closes read or write side.
copy_duplex_abortable
Variant of copy_duplex with an option to abort either side early using the given AbortRegistrations.