Expand description
Mocking helpers for testing with futures::io types.
Note that some of this code might be of general use, but for now weβre only trying it for testing.
Re-exportsΒ§
use crate::util::mpsc_channel;πuse futures::channel::mpsc;πuse futures::io::AsyncRead;πuse futures::io::AsyncWrite;πuse futures::sink::Sink;πuse futures::sink::SinkExt;πuse futures::stream::Stream;πuse std::io::Error as IoError;πuse std::io::ErrorKind;πuse std::io::Result as IoResult;πuse std::pin::Pin;πuse std::task::Context;πuse std::task::Poll;πuse tor_rtcompat::StreamOps;πuse tor_rtcompat::UnsupportedStreamOp;π
StructsΒ§
- Local
Stream - One half of a pair of linked streams returned by
stream_pair. - Synthetic
Error - An error generated by
LocalStream::send_err.
ConstantsΒ§
- CAPACITY π
- Channel capacity for our internal MPSC channels.
- CHUNKSZ π
- Maximum size for a queued buffer on a local chunk.
FunctionsΒ§
- drain_
helper π - Helper: pull bytes off the front of
pending_bytesand put them onto `buf. Return the number of bytes moved. - stream_
pair - Construct a new pair of linked LocalStream objects.