pub struct HealthCheckBuilder { /* private fields */ }Expand description
Builder for health check configuration
Implementations§
Source§impl HealthCheckBuilder
impl HealthCheckBuilder
Sourcepub fn new(include_default: bool) -> Self
pub fn new(include_default: bool) -> Self
Create a new health check builder
§Arguments
include_default- Whether to include a default “self” check that always returns healthy
Sourcepub fn add_check<F, Fut>(self, name: impl Into<String>, check: F) -> Self
pub fn add_check<F, Fut>(self, name: impl Into<String>, check: F) -> Self
Add a health check
§Example
use rustapi_core::health::{HealthCheckBuilder, HealthStatus};
let health = HealthCheckBuilder::new(false)
.add_check("database", || async {
// Simulate database check
HealthStatus::healthy()
})
.build();Sourcepub fn build(self) -> HealthCheck
pub fn build(self) -> HealthCheck
Build the health check
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HealthCheckBuilder
impl !RefUnwindSafe for HealthCheckBuilder
impl Send for HealthCheckBuilder
impl Sync for HealthCheckBuilder
impl Unpin for HealthCheckBuilder
impl !UnwindSafe for HealthCheckBuilder
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