pub struct ScopeContext { /* private fields */ }Expand description
Routing context that resolves storage paths based on scope and call identity.
ScopeContext is threaded through the state reduction pipeline so that
ToolCall-scoped actions are transparently routed to a per-call namespace
(__tool_call_scope.<call_id>.<base_path>) without plugins needing to know
the call id.
Implementations§
Source§impl ScopeContext
impl ScopeContext
Sourcepub fn run() -> Self
pub fn run() -> Self
Create a scope context without a call id (used for Thread and Run scopes).
Sourcepub fn for_call(call_id: impl Into<String>) -> Self
pub fn for_call(call_id: impl Into<String>) -> Self
Create a scope context for a specific tool call.
Sourcepub fn resolve_path(&self, scope: StateScope, base_path: &str) -> String
pub fn resolve_path(&self, scope: StateScope, base_path: &str) -> String
Resolve a (scope, base_path) pair to the actual storage path.
Thread/Runscope: returnsbase_pathunchanged.ToolCallscope with a call id: returns__tool_call_scope.<id>.<base_path>.ToolCallscope without a call id: falls back tobase_path.
Trait Implementations§
Source§impl Clone for ScopeContext
impl Clone for ScopeContext
Source§fn clone(&self) -> ScopeContext
fn clone(&self) -> ScopeContext
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 moreAuto Trait Implementations§
impl Freeze for ScopeContext
impl RefUnwindSafe for ScopeContext
impl Send for ScopeContext
impl Sync for ScopeContext
impl Unpin for ScopeContext
impl UnsafeUnpin for ScopeContext
impl UnwindSafe for ScopeContext
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