Struct sqruff_lib::core::parser::lexer::StringLexer
source · pub struct StringLexer<SegmentArgs: 'static + Clone> { /* private fields */ }
Expand description
This singleton matcher matches strings exactly.
This is the simplest usable matcher, but it also defines some of the
mechanisms for more complicated matchers, which may simply override the
_match
function rather than the public match
function. This acts as
the base class for matchers.
Implementations§
Trait Implementations§
source§impl<SegmentArgs: Clone + 'static + Clone> Clone for StringLexer<SegmentArgs>
impl<SegmentArgs: Clone + 'static + Clone> Clone for StringLexer<SegmentArgs>
source§fn clone(&self) -> StringLexer<SegmentArgs>
fn clone(&self) -> StringLexer<SegmentArgs>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<SegmentArgs: Clone + Debug + Sync> Matcher for StringLexer<SegmentArgs>
impl<SegmentArgs: Clone + Debug + Sync> Matcher for StringLexer<SegmentArgs>
source§fn match_(&self, forward_string: &str) -> Result<LexMatch, ValueError>
fn match_(&self, forward_string: &str) -> Result<LexMatch, ValueError>
Given a string, match what we can and return the rest.
source§fn get_sub_divider(&self) -> Option<Box<dyn Matcher>>
fn get_sub_divider(&self) -> Option<Box<dyn Matcher>>
Access methods that need to be implemented by the subclass.
Get the sub-divider for this matcher.
fn get_trim_post_subdivide(&self) -> Option<Box<dyn Matcher>>
fn construct_segment( &self, raw: String, pos_marker: PositionMarker ) -> ErasedSegment
fn _subdivide(&self, matched: LexedElement) -> Vec<LexedElement>
source§fn _trim_match(&self, matched_str: &str) -> Vec<LexedElement>
fn _trim_match(&self, matched_str: &str) -> Vec<LexedElement>
Given a string, trim if we are allowed to.
Auto Trait Implementations§
impl<SegmentArgs> Freeze for StringLexer<SegmentArgs>where
SegmentArgs: Freeze,
impl<SegmentArgs> !RefUnwindSafe for StringLexer<SegmentArgs>
impl<SegmentArgs> !Send for StringLexer<SegmentArgs>
impl<SegmentArgs> Sync for StringLexer<SegmentArgs>where
SegmentArgs: Sync,
impl<SegmentArgs> Unpin for StringLexer<SegmentArgs>where
SegmentArgs: Unpin,
impl<SegmentArgs> !UnwindSafe for StringLexer<SegmentArgs>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneMatcher for T
impl<T> CloneMatcher for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more