pub struct ToolSession { /* private fields */ }Expand description
A turn’s credential and tool surface.
Dropping this revokes the bearer. That is deliberate and is the reason the guard exists rather than a plain id: a turn that ends — normally, by error, or because the caller went away — must not leave a live credential that an orphaned agent subprocess can still spend.
Implementations§
Source§impl ToolSession
impl ToolSession
Sourcepub fn mcp_servers(&self) -> Vec<McpServerConfig>
pub fn mcp_servers(&self) -> Vec<McpServerConfig>
The mcpServers entry to hand the agent.
A Vec because that is the shape ChatRequest::with_mcp_servers takes
and a caller may be composing several servers.
Sourcepub fn session_id(&self) -> &str
pub fn session_id(&self) -> &str
Non-secret id for log correlation. The bearer is never exposed.
Sourcepub fn calls_served(&self) -> u64
pub fn calls_served(&self) -> u64
Tool calls served on this session.
Zero on a turn whose reply claimed to have consulted data is the signal that it did not.
Trait Implementations§
Source§impl Drop for ToolSession
impl Drop for ToolSession
Auto Trait Implementations§
impl !RefUnwindSafe for ToolSession
impl !UnwindSafe for ToolSession
impl Freeze for ToolSession
impl Send for ToolSession
impl Sync for ToolSession
impl Unpin for ToolSession
impl UnsafeUnpin for ToolSession
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more