pub struct MemberLifeline { /* private fields */ }Expand description
The launcher’s side of one member’s lifeline: the write end it holds for the formation’s life, and the read end until the member has been spawned with it.
Dropping it closes whatever it still holds, so a launcher that is gone has closed every lifeline.
Implementations§
Source§impl MemberLifeline
impl MemberLifeline
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
A new pipe, both ends FD_CLOEXEC, the read end numbered 3 or above.
Where pipe2 is missing the flag is set after pipe returns, so a process that spawns
from other threads must create every lifeline before its first spawn.
Sourcepub fn hand_to(&self, command: &mut Command)
pub fn hand_to(&self, command: &mut Command)
Give the member command will start its read end: set FORMATION_LIFELINE_ENV and
register a pre_exec that clears FD_CLOEXEC on that one descriptor in the child.
Register it after any fd-hygiene pre_exec, which marks every inherited descriptor
close-on-exec; pre_exec closures run in registration order. The child never gets the
write end, which stays close-on-exec. Does nothing once Self::spawned has run.
Sourcepub fn spawned(&mut self)
pub fn spawned(&mut self)
Close the launcher’s copy of the read end once the member holds its own, so the member is the read end’s only holder.
Trait Implementations§
Auto Trait Implementations§
impl Forget for MemberLifeline
impl Freeze for MemberLifeline
impl Move for MemberLifeline
impl RefUnwindSafe for MemberLifeline
impl Send for MemberLifeline
impl Sync for MemberLifeline
impl Unpin for MemberLifeline
impl UnsafeUnpin for MemberLifeline
impl UnwindSafe for MemberLifeline
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
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> ⓘ
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> ⓘ
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