pub struct McpSandboxContext { /* private fields */ }Expand description
Sandbox policy and launch context inherited by MCP stdio providers.
Implementations§
Source§impl McpSandboxContext
impl McpSandboxContext
Sourcepub fn new(policy: SandboxPolicy, sandbox_cwd: impl Into<PathBuf>) -> Self
pub fn new(policy: SandboxPolicy, sandbox_cwd: impl Into<PathBuf>) -> Self
Create a context using the configured workspace as the sandbox cwd.
Sourcepub fn with_linux_sandbox_executable(
self,
executable: impl Into<PathBuf>,
) -> Self
pub fn with_linux_sandbox_executable( self, executable: impl Into<PathBuf>, ) -> Self
Override the Linux helper path, primarily for embedding applications and tests.
Sourcepub fn policy(&self) -> &SandboxPolicy
pub fn policy(&self) -> &SandboxPolicy
Return the policy carried by this context.
Sourcepub fn narrowed(&self, overrides: &McpSandboxOverrideConfig) -> Result<Self>
pub fn narrowed(&self, overrides: &McpSandboxOverrideConfig) -> Result<Self>
Derive a per-server narrowed context from this session context.
Unset override fields inherit the parent policy. Setting any resource limit opts into the conservative cap family for the unset siblings, so limits require a workspace-write session policy and fail otherwise.
§Errors
Returns an error when the overrides cannot narrow the parent safely.
Trait Implementations§
Source§impl Clone for McpSandboxContext
impl Clone for McpSandboxContext
Auto Trait Implementations§
impl Forget for McpSandboxContext
impl Freeze for McpSandboxContext
impl Move for McpSandboxContext
impl RefUnwindSafe for McpSandboxContext
impl Send for McpSandboxContext
impl Sync for McpSandboxContext
impl Unpin for McpSandboxContext
impl UnsafeUnpin for McpSandboxContext
impl UnwindSafe for McpSandboxContext
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