pub struct Flow {Show 13 fields
pub id: Uuid,
pub controller_id: String,
pub goal: String,
pub owner_session_key: String,
pub requester_origin: String,
pub current_step: String,
pub state_json: Value,
pub wait_json: Option<Value>,
pub status: FlowStatus,
pub cancel_requested: bool,
pub revision: i64,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
A flow record as persisted in flows. state_json and wait_json carry
arbitrary controller-specific payloads; the runtime treats them as opaque
blobs and only mutates them through revision-checked APIs.
Fields§
§id: Uuid§controller_id: String§goal: String§owner_session_key: String§requester_origin: String§current_step: String§state_json: Value§wait_json: Option<Value>§status: FlowStatus§cancel_requested: boolSticky cancel intent. When true, the flow refuses any non-terminal
transition until it reaches Cancelled. Survives restart.
revision: i64§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl Flow
impl Flow
Sourcepub fn transition_to(&mut self, next: FlowStatus) -> Result<(), FlowError>
pub fn transition_to(&mut self, next: FlowStatus) -> Result<(), FlowError>
Validate and apply a status transition. Does not persist — caller is
responsible for FlowStore::update_with_revision. Mutates self so
the caller can immediately persist the resulting state.
Sourcepub fn request_cancel(&mut self)
pub fn request_cancel(&mut self)
Mark a sticky cancel intent. Survives restart; subsequent transitions
are restricted to Cancelled. Idempotent — calling on an already
cancel-requested flow is a no-op.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Flow
impl<'de> Deserialize<'de> for Flow
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 Flow
impl RefUnwindSafe for Flow
impl Send for Flow
impl Sync for Flow
impl Unpin for Flow
impl UnsafeUnpin for Flow
impl UnwindSafe for Flow
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