pub struct FormationLifeline { /* private fields */ }Expand description
A member’s read end of its formation lifeline, owned by this process alone.
Implementations§
Source§impl FormationLifeline
impl FormationLifeline
Sourcepub fn from_env() -> Result<Option<Self>, RuntimeError>
pub fn from_env() -> Result<Option<Self>, RuntimeError>
This process’s formation lifeline, read from FORMATION_LIFELINE_ENV.
Ok(None) when the variable is absent or blank. Otherwise the value must be the decimal
number, 3 or above, of an open descriptor that is a FIFO opened read-only; anything else
is an error, as is a second read of a set variable in the same process. On success the
descriptor has FD_CLOEXEC set and is owned by the returned value.
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 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; nothing else in the process holds or closes it. Errors only when the thread cannot be started.
Trait Implementations§
Auto Trait Implementations§
impl Forget for FormationLifeline
impl Freeze for FormationLifeline
impl Move for FormationLifeline
impl RefUnwindSafe for FormationLifeline
impl Send for FormationLifeline
impl Sync for FormationLifeline
impl Unpin for FormationLifeline
impl UnsafeUnpin for FormationLifeline
impl UnwindSafe for FormationLifeline
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