[][src]Struct bytes::Bytes

pub struct Bytes { /* fields omitted */ }

A specialized ByteStr box.

Methods

impl Bytes[src]

pub fn from_slice(bytes: &[u8]) -> Bytes[src]

pub fn of<B: ByteStr>(bytes: B) -> Bytes[src]

pub fn empty() -> Bytes[src]

pub fn downcast_ref<'a, B: ByteStr>(&'a self) -> Option<&'a B>[src]

If the underlying ByteStr is of type B, returns a reference to it otherwise None.

pub fn try_unwrap<B: ByteStr>(self) -> Result<B, Bytes>[src]

If the underlying ByteStr is of type B, returns the unwraped value, otherwise, returns the original Bytes as Err.

Trait Implementations

impl<'a> Source for &'a Bytes[src]

type Error = BufError

impl ByteStr for Bytes[src]

type Buf = Box<dyn Buf + 'static>

impl ToBytes for Bytes[src]

impl Send for Bytes[src]

impl Sync for Bytes[src]

impl Drop for Bytes[src]

impl Clone for Bytes[src]

impl Eq for Bytes[src]

impl<B: ByteStr> PartialEq<B> for Bytes[src]

impl Debug for Bytes[src]

impl Index<usize> for Bytes[src]

type Output = u8

The returned type after indexing.

Auto Trait Implementations

impl Unpin for Bytes

impl UnwindSafe for Bytes

impl RefUnwindSafe for Bytes

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]