Skip to main content

SourceParser

Trait SourceParser 

Source
pub trait SourceParser<'a>: 'a {
    type Pos: StringPosition;
    type Str: StringOrStr<'a>;
    type Source;

Show 19 methods // Required methods fn curr_pos(&self) -> Self::Pos; fn next_char(&mut self) -> Option<char>; fn read_until_line_end(&mut self) -> (Self::Str, Self::Pos); fn trim_start(&mut self); fn starts_with(&mut self, c: char) -> bool; fn peek_head(&mut self) -> Option<char>; fn read_n(&mut self, i: usize) -> Self::Str; fn read_while(&mut self, pred: impl FnMut(char) -> bool) -> Self::Str; fn read_until_inclusive( &mut self, pred: impl FnMut(char) -> bool, ) -> Self::Str; fn read_until_str(&mut self, s: &str) -> Self::Str; fn read_until_needle(&mut self, s: &Needle<'_>) -> Self::Str; fn read_until_byte(&mut self, b: u8) -> Self::Str; fn read_until_char(&mut self, c: char) -> Self::Str; fn starts_with_str(&mut self, s: &str) -> bool; fn drop_prefix(&mut self, s: &str) -> bool; fn read_until_with_brackets( &mut self, open: char, close: char, pred: impl FnMut(char) -> bool, ) -> Self::Str; fn read_until_byte_with_brackets( &mut self, b: u8, open: u8, close: u8, ) -> Self::Str; fn skip(&mut self, i: usize); // Provided method fn read_until(&mut self, pred: impl FnMut(char) -> bool) -> Self::Str { ... }
}

Required Associated Typesยง

Required Methodsยง

Source

fn curr_pos(&self) -> Self::Pos

Source

fn next_char(&mut self) -> Option<char>

Source

fn read_until_line_end(&mut self) -> (Self::Str, Self::Pos)

Source

fn trim_start(&mut self)

Source

fn starts_with(&mut self, c: char) -> bool

Source

fn peek_head(&mut self) -> Option<char>

Source

fn read_n(&mut self, i: usize) -> Self::Str

Source

fn read_while(&mut self, pred: impl FnMut(char) -> bool) -> Self::Str

Source

fn read_until_inclusive(&mut self, pred: impl FnMut(char) -> bool) -> Self::Str

Source

fn read_until_str(&mut self, s: &str) -> Self::Str

Source

fn read_until_needle(&mut self, s: &Needle<'_>) -> Self::Str

Source

fn read_until_byte(&mut self, b: u8) -> Self::Str

Source

fn read_until_char(&mut self, c: char) -> Self::Str

Source

fn starts_with_str(&mut self, s: &str) -> bool

Source

fn drop_prefix(&mut self, s: &str) -> bool

Source

fn read_until_with_brackets( &mut self, open: char, close: char, pred: impl FnMut(char) -> bool, ) -> Self::Str

Source

fn read_until_byte_with_brackets( &mut self, b: u8, open: u8, close: u8, ) -> Self::Str

Source

fn skip(&mut self, i: usize)

Provided Methodsยง

Source

fn read_until(&mut self, pred: impl FnMut(char) -> bool) -> Self::Str

Dyn Compatibilityยง

This trait is not dyn compatible.

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

Implementorsยง