Struct SubConfig

Source
pub struct SubConfig<'a> {
    pub ctx: Arc<Context>,
    pub bind: Vec<&'a str>,
    pub connect: Vec<&'a str>,
    pub customize: Box<dyn Fn(&Socket)>,
    pub filter: Vec<&'a [u8]>,
    pub identity: Option<&'a [u8]>,
}
Expand description

The final builder step for the Sub socket type.

This contains all the information required to contstruct a valid SUB socket

Fields§

§ctx: Arc<Context>§bind: Vec<&'a str>§connect: Vec<&'a str>§customize: Box<dyn Fn(&Socket)>§filter: Vec<&'a [u8]>§identity: Option<&'a [u8]>

Implementations§

Source§

impl<'a> SubConfig<'a>

Source

pub fn filter(self, pattern: &'a [u8]) -> SubConfig<'a>

Continue the building process into a SubConfig, for the SUB socket type which requires setting a subscription filter.

Source

pub fn customize<F>(self, f: F) -> Self
where F: Fn(&Socket) + 'static,

Provide a function for configuring the underlying ZeroMQ socket

Note: Only the last call to customize will apply to a given socket.

Documentation can be found here

Source

pub fn do_build(self) -> Result<Socket, Error>

Finalize the SubConfig into a Sub if the creation is successful, or into an Error if something went wrong.

Auto Trait Implementations§

§

impl<'a> Freeze for SubConfig<'a>

§

impl<'a> !RefUnwindSafe for SubConfig<'a>

§

impl<'a> !Send for SubConfig<'a>

§

impl<'a> !Sync for SubConfig<'a>

§

impl<'a> Unpin for SubConfig<'a>

§

impl<'a> !UnwindSafe for SubConfig<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.