pub struct FlowContext {
pub trace_id: String,
pub ok: bool,
pub errors: Vec<String>,
pub step_logs: Vec<StepLog>,
pub variables: HashMap<String, String>,
pub snapshots: HashMap<String, ContextSnapshot>,
}
Fields§
§trace_id: String
§ok: bool
§errors: Vec<String>
§step_logs: Vec<StepLog>
§variables: HashMap<String, String>
§snapshots: HashMap<String, ContextSnapshot>
Implementations§
Source§impl FlowContext
impl FlowContext
pub fn new_with_trace_id(trace_id: String) -> Self
Sourcepub fn create_snapshot(
&mut self,
snapshot_id: String,
description: String,
) -> Result<(), String>
pub fn create_snapshot( &mut self, snapshot_id: String, description: String, ) -> Result<(), String>
创建快照
Sourcepub fn list_snapshots(&self) -> Vec<&ContextSnapshot>
pub fn list_snapshots(&self) -> Vec<&ContextSnapshot>
列出所有快照
pub fn start_step(&mut self, step_name: String)
pub fn end_step_success(&mut self, step_name: &str)
pub fn end_step_failed(&mut self, step_name: &str, error: &str)
pub fn end_step_skipped(&mut self, step_name: &str, reason: &str)
pub fn end_step_timeout(&mut self, step_name: &str)
pub fn set_variable(&mut self, key: String, value: String)
pub fn get_variable(&self, key: &str) -> Option<&String>
pub fn print_summary(&self)
Trait Implementations§
Source§impl Clone for FlowContext
impl Clone for FlowContext
Source§fn clone(&self) -> FlowContext
fn clone(&self) -> FlowContext
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 FlowContext
impl Debug for FlowContext
Auto Trait Implementations§
impl Freeze for FlowContext
impl RefUnwindSafe for FlowContext
impl Send for FlowContext
impl Sync for FlowContext
impl Unpin for FlowContext
impl UnwindSafe for FlowContext
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