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ยง
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 Methodsยง
Dyn Compatibilityยง
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".