pub struct FlowInstance<S>{
pub id: String,
pub status: FlowStatus,
pub current_step: Option<S>,
pub context: Value,
pub completed_steps: Vec<S>,
pub error: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Generic workflow instance parametrised over the step enum S.
Generated files use a type alias:
pub type OrderProcessingFlowInstance = FlowInstance<OrderProcessingFlowStep>;
Fields§
§id: String§status: FlowStatus§current_step: Option<S>§context: Value§completed_steps: Vec<S>§error: Option<String>§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl<S> FlowInstance<S>
impl<S> FlowInstance<S>
pub fn new(id: impl Into<String>) -> Self
pub fn is_complete(&self) -> bool
pub fn is_running(&self) -> bool
pub fn set_context(&mut self, key: &str, value: Value)
pub fn get_context(&self, key: &str) -> Option<&Value>
Trait Implementations§
Source§impl<S> Clone for FlowInstance<S>
impl<S> Clone for FlowInstance<S>
Source§impl<S> Debug for FlowInstance<S>
impl<S> Debug for FlowInstance<S>
Source§impl<'de, S> Deserialize<'de> for FlowInstance<S>
impl<'de, S> Deserialize<'de> for FlowInstance<S>
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
Source§impl<S> Serialize for FlowInstance<S>
impl<S> Serialize for FlowInstance<S>
Auto Trait Implementations§
impl<S> Freeze for FlowInstance<S>
impl<S> RefUnwindSafe for FlowInstance<S>
impl<S> Send for FlowInstance<S>
impl<S> Sync for FlowInstance<S>
impl<S> Unpin for FlowInstance<S>
impl<S> UnsafeUnpin for FlowInstance<S>
impl<S> UnwindSafe for FlowInstance<S>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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