pub struct PingState { /* private fields */ }Expand description
Ping/health-check state for all hosts.
Implementations§
Source§impl PingState
impl PingState
pub fn status_map(&self) -> &HashMap<String, PingStatus>
pub fn status_map_mut(&mut self) -> &mut HashMap<String, PingStatus>
pub fn status_of(&self, alias: &str) -> Option<&PingStatus>
pub fn status_contains(&self, alias: &str) -> bool
pub fn status_len(&self) -> usize
pub fn status_is_empty(&self) -> bool
pub fn insert_status(&mut self, alias: String, status: PingStatus)
pub fn remove_status(&mut self, alias: &str)
pub fn last_checked(&self) -> &HashMap<String, Instant>
pub fn last_checked_at(&self, alias: &str) -> Option<&Instant>
pub fn record_check(&mut self, alias: String, at: Instant)
pub fn has_pinged(&self) -> bool
pub fn set_has_pinged(&mut self, value: bool)
pub fn generation(&self) -> u64
pub fn set_generation(&mut self, value: u64)
pub fn slow_threshold_ms(&self) -> u16
pub fn set_slow_threshold_ms(&mut self, value: u16)
pub fn auto_ping(&self) -> bool
pub fn set_auto_ping(&mut self, value: bool)
pub fn filter_down_only(&self) -> bool
pub fn set_filter_down_only(&mut self, value: bool)
pub fn checked_at(&self) -> Option<Instant>
pub fn set_checked_at(&mut self, value: Option<Instant>)
Sourcepub fn from_preferences() -> Self
pub fn from_preferences() -> Self
Construct with slow threshold + auto-ping loaded from preferences.
Sourcepub fn clear_results(&mut self)
pub fn clear_results(&mut self)
Clear all ping results and reset the dynamic filter/timestamp state.
Preserves config (slow_threshold_ms, auto_ping) and has_pinged.
Bumps generation so in-flight ping responses can be discarded.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PingState
impl RefUnwindSafe for PingState
impl Send for PingState
impl Sync for PingState
impl Unpin for PingState
impl UnsafeUnpin for PingState
impl UnwindSafe for PingState
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> 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