pub struct SpawnerLifeline { /* private fields */ }Expand description
A delegated child’s read end of its spawner lifeline, owned by this process alone. EOF on it means the process that spawned this one has ended.
Implementations§
Source§impl SpawnerLifeline
impl SpawnerLifeline
Sourcepub fn from_env() -> Result<Option<Self>, RuntimeError>
pub fn from_env() -> Result<Option<Self>, RuntimeError>
This process’s spawner lifeline, read from SPAWNER_LIFELINE_ENV.
Validated on exactly the terms of FormationLifeline::from_env, under a once-flag of
its own; errors are RuntimeError::SpawnerLifelineUnreadable.
Sourcepub fn watch(self, on_closed: impl FnOnce() + Send + 'static) -> Result<()>
pub fn watch(self, on_closed: impl FnOnce() + Send + 'static) -> Result<()>
Hand the lifeline to a detached spawner-lifeline thread that blocks on it and calls
on_closed once, at EOF. EOF that came before this call is seen at once.
The thread owns the descriptor from here on. Errors only when the thread cannot be started.
Trait Implementations§
Auto Trait Implementations§
impl Forget for SpawnerLifeline
impl Freeze for SpawnerLifeline
impl Move for SpawnerLifeline
impl RefUnwindSafe for SpawnerLifeline
impl Send for SpawnerLifeline
impl Sync for SpawnerLifeline
impl Unpin for SpawnerLifeline
impl UnsafeUnpin for SpawnerLifeline
impl UnwindSafe for SpawnerLifeline
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
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> ⓘ
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 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> ⓘ
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