Enum RegexAst
pub enum RegexAst {
Show 15 variants
And(Vec<RegexAst>),
Or(Vec<RegexAst>),
Concat(Vec<RegexAst>),
LookAhead(Box<RegexAst>),
Not(Box<RegexAst>),
Repeat(Box<RegexAst>, u32, u32),
Prefixes(Box<RegexAst>),
EmptyString,
NoMatch,
Regex(String),
Literal(String),
ByteLiteral(Vec<u8>),
Byte(u8),
ByteSet(Vec<u32>),
ExprRef(ExprRef),
}
Variants§
And(Vec<RegexAst>)
Intersection of the regexes
Or(Vec<RegexAst>)
Union of the regexes
Concat(Vec<RegexAst>)
Concatenation of the regexes
LookAhead(Box<RegexAst>)
Matches the regex; should be at the end of the main regex. The length of the lookahead can be recovered from the engine.
Not(Box<RegexAst>)
Matches everything the regex doesn’t match. Can lead to invalid utf8.
Repeat(Box<RegexAst>, u32, u32)
Repeat the regex at least min times, at most max times u32::MAX means infinity
Prefixes(Box<RegexAst>)
All prefixes of the words matched by the regex (including the empty string and the words themselves).
EmptyString
Matches the empty string. Same as Concat([]).
NoMatch
Matches nothing. Same as Or([]).
Regex(String)
Compile the regex using the regex_syntax crate
Literal(String)
Matches this string only
ByteLiteral(Vec<u8>)
Matches this string of bytes only. Can lead to invalid utf8.
Byte(u8)
Matches this byte only. If byte is not in 0..127, it may lead to invalid utf8
ByteSet(Vec<u32>)
Matches any byte in the set, expressed as bitset. Can lead to invalid utf8 if the set is not a subset of 0..127
ExprRef(ExprRef)
Reference previously built regex
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RegexAst
impl RefUnwindSafe for RegexAst
impl Send for RegexAst
impl Sync for RegexAst
impl Unpin for RegexAst
impl UnwindSafe for RegexAst
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Any
.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Any
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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> ⓘ
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> ⓘ
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