pub struct RateLimitedWriterConfig {
pub rate: u64,
pub burst: u64,
pub wake_when_bytes_available: NonZero<u64>,
}Expand description
The refill rate and burst for a RateLimitedWriter.
Fields§
§rate: u64The refill rate in bytes/second.
burst: u64The “burst” in bytes.
wake_when_bytes_available: NonZero<u64>When polled, block until at most this many bytes are available.
Or in other words, wake when we can write this many bytes, even if the provided buffer is larger.
For example if a user attempts to write a large buffer, we usually don’t want to block until the entire buffer can be written. We’d prefer several partial writes to a single large write. So instead of blocking until the entire buffer can be written, we only block until at most this many bytes are available.
Trait Implementations§
Source§impl Clone for RateLimitedWriterConfig
impl Clone for RateLimitedWriterConfig
Source§fn clone(&self) -> RateLimitedWriterConfig
fn clone(&self) -> RateLimitedWriterConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RateLimitedWriterConfig
impl RefUnwindSafe for RateLimitedWriterConfig
impl Send for RateLimitedWriterConfig
impl Sync for RateLimitedWriterConfig
impl Unpin for RateLimitedWriterConfig
impl UnsafeUnpin for RateLimitedWriterConfig
impl UnwindSafe for RateLimitedWriterConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more