Expand description
A rate limited async duplex connection.
An AsyncRead and AsyncWrite wrapper that rate limits both directions of a
single bidirectional byte stream such as a TCP or TLS connection, by acquiring
bandwidth from a super::BandwidthAcquirer given for each diection (read and
write). One byte is one token.
Re-exportsยง
use futures::AsyncRead;๐use futures::AsyncWrite;๐use pin_project::pin_project;๐use std::borrow::Cow;๐use std::io::Error;๐use std::num::NonZero;๐use std::pin::Pin;๐use std::task::Context;๐use std::task::Poll;๐use tor_rtcompat::CertifiedConn;๐use tor_rtcompat::StreamOps;๐use super::DirectionState;๐use crate::bw_pool::BandwidthAcquirer;๐
Structsยง
- Global
Rate Limited Conn - An
AsyncReadandAsyncWritewrapper that rate limits each direction of a single bidirectional byte stream.