pub struct LaunchedChild {
pub workdir: PathBuf,
pub session_id: String,
pub capsule_url: String,
pub argv: Vec<String>,
pub env: Vec<(String, String)>,
pub delegation_id: Option<String>,
pub door_token: Option<DoorToken>,
/* private fields */
}Expand description
A running child capsule and the handles to end it.
Fields§
§workdir: PathBufThe directory the parent created for this child, and passed as its --workdir. The
child’s own session artifacts land at <workdir>/.murmur/<session_id>/.
session_id: StringThe session id the child’s runtime minted for itself.
capsule_url: StringThe child’s A2A endpoint, http://host:port. Empty for a script capsule, which binds no
port and has already finished by the time it reports.
argv: Vec<String>The argument vector the parent built, in order, starting with the binary.
Exposed so a caller — a test, notably — can assert what was passed without reading
/proc. It carries no token: the approval goes in on standard input.
env: Vec<(String, String)>The complete environment the parent built for this child, in insertion order. Also carries no token.
delegation_id: Option<String>The id this launch’s completion reports under, None when no spawner was supplied.
Minted here, injected into the child as part of SPAWNER_ENV, and echoed back on the
completion — the one value that joins a delegation to the task it produces at the parent.
door_token: Option<DoorToken>The operator token of a child that declares network.authentication, read from
tokens.operator on its readiness line. The parent presents it on every call to the
child’s door. Never printed by Debug.
Implementations§
Source§impl LaunchedChild
impl LaunchedChild
Sourcepub fn stderr_tail(&self) -> Vec<String>
pub fn stderr_tail(&self) -> Vec<String>
The child’s last [CHILD_STDERR_TAIL_LINES] lines, oldest first.
The same lines a crash completion quotes back, exposed so a caller can read what the child said without scraping the stderr they were already echoed to.
Sourcepub fn shutdown(&mut self) -> Result<(), RuntimeError>
pub fn shutdown(&mut self) -> Result<(), RuntimeError>
Terminate the child and reap it. Idempotent: a second call, or a call after Drop has
already run, does nothing.
Marks the ending as deliberate, so the watcher records the delegation as terminated and
posts nothing: the only party that would be told is the party that did it.
Sourcepub fn release(self)
pub fn release(self)
Stop owning the child’s lifetime without signalling it, and let this handle go.
The one escape from Drop’s kill. After this the process keeps running and only the
completion watcher started by launch_child_capsule will ever observe or reap it — a
child released from a launch that named no CompletionAddress is a process nothing will
ever wait on.
This is how a delegation outlives the call that made it: delegate-task returns as soon as
the child is running and holding its task, and what the child eventually did arrives at the
parent as a completion the watcher either forwards or writes itself.
Trait Implementations§
Source§impl Debug for LaunchedChild
impl Debug for LaunchedChild
Source§impl Drop for LaunchedChild
impl Drop for LaunchedChild
Source§fn drop(&mut self)
fn drop(&mut self)
Terminates and reaps, so a parent that returns early — including by panicking — leaves no
orphaned capsule process behind holding a port and a directory. Deliberate on the same
terms as LaunchedChild::shutdown.
A released child is left alone: its lifetime stopped being this handle’s the moment
LaunchedChild::release was called.
Auto Trait Implementations§
impl Freeze for LaunchedChild
impl RefUnwindSafe for LaunchedChild
impl Send for LaunchedChild
impl Sync for LaunchedChild
impl Unpin for LaunchedChild
impl UnsafeUnpin for LaunchedChild
impl UnwindSafe for LaunchedChild
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
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