pub struct StateTransition {
pub from: TaskState,
pub to: TaskState,
pub timestamp: f64,
pub reason: Option<String>,
pub metadata: Option<HashMap<String, Value>>,
}Expand description
A state transition record
Fields§
§from: TaskStatePrevious state
to: TaskStateNew state
timestamp: f64Unix timestamp when the transition occurred
reason: Option<String>Optional reason for the transition
metadata: Option<HashMap<String, Value>>Optional additional metadata
Implementations§
Source§impl StateTransition
impl StateTransition
Sourcepub fn with_reason(self, reason: impl Into<String>) -> Self
pub fn with_reason(self, reason: impl Into<String>) -> Self
Add a reason for the transition
Sourcepub fn with_metadata(self, metadata: HashMap<String, Value>) -> Self
pub fn with_metadata(self, metadata: HashMap<String, Value>) -> Self
Add metadata to the transition
Trait Implementations§
Source§impl Clone for StateTransition
impl Clone for StateTransition
Source§fn clone(&self) -> StateTransition
fn clone(&self) -> StateTransition
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 Debug for StateTransition
impl Debug for StateTransition
Source§impl<'de> Deserialize<'de> for StateTransition
impl<'de> Deserialize<'de> for StateTransition
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 Freeze for StateTransition
impl RefUnwindSafe for StateTransition
impl Send for StateTransition
impl Sync for StateTransition
impl Unpin for StateTransition
impl UnwindSafe for StateTransition
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