pub struct ToolKillHandle { /* private fields */ }Expand description
Force-stop + join for Abortable (Tokio) or ProcessIsolated (OS child) workers.
Timed waits must not drop the join on timeout (put-back) or the worker would detach while capacity is released. Process kill uses OS signals (D-043).
Implementations§
Source§impl ToolKillHandle
impl ToolKillHandle
Sourcepub fn from_child_driven(
child: Child,
completion_tx: Sender<ToolCompletion>,
wait_deadline: Instant,
) -> (Self, Pin<Box<dyn Future<Output = ()> + Send>>)
pub fn from_child_driven( child: Child, completion_tx: Sender<ToolCompletion>, wait_deadline: Instant, ) -> (Self, Pin<Box<dyn Future<Output = ()> + Send>>)
Own a Child: kill uses OS signals; wait/poll is an inline drive future (M5.4).
Mutex is never held across .await — kill can interleave with the poll loop.
Sourcepub fn from_child_driven_with_stdin(
child: Child,
stdin: Option<ChildStdin>,
payload: Vec<u8>,
completion_tx: Sender<ToolCompletion>,
wait_deadline: Instant,
) -> (Self, Pin<Box<dyn Future<Output = ()> + Send>>)
pub fn from_child_driven_with_stdin( child: Child, stdin: Option<ChildStdin>, payload: Vec<u8>, completion_tx: Sender<ToolCompletion>, wait_deadline: Instant, ) -> (Self, Pin<Box<dyn Future<Output = ()> + Send>>)
Own a Child immediately; optional stdin is written on the owned drive
via tokio::process async I/O (D-048 — never block ToolHandler::start,
never ambient spawn_blocking).
Source§impl ToolKillHandle
impl ToolKillHandle
Sourcepub fn cancel_only(control: ToolExecutionControl) -> Self
pub fn cancel_only(control: ToolExecutionControl) -> Self
AbortableAtYield without a nested Tokio task (M5.4).
Caller drives LinkedToolExecutionHandle::drive on the supervised
dispatch task; kill requests cooperative cancel via control.
Sourcepub fn register_owned_process(&self, counter: Arc<AtomicU32>)
pub fn register_owned_process(&self, counter: Arc<AtomicU32>)
Register this ProcessIsolated child in the runtime owned_processes count.
Idempotent. Call from the dispatcher after start when a shared counter exists.
Sourcepub fn note_process_reaped(&self)
pub fn note_process_reaped(&self)
Release the owned-process lease once the child is observed reaped.
Sourcepub fn kill(&self)
pub fn kill(&self)
Request cancel (CancelOnly) or OS-kill the child (ProcessIsolated). Idempotent.
Sourcepub async fn join_timeout(&self, budget: Duration) -> Result<(), ()>
pub async fn join_timeout(&self, budget: Duration) -> Result<(), ()>
Await worker teardown. On timeout, ProcessIsolated leaves the child owned so capacity stays held; caller must keep joining or park an orphan permit.
Sourcepub fn has_join(&self) -> bool
pub fn has_join(&self) -> bool
Whether unfinished ProcessIsolated work is still owned (capacity hold).
Sourcepub fn is_process_isolated(&self) -> bool
pub fn is_process_isolated(&self) -> bool
True when this handle owns an OS process (ProcessIsolated).
Sourcepub fn os_pid(&self) -> Option<u32>
pub fn os_pid(&self) -> Option<u32>
OS PID of a live ProcessIsolated child, if still owned.
Used by sacrificial proofs (D-048) to assert kill/reap without ambient heuristics.
Sourcepub fn is_cancel_only(&self) -> bool
pub fn is_cancel_only(&self) -> bool
True when the body is driven inline on the caller task (no nested JoinHandle).
Trait Implementations§
Source§impl Clone for ToolKillHandle
impl Clone for ToolKillHandle
Source§fn clone(&self) -> ToolKillHandle
fn clone(&self) -> ToolKillHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more