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 sink::GlobalRateLimitedSink that implements futures::Sink.
* 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 ;).
Modulesยง
- conn ๐
- A rate limited async duplex connection.
- reader ๐
- A rate limited async reader.
- sink ๐
- A rate limited sink.
- writer ๐
- A rate limited async writer.
Structsยง
- Direction
State ๐ - Rate-limiting state for a single direction.
- Global
Rate Limited Conn - An
AsyncReadandAsyncWritewrapper that rate limits each direction of a single bidirectional byte stream. - Global
Rate Limited Reader - An
AsyncReadwrapper that acquires bandwidth before yielding bytes. - Global
Rate Limited Sink - A
Sinkwrapper that acquires bandwidth before forwarding each item. - Global
Rate Limited Writer - An
AsyncWritewrapper that acquires bandwidth before writing bytes.
Enumsยง
- Global
Rate Limited Error - Error returned by the rate limiters in this module.