pub unsafe trait Buffer: AsRef<[u8]> {
    // Required methods
    fn from_bytes(bytes: &[u8]) -> Self;
    fn from_vec(bytes: Vec<u8>) -> Self;
}
Expand description

Buffer type.

§Safety

The AsRef<[u8]> implementation must return the bytes provided using the from_bytes and from_vec constructor functions.

Required Methods§

source

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

source

fn from_vec(bytes: Vec<u8>) -> Self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Buffer for Vec<u8>

source§

fn from_bytes(bytes: &[u8]) -> Vec<u8>

source§

fn from_vec(bytes: Vec<u8>) -> Vec<u8>

source§

impl<A> Buffer for SmallVec<A>
where A: Array<Item = u8>,

source§

fn from_vec(bytes: Vec<u8>) -> SmallVec<A>

source§

fn from_bytes(bytes: &[u8]) -> SmallVec<A>

Implementors§