Enum enso_automata::pattern::Pattern [−][src]
pub enum Pattern { Range(RangeInclusive<Symbol>), Or(Vec<Pattern>), Seq(Vec<Pattern>), Many(Box<Pattern>), Always, Never, }
Expand description
A representation of a simple regular pattern.
Variants
Range(RangeInclusive<Symbol>)
Expand description
The pattern that triggers on any symbol from the given range.
Expand description
The pattern that triggers on any given pattern from a sequence.
Expand description
The pattern that triggers when a sequence of patterns is encountered.
Expand description
The pattern that triggers on 0..N repetitions of given pattern.
Expand description
The pattern that always triggers without consuming any input.
Expand description
The pattern that never triggers and does not consume any input.
Implementations
impl Pattern
[src]
impl Pattern
[src]pub fn many(&self) -> Self
[src]
pub fn many(&self) -> Self
[src]A pattern that triggers on 0..N repetitions of the pattern described by self
.
pub fn many1(&self) -> Self
[src]
pub fn many1(&self) -> Self
[src]A pattern that triggers on 1..N repetitions of the pattern described by self
.
pub fn opt(&self) -> Self
[src]
pub fn opt(&self) -> Self
[src]A pattern that triggers on 0..=1 repetitions of the pattern described by self
.
pub fn symbols(symbols: RangeInclusive<Symbol>) -> Self
[src]
pub fn symbols(symbols: RangeInclusive<Symbol>) -> Self
[src]A pattern that triggers on any of the provided symbols
.
pub fn range(range: RangeInclusive<char>) -> Self
[src]
pub fn range(range: RangeInclusive<char>) -> Self
[src]A pattern that triggers on any character in the provided range
.
pub fn all_of(chars: &str) -> Self
[src]
pub fn all_of(chars: &str) -> Self
[src]Pattern that triggers when sequence of characters given by chars
is encountered.
pub fn any_of(chars: &str) -> Self
[src]
pub fn any_of(chars: &str) -> Self
[src]The pattern that triggers on any characters contained in chars
.
pub fn none_of(chars: &str) -> Self
[src]
pub fn none_of(chars: &str) -> Self
[src]The pattern that doesn’t trigger on any character contained in chars
.
This pattern will always implicitly include [Symbol::NULL
] and [Symbol::EOF_CODE
] in
the excluded characters. If you do not want this behaviour instead use
Pattern::none_of_codes
below.
pub fn none_of_codes(codes: &[u64], names: &[String]) -> Self
[src]
pub fn none_of_codes(codes: &[u64], names: &[String]) -> Self
[src]This pattern doesn’t trigger on any code contained in codes
.
pub fn not_symbol(symbol: Symbol) -> Self
[src]
pub fn not_symbol(symbol: Symbol) -> Self
[src]The pattern that triggers on any symbol but symbol
.
pub fn repeat(pat: &Pattern, num: usize) -> Self
[src]
pub fn repeat(pat: &Pattern, num: usize) -> Self
[src]The pattern that triggers on num
repetitions of pat
.
pub fn repeat_between(pat: &Pattern, min: usize, max: usize) -> Self
[src]
pub fn repeat_between(pat: &Pattern, min: usize, max: usize) -> Self
[src]Pattern that triggers on min
..max
repetitions of pat
.
Trait Implementations
impl StructuralPartialEq for Pattern
[src]
Auto Trait Implementations
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnwindSafe for Pattern
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> HasRefValue for T where
T: ?Sized,
[src]
impl<T> HasRefValue for T where
T: ?Sized,
[src]type RefValue = T
impl<T> PhantomConversions for T
[src]
impl<T> PhantomConversions for T
[src]fn phantom_into<P>() -> P where
Self: PhantomInto<P>,
[src]
Self: PhantomInto<P>,
fn phantom_from<P>() -> Self where
P: PhantomInto<Self>,
[src]
P: PhantomInto<Self>,
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> TypeDisplay for T
[src]
impl<T> TypeDisplay for T
[src]pub default fn type_display() -> String
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,