anybytes::bytes

Trait ByteSource

Source
pub unsafe trait ByteSource {
    type Owner: ByteOwner;

    // Required methods
    fn as_bytes(&self) -> &[u8] ;
    fn get_owner(self) -> Self::Owner;
}

Required Associated Types§

Required Methods§

Source

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

Source

fn get_owner(self) -> Self::Owner

Implementations on Foreign Types§

Source§

impl ByteSource for &'static str

Source§

type Owner = &'static str

Source§

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

Source§

fn get_owner(self) -> Self::Owner

Source§

impl ByteSource for String

Source§

type Owner = String

Source§

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

Source§

fn get_owner(self) -> Self::Owner

Source§

impl ByteSource for Mmap

Source§

type Owner = Mmap

Source§

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

Source§

fn get_owner(self) -> Self::Owner

Source§

impl<T> ByteSource for &'static [T]
where T: IntoBytes + Immutable + Sync + Send + 'static,

Source§

type Owner = &'static [T]

Source§

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

Source§

fn get_owner(self) -> Self::Owner

Source§

impl<T> ByteSource for Box<T>
where T: IntoBytes + Immutable + ?Sized + Sync + Send + 'static,

Source§

type Owner = Box<T>

Source§

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

Source§

fn get_owner(self) -> Self::Owner

Source§

impl<T> ByteSource for Vec<T>
where T: IntoBytes + Immutable + Sync + Send + 'static,

Source§

type Owner = Vec<T>

Source§

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

Source§

fn get_owner(self) -> Self::Owner

Implementors§