pub struct McpSession<T: McpTransport> {
pub calls: u64,
/* private fields */
}Expand description
A provider backed by an MCP session.
object selects the tool index; method is the tool name. The session
performs the real JSON-RPC handshake (initialize, tools/list) and then
tools/call per invocation.
Fields§
§calls: u64Implementations§
Source§impl<T: McpTransport> McpSession<T>
impl<T: McpTransport> McpSession<T>
Sourcepub fn tools(&self) -> &[McpToolDef]
pub fn tools(&self) -> &[McpToolDef]
Discovered tools.
Sourcepub fn policy(&self) -> ToolPolicy
pub fn policy(&self) -> ToolPolicy
A policy allowing exactly the discovered tools.
Trait Implementations§
Source§impl<T: McpTransport> Provider for McpSession<T>
impl<T: McpTransport> Provider for McpSession<T>
Source§fn mutating(&self, _method: &str) -> bool
fn mutating(&self, _method: &str) -> bool
Whether
method mutates provider state (refused on read-only caps).Source§fn has_method(&self, method: &str) -> bool
fn has_method(&self, method: &str) -> bool
Whether this provider answers
method.Source§fn on_drop(&mut self, _object: u64, _cap: CapId)
fn on_drop(&mut self, _object: u64, _cap: CapId)
Called when the last capability referencing
object is dropped.Source§fn take_drop_notifications(&mut self) -> Vec<(u64, CapId)>
fn take_drop_notifications(&mut self) -> Vec<(u64, CapId)>
Drain provider-side drop notifications recorded by
Provider::on_drop. Read moreAuto Trait Implementations§
impl<T> Freeze for McpSession<T>where
T: Freeze,
impl<T> RefUnwindSafe for McpSession<T>where
T: RefUnwindSafe,
impl<T> Send for McpSession<T>where
T: Send,
impl<T> Sync for McpSession<T>where
T: Sync,
impl<T> Unpin for McpSession<T>where
T: Unpin,
impl<T> UnsafeUnpin for McpSession<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for McpSession<T>where
T: UnwindSafe,
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