pub struct SandboxManager { /* private fields */ }Expand description
Owns an agent’s sandboxes for its whole lifetime. Created at spawn, updated
per stage via Self::set_stage, torn down at reap via Self::destroy_all.
Implementations§
Source§impl SandboxManager
impl SandboxManager
Sourcepub fn build(
run_id: &str,
by_index: Vec<ToolSandboxConfig>,
workdir: &str,
entry_index: usize,
) -> Result<Option<Self>, String>
pub fn build( run_id: &str, by_index: Vec<ToolSandboxConfig>, workdir: &str, entry_index: usize, ) -> Result<Option<Self>, String>
Build the manager for an agent whose stages resolve (in order) to
by_index, bind-mounting workdir. entry_index selects the initial
stage’s config. Returns Ok(None) when nothing is sandboxed (the common
case - the caller then attaches no executor and shell runs on the host).
Returns Err when a required runtime is unavailable and that config’s
on_unavailable is Error.
Sourcepub fn set_stage(&self, index: usize)
pub fn set_stage(&self, index: usize)
Point the shell tool at the sandbox for stage index (called by the tool
service’s sync_stage on every stage change).
Sourcepub fn destroy_all(&self)
pub fn destroy_all(&self)
Force-remove every container this manager started (best-effort). Called once, at reap, before the agent entity is despawned.
Trait Implementations§
Source§impl Debug for SandboxManager
impl Debug for SandboxManager
Source§impl ShellExecutor for SandboxManager
impl ShellExecutor for SandboxManager
Source§fn build_command(
&self,
shell: &str,
flag: &str,
command: &str,
workdir: &Path,
) -> TokioCommand
fn build_command( &self, shell: &str, flag: &str, command: &str, workdir: &Path, ) -> TokioCommand
command via shell flag for workdir.Auto Trait Implementations§
impl !Freeze for SandboxManager
impl RefUnwindSafe for SandboxManager
impl Send for SandboxManager
impl Sync for SandboxManager
impl Unpin for SandboxManager
impl UnsafeUnpin for SandboxManager
impl UnwindSafe for SandboxManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ConditionalSend for Twhere
T: Send,
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>, which can then be
downcast into Box<dyn 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>, which 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.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
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> ⓘ
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