pub struct Take<R> { /* private fields */ }
Expand description
Stream for the take
method.
Implementations§
source§impl<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>
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut R>
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.