Struct tmq::SocketBuilder

source ·
pub struct SocketBuilder<T> { /* private fields */ }
Expand description

Builder which provides bind and connect methods to build a corresponding ZMQ socket as per the standard functions

You can use the standard functions from the crate to create a builder

Use the set_ functions to set socket options before binding/connecting

See ZMQ documentation for more info on what these options do: http://api.zeromq.org/4-2:zmq-setsockopt

Implementations§

source§

impl<T> SocketBuilder<T>where T: FromZmqSocket<T>,

source

pub fn connect(self, endpoint: &str) -> Result<T>

Connect to a ZMQ endpoint at the given address.

source

pub fn bind(self, endpoint: &str) -> Result<T>

Bind to a ZMQ endpoint at the given address.

source

pub fn monitor(self, monitor_endpoint: &str, events: i32) -> Self

Configure the socket for monitoring

source

pub fn set_ipv6(self, value: bool) -> Self

Setter for the ZMQ_IPV6 option.

source

pub fn set_immediate(self, value: bool) -> Self

Setter for the ZMQ_IMMEDIATE option.

source

pub fn set_plain_server(self, value: bool) -> Self

Setter for the ZMQ_PLAIN_SERVER option.

source

pub fn set_conflate(self, value: bool) -> Self

Setter for the ZMQ_CONFLATE option.

source

pub fn set_probe_router(self, value: bool) -> Self

Setter for the ZMQ_PROBE_ROUTER option.

source

pub fn set_curve_server(self, value: bool) -> Self

Setter for the ZMQ_CURVE_SERVER option.

source

pub fn set_gssapi_server(self, value: bool) -> Self

Setter for the ZMQ_GSSAPI_SERVER option.

source

pub fn set_gssapi_plaintext(self, value: bool) -> Self

Setter for the ZMQ_GSSAPI_PLAINTEXT option.

source

pub fn set_maxmsgsize(self, value: i64) -> Self

Setter for the ZMQ_MAXMSGSIZE option.

source

pub fn set_sndhwm(self, value: i32) -> Self

Setter for the ZMQ_SNDHWM option.

source

pub fn set_rcvhwm(self, value: i32) -> Self

Setter for the ZMQ_RCVHWM option.

source

pub fn set_affinity(self, value: u64) -> Self

Setter for the ZMQ_AFFINITY option.

source

pub fn set_rate(self, value: i32) -> Self

Setter for the ZMQ_RATE option.

source

pub fn set_recovery_ivl(self, value: i32) -> Self

Setter for the ZMQ_RECOVERY_IVL option.

source

pub fn set_sndbuf(self, value: i32) -> Self

Setter for the ZMQ_SNDBUF option.

source

pub fn set_rcvbuf(self, value: i32) -> Self

Setter for the ZMQ_RCVBUF option.

source

pub fn set_tos(self, value: i32) -> Self

Setter for the ZMQ_TOS option.

source

pub fn set_linger(self, value: i32) -> Self

Setter for the ZMQ_LINGER option.

source

pub fn set_reconnect_ivl(self, value: i32) -> Self

Setter for the ZMQ_RECONNECT_IVL option.

source

pub fn set_reconnect_ivl_max(self, value: i32) -> Self

Setter for the ZMQ_RECONNECT_IVL_MAX option.

source

pub fn set_backlog(self, value: i32) -> Self

Setter for the ZMQ_BACKLOG option.

source

pub fn set_identity(self, value: &[u8]) -> Self

Setter for the ZMQ_IDENTITY option.

source

pub fn set_tcp_keepalive(self, value: i32) -> Self

Setter for the ZMQ_TCP_KEEPALIVE option.

source

pub fn set_tcp_keepalive_cnt(self, value: i32) -> Self

Setter for the ZMQ_TCP_KEEPALIVE_CNT option.

source

pub fn set_tcp_keepalive_idle(self, value: i32) -> Self

Setter for the ZMQ_TCP_KEEPALIVE_IDLE option.

source

pub fn set_tcp_keepalive_intvl(self, value: i32) -> Self

Setter for the ZMQ_TCP_KEEPALIVE_INTVL option.

source

pub fn set_rcvtimeo(self, value: i32) -> Self

Setter for the ZMQ_RCVTIMEO option.

source

pub fn set_sndtimeo(self, value: i32) -> Self

Setter for the ZMQ_SNDTIMEO option.

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for SocketBuilder<T>

§

impl<T> Send for SocketBuilder<T>where T: Send,

§

impl<T> !Sync for SocketBuilder<T>

§

impl<T> Unpin for SocketBuilder<T>where T: Unpin,

§

impl<T> !UnwindSafe for SocketBuilder<T>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.