pub struct PersistentSandbox { /* private fields */ }Expand description
A long-lived sandbox that persists across sessions.
Spawned once at process startup (when SandboxMode::Persistent is configured)
and shared by all sessions. Includes a background health monitor that
periodically pings the sandbox and attempts to respawn it on failure.
Implementations§
Source§impl PersistentSandbox
impl PersistentSandbox
Sourcepub async fn spawn(config: &SandboxConfig) -> Result<Self, String>
pub async fn spawn(config: &SandboxConfig) -> Result<Self, String>
Spawn a persistent sandbox with a background health monitor.
Sourcepub async fn client(&self) -> Arc<McpClient>
pub async fn client(&self) -> Arc<McpClient>
Get the MCP client for routing tool calls through this sandbox.
Sourcepub fn health(&self) -> SandboxHealth
pub fn health(&self) -> SandboxHealth
Get the current health status (non-blocking snapshot).
Sourcepub fn mode(&self) -> &SandboxMode
pub fn mode(&self) -> &SandboxMode
Get the sandbox mode from the config.
Auto Trait Implementations§
impl Freeze for PersistentSandbox
impl !RefUnwindSafe for PersistentSandbox
impl Send for PersistentSandbox
impl Sync for PersistentSandbox
impl Unpin for PersistentSandbox
impl UnsafeUnpin for PersistentSandbox
impl !UnwindSafe for PersistentSandbox
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request