Struct bytes::Take [] [src]

pub struct Take<T> { /* fields omitted */ }

A buffer adapter which limits the bytes read from an underlying value.

Methods

impl<T> Take<T>
[src]

Consumes this Take, returning the underlying value.

Gets a reference to the underlying value in this Take.

Gets a mutable reference to the underlying value in this Take.

Returns the maximum number of bytes that are made available from the underlying value.

Sets the maximum number of bytes that are made available from the underlying value.

Trait Implementations

impl<T: Debug> Debug for Take<T>
[src]

Formats the value using the given formatter.

impl<T: Buf> Buf for Take<T>
[src]

Returns the number of bytes that can be accessed from the Buf

Returns a slice starting at the current Buf position and of length between 0 and Buf::remaining(). Read more

Advance the internal cursor of the Buf

Returns true if there are any more bytes to consume

Copies bytes from self into dst Read more

Copies bytes from the Buf into the given slice and advance the cursor by the number of bytes copied. Read more

Gets an unsigned 8 bit integer from the Buf without advancing the buffer cursor Read more

Gets an unsigned 8 bit integer from the Buf.

Gets a signed 8 bit integer from the Buf.

Gets an unsigned 16 bit integer from the Buf

Gets a signed 16 bit integer from the Buf

Gets an unsigned 32 bit integer from the Buf

Gets a signed 32 bit integer from the Buf

Gets an unsigned 64 bit integer from the Buf

Gets a signed 64 bit integer from the Buf

Gets an unsigned n-bytes integer from the Buf

Gets a signed n-bytes integer from the Buf

Gets a IEEE754 single-precision (4 bytes) floating point number from the Buf Read more

Gets a IEEE754 double-precision (8 bytes) floating point number from the Buf Read more

Creates a "by reference" adaptor for this instance of Buf

Create an adapter which will limit at most limit bytes from it.

Return a Reader for the value. Allows using a Buf as an io::Read

impl<T: BufMut> BufMut for Take<T>
[src]

Returns the number of bytes that can be written to the BufMut

Returns a mutable slice starting at the current BufMut position and of length between 0 and BufMut::remaining(). Read more

Advance the internal cursor of the BufMut

Returns true iff there is any more space for bytes to be written

Copies bytes from src into self Read more

Copies bytes from the given slice into the BufMut and advance the cursor by the number of bytes written. Returns the number of bytes written. Read more

Writes the given string into self. Read more

Writes an unsigned 8 bit integer to the BufMut.

Writes a signed 8 bit integer to the BufMut.

Writes an unsigned 16 bit integer to the BufMut.

Writes a signed 16 bit integer to the BufMut.

Writes an unsigned 32 bit integer to the BufMut.

Writes a signed 32 bit integer to the BufMut.

Writes an unsigned 64 bit integer to the BufMut.

Writes a signed 64 bit integer to the BufMut.

Writes an unsigned n-bytes integer to the BufMut. Read more

Writes a signed n-bytes integer to the BufMut. Read more

Writes a IEEE754 single-precision (4 bytes) floating point number to the BufMut. Read more

Writes a IEEE754 double-precision (8 bytes) floating point number to the BufMut. Read more

Creates a "by reference" adaptor for this instance of BufMut

Create an adapter which will limit at most limit bytes from it.

Return a Write for the value. Allows using a BufMut as an io::Write Read more

impl<T: BufMut> Write for Take<T>
[src]

Writes a slice of bytes into this writer, returning whether the write succeeded. Read more

Glue for usage of the write! macro with implementors of this trait. Read more

Writes a char into this writer, returning whether the write succeeded. Read more