Struct tokio_core::io::EasyBuf [] [src]

pub struct EasyBuf { /* fields omitted */ }
Deprecated

: moved to the tokio-io crate

A reference counted buffer of bytes.

An EasyBuf is a representation of a byte buffer where sub-slices of it can be handed out efficiently, each with a 'static lifetime which keeps the data alive. The buffer also supports mutation but may require bytes to be copied to complete the operation.

Methods

impl EasyBuf
[src]

Deprecated

: moved to the tokio-io crate

Creates a new EasyBuf with no data and the default capacity.

Deprecated

: moved to the tokio-io crate

Creates a new EasyBuf with cap capacity.

Deprecated

: moved to the tokio-io crate

Returns the number of bytes contained in this EasyBuf.

Deprecated

: moved to the tokio-io crate

Returns the inner contents of this EasyBuf as a slice.

Deprecated

: moved to the tokio-io crate

Splits the buffer into two at the given index.

Afterwards self contains elements [0, at), and the returned EasyBuf contains elements [at, len).

This is an O(1) operation that just increases the reference count and sets a few indexes.

Panics

Panics if at > len

Deprecated

: moved to the tokio-io crate

Splits the buffer into two at the given index.

Afterwards self contains elements [at, len), and the returned EasyBuf contains elements [0, at).

This is an O(1) operation that just increases the reference count and sets a few indexes.

Panics

Panics if at > len

Deprecated

: moved to the tokio-io crate

Returns a mutable reference to the underlying growable buffer of bytes.

If this EasyBuf is the only instance pointing at the underlying buffer of bytes, a direct mutable reference will be returned. Otherwise the contents of this EasyBuf will be reallocated in a fresh Vec<u8> allocation with the same capacity as an EasyBuf created with EasyBuf::new(), and that allocation will be returned.

This operation is not O(1) as it may clone the entire contents of this buffer.

The returned EasyBufMut type implement Deref and DerefMut to Vec<u8> can the byte buffer can be manipulated using the standard Vec<u8> methods.

Trait Implementations

impl Clone for EasyBuf
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Eq for EasyBuf
[src]

impl AsRef<[u8]> for EasyBuf
[src]

Performs the conversion.

impl From<Vec<u8>> for EasyBuf
[src]

Performs the conversion.

impl<T: AsRef<[u8]>> PartialEq<T> for EasyBuf
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Ord for EasyBuf
[src]

This method returns an Ordering between self and other. Read more

🔬 This is a nightly-only experimental API. (ord_max_min)

Compares and returns the maximum of two values. Read more

🔬 This is a nightly-only experimental API. (ord_max_min)

Compares and returns the minimum of two values. Read more

impl<T: AsRef<[u8]>> PartialOrd<T> for EasyBuf
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Hash for EasyBuf
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for EasyBuf
[src]

Formats the value using the given formatter.

impl Into<Vec<u8>> for EasyBuf
[src]

Performs the conversion.