pub trait LengthLimitExt: Sized + AsyncRead {
// Provided methods
fn limit_bytes(self, max_bytes: usize) -> LengthLimit<Self> { ... }
fn limit_kb(self, max_kb: usize) -> LengthLimit<Self> { ... }
fn limit_mb(self, max_mb: usize) -> LengthLimit<Self> { ... }
fn limit_gb(self, max_gb: usize) -> LengthLimit<Self> { ... }
}
Expand description
Extension trait to add length limiting behavior to any AsyncRead
Full explanation of the behavior at LengthLimit
Provided Methods§
sourcefn limit_bytes(self, max_bytes: usize) -> LengthLimit<Self>
fn limit_bytes(self, max_bytes: usize) -> LengthLimit<Self>
Applies a LengthLimit to self with an exclusive maxiumum of max_bytes
bytes
sourcefn limit_kb(self, max_kb: usize) -> LengthLimit<Self>
fn limit_kb(self, max_kb: usize) -> LengthLimit<Self>
Applies a LengthLimit to self with an exclusive maxiumum of max_kb
kilobytes (defined as
1024 bytes)
sourcefn limit_mb(self, max_mb: usize) -> LengthLimit<Self>
fn limit_mb(self, max_mb: usize) -> LengthLimit<Self>
Applies a LengthLimit to self with an exclusive maxiumum of max_mb
megabytes (defined as
1024 kilobytes, or 1,048,576 bytes)
sourcefn limit_gb(self, max_gb: usize) -> LengthLimit<Self>
fn limit_gb(self, max_gb: usize) -> LengthLimit<Self>
Applies a LengthLimit to self with an exclusive maxiumum of max_gb
kilobytes (defined as
1024 megabytes, or 1,073,741,824 bytes)
Object Safety§
This trait is not object safe.