[][src]Trait in_situ::Raw

pub trait Raw: AsRef<[u8]> + Default + PartialEq + Eq + PartialOrd + Ord + Debug + Hash {
    fn split_off(&mut self, at: usize) -> Self;
fn split_to(&mut self, at: usize) -> Self; }

Abstracts immutable as well as mutable generic bytes view types like [u8], mut [u8], Bytes, or BytesMut as immutable views and requires some standard nice-to-have but easily-to-get traits, so the wrapper can just derive them. Requires methods to be implemented to split views into subviews.

Required methods

fn split_off(&mut self, at: usize) -> Self

Splits the bytes into two at the given index.

Afterwards self contains elements [0, at), and the returned Self contains elements [at, len).

fn split_to(&mut self, at: usize) -> Self

Splits the bytes into two at the given index.

Afterwards self contains elements [at, len), and the returned Self contains elements [0, at).

Loading content...

Implementations on Foreign Types

impl<'a> Raw for &'a [u8][src]

impl<'a> Raw for &'a mut [u8][src]

impl Raw for Bytes[src]

impl Raw for BytesMut[src]

Loading content...

Implementors

Loading content...