pub struct HealthCheckConfig {
pub interval: Duration,
pub timeout: Duration,
pub failure_threshold: u32,
pub enabled: bool,
}Expand description
健康检查配置
Fields§
§interval: Duration健康检查间隔(默认 10 秒)
timeout: Duration健康检查超时时间(默认 5 秒)
failure_threshold: u32连续失败阈值(默认 3 次)
enabled: bool是否启用健康检查(默认 true)
Implementations§
Source§impl HealthCheckConfig
impl HealthCheckConfig
Sourcepub fn with_interval(self, interval: Duration) -> Self
pub fn with_interval(self, interval: Duration) -> Self
设置检查间隔
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
设置超时时间
Sourcepub fn with_failure_threshold(self, threshold: u32) -> Self
pub fn with_failure_threshold(self, threshold: u32) -> Self
设置失败阈值
Sourcepub fn with_enabled(self, enabled: bool) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
启用/禁用健康检查
Trait Implementations§
Source§impl Clone for HealthCheckConfig
impl Clone for HealthCheckConfig
Source§impl Debug for HealthCheckConfig
impl Debug for HealthCheckConfig
Auto Trait Implementations§
impl Freeze for HealthCheckConfig
impl RefUnwindSafe for HealthCheckConfig
impl Send for HealthCheckConfig
impl Sync for HealthCheckConfig
impl Unpin for HealthCheckConfig
impl UnsafeUnpin for HealthCheckConfig
impl UnwindSafe for HealthCheckConfig
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