[][src]Struct libzmq::CtxBuilder

pub struct CtxBuilder { /* fields omitted */ }

A convenience builder for a Ctx.

Makes complex context configuration more convenient.

Implementations

impl CtxBuilder[src]

pub fn new() -> Self[src]

pub fn build(&self) -> Result<Ctx, Error>[src]

Builds a Ctx from a CtxBuilder.

Usage Example

use libzmq::*;

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

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

pub fn apply(&self, handle: CtxHandle) -> Result<(), Error>[src]

Applies the configuration of CtxBuilder to an existing context via its CtxHandle.

Usage Example

use libzmq::*;

let global = Ctx::global();

CtxBuilder::new()
  .io_threads(0)
  .max_sockets(69)
  .apply(global)?;

assert_eq!(global.io_threads(), 0);
assert_eq!(global.max_sockets(), 69);

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

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

Trait Implementations

impl Clone for CtxBuilder[src]

impl Default for CtxBuilder[src]

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

impl Eq for CtxBuilder[src]

impl Hash for CtxBuilder[src]

impl PartialEq<CtxBuilder> for CtxBuilder[src]

impl Serialize for CtxBuilder[src]

impl StructuralEq for CtxBuilder[src]

impl StructuralPartialEq for CtxBuilder[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>,