pub struct MemoryStore { /* private fields */ }Implementations§
Source§impl MemoryStore
impl MemoryStore
pub fn new() -> Self
pub fn save_to_path(&self, path: impl AsRef<Path>) -> Result<()>
pub fn load_from_path(path: impl AsRef<Path>) -> Result<Self>
pub fn create_run(&mut self, initial_state: State) -> (String, String)
pub fn claim_step( &mut self, worker_id: &str, run_id: &str, lease_seconds: f64, ) -> Result<StepClaim>
pub fn load_state(&self, run_id: &str) -> Result<(State, u64, String)>
pub fn recover_expired_leases(&mut self) -> usize
pub fn cancel_run(&mut self, run_id: &str, reason: &str) -> Result<usize>
pub fn commit_state_patch( &mut self, run_id: &str, step_id: &str, lease_token: &str, base_version: u64, patch: State, ) -> Result<u64>
pub fn mark_retry( &mut self, run_id: &str, step_id: &str, error_type: &str, message: &str, )
pub fn mark_waiting_human( &mut self, run_id: &str, step_id: &str, reason: &str, approval_id: &str, )
pub fn mark_failed( &mut self, run_id: &str, step_id: &str, error_type: &str, message: &str, )
pub fn append_event( &mut self, run_id: &str, session_id: Option<&str>, step_id: Option<&str>, event_type: &str, payload: State, agent_role: Option<&str>, state_version: Option<u64>, causal_token: Option<&str>, ) -> Event
pub fn reserve_ledger( &mut self, key: &str, entry: ToolLedgerEntry, ) -> Option<ToolLedgerEntry>
pub fn update_ledger( &mut self, key: &str, status: &str, response: Option<Value>, error_type: Option<String>, )
pub fn request_approval( &mut self, approval_key: &str, run_id: &str, session_id: &str, step_id: &str, tool_name: &str, risk_level: &str, reason: &str, request_hash: &str, request_ref: &str, requested_by: &str, ) -> ApprovalRequest
pub fn approval_for_key(&self, approval_key: &str) -> Option<ApprovalRequest>
pub fn approval_requests(&self, run_id: &str) -> Vec<ApprovalRequest>
pub fn approve_request( &mut self, approval_id: &str, approver: &str, reason: &str, ) -> Result<ApprovalRequest>
pub fn deny_request( &mut self, approval_id: &str, approver: &str, reason: &str, ) -> Result<ApprovalRequest>
pub fn record_cost( &mut self, run_id: &str, session_id: &str, step_id: &str, category: &str, name: &str, amount: f64, unit: &str, metadata: State, ) -> String
pub fn cost_records(&self, run_id: &str) -> Vec<CostRecord>
pub fn cost_summary(&self, run_id: &str) -> CostSummary
pub fn create_artifact( &mut self, run_id: &str, step_id: Option<&str>, name: &str, content: State, metadata: State, ) -> Artifact
pub fn artifacts(&self, run_id: &str) -> Vec<Artifact>
pub fn validate_lease(&self, step_id: &str, lease_token: &str) -> Result<()>
pub fn final_state(&self, run_id: &str) -> Result<State>
pub fn run(&self, run_id: &str) -> Result<Run>
pub fn steps(&self, run_id: &str) -> Vec<Step>
pub fn events(&self, run_id: &str) -> Vec<Event>
pub fn ledger(&self, run_id: &str) -> Vec<ToolLedgerEntry>
Trait Implementations§
Source§impl Default for MemoryStore
impl Default for MemoryStore
Source§fn default() -> MemoryStore
fn default() -> MemoryStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryStore
impl RefUnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl UnsafeUnpin for MemoryStore
impl UnwindSafe for MemoryStore
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