pub struct ExitPattern(/* private fields */);Expand description
A bounded exit-outcome pattern used to select one transition.
A pattern contains literal characters plus * for zero or more characters
and ? for exactly one character. It matches the bounded
ExitCode, never BatchStatus.
The worked example lives in the oxide-batch crate documentation, so that
it keeps demonstrating the supported import path.
Implementations§
Source§impl ExitPattern
impl ExitPattern
Sourcepub fn new(value: impl Into<String>) -> Result<Self, PlanError>
pub fn new(value: impl Into<String>) -> Result<Self, PlanError>
Validates and constructs an exit pattern.
§Errors
Returns PlanError::InvalidPattern for an empty pattern, a pattern
longer than 64 UTF-8 bytes, surrounding whitespace, or a control
character.
Sourcepub fn matches(&self, code: &ExitCode) -> bool
pub fn matches(&self, code: &ExitCode) -> bool
Returns whether this pattern matches one exit code.
Sourcepub fn specificity(&self) -> PatternSpecificity
pub fn specificity(&self) -> PatternSpecificity
Returns the computed specificity used to order transitions.
A greater specificity is evaluated first.
Sourcepub fn intersects(&self, other: &Self) -> bool
pub fn intersects(&self, other: &Self) -> bool
Returns whether some exit code exists that both patterns match.
Trait Implementations§
Source§impl Clone for ExitPattern
impl Clone for ExitPattern
Source§fn clone(&self) -> ExitPattern
fn clone(&self) -> ExitPattern
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExitPattern
impl Debug for ExitPattern
Source§impl Display for ExitPattern
impl Display for ExitPattern
impl Eq for ExitPattern
Source§impl Hash for ExitPattern
impl Hash for ExitPattern
Source§impl Ord for ExitPattern
impl Ord for ExitPattern
Source§fn cmp(&self, other: &ExitPattern) -> Ordering
fn cmp(&self, other: &ExitPattern) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ExitPattern
impl PartialEq for ExitPattern
Source§impl PartialOrd for ExitPattern
impl PartialOrd for ExitPattern
impl StructuralPartialEq for ExitPattern
Auto Trait Implementations§
impl Freeze for ExitPattern
impl RefUnwindSafe for ExitPattern
impl Send for ExitPattern
impl Sync for ExitPattern
impl Unpin for ExitPattern
impl UnsafeUnpin for ExitPattern
impl UnwindSafe for ExitPattern
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