Skip to main content

ContainmentGuard

Struct ContainmentGuard 

Source
pub struct ContainmentGuard<C: ContainmentChild> { /* private fields */ }
Expand description

An owned, stateful containment capability and child lifecycle.

Termination and normal completion mutably borrow the guard and are one-shot. Dropping an active guard kills the contained tree and makes a bounded attempt to reap the child. The guard never reconstructs containment from a caller-supplied PID.

Implementations§

Source§

impl<C: ContainmentChild> ContainmentGuard<C>

Source

pub fn identity(&self) -> &ContainmentIdentity

Source

pub fn tree_kill_reliability(&self) -> TreeKillReliability

Source

pub fn boundary_strength(&self) -> ContainmentBoundaryStrength

Source

pub fn into_child(self) -> Result<C, Self>

Recover the child adapter after successful termination or completion.

Source

pub fn try_complete( &mut self, config: TerminateTreeConfig, ) -> SysprimsResult<Option<ContainmentOutcome>>

Finalize a normally exited child without surrendering containment early.

This observes leader exit without reaping. When the leader has exited, the method cleans any remaining descendants before reaping and returns the resulting outcome. It returns Ok(None) while the leader is running.

Source

pub fn terminate( &mut self, config: TerminateTreeConfig, ) -> SysprimsResult<ContainmentOutcome>

Terminate the owned containment once, preserving the child until reap.

Trait Implementations§

Source§

impl<C: ContainmentChild> Drop for ContainmentGuard<C>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
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§

§

impl<C> Freeze for ContainmentGuard<C>
where Option<C>: Freeze,

§

impl<C> RefUnwindSafe for ContainmentGuard<C>

§

impl<C> Send for ContainmentGuard<C>
where Option<C>: Send,

§

impl<C> Sync for ContainmentGuard<C>
where Option<C>: Sync,

§

impl<C> Unpin for ContainmentGuard<C>
where Option<C>: Unpin,

§

impl<C> UnsafeUnpin for ContainmentGuard<C>
where Option<C>: UnsafeUnpin,

§

impl<C> UnwindSafe for ContainmentGuard<C>
where Option<C>: UnwindSafe,

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, 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, 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, <T as TryFrom<U>>::Error>

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.