[−][src]Struct libzmq::CtxHandle
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!(), }
Methods
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 Eq for CtxHandle
[src]
impl Clone for CtxHandle
[src]
impl PartialEq<CtxHandle> for CtxHandle
[src]
impl Copy for CtxHandle
[src]
impl Debug for CtxHandle
[src]
Auto Trait Implementations
impl Unpin for CtxHandle
impl Sync for CtxHandle
impl Send for CtxHandle
impl UnwindSafe for CtxHandle
impl RefUnwindSafe for CtxHandle
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,