pub struct Readiness { /* private fields */ }Expand description
Shareable readiness latch for exposing a /readyz endpoint.
Defaults to NotReady. Application code should call mark_ready() once
initialization completes.
§Thread-safety
This type is cheaply clonable and can be shared across threads.
Implementations§
Source§impl Readiness
impl Readiness
Sourcepub fn state(&self) -> ReadinessState
pub fn state(&self) -> ReadinessState
Get the current readiness state.
Sourcepub fn is_ready(&self) -> bool
pub fn is_ready(&self) -> bool
Returns true if the state is ReadinessState::Ready.
Note: ReadinessState::ShuttingDown is treated as “not ready”.
Sourcepub fn mark_not_ready(&self)
pub fn mark_not_ready(&self)
Mark the service as not ready.
Sourcepub fn mark_ready(&self)
pub fn mark_ready(&self)
Mark the service as ready.
Sourcepub fn mark_shutting_down(&self)
pub fn mark_shutting_down(&self)
Mark the service as shutting down.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Readiness
impl RefUnwindSafe for Readiness
impl Send for Readiness
impl Sync for Readiness
impl Unpin for Readiness
impl UnwindSafe for Readiness
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
Mutably borrows from an owned value. Read more