[][src]Struct libzmq::CtxBuilder

pub struct CtxBuilder { /* fields omitted */ }

A convenience builder for a Ctx.

Makes complex context configuration more convenient.

Methods

impl CtxBuilder[src]

pub fn new() -> Self[src]

pub fn build(&self) -> Ctx[src]

Builds a Ctx from a CtxBuilder.

Usage Example

use libzmq::*;

let ctx = CtxBuilder::new()
  .io_threads(2)
  .no_linger(true)
  .build();

assert_eq!(ctx.io_threads(), 2);
assert_eq!(ctx.no_linger(), true);

pub fn apply(&self, ctx: &Ctx)[src]

Applies a CtxBuilder to an existing Ctx.

Usage Example

use libzmq::*;

let global = Ctx::global();

CtxBuilder::new()
  .io_threads(0)
  .max_msg_size(420)
  .max_sockets(69)
  .no_linger(true)
  .apply(global);

assert_eq!(global.io_threads(), 0);
assert_eq!(global.max_msg_size(), 420);
assert_eq!(global.no_linger(), true);
assert_eq!(global.max_sockets(), 69);

pub fn io_threads(&mut self, value: i32) -> &mut Self[src]

pub fn max_msg_size(&mut self, value: i32) -> &mut Self[src]

pub fn max_sockets(&mut self, value: i32) -> &mut Self[src]

pub fn no_linger(&mut self, value: bool) -> &mut Self[src]

Trait Implementations

impl PartialEq<CtxBuilder> for CtxBuilder[src]

impl Clone for CtxBuilder[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for CtxBuilder[src]

impl Eq for CtxBuilder[src]

impl Hash for CtxBuilder[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Serialize for CtxBuilder[src]

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

Auto Trait Implementations

impl Send for CtxBuilder

impl Sync for CtxBuilder

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

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

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

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