pub trait ParseSource<'a>: 'a {
type Pos: SourcePos;
type Str: StringOrStr<'a>;
type Source;
Show 13 methods
// Required methods
fn source(&self) -> &Self::Source;
fn curr_pos(&self) -> Self::Pos;
fn pop_head(&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_str(&mut self, s: &str) -> Self::Str;
fn read_until_with_brackets<const OPEN: char, const CLOSE: char>(
&mut self,
pred: impl FnMut(char) -> bool,
) -> 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 source(&self) -> &Self::Source
fn curr_pos(&self) -> Self::Pos
fn pop_head(&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_str(&mut self, s: &str) -> Self::Str
fn read_until_with_brackets<const OPEN: char, const CLOSE: char>( &mut self, pred: impl FnMut(char) -> bool, ) -> 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", so this trait is not object safe.