pub enum PatternSequence {
Condition(PatternCondition),
Seq(Vec<PatternSequence>),
Within(Box<PatternSequence>, Duration),
FollowedBy(Box<PatternSequence>, Box<PatternSequence>),
Not(Box<PatternSequence>),
Or(Vec<PatternSequence>),
And(Vec<PatternSequence>),
Repeat(Box<PatternSequence>, usize),
}Expand description
Pattern sequence operators
Variants§
Condition(PatternCondition)
Single condition
Seq(Vec<PatternSequence>)
Sequence of patterns (must occur in order)
Within(Box<PatternSequence>, Duration)
Pattern must complete within duration
FollowedBy(Box<PatternSequence>, Box<PatternSequence>)
One pattern followed by another
Not(Box<PatternSequence>)
Pattern must NOT occur
Or(Vec<PatternSequence>)
Any of these patterns
And(Vec<PatternSequence>)
All of these patterns (any order)
Repeat(Box<PatternSequence>, usize)
Pattern repeated N times
Implementations§
Source§impl PatternSequence
impl PatternSequence
Sourcepub fn condition(
name: &str,
field: &str,
op: ComparisonOp,
value: ValueWord,
) -> Self
pub fn condition( name: &str, field: &str, op: ComparisonOp, value: ValueWord, ) -> Self
Create a single condition pattern
Sourcepub fn seq(patterns: Vec<PatternSequence>) -> Self
pub fn seq(patterns: Vec<PatternSequence>) -> Self
Create a sequence of patterns
Sourcepub fn followed_by(self, next: PatternSequence) -> Self
pub fn followed_by(self, next: PatternSequence) -> Self
Create a followed-by pattern
Sourcepub fn or(patterns: Vec<PatternSequence>) -> Self
pub fn or(patterns: Vec<PatternSequence>) -> Self
Create an OR of patterns
Sourcepub fn and(patterns: Vec<PatternSequence>) -> Self
pub fn and(patterns: Vec<PatternSequence>) -> Self
Create an AND of patterns
Trait Implementations§
Source§impl Clone for PatternSequence
impl Clone for PatternSequence
Source§fn clone(&self) -> PatternSequence
fn clone(&self) -> PatternSequence
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for PatternSequence
impl RefUnwindSafe for PatternSequence
impl Send for PatternSequence
impl Sync for PatternSequence
impl Unpin for PatternSequence
impl UnsafeUnpin for PatternSequence
impl UnwindSafe for PatternSequence
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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