pub struct McpRuntimeManager { /* private fields */ }Expand description
Session-scoped exact MCP runtime lease manager. See module docs.
Implementations§
Source§impl McpRuntimeManager
impl McpRuntimeManager
pub fn new(config_source: ConfigSource, idle_max: Duration) -> Self
Sourcepub fn with_cache_path(self, path: PathBuf) -> Self
pub fn with_cache_path(self, path: PathBuf) -> Self
Override the descriptor-cache write-back location (tests, or a host that keeps its cache elsewhere).
Sourcepub fn lease_count(&self) -> usize
pub fn lease_count(&self) -> usize
Number of live (Ready or Starting) leases.
Sourcepub fn revoke_server_lease(&self, session: &SessionId, server: &str)
pub fn revoke_server_lease(&self, session: &SessionId, server: &str)
Terminate one session’s runtime lease on one SERVER (the lease unit: one child process shared by that session’s exact tools of that server).
Sourcepub fn revoke_exact_tool(
&self,
session: &SessionId,
server: &str,
server_tool_name: &str,
)
pub fn revoke_exact_tool( &self, session: &SessionId, server: &str, server_tool_name: &str, )
Revoke one EXACT tool grant’s runtime backing. Grant revocation
itself is gate-level (the SessionToolSet); at the runtime layer the
lease unit is the server child, so this conservatively terminates
the shared server lease — the child loses all session access rather
than retaining any after an exact revocation.
Sourcepub fn terminate_session(&self, session: &SessionId) -> usize
pub fn terminate_session(&self, session: &SessionId) -> usize
Terminate every lease held by one session. Returns how many.
Shared ("*") leases are never a session’s to terminate.
Sourcepub fn terminate_all(&self)
pub fn terminate_all(&self)
Terminate every lease (runtime shutdown).
Sourcepub fn reap_idle(&self)
pub fn reap_idle(&self)
Reap Ready leases idle past the configured bound. Work per pass is
bounded by REAP_SCAN_MAX examined keys.
Sourcepub async fn call_exact(
&self,
session: &SessionId,
server: &str,
expected_fingerprint: &str,
server_tool_name: &str,
expected_digest: &SchemaDigest,
params: Value,
) -> Result<String, McpLeaseError>
pub async fn call_exact( &self, session: &SessionId, server: &str, expected_fingerprint: &str, server_tool_name: &str, expected_digest: &SchemaDigest, params: Value, ) -> Result<String, McpLeaseError>
Execute one EXACT already-gate-authorized MCP tool call. See module docs for the lease/single-flight/validation/revocation contract.
Trait Implementations§
Source§impl Debug for McpRuntimeManager
impl Debug for McpRuntimeManager
Source§impl Drop for McpRuntimeManager
impl Drop for McpRuntimeManager
Auto Trait Implementations§
impl !Freeze for McpRuntimeManager
impl !RefUnwindSafe for McpRuntimeManager
impl !UnwindSafe for McpRuntimeManager
impl Send for McpRuntimeManager
impl Sync for McpRuntimeManager
impl Unpin for McpRuntimeManager
impl UnsafeUnpin for McpRuntimeManager
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.