pub struct Transition<S, E> {
pub from: S,
pub to: S,
pub event: E,
pub at: DateTime<Utc>,
}Expand description
A recorded state transition.
Captures the from/to states, the event that triggered the transition, and when it occurred.
§Examples
use ironflow_engine::fsm::Transition;
let t: Transition<String, String> = Transition {
from: "Pending".to_string(),
to: "Running".to_string(),
event: "picked_up".to_string(),
at: chrono::Utc::now(),
};Fields§
§from: SState before the transition.
to: SState after the transition.
event: EEvent that triggered the transition.
at: DateTime<Utc>When the transition occurred.
Trait Implementations§
Source§impl<S: Clone, E: Clone> Clone for Transition<S, E>
impl<S: Clone, E: Clone> Clone for Transition<S, E>
Source§fn clone(&self) -> Transition<S, E>
fn clone(&self) -> Transition<S, E>
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 moreSource§impl<'de, S, E> Deserialize<'de> for Transition<S, E>where
S: Deserialize<'de>,
E: Deserialize<'de>,
impl<'de, S, E> Deserialize<'de> for Transition<S, E>where
S: Deserialize<'de>,
E: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<S, E> Freeze for Transition<S, E>
impl<S, E> RefUnwindSafe for Transition<S, E>where
S: RefUnwindSafe,
E: RefUnwindSafe,
impl<S, E> Send for Transition<S, E>
impl<S, E> Sync for Transition<S, E>
impl<S, E> Unpin for Transition<S, E>
impl<S, E> UnsafeUnpin for Transition<S, E>where
S: UnsafeUnpin,
E: UnsafeUnpin,
impl<S, E> UnwindSafe for Transition<S, E>where
S: UnwindSafe,
E: UnwindSafe,
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