[][src]Trait fixed_width::AsByteSlice

pub trait AsByteSlice {
    fn as_byte_slice(&self) -> &[u8];
}

A trait to ease converting byte like data into a byte slice. This allows handling these types with one generic function.

Required methods

fn as_byte_slice(&self) -> &[u8]

Borrows self as a slice of bytes.

Loading content...

Implementations on Foreign Types

impl AsByteSlice for String[src]

fn as_byte_slice(&self) -> &[u8][src]

Borrow a String as &[u8]

impl AsByteSlice for str[src]

fn as_byte_slice(&self) -> &[u8][src]

Borrow a str as &[u8]

impl AsByteSlice for [u8][src]

fn as_byte_slice(&self) -> &[u8][src]

Borrow a [u8] as &[u8]

impl AsByteSlice for Vec<u8>[src]

fn as_byte_slice(&self) -> &[u8][src]

Borrow a Vec<u8> as &[u8]

impl<'a, T: ?Sized> AsByteSlice for Cow<'a, T> where
    T: AsByteSlice + ToOwned,
    <T as ToOwned>::Owned: AsByteSlice
[src]

fn as_byte_slice(&self) -> &[u8][src]

Borrow a Cow type as &[u8]

impl<'a, T: ?Sized + AsByteSlice> AsByteSlice for &'a T[src]

Loading content...

Implementors

Loading content...