#[repr(u8)]pub enum Phase {
Starting = 0,
Ready = 1,
Draining = 2,
ShuttingDown = 3,
Stopped = 4,
}Expand description
Discrete lifecycle phases. Numeric values are monotonic so an
AtomicU8 compare_exchange gives us atomic transitions without
a mutex. Decoded via Phase::from_u8.
Variants§
Starting = 0
Engine is opening: WAL replay, restore-from-remote, initial checkpoint. Reads and writes are not yet served.
Ready = 1
Engine is fully ready: every public surface accepts traffic.
Draining = 2
/admin/drain was called or /admin/shutdown is in flight.
New writes return 503; existing in-flight may finish.
ShuttingDown = 3
Engine::graceful_shutdown is running its final flush +
checkpoint + optional backup. The runtime is no longer usable
for writes.
Stopped = 4
Shutdown completed; the process is safe to exit.
Implementations§
Source§impl Phase
impl Phase
pub fn from_u8(v: u8) -> Self
pub fn as_str(self) -> &'static str
Sourcepub fn accepts_writes(self) -> bool
pub fn accepts_writes(self) -> bool
Whether public mutations should be allowed in this phase.
Replica/read_only checks live in WriteGate; this is the
orthogonal lifecycle check.
Sourcepub fn accepts_queries(self) -> bool
pub fn accepts_queries(self) -> bool
Whether the runtime is far enough along in boot to answer SQL queries. /health/ready follows this answer.
Trait Implementations§
Source§impl Ord for Phase
impl Ord for Phase
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Phase
impl PartialOrd for Phase
impl Copy for Phase
impl Eq for Phase
impl StructuralPartialEq for Phase
Auto Trait Implementations§
impl Freeze for Phase
impl RefUnwindSafe for Phase
impl Send for Phase
impl Sync for Phase
impl Unpin for Phase
impl UnsafeUnpin for Phase
impl UnwindSafe for Phase
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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