pub struct SockConfig<'a, T>where
T: IntoInnerSocket,{
pub ctx: Arc<Context>,
pub bind: Vec<&'a str>,
pub connect: Vec<&'a str>,
pub identity: Option<&'a [u8]>,
pub customize: Box<dyn Fn(&Socket)>,
/* private fields */
}
Expand description
The final builder step for some socket types
This contains all the information required to contstruct a valid socket, except in the case of
SUB, which needs an additional filter
parameter.
Fields§
§ctx: Arc<Context>
§bind: Vec<&'a str>
§connect: Vec<&'a str>
§identity: Option<&'a [u8]>
§customize: Box<dyn Fn(&Socket)>
Implementations§
Source§impl<'a, T> SockConfig<'a, T>where
T: UnPair + IntoInnerSocket,
impl<'a, T> SockConfig<'a, T>where
T: UnPair + IntoInnerSocket,
Sourcepub fn bind(self, addr: &'a str) -> Self
pub fn bind(self, addr: &'a str) -> Self
Bind the SockConfig
to an address, returning a SockConfig
This allows for a single socket to be bound to multiple addresses.
Sourcepub fn connect(self, addr: &'a str) -> Self
pub fn connect(self, addr: &'a str) -> Self
Connect the SockConfig
to an address, returning a SockConfig
This allows for a single socket to be connected to multiple addresses.
Sourcepub fn customize<F>(self, f: F) -> Self
pub fn customize<F>(self, f: F) -> Self
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
pub fn do_build(self) -> Result<Socket, Error>
Source§impl<'a, T> SockConfig<'a, T>where
T: IntoInnerSocket + Pair,
impl<'a, T> SockConfig<'a, T>where
T: IntoInnerSocket + Pair,
Sourcepub fn pair(self, addr: &'a str, bind: bool) -> PairConfig<'a>
pub fn pair(self, addr: &'a str, bind: bool) -> PairConfig<'a>
Bind or Connect the socket to an address
This method indicates that the resulting socket will be a PAIR socket.
Source§impl<'a, T> SockConfig<'a, T>where
T: IntoInnerSocket + Sub,
impl<'a, T> SockConfig<'a, T>where
T: IntoInnerSocket + Sub,
Auto Trait Implementations§
impl<'a, T> Freeze for SockConfig<'a, T>
impl<'a, T> !RefUnwindSafe for SockConfig<'a, T>
impl<'a, T> !Send for SockConfig<'a, T>
impl<'a, T> !Sync for SockConfig<'a, T>
impl<'a, T> Unpin for SockConfig<'a, T>where
T: Unpin,
impl<'a, T> !UnwindSafe for SockConfig<'a, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more