Struct async_zmq_types::SockConfig
source · 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]>,
/* 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]>
Implementations
sourceimpl<'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.
pub fn do_build(self) -> Result<Socket, Error>
sourceimpl<'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.
sourceimpl<'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> RefUnwindSafe for SockConfig<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for SockConfig<'a, T>where
T: Send,
impl<'a, T> Sync for SockConfig<'a, T>where
T: Sync,
impl<'a, T> Unpin for SockConfig<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for SockConfig<'a, T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more