[][src]Trait libzmq::prelude::RecvMsg

pub trait RecvMsg: GetRawSocket {
    fn recv(&self, msg: &mut Msg) -> Result<(), Error> { ... }
fn try_recv(&self, msg: &mut Msg) -> Result<(), Error> { ... }
fn recv_msg(&self) -> Result<Msg, Error> { ... }
fn try_recv_msg(&self) -> Result<Msg, Error> { ... }
fn recv_high_water_mark(&self) -> Result<Option<i32>, Error> { ... }
fn set_recv_high_water_mark(&self, maybe: Option<i32>) -> Result<(), Error> { ... }
fn recv_timeout(&self) -> Result<Option<Duration>, Error> { ... }
fn set_recv_timeout(&self, maybe: Option<Duration>) -> Result<(), Error> { ... } }

Receive atomic messages in an immutable, thread-safe fashion.

Does not support multipart messages.

Provided methods

fn recv(&self, msg: &mut Msg) -> Result<(), Error>

Retreive a message from the inbound socket queue.

This operation might block until the socket receives a message.

Error

The Msg is returned as the content of the Error.

Possible Error Variants

fn try_recv(&self, msg: &mut Msg) -> Result<(), Error>

Try to retrieve a message from the inbound socket queue without blocking.

This polls the socket to determine there is at least on inbound message in the socket queue. If there is, it retuns it, otherwise it errors with WouldBlock.

Error

No message from the inbound queue is lost if there is an error.

Possible Error Variants

fn recv_msg(&self) -> Result<Msg, Error>

A convenience function that allocates a Msg with the same properties as recv.

fn try_recv_msg(&self) -> Result<Msg, Error>

A convenience function that allocates a Msg with the same properties as try_recv.

fn recv_high_water_mark(&self) -> Result<Option<i32>, Error>

The high water mark for incoming messages on the specified socket.

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory.

If this limit has been reached the socket shall enter the mute state.

fn set_recv_high_water_mark(&self, maybe: Option<i32>) -> Result<(), Error>

Set the high water mark for inbound messages on the specified socket.

The high water mark is a hard limit on the maximum number of outstanding messages ØMQ shall queue in memory.

If this limit has been reached the socket shall enter the mute state.

A value of None means no limit.

Default value

1000

fn recv_timeout(&self) -> Result<Option<Duration>, Error>

The timeout for [recv] on the socket.

If some timeout is specified, [recv] will return [WouldBlock] after the duration is elapsed. Otherwise it will until a message is received.

fn set_recv_timeout(&self, maybe: Option<Duration>) -> Result<(), Error>

Sets the timeout for [recv] on the socket.

If some timeout is specified, [recv] will return [WouldBlock] after the duration is elapsed. Otherwise it will until a message is received.

Default

None

Loading content...

Implementors

impl RecvMsg for Client[src]

impl RecvMsg for Dish[src]

impl RecvMsg for Server[src]

Loading content...