Struct tokio::io::Take [−][src]
#[must_use = "streams do nothing unless you `.await` or poll them"]pub struct Take<R> { /* fields omitted */ }
Expand description
Stream for the take
method.
Implementations
impl<R: AsyncRead> Take<R>
[src]
impl<R: AsyncRead> Take<R>
[src]pub fn set_limit(&mut self, limit: u64)
[src]
pub fn set_limit(&mut self, limit: u64)
[src]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.
pub fn get_mut(&mut self) -> &mut R
[src]
pub fn get_mut(&mut self) -> &mut R
[src]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
.
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut R>ⓘ
[src]
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut R>ⓘ
[src]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
.
pub fn into_inner(self) -> R
[src]
pub fn into_inner(self) -> R
[src]Consumes the Take
, returning the wrapped reader.
Trait Implementations
impl<R: AsyncBufRead> AsyncBufRead for Take<R>
[src]
impl<R: AsyncBufRead> AsyncBufRead for Take<R>
[src]impl<R: AsyncRead> AsyncRead for Take<R>
[src]
impl<R: AsyncRead> AsyncRead for Take<R>
[src]unsafe fn prepare_uninitialized_buffer(
&self,
buf: &mut [MaybeUninit<u8>]
) -> bool
[src]
unsafe fn prepare_uninitialized_buffer(
&self,
buf: &mut [MaybeUninit<u8>]
) -> bool
[src]Prepares an uninitialized buffer to be safe to pass to read
. Returns
true
if the supplied buffer was zeroed out. Read more
impl<'__pin, R> Unpin for Take<R> where
__Origin<'__pin, R>: Unpin,
[src]
__Origin<'__pin, R>: Unpin,
Auto Trait Implementations
impl<R> RefUnwindSafe for Take<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for Take<R> where
R: Send,
R: Send,
impl<R> Sync for Take<R> where
R: Sync,
R: Sync,
impl<R> UnwindSafe for Take<R> where
R: UnwindSafe,
R: UnwindSafe,