pub struct HealthChecker { /* private fields */ }Expand description
Implementations§
Source§impl HealthChecker
impl HealthChecker
Sourcepub fn with_failure_threshold(self, threshold: u32) -> Self
pub fn with_failure_threshold(self, threshold: u32) -> Self
设置失败阈值
Sourcepub fn add_check(&mut self, check: Arc<dyn HealthCheck>)
pub fn add_check(&mut self, check: Arc<dyn HealthCheck>)
Sourcepub async fn check_all(&self) -> Vec<HealthCheckResult>
pub async fn check_all(&self) -> Vec<HealthCheckResult>
Sourcepub async fn is_healthy(&self) -> bool
pub async fn is_healthy(&self) -> bool
检查是否所有检查都健康
Sourcepub fn check_count(&self) -> usize
pub fn check_count(&self) -> usize
获取检查数量
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for HealthChecker
impl !UnwindSafe for HealthChecker
impl Freeze for HealthChecker
impl Send for HealthChecker
impl Sync for HealthChecker
impl Unpin for HealthChecker
impl UnsafeUnpin for HealthChecker
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