[][src]Struct libzmq::CtxHandle

pub struct CtxHandle { /* fields omitted */ }

A non-owning pointer to a Ctx.

A CtxHandle allows thread-safe configuration of the context aliased by the handle. It is also used to created sockets associated with the context.

Once the Ctx it is pointing to is shutdown or dropped, all associated CtxHandle will be invalidated. All calls involving an invalidated CtxHandle will return a InvalidCtx error.

use libzmq::{Ctx, Dish, ErrorKind};

// We create a `CtxHandle` from a new context. Since we drop
// the context pointed by the handle, it will no longer be valid
// once it reaches the outer scope.
let handle = {
    let ctx = Ctx::new();
    ctx.handle()
};

// Attempting to use the invalided handle will result in `InvalidCtx`
// errors.
let err = Dish::with_ctx(handle).unwrap_err();
match err.kind() {
    ErrorKind::InvalidCtx => (),
    _ => unreachable!(),
}

Implementations

impl CtxHandle[src]

pub fn io_threads(self) -> i32[src]

pub fn set_io_threads(self, nb_threads: i32) -> Result<(), Error>[src]

pub fn max_sockets(self) -> i32[src]

pub fn set_max_sockets(self, max: i32) -> Result<(), Error>[src]

pub fn shutdown(self)[src]

Trait Implementations

impl Clone for CtxHandle[src]

impl Copy for CtxHandle[src]

impl Debug for CtxHandle[src]

impl Eq for CtxHandle[src]

impl PartialEq<CtxHandle> for CtxHandle[src]

impl StructuralEq for CtxHandle[src]

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