pub struct HealthCheck { /* private fields */ }Expand description
Health check service
Implementations§
Source§impl HealthCheck
impl HealthCheck
Sourcepub fn new(pool: DatabasePool) -> Self
pub fn new(pool: DatabasePool) -> Self
Create a new health check service with default configuration
Sourcepub fn with_config(pool: DatabasePool, config: HealthCheckConfig) -> Self
pub fn with_config(pool: DatabasePool, config: HealthCheckConfig) -> Self
Create a new health check service with custom configuration
Sourcepub async fn is_alive(&self) -> Result<bool>
pub async fn is_alive(&self) -> Result<bool>
Quick liveness check - just verifies database is responding
This is suitable for Kubernetes liveness probes. It only checks if the database connection works.
Sourcepub async fn check(&self) -> Result<HealthReport>
pub async fn check(&self) -> Result<HealthReport>
Comprehensive health check
This is suitable for Kubernetes readiness probes. It checks all system components and returns detailed status.
Auto Trait Implementations§
impl Freeze for HealthCheck
impl !RefUnwindSafe for HealthCheck
impl Send for HealthCheck
impl Sync for HealthCheck
impl Unpin for HealthCheck
impl !UnwindSafe for HealthCheck
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
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>
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 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>
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