pub struct WorkflowTransition {
pub from: String,
pub to: String,
pub trigger: String,
pub guard: Option<String>,
}Expand description
A directed transition between two states.
Fields§
§from: StringThe source state ID.
to: StringThe destination state ID.
trigger: StringEvent name that triggers this transition.
guard: Option<String>Optional guard expression (informational only in this implementation).
Implementations§
Source§impl WorkflowTransition
impl WorkflowTransition
Sourcepub fn new(
from: impl Into<String>,
to: impl Into<String>,
trigger: impl Into<String>,
) -> Self
pub fn new( from: impl Into<String>, to: impl Into<String>, trigger: impl Into<String>, ) -> Self
Create a new transition.
Sourcepub fn with_guard(self, guard: impl Into<String>) -> Self
pub fn with_guard(self, guard: impl Into<String>) -> Self
Attach a guard expression to this transition.
Sourcepub fn matches_trigger(&self, t: &str) -> bool
pub fn matches_trigger(&self, t: &str) -> bool
Returns true when t matches this transition’s trigger.
Trait Implementations§
Source§impl Clone for WorkflowTransition
impl Clone for WorkflowTransition
Source§fn clone(&self) -> WorkflowTransition
fn clone(&self) -> WorkflowTransition
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 moreAuto Trait Implementations§
impl Freeze for WorkflowTransition
impl RefUnwindSafe for WorkflowTransition
impl Send for WorkflowTransition
impl Sync for WorkflowTransition
impl Unpin for WorkflowTransition
impl UnsafeUnpin for WorkflowTransition
impl UnwindSafe for WorkflowTransition
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