pub struct HeartbeatMonitor { /* private fields */ }
Expand description
Monitors connection health through heartbeats
Implementations§
Source§impl HeartbeatMonitor
impl HeartbeatMonitor
Sourcepub fn new(
config: HeartbeatConfig,
connection_manager: Weak<ConnectionManager>,
) -> Self
pub fn new( config: HeartbeatConfig, connection_manager: Weak<ConnectionManager>, ) -> Self
Creates a new heartbeat monitor
Sourcepub fn set_connection_manager(
&self,
_connection_manager: Weak<ConnectionManager>,
)
pub fn set_connection_manager( &self, _connection_manager: Weak<ConnectionManager>, )
Sets the connection manager reference
Sourcepub async fn get_last_heartbeat(&self) -> Instant
pub async fn get_last_heartbeat(&self) -> Instant
Gets the time of the last successful heartbeat
Sourcepub async fn get_missed_count(&self) -> u32
pub async fn get_missed_count(&self) -> u32
Gets the current missed heartbeat count
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HeartbeatMonitor
impl !RefUnwindSafe for HeartbeatMonitor
impl Send for HeartbeatMonitor
impl Sync for HeartbeatMonitor
impl Unpin for HeartbeatMonitor
impl !UnwindSafe for HeartbeatMonitor
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