Trait tendril::fmt::Slice [] [src]

pub unsafe trait Slice {
    type Format: SliceFormat<Slice=Self>;
    fn as_bytes(&self) -> &[u8];
    unsafe fn from_bytes(x: &[u8]) -> &Self;
}

Indicates a Rust slice type that has a corresponding format.

Associated Types

type Format: SliceFormat<Slice=Self>

Required Methods

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

Access the raw bytes of the slice.

unsafe fn from_bytes(x: &[u8]) -> &Self

Convert a byte slice to this kind of slice.

You may assume the buffer is already validated for Format.

Implementors