Skip to main content

ScannerInput

Trait ScannerInput 

Source
pub trait ScannerInput: AsRef<[u8]> + Sized {
    // Required methods
    fn split_to(&mut self, at: usize) -> Self;
    fn finish(&mut self);
}
Expand description

this is a trait which implements the interface of possible inputs (usually byte slices)

Required Methods§

Source

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

Splits the input into two at the given index. Afterwards self contains elements [at, len), and the returned input part contains elements [0, at).

Source

fn finish(&mut self)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ScannerInput for &[u8]

Source§

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

Source§

fn finish(&mut self)

Source§

impl ScannerInput for &mut [u8]

Source§

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

Source§

fn finish(&mut self)

Implementors§