Struct sphinx::lexer::LexerBuilder
source · [−]pub struct LexerBuilder { /* private fields */ }Implementations
sourceimpl LexerBuilder
impl LexerBuilder
pub fn new() -> Self
pub fn set_skip_comments(self, skip_comments: bool) -> Self
pub fn add_rule<R>(self, rule: R) -> Self where
R: LexerRule + 'static,
pub fn insert_rule<R>(
self,
index: usize,
rule: impl LexerRule + 'static
) -> Self
pub fn extend_rules(
self,
rules: impl Iterator<Item = impl LexerRule + 'static>
) -> Self
pub fn build_once<S>(self, source: S) -> Lexer<S>ⓘNotable traits for Lexer<S>impl<S> Iterator for Lexer<S> where
S: Iterator<Item = Result<char>>, type Item = Result<TokenMeta, LexerError>; where
S: Iterator<Item = Result<char>>,
S: Iterator<Item = Result<char>>, type Item = Result<TokenMeta, LexerError>;
pub fn build<S>(&self, source: S) -> Lexer<S>ⓘNotable traits for Lexer<S>impl<S> Iterator for Lexer<S> where
S: Iterator<Item = Result<char>>, type Item = Result<TokenMeta, LexerError>; where
S: Iterator<Item = Result<char>>,
S: Iterator<Item = Result<char>>, type Item = Result<TokenMeta, LexerError>;
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for LexerBuilder
impl !Send for LexerBuilder
impl !Sync for LexerBuilder
impl Unpin for LexerBuilder
impl !UnwindSafe for LexerBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more