Skip to main content

LaunchedChild

Struct LaunchedChild 

Source
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: PathBuf

The 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: String

The session id the child’s runtime minted for itself.

§capsule_url: String

The 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

Source

pub fn pid(&self) -> u32

The child’s operating-system process id. 0 once it has been reaped.

Source

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.

Source

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.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for LaunchedChild

Source§

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.

Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more