Skip to main content

Module conn

Module conn 

Source
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ยง

GlobalRateLimitedConn
An AsyncRead and AsyncWrite wrapper that rate limits each direction of a single bidirectional byte stream.