pub struct ExecutionSnapshot {
pub execution_id: ExecutionId,
pub tenant_id: TenantId,
pub user_id: Option<UserId>,
pub state: ExecutionState,
pub current_step_id: Option<StepId>,
pub step_outputs: HashMap<StepId, Value>,
pub variables: HashMap<String, Value>,
pub timestamp: DateTime<Utc>,
pub sequence_number: u64,
}Expand description
Execution state snapshot
This captures the current state of an execution for fast resumption.
The sequence_number should match the EventStore sequence to verify freshness.
Fields§
§execution_id: ExecutionIdThe execution this snapshot is for
tenant_id: TenantIdTenant for multi-tenancy isolation
user_id: Option<UserId>User who initiated this execution (for observability)
state: ExecutionStateCurrent execution state
current_step_id: Option<StepId>Currently executing step (if any)
step_outputs: HashMap<StepId, Value>Outputs from completed steps
variables: HashMap<String, Value>Working variables
timestamp: DateTime<Utc>When this snapshot was created
sequence_number: u64EventStore sequence number at snapshot time
Used to verify freshness - if EventStore has more events, the snapshot may be stale.
Implementations§
Source§impl ExecutionSnapshot
impl ExecutionSnapshot
Sourcepub fn new(
execution_id: ExecutionId,
tenant_id: TenantId,
state: ExecutionState,
sequence_number: u64,
) -> Self
pub fn new( execution_id: ExecutionId, tenant_id: TenantId, state: ExecutionState, sequence_number: u64, ) -> Self
Create a new snapshot
Sourcepub fn with_user(
execution_id: ExecutionId,
tenant_id: TenantId,
user_id: Option<UserId>,
state: ExecutionState,
sequence_number: u64,
) -> Self
pub fn with_user( execution_id: ExecutionId, tenant_id: TenantId, user_id: Option<UserId>, state: ExecutionState, sequence_number: u64, ) -> Self
Create a new snapshot with user_id
Trait Implementations§
Source§impl Clone for ExecutionSnapshot
impl Clone for ExecutionSnapshot
Source§fn clone(&self) -> ExecutionSnapshot
fn clone(&self) -> ExecutionSnapshot
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 ExecutionSnapshot
impl Debug for ExecutionSnapshot
Source§impl<'de> Deserialize<'de> for ExecutionSnapshot
impl<'de> Deserialize<'de> for ExecutionSnapshot
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 ExecutionSnapshot
impl RefUnwindSafe for ExecutionSnapshot
impl Send for ExecutionSnapshot
impl Sync for ExecutionSnapshot
impl Unpin for ExecutionSnapshot
impl UnsafeUnpin for ExecutionSnapshot
impl UnwindSafe for ExecutionSnapshot
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