Struct tokio_zmq::socket::config::SocketBuilder
source · pub struct SocketBuilder<'a, T> { /* private fields */ }
Expand description
The root struct for a Socket builder
This struct contains a context and an identity.
Implementations§
source§impl<'a, T> SocketBuilder<'a, T>
impl<'a, T> SocketBuilder<'a, T>
sourcepub fn new(ctx: Arc<Context>) -> Self
pub fn new(ctx: Arc<Context>) -> Self
Create a new Socket builder
All sockets that are created through the Tokio ZMQ library will use this as the base for their socket builder (except PAIR sockets).
sourcepub fn bind(self, addr: &'a str) -> SockConfig<'a, T>
pub fn bind(self, addr: &'a str) -> SockConfig<'a, T>
Bind the socket to an address
Since this is just part of the builder, and the socket doesn’t exist yet, we store the address for later retrieval.
sourcepub fn connect(self, addr: &'a str) -> SockConfig<'a, T>
pub fn connect(self, addr: &'a str) -> SockConfig<'a, T>
Connect the socket to an address
Since this is just part of the builder, and the socket doesn’t exist yet, we store the address for later retrieval.