pub struct Take<R> { /* private fields */ }
Expand description
Stream for the take
method.
Implementations
sourceimpl<R: AsyncRead> Take<R>
impl<R: AsyncRead> Take<R>
sourcepub fn set_limit(&mut self, limit: u64)
pub fn set_limit(&mut self, limit: u64)
Sets the number of bytes that can be read before this instance will
return EOF. This is the same as constructing a new Take
instance, so
the amount of bytes read and the previous limit value don’t matter when
calling this method.
sourcepub fn get_mut(&mut self) -> &mut R
pub fn get_mut(&mut self) -> &mut R
Gets a mutable reference to the underlying reader.
Care should be taken to avoid modifying the internal I/O state of the
underlying reader as doing so may corrupt the internal limit of this
Take
.
sourcepub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut R>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P>where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut R>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P>where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
Gets a pinned mutable reference to the underlying reader.
Care should be taken to avoid modifying the internal I/O state of the
underlying reader as doing so may corrupt the internal limit of this
Take
.
sourcepub fn into_inner(self) -> R
pub fn into_inner(self) -> R
Consumes the Take
, returning the wrapped reader.
Trait Implementations
sourceimpl<R: AsyncBufRead> AsyncBufRead for Take<R>
impl<R: AsyncBufRead> AsyncBufRead for Take<R>
impl<'__pin, R> Unpin for Take<R>where
__Origin<'__pin, R>: Unpin,
Auto Trait Implementations
impl<R> RefUnwindSafe for Take<R>where
R: RefUnwindSafe,
impl<R> Send for Take<R>where
R: Send,
impl<R> Sync for Take<R>where
R: Sync,
impl<R> UnwindSafe for Take<R>where
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more