pub struct ProcessSupervisor { /* private fields */ }Expand description
Run-scoped owner and observer for pipe and PTY execution resources.
Implementations§
Source§impl ProcessSupervisor
impl ProcessSupervisor
pub fn new(max_output_bytes: usize) -> Result<Self, ExecProcessError>
Sourcepub fn new_with_runtime_temp_root(
max_output_bytes: usize,
root: impl AsRef<Path>,
) -> Result<Self, ExecProcessError>
pub fn new_with_runtime_temp_root( max_output_bytes: usize, root: impl AsRef<Path>, ) -> Result<Self, ExecProcessError>
Use a stable, private Host directory so execution policy identities can survive Host restart. The root must be outside all workspace roots. Its parent must already exist; Run children are exclusively created.
Sourcepub fn runtime_temp_root(&self) -> &Path
pub fn runtime_temp_root(&self) -> &Path
Host policy and exec Tool restrictions must explicitly grant read/write access to this root. Each dispatched sandbox receives only its Run child.
pub fn subscribe(&self) -> Receiver<ExecSessionEvent>
pub async fn spawn( &self, spec: ExecSpawnSpec, ) -> Result<ExecSessionId, ExecProcessError>
Sourcepub async fn write_and_poll(
&self,
run_id: &RunId,
session_id: ExecSessionId,
input: Option<&str>,
wait: Duration,
cancellation: &CancellationToken,
) -> Result<ExecPollResult, ExecProcessError>
pub async fn write_and_poll( &self, run_id: &RunId, session_id: ExecSessionId, input: Option<&str>, wait: Duration, cancellation: &CancellationToken, ) -> Result<ExecPollResult, ExecProcessError>
Use output waits for TTY/input interactions and completion waits for empty pipe observations. The duration bounds this observation only.
Sourcepub async fn write_and_poll_with_options(
&self,
run_id: &RunId,
session_id: ExecSessionId,
input: Option<&str>,
options: ExecWaitOptions,
cancellation: &CancellationToken,
) -> Result<ExecPollResult, ExecProcessError>
pub async fn write_and_poll_with_options( &self, run_id: &RunId, session_id: ExecSessionId, input: Option<&str>, options: ExecWaitOptions, cancellation: &CancellationToken, ) -> Result<ExecPollResult, ExecProcessError>
Observe one existing session with an explicit wait strategy. Yielding preserves both the process and its Run-scoped authority.
pub async fn close( &self, run_id: &RunId, session_id: ExecSessionId, ) -> Result<(), ExecProcessError>
pub async fn close_run(&self, run_id: &RunId) -> Result<usize, ExecProcessError>
pub fn list( &self, run_id: &RunId, ) -> Result<Vec<ExecSessionId>, ExecProcessError>
pub fn snapshot( &self, run_id: &RunId, session_id: ExecSessionId, ) -> Result<ExecSessionSnapshot, ExecProcessError>
pub fn operation_plan( &self, run_id: &RunId, session_id: ExecSessionId, ) -> Result<ToolOperationPlan, ExecProcessError>
Auto Trait Implementations§
impl !Freeze for ProcessSupervisor
impl !RefUnwindSafe for ProcessSupervisor
impl !UnwindSafe for ProcessSupervisor
impl Send for ProcessSupervisor
impl Sync for ProcessSupervisor
impl Unpin for ProcessSupervisor
impl UnsafeUnpin for ProcessSupervisor
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> 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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.