Struct Take
struct Take<R> { ... }
Reader for the take method.
Implementations
impl<R: AsyncRead> Take<R>
fn limit(self: &Self) -> u64Returns the remaining number of bytes that can be read before this instance will return EOF.
Note
This instance may reach
EOFafter reading fewer bytes than indicated by this method if the underlyingAsyncReadinstance reaches EOF.Examples
# block_on.unwrap;fn set_limit(self: &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
Takeinstance, so the amount of bytes read and the previous limit value don't matter when calling this method.Examples
# block_on.unwrap;fn get_ref(self: &Self) -> &RAcquires a reference to the underlying sink or stream that this combinator is pulling from.
fn get_mut(self: &mut Self) -> &mut RAcquires a mutable reference to the underlying sink or stream that this combinator is pulling from.
Note that care must be taken to avoid tampering with the state of the sink or stream which may otherwise confuse this combinator.
fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut R>Acquires a pinned mutable reference to the underlying sink or stream that this combinator is pulling from.
Note that care must be taken to avoid tampering with the state of the sink or stream which may otherwise confuse this combinator.
fn into_inner(self: Self) -> RConsumes this combinator, returning the underlying sink or stream.
Note that this may discard intermediate state of this combinator, so care should be taken to avoid losing resources when this is called.
impl<'__pin, R> Unpin for Take<R>
impl<R> AsyncBufReadExt for Take<R>
impl<R> AsyncReadExt for Take<R>
impl<R> Freeze for Take<R>
impl<R> RefUnwindSafe for Take<R>
impl<R> Send for Take<R>
impl<R> Sync for Take<R>
impl<R> UnsafeUnpin for Take<R>
impl<R> UnwindSafe for Take<R>
impl<R: $crate::fmt::Debug> Debug for Take<R>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<R: AsyncBufRead> AsyncBufRead for Take<R>
fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<&[u8]>>fn consume(self: Pin<&mut Self>, amt: usize)
impl<R: AsyncRead> AsyncRead for Take<R>
fn poll_read(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut [u8]) -> Poll<Result<usize, Error>>
impl<T> Any for Take<R>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Take<R>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Take<R>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for Take<R>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for Take<R>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Take<R>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Take<R>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>