pub struct Heartbeat { /* private fields */ }
Expand description
Socket heartbeating configuration.
§Example
use libzmq::Heartbeat;
use std::time::Duration;
let duration = Duration::from_millis(300);
let hb = Heartbeat::new(duration)
.add_timeout(2 * duration);
Implementations§
Source§impl Heartbeat
impl Heartbeat
Sourcepub fn new<D>(interval: D) -> Self
pub fn new<D>(interval: D) -> Self
Create a new Heartbeat
from the given interval.
This interval specifies the duration between each heartbeat.
Sourcepub fn add_timeout<D>(self, timeout: D) -> Self
pub fn add_timeout<D>(self, timeout: D) -> Self
Set a timeout for the Heartbeat
.
This timeout specifies how long to wait before timing out a connection with a peer for not receiving any traffic.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Heartbeat
impl<'de> Deserialize<'de> for Heartbeat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Heartbeat
impl StructuralPartialEq for Heartbeat
Auto Trait Implementations§
impl Freeze for Heartbeat
impl RefUnwindSafe for Heartbeat
impl Send for Heartbeat
impl Sync for Heartbeat
impl Unpin for Heartbeat
impl UnwindSafe for Heartbeat
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