Skip to main content

Take

Struct Take 

Source
pub struct Take<R> {
    inner: R,
    limit: u64,
}

Fields§

§inner: R§limit: u64

Trait Implementations§

Source§

impl<R: BufRead> BufRead for Take<R>

Source§

fn fill_buf(&mut self) -> Result<&[u8]>

Source§

fn consume(&mut self, amt: usize)

Source§

impl<R: Read> Read for Take<R>

Source§

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

Source§

fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>

Source§

fn read_to_end(&mut self, out: &mut Vec<u8>) -> Result<usize>

Source§

fn take(self, limit: u64) -> Take<Self>
where Self: Sized,

Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Source§

fn bytes(self) -> Bytes<Self>
where Self: Sized,

Auto Trait Implementations§

§

impl<R> Freeze for Take<R>
where R: Freeze,

§

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> Unpin for Take<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for Take<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for Take<R>
where R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<R> ReadBytesExt for R
where R: Read + ?Sized,

Source§

fn read_u8(&mut self) -> Result<u8>

Source§

fn read_i8(&mut self) -> Result<i8>

Source§

fn read_u16<B: ByteOrder>(&mut self) -> Result<u16>

Source§

fn read_u24<B: ByteOrder>(&mut self) -> Result<u32>

Source§

fn read_u32<B: ByteOrder>(&mut self) -> Result<u32>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.