Skip to main content

Module io

Module io 

Source
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Β§

LocalStream
One half of a pair of linked streams returned by stream_pair.
SyntheticError
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_bytes and put them onto `buf. Return the number of bytes moved.
stream_pair
Construct a new pair of linked LocalStream objects.