pub struct Lifecycle { /* private fields */ }Expand description
Lifecycle state wrapper held in RuntimeInner.
Implementations§
Source§impl Lifecycle
impl Lifecycle
pub fn new() -> Lifecycle
Sourcepub fn mark_restore_started(&self)
pub fn mark_restore_started(&self)
PLAN.md Phase 9.1 — mark a cold-start phase boundary. Boot code calls these as it transitions through restore-from- remote, WAL replay, and index warmup. Idempotent: only the first call sets the timestamp; subsequent calls are no-ops so a retried boot doesn’t reset the gauge.
pub fn mark_restore_ready(&self)
pub fn mark_wal_replay_started(&self)
pub fn mark_wal_replay_ready(&self)
pub fn mark_index_warmup_started(&self)
pub fn mark_index_warmup_ready(&self)
Sourcepub fn set_restore_started_at_ms(&self, ms: u64)
pub fn set_restore_started_at_ms(&self, ms: u64)
PLAN.md Phase 9.1 — backfill phase markers with an explicit timestamp. Used when the runtime captures the wall-clock before Lifecycle is constructible (e.g. before storage open) and wants to replay it into the markers afterwards. Idempotent (only sets when current value is 0).
pub fn set_restore_ready_at_ms(&self, ms: u64)
pub fn set_wal_replay_started_at_ms(&self, ms: u64)
pub fn set_wal_replay_ready_at_ms(&self, ms: u64)
Sourcepub fn cold_start_phases(&self) -> ColdStartPhases
pub fn cold_start_phases(&self) -> ColdStartPhases
Snapshot every cold-start marker in one read. Callers compute
per-phase deltas via ColdStartPhases::durations_ms().
pub fn phase(&self) -> Phase
pub fn started_at_ms(&self) -> u64
pub fn ready_at_ms(&self) -> Option<u64>
pub fn not_ready_reason(&self) -> Option<String>
pub fn shutdown_report(&self) -> Option<ShutdownReport>
Sourcepub fn set_starting_reason(&self, reason: impl Into<String>)
pub fn set_starting_reason(&self, reason: impl Into<String>)
Mark a transient “still starting, here’s why” reason. Called from boot stages so /health/ready 503 carries operator-useful context (e.g. “wal_replay”, “restore_from_remote”, “initial_checkpoint”).
Sourcepub fn mark_ready(&self) -> bool
pub fn mark_ready(&self) -> bool
Transition Starting → Ready. Idempotent: a second call leaves
the existing ready_at_ms untouched. Returns true if this
call effected the transition.
Sourcepub fn mark_draining(&self)
pub fn mark_draining(&self)
Transition Ready → Draining (best effort — already-Stopped runtimes stay Stopped). Idempotent.
Sourcepub fn begin_shutdown(&self) -> bool
pub fn begin_shutdown(&self) -> bool
Transition into ShuttingDown if not already past it. Returns true if this call started the shutdown (caller should run the actual flush pipeline); false if shutdown was already started or finished by someone else (caller should poll for the existing report instead).
Sourcepub fn finish_shutdown(&self, report: ShutdownReport)
pub fn finish_shutdown(&self, report: ShutdownReport)
Stamp the final report and move to Stopped. Called by
Engine::graceful_shutdown after the flush pipeline finishes.
Auto Trait Implementations§
impl !Freeze for Lifecycle
impl !RefUnwindSafe for Lifecycle
impl Send for Lifecycle
impl Sync for Lifecycle
impl Unpin for Lifecycle
impl UnsafeUnpin for Lifecycle
impl UnwindSafe for Lifecycle
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 moreSource§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