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§

source

fn limit_bytes(self, max_bytes: usize) -> LengthLimit<Self>

Applies a LengthLimit to self with an exclusive maxiumum of max_bytes bytes

source

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)

source

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)

source

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.

Implementors§

source§

impl<T> LengthLimitExt for T
where T: AsyncRead + Unpin,