Enum nitox::Op

source ·
pub enum Op {
    INFO(ServerInfo),
    CONNECT(ConnectCommand),
    PUB(PubCommand),
    SUB(SubCommand),
    UNSUB(UnsubCommand),
    MSG(Message),
    PING,
    PONG,
    OK,
    ERR(ServerError),
}
Expand description

Abstraction over NATS protocol messages

Variants

INFO(ServerInfo)

SERVER Sent to client after initial TCP/IP connection

CONNECT(ConnectCommand)

CLIENT Sent to server to specify connection information

PUB(PubCommand)

CLIENT Publish a message to a subject, with optional reply subject

SUB(SubCommand)

CLIENT Subscribe to a subject (or subject wildcard)

UNSUB(UnsubCommand)

CLIENT Unsubscribe (or auto-unsubscribe) from subject

MSG(Message)

SERVER Delivers a message payload to a subscriber

PING

BOTH PING keep-alive message

PONG

BOTH PONG keep-alive message

OK

SERVER Acknowledges well-formed protocol message in verbose mode

ERR(ServerError)

SERVER Indicates a protocol error. May cause client disconnect.

Implementations

Transforms the OP into a byte slice

Tries to parse from a pair of command name and whole buffer

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.