Enum nanomsg::Protocol [] [src]

pub enum Protocol {
    Req,
    Rep,
    Push,
    Pull,
    Pair,
    Bus,
    Pub,
    Sub,
    Surveyor,
    Respondent,
}

Type-safe protocols that Nanomsg uses. Each socket is bound to a single protocol that has specific behaviour (such as only being able to receive messages and not send 'em).

Variants

Req

Used to implement the client application that sends requests and receives replies.

See also: Socket::set_request_resend_interval

Rep

Used to implement the stateless worker that receives requests and sends replies.

Push

This socket is used to send messages to a cluster of load-balanced nodes. Receive operation is not implemented on this socket type.

Pull

This socket is used to receive a message from a cluster of nodes. Send operation is not implemented on this socket type.

Pair

Socket for communication with exactly one peer. Each party can send messages at any time. If the peer is not available or send buffer is full subsequent calls to write will block until it’s possible to send the message.

Bus

Sent messages are distributed to all nodes in the topology. Incoming messages from all other nodes in the topology are fair-queued in the socket.

Pub

This socket is used to distribute messages to multiple destinations. Receive operation is not defined.

Sub

Receives messages from the publisher. Only messages that the socket is subscribed to are received. When the socket is created there are no subscriptions and thus no messages will be received. Send operation is not defined on this socket.

See also: Socket::subscribe and Socket::unsubscribe.

Surveyor

Used to send the survey. The survey is delivered to all the connected respondents. Once the query is sent, the socket can be used to receive the responses. When the survey deadline expires, receive will return Timeout error.

See also: Socket::set_survey_deadline

Respondent

Use to respond to the survey. Survey is received using receive function, response is sent using send function This socket can be connected to at most one peer.

Trait Implementations

impl Copy for Protocol
[src]

impl Clone for Protocol
[src]

fn clone(&self) -> Protocol

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl PartialEq for Protocol
[src]

fn eq(&self, __arg_0: &Protocol) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl Debug for Protocol
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.