pub struct Extensions { /* private fields */ }Expand description
Typed, tamper-evident extension map carried on CallCtx.
This is the substrate-level channel through which a host attaches
caller identity / clearance / mandate (e.g. a ClearanceContext
from atomr-agents-security) so it flows unmodified to
Tool::invoke via InvokeCtx. Two deliberate guarantees:
- Never persisted.
CallCtxis notSerialize, and the extension map holdsdyn Anyvalues that cannot be serialized, so secrets/clearance attached here never land in a checkpoint, telemetry record, or prompt. - Not LLM-writable. Values are inserted only by Rust host /
runtime code via
Extensions::insert/CallCtx::insert_ext; there is no path from an LLM tool argument (raw_args) into this map, so it is tamper-evident with respect to model output.
Stored values are Arc-wrapped so cloning a CallCtx (which the
runtime does per tool dispatch) shares — rather than deep-copies —
the extensions.
Implementations§
Source§impl Extensions
impl Extensions
Sourcepub fn insert<T: Any + Send + Sync>(&mut self, value: T)
pub fn insert<T: Any + Send + Sync>(&mut self, value: T)
Insert (or replace) the extension of type T.
Sourcepub fn get<T: Any + Send + Sync>(&self) -> Option<&T>
pub fn get<T: Any + Send + Sync>(&self) -> Option<&T>
Borrow the extension of type T, if present.
Trait Implementations§
Source§impl Clone for Extensions
impl Clone for Extensions
Source§fn clone(&self) -> Extensions
fn clone(&self) -> Extensions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Extensions
impl Debug for Extensions
Source§impl Default for Extensions
impl Default for Extensions
Source§fn default() -> Extensions
fn default() -> Extensions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Extensions
impl !UnwindSafe for Extensions
impl Freeze for Extensions
impl Send for Extensions
impl Sync for Extensions
impl Unpin for Extensions
impl UnsafeUnpin for Extensions
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