pub struct HealthCheckRegistry { /* private fields */ }Implementations§
Source§impl HealthCheckRegistry
impl HealthCheckRegistry
pub fn new() -> Arc<HealthCheckRegistry> ⓘ
pub fn register( self: &Arc<HealthCheckRegistry>, name: impl Into<String>, check: Arc<dyn Fn() -> HealthStatus + Send + Sync>, )
pub fn all_healthy(&self) -> bool
Sourcepub fn snapshot(&self) -> Vec<HealthCheckEntry>
pub fn snapshot(&self) -> Vec<HealthCheckEntry>
返回所有健康检查项的当前快照。
Sourcepub fn overall_status(&self) -> &'static str
pub fn overall_status(&self) -> &'static str
计算整体状态:fail 优先于 warn 优先于 pass;空列表视为 pass。 Mutex poisoned 时保守返回 “fail”。
Auto Trait Implementations§
impl !Freeze for HealthCheckRegistry
impl RefUnwindSafe for HealthCheckRegistry
impl Send for HealthCheckRegistry
impl Sync for HealthCheckRegistry
impl Unpin for HealthCheckRegistry
impl UnsafeUnpin for HealthCheckRegistry
impl UnwindSafe for HealthCheckRegistry
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