Skip to main content

Lifecycle

Struct Lifecycle 

Source
pub struct Lifecycle { /* private fields */ }
Expand description

Lifecycle state wrapper held in RuntimeInner.

Implementations§

Source§

impl Lifecycle

Source

pub fn new() -> Self

Source

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.

Source

pub fn mark_restore_ready(&self)

Source

pub fn mark_wal_replay_started(&self)

Source

pub fn mark_wal_replay_ready(&self)

Source

pub fn mark_index_warmup_started(&self)

Source

pub fn mark_index_warmup_ready(&self)

Source

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).

Source

pub fn set_restore_ready_at_ms(&self, ms: u64)

Source

pub fn set_wal_replay_started_at_ms(&self, ms: u64)

Source

pub fn set_wal_replay_ready_at_ms(&self, ms: u64)

Source

pub fn cold_start_phases(&self) -> ColdStartPhases

Snapshot every cold-start marker in one read. Callers compute per-phase deltas via ColdStartPhases::durations_ms().

Source

pub fn phase(&self) -> Phase

Source

pub fn started_at_ms(&self) -> u64

Source

pub fn ready_at_ms(&self) -> Option<u64>

Source

pub fn not_ready_reason(&self) -> Option<String>

Source

pub fn shutdown_report(&self) -> Option<ShutdownReport>

Source

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”).

Source

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.

Source

pub fn mark_draining(&self)

Transition Ready → Draining (best effort — already-Stopped runtimes stay Stopped). Idempotent.

Source

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).

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more