pub struct HeartbeatConfig {
pub enabled: bool,
pub interval: Duration,
pub timeout: Duration,
pub max_missed: u32,
}
Expand description
Configuration for heartbeat monitoring
Fields§
§enabled: bool
Whether heartbeat monitoring is enabled
interval: Duration
Interval between heartbeat messages
timeout: Duration
Timeout for heartbeat responses
max_missed: u32
Maximum number of missed heartbeats before considering connection lost
Implementations§
Source§impl HeartbeatConfig
impl HeartbeatConfig
Sourcepub fn conservative() -> Self
pub fn conservative() -> Self
Creates a conservative heartbeat config
Sourcepub fn with_enabled(self, enabled: bool) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
Sets whether heartbeat is enabled
Sourcepub fn with_interval(self, interval: Duration) -> Self
pub fn with_interval(self, interval: Duration) -> Self
Sets the heartbeat interval
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sets the heartbeat timeout
Sourcepub fn with_max_missed(self, max_missed: u32) -> Self
pub fn with_max_missed(self, max_missed: u32) -> Self
Sets the maximum number of missed heartbeats
Trait Implementations§
Source§impl Clone for HeartbeatConfig
impl Clone for HeartbeatConfig
Source§fn clone(&self) -> HeartbeatConfig
fn clone(&self) -> HeartbeatConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for HeartbeatConfig
impl Debug for HeartbeatConfig
Auto Trait Implementations§
impl Freeze for HeartbeatConfig
impl RefUnwindSafe for HeartbeatConfig
impl Send for HeartbeatConfig
impl Sync for HeartbeatConfig
impl Unpin for HeartbeatConfig
impl UnwindSafe for HeartbeatConfig
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