pub struct TransitionInfo {
pub input: String,
pub target_status: String,
pub effects: Vec<String>,
pub timers: Vec<String>,
pub description: Option<String>,
}Expand description
Information about a possible transition from the current state.
Fields§
§input: StringThe input/action name that triggers this transition.
target_status: StringThe target status after this transition.
effects: Vec<String>Effects that would be produced by this transition.
timers: Vec<String>Timers that would be scheduled by this transition.
description: Option<String>Optional description for UI tooltips.
Implementations§
Source§impl TransitionInfo
impl TransitionInfo
Sourcepub fn new(input: impl Into<String>, target_status: impl Into<String>) -> Self
pub fn new(input: impl Into<String>, target_status: impl Into<String>) -> Self
Create a new transition.
Sourcepub fn with_effect(self, effect: impl Into<String>) -> Self
pub fn with_effect(self, effect: impl Into<String>) -> Self
Add an effect that this transition produces.
Sourcepub fn with_timer(self, timer: impl Into<String>) -> Self
pub fn with_timer(self, timer: impl Into<String>) -> Self
Add a timer that this transition schedules.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Add a description for this transition.
Trait Implementations§
Source§impl Clone for TransitionInfo
impl Clone for TransitionInfo
Source§fn clone(&self) -> TransitionInfo
fn clone(&self) -> TransitionInfo
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 TransitionInfo
impl RefUnwindSafe for TransitionInfo
impl Send for TransitionInfo
impl Sync for TransitionInfo
impl Unpin for TransitionInfo
impl UnwindSafe for TransitionInfo
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