[−][src]Trait zeromq::Socket
Required methods
pub fn new() -> Self
[src]
pub fn backend(&self) -> Arc<dyn MultiPeerBackend>
[src]
pub fn binds(&mut self) -> &mut HashMap<Endpoint, AcceptStopHandle>
[src]
pub fn monitor(&mut self) -> Receiver<SocketEvent>
[src]
Creates and setups new socket monitor
Subsequent calls to this method each create a new monitor channel. Sender side of previous one is dropped.
Provided methods
#[must_use]pub fn bind<'life0, 'life1, 'async_trait>(
&'life0 mut self,
endpoint: &'life1 str
) -> Pin<Box<dyn Future<Output = ZmqResult<Endpoint>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
endpoint: &'life1 str
) -> Pin<Box<dyn Future<Output = ZmqResult<Endpoint>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Binds to the endpoint and starts a coroutine to accept new connections on it.
Returns the endpoint resolved to the exact bound location if applicable (port # resolved, for example).
#[must_use]pub fn unbind<'life0, 'async_trait>(
&'life0 mut self,
endpoint: Endpoint
) -> Pin<Box<dyn Future<Output = ZmqResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
endpoint: Endpoint
) -> Pin<Box<dyn Future<Output = ZmqResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Unbinds the endpoint, blocking until the associated endpoint is no longer in use
Errors
May give a ZmqError::NoSuchBind
if endpoint
isn't bound. May also
give any other zmq errors encountered when attempting to disconnect
#[must_use]pub fn unbind_all<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Vec<ZmqError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Vec<ZmqError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Unbinds all bound endpoints, blocking until finished.
#[must_use]pub fn connect<'life0, 'life1, 'async_trait>(
&'life0 mut self,
endpoint: &'life1 str
) -> Pin<Box<dyn Future<Output = ZmqResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
endpoint: &'life1 str
) -> Pin<Box<dyn Future<Output = ZmqResult<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Connects to the given endpoint.
#[must_use]pub fn close<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = Vec<ZmqError>> + Send + 'async_trait>> where
Self: 'async_trait,
[src]
self
) -> Pin<Box<dyn Future<Output = Vec<ZmqError>> + Send + 'async_trait>> where
Self: 'async_trait,
Disconnects from the given endpoint, blocking until finished.
Errors
May give a ZmqError::NoSuchConnection
if endpoint
isn't connected.
May also give any other zmq errors encountered when attempting to
disconnect.
Disconnects all connecttions, blocking until finished.
Closes the socket, blocking until all associated binds are closed.
This is equivalent to drop()
, but with the benefit of blocking until
resources are released, and getting any underlying errors.
Returns any encountered errors.