pub struct HeartbeatConfig {
pub interval: Duration,
pub max_missed: u32,
}Expand description
Heartbeat configuration
Fields§
§interval: DurationInterval between heartbeats
max_missed: u32Maximum missed heartbeats before disconnect
Implementations§
Source§impl HeartbeatConfig
impl HeartbeatConfig
Sourcepub fn with_interval(interval_secs: u64) -> Self
pub fn with_interval(interval_secs: u64) -> Self
Create a new heartbeat config with custom interval
Sourcepub fn interval_ms(&self) -> u64
pub fn interval_ms(&self) -> u64
Get interval in milliseconds
Trait Implementations§
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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