[][src]Struct libzmq::Heartbeat

pub struct Heartbeat { /* fields omitted */ }

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

impl Heartbeat[src]

pub fn new<D>(interval: D) -> Self where
    D: Into<Duration>, 
[src]

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]

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]

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 Clone for Heartbeat[src]

impl Debug for Heartbeat[src]

impl<'de> Deserialize<'de> for Heartbeat[src]

impl Eq for Heartbeat[src]

impl<'a> From<&'a Heartbeat> for Heartbeat[src]

impl Hash for Heartbeat[src]

impl PartialEq<Heartbeat> for Heartbeat[src]

impl Serialize for Heartbeat[src]

impl StructuralEq for Heartbeat[src]

impl StructuralPartialEq for Heartbeat[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,