Trait Source

Source
pub trait Source {
    type Char;
    type String;
    type Error;

    // Required methods
    fn next_index(&self) -> usize;
    fn is_empty(&self) -> bool;
    fn advance_while(
        &mut self,
        predicate: impl FnMut(Self::Char) -> bool,
    ) -> Result<Self::String, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn next_index(&self) -> usize

Returns the start index of the next character.

Source

fn is_empty(&self) -> bool

Source

fn advance_while( &mut self, predicate: impl FnMut(Self::Char) -> bool, ) -> Result<Self::String, Self::Error>

Advances in the input as long as the character matches the predicate, returning the matching string.

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.

Implementors§