[−][src]Struct libzmq::Heartbeat
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);
Methods
impl Heartbeat
[src]
pub fn new<D>(interval: D) -> Self where
D: Into<Duration>,
[src]
D: Into<Duration>,
Create a new Heartbeat
from the given interval.
This interval specifies the duration between each heartbeat.
pub fn interval(&self) -> Duration
[src]
Returns the interval between each heartbeat.
pub fn add_timeout<D>(self, timeout: D) -> Self where
D: Into<Duration>,
[src]
D: Into<Duration>,
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.
pub fn timeout(&self) -> Period
[src]
Returns the heartbeat timeout.
pub fn add_ttl<D>(self, ttl: D) -> Self where
D: Into<Duration>,
[src]
D: Into<Duration>,
Set a ttl for the Heartbeat
This ttl is equivalent to a heartbeat_timeout
for the remote
side for this specific connection.
pub fn ttl(&self) -> Period
[src]
Returns the heartbeat ttl.
Trait Implementations
impl Eq for Heartbeat
[src]
impl PartialEq<Heartbeat> for Heartbeat
[src]
impl Clone for Heartbeat
[src]
fn clone(&self) -> Heartbeat
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> From<&'a Heartbeat> for Heartbeat
[src]
impl Debug for Heartbeat
[src]
impl Hash for Heartbeat
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Serialize for Heartbeat
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Heartbeat
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,