Trait in_situ::Raw[][src]

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

Splits the bytes into two at the given index.

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

Splits the bytes into two at the given index.

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

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]

Implementors