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>
impl<C: ContainmentChild> ContainmentGuard<C>
pub fn identity(&self) -> &ContainmentIdentity
pub fn tree_kill_reliability(&self) -> TreeKillReliability
pub fn boundary_strength(&self) -> ContainmentBoundaryStrength
Sourcepub fn into_child(self) -> Result<C, Self>
pub fn into_child(self) -> Result<C, Self>
Recover the child adapter after successful termination or completion.
Sourcepub fn try_complete(
&mut self,
config: TerminateTreeConfig,
) -> SysprimsResult<Option<ContainmentOutcome>>
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.
Sourcepub fn terminate(
&mut self,
config: TerminateTreeConfig,
) -> SysprimsResult<ContainmentOutcome>
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>
impl<C: ContainmentChild> Drop for ContainmentGuard<C>
Auto Trait Implementations§
impl<C> Forget for ContainmentGuard<C>
impl<C> Freeze for ContainmentGuard<C>
impl<C> Move for ContainmentGuard<C>
impl<C> RefUnwindSafe for ContainmentGuard<C>where
Option<C>: RefUnwindSafe,
impl<C> Send for ContainmentGuard<C>
impl<C> Sync for ContainmentGuard<C>
impl<C> Unpin for ContainmentGuard<C>
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> 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