Skip to main content

PushSocket

Struct PushSocket 

Source
pub struct PushSocket { /* private fields */ }
Expand description

Push socket (PUSH). Distributes messages round-robin to connected PULL peers.

Use with PullSocket to build a pipeline. Each message goes to exactly one peer.

See RFC 30 for the PUSH/PULL wire contract and zmq_socket(3).

Trait Implementations§

Source§

impl Socket for PushSocket

Source§

type Backend = GenericSocketBackend

Source§

fn with_options(options: SocketOptions) -> Self

Create a socket with the given options.
Source§

async fn connect<E>(&mut self, endpoint: E) -> ZmqResult<()>
where E: TryInto<Endpoint> + Send, E::Error: Into<ZmqError>,

Connects to the given endpoint. Read more
Source§

fn new() -> Self

Create a socket with default options.
Source§

fn builder() -> SocketBuilder<Self>

Create a SocketBuilder to configure the socket before constructing it.
Source§

fn bind<E>( &mut self, endpoint: E, ) -> impl Future<Output = ZmqResult<Endpoint>> + Send
where E: TryInto<Endpoint> + Send, E::Error: Into<ZmqError>,

Binds to the endpoint and starts a coroutine to accept new connections on it. Returns the resolved bound endpoint. Read more
Source§

fn last_endpoint(&self) -> Option<&Endpoint>

Returns the last endpoint resolved by bind, or None if the socket has not been bound.
Source§

fn unbind( &mut self, endpoint: Endpoint, ) -> impl Future<Output = ZmqResult<()>> + Send

Stop accepting connections on the given endpoint.
Source§

fn unbind_all(&mut self) -> impl Future<Output = Vec<ZmqError>> + Send

Stop accepting connections on all bound endpoints.
Source§

fn monitor(&mut self) -> Receiver<SocketEvent>

Subscribe to SocketEvents. Returns a channel receiver that yields events as connections are made, accepted, or dropped. Read more
Source§

fn close(self) -> impl Future<Output = Result<(), Vec<ZmqError>>> + Send

Stop accepting connections and wait for outbound messages to drain (subject to the configured linger timeout), then drop the socket. Read more
Source§

impl SocketSend for PushSocket

Source§

async fn send(&mut self, message: impl Into<ZmqMessage> + Send) -> ZmqResult<()>

Send a message, blocking until it is accepted by the outbound queue. Read more
Source§

impl CaptureSocket for PushSocket

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.