pub enum WireMessage {
    Signal {
        data: Vec<u8>,
    },
    Request {
        id: u64,
        data: Vec<u8>,
    },
    Response {
        id: u64,
        data: Option<Vec<u8>>,
    },
}
Expand description

The messages actually sent over the wire by this library. If you want to impliment your own server or client you will need this type or be able to serialize / deserialize it.

Variants§

§

Signal

Fields

§data: Vec<u8>

Actual bytes of the message serialized as message pack.

A message without a response.

§

Request

Fields

§id: u64

The id of this request. Note ids are recycled once they are used.

§data: Vec<u8>

Actual bytes of the message serialized as message pack.

A request that requires a response.

§

Response

Fields

§id: u64

The id of the request that this response is for.

§data: Option<Vec<u8>>

Actual bytes of the message serialized as message pack.

The response to a request.

Trait Implementations§

Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. 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.
The type returned in the event of a conversion error.
Performs the conversion.

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self
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.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more