pub struct OperationState { /* private fields */ }Expand description
Operation State: Execution logging and history
Implementations§
Source§impl OperationState
impl OperationState
Sourcepub async fn generate_id(&self) -> String
pub async fn generate_id(&self) -> String
Generate a new unique operation ID
Sourcepub async fn start_operation(&self, log: OperationLog) -> String
pub async fn start_operation(&self, log: OperationLog) -> String
Start tracking a new operation
Sourcepub async fn complete_operation(
&self,
operation_id: &str,
success: bool,
outputs: Option<Value>,
error: Option<String>,
)
pub async fn complete_operation( &self, operation_id: &str, success: bool, outputs: Option<Value>, error: Option<String>, )
Complete an operation
Sourcepub async fn mark_compensated(&self, operation_id: &str)
pub async fn mark_compensated(&self, operation_id: &str)
Mark an operation as compensated
Sourcepub async fn get_active_operations(&self) -> Vec<OperationLog>
pub async fn get_active_operations(&self) -> Vec<OperationLog>
Get active operations
Sourcepub async fn get_active_operation_ids(&self) -> Vec<String>
pub async fn get_active_operation_ids(&self) -> Vec<String>
Get active operation IDs
Sourcepub async fn get_operation(&self, operation_id: &str) -> Option<OperationLog>
pub async fn get_operation(&self, operation_id: &str) -> Option<OperationLog>
Get operation by ID
Sourcepub async fn get_agent_operations(&self, agent_id: &str) -> Vec<OperationLog>
pub async fn get_agent_operations(&self, agent_id: &str) -> Vec<OperationLog>
Get all operations for an agent
Sourcepub async fn add_child_operation(&self, parent_id: &str, child_id: &str)
pub async fn add_child_operation(&self, parent_id: &str, child_id: &str)
Add child operation to parent
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for OperationState
impl !RefUnwindSafe for OperationState
impl Send for OperationState
impl Sync for OperationState
impl Unpin for OperationState
impl UnsafeUnpin for OperationState
impl UnwindSafe for OperationState
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