pub struct PidFileGuard { /* private fields */ }Expand description
Removes the pid file on drop — but only while the file still holds this guard’s INCARNATION, so a lingering guard can never delete a successor’s claim.
Implementations§
Source§impl PidFileGuard
impl PidFileGuard
Sourcepub fn reconciliation(&self) -> &StaleReconciliation
pub fn reconciliation(&self) -> &StaleReconciliation
What the birth claim found and reconciled when this guard was created.
Sourcepub fn record(&self) -> Result<PidRecord, ServerError>
pub fn record(&self) -> Result<PidRecord, ServerError>
A copy of this incarnation’s record as last written.
§Errors
Returns ServerError::PidFile when the in-process record lock is
poisoned — a panic inside a previous update, which leaves the copy’s
agreement with the file unproven.
Sourcepub fn holds_claim(&self) -> bool
pub fn holds_claim(&self) -> bool
Whether this guard’s incarnation holds the home’s claim. False for a
server that booted UNCLAIMED over another live claimant’s record
(StaleReconciliation::LiveIncarnationElsewhere): the control verbs
address the recorded server, not this one.
Sourcepub fn update_own(
&self,
change: impl FnOnce(&mut PidRecord),
) -> Result<RecordUpdate, ServerError>
pub fn update_own( &self, change: impl FnOnce(&mut PidRecord), ) -> Result<RecordUpdate, ServerError>
Apply change to this incarnation’s own record and write it.
§Errors
Returns ServerError::PidFile when the mutation lock cannot be
taken, the file cannot be read, or the write fails. A record that no
longer belongs to this incarnation is NOT an error — it is
RecordUpdate::NotOurs, reported and skipped.
Sourcepub fn stage_reporter(&self) -> StageReporter
pub fn stage_reporter(&self) -> StageReporter
A cheap, cloneable handle for reporting boot stages from anywhere — including a blocking closure on another thread.
Trait Implementations§
Source§impl Debug for PidFileGuard
impl Debug for PidFileGuard
Source§impl Drop for PidFileGuard
impl Drop for PidFileGuard
Auto Trait Implementations§
impl Freeze for PidFileGuard
impl RefUnwindSafe for PidFileGuard
impl Send for PidFileGuard
impl Sync for PidFileGuard
impl Unpin for PidFileGuard
impl UnsafeUnpin for PidFileGuard
impl UnwindSafe for PidFileGuard
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request