pub struct Limit<T> { /* private fields */ }
Expand description
Limits the stream to a maximum amount of data.
Trait Implementations§
Source§impl<T> BufStream for Limit<T>where
T: BufStream,
impl<T> BufStream for Limit<T>where
T: BufStream,
Source§type Error = LimitError<<T as BufStream>::Error>
type Error = LimitError<<T as BufStream>::Error>
The error type this
BufStream
might generate.Auto Trait Implementations§
impl<T> Freeze for Limit<T>where
T: Freeze,
impl<T> RefUnwindSafe for Limit<T>where
T: RefUnwindSafe,
impl<T> Send for Limit<T>where
T: Send,
impl<T> Sync for Limit<T>where
T: Sync,
impl<T> Unpin for Limit<T>where
T: Unpin,
impl<T> UnwindSafe for Limit<T>where
T: UnwindSafe,
Blanket Implementations§
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
Source§impl<T> BufStreamExt for Twhere
T: BufStream,
impl<T> BufStreamExt for Twhere
T: BufStream,
Source§fn chain<T>(self, other: T) -> Chain<Self, T>
fn chain<T>(self, other: T) -> Chain<Self, T>
Takes two buf streams and creates a new buf stream over both in
sequence. Read more
Source§fn limit(self, amount: u64) -> Limit<Self>where
Self: Sized,
fn limit(self, amount: u64) -> Limit<Self>where
Self: Sized,
Limit the number of bytes that the stream can yield. Read more
Source§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
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