wiwi::parser::input

Trait Input

Source
pub trait Input: Sized {
    type ConstSize<const N: usize>: Sized;
    type ConstSizeOwned<const N: usize>: Sized + 'static;

    // Required methods
    fn len(&self) -> usize;
    fn take_first(&self, i: usize) -> Option<(Self, Self)>;
    fn take_first_const<const N: usize>(
        &self,
    ) -> Option<(Self::ConstSize<N>, Self)>;
    fn take_first_const_owned<const N: usize>(
        &self,
    ) -> Option<(Self::ConstSizeOwned<N>, Self)>;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn starts_with<N>(&self, needle: &N) -> bool
       where N: Needle<Self> { ... }
}

Required Associated Types§

Source

type ConstSize<const N: usize>: Sized

Source

type ConstSizeOwned<const N: usize>: Sized + 'static

Required Methods§

Source

fn len(&self) -> usize

Source

fn take_first(&self, i: usize) -> Option<(Self, Self)>

Source

fn take_first_const<const N: usize>(&self) -> Option<(Self::ConstSize<N>, Self)>

Source

fn take_first_const_owned<const N: usize>( &self, ) -> Option<(Self::ConstSizeOwned<N>, Self)>

Provided Methods§

Source

fn is_empty(&self) -> bool

Source

fn starts_with<N>(&self, needle: &N) -> bool
where N: Needle<Self>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'h> Input for &'h [u8]

Source§

type ConstSize<const N: usize> = &'h [u8; N]

Source§

type ConstSizeOwned<const N: usize> = [u8; N]

Source§

fn len(&self) -> usize

Source§

fn take_first(&self, i: usize) -> Option<(&'h [u8], &'h [u8])>

Source§

fn take_first_const<const N: usize>(&self) -> Option<(Self::ConstSize<N>, Self)>

Source§

fn take_first_const_owned<const N: usize>( &self, ) -> Option<(Self::ConstSizeOwned<N>, Self)>

Implementors§