pub trait InputTake: Sized {
    // Required methods
    fn take(&self, count: usize) -> Self;
    fn take_split(&self, count: usize) -> (Self, Self);
}
Available on crate feature mtls only.
Expand description

Abstracts slicing operations

Required Methods§

fn take(&self, count: usize) -> Self

Returns a slice of count bytes. panics if count > length

fn take_split(&self, count: usize) -> (Self, Self)

Split the stream at the count byte offset. panics if count > length

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl<'a> InputTake for &'a str

§

fn take(&self, count: usize) -> &'a str

§

fn take_split(&self, count: usize) -> (&'a str, &'a str)

§

impl<'a> InputTake for &'a [u8]

§

fn take(&self, count: usize) -> &'a [u8]

§

fn take_split(&self, count: usize) -> (&'a [u8], &'a [u8])

Implementors§