Expand description
Rate limiter objects backed by a shared crate::bw_pool::BandwidthPool making them
global as in sharable accross multiple thread/tasks.
Available in this module is:
* A writer::GlobalRateLimitedWriter that implements futures::AsyncWrite.
* A reader::GlobalRateLimitedReader that implements futures::AsyncRead.
* A conn::GlobalRateLimitedConn that implements both futures::AsyncRead and
futures::AsyncWrite, rate limiting each direction independently.
Please read carefully each submodule documentation before using. These can be tricky to operate without a license ;).
Re-exportsยง
pub use conn::GlobalRateLimitedConn;pub use reader::GlobalRateLimitedReader;pub use writer::GlobalRateLimitedWriter;use std::io::Error;๐use std::num::NonZero;๐use std::task::Context;๐use std::task::Poll;๐use std::task::ready;๐use crate::bw_pool::BandwidthAcquirer;๐use crate::bw_pool::Permit;๐
Modulesยง
- conn ๐
- A rate limited async duplex connection.
- reader ๐
- A rate limited async reader.
- writer ๐
- A rate limited async writer.
Structsยง
- Direction
State ๐ - Rate-limiting state for a single direction.