Skip to main content

Module message

Module message 

Source
Expand description

The message type. Is the base type for all messages in the request-response protocol

Structs§

RequestMessage
A request message, which includes the requester’s public key, the request’s signature, a timestamp, and the request itself
ResponseMessage
A response message, which includes the hash of the request we’re responding to and the response itself.

Enums§

Message
The outer message type for the request-response protocol. Can either be a request or a response
MessageFrame
A serialized Message with only its framing parsed: the type byte, and for a response the request hash. The receiver uses it to route a response to its waiters, or drop it, without deserializing the body

Constants§

REQUEST_TAG 🔒
The type byte that prefixes a serialized Message::Request
RESPONSE_TAG 🔒
The type byte that prefixes a serialized Message::Response

Functions§

read_length_prefixed 🔒
A helper function to read a length-prefixed value from a reader
read_to_end 🔒
A helper function to read to the end of the reader
split_request_hash 🔒
Split the request hash prefix off a serialized ResponseMessage
write_length_prefixed 🔒
A helper function to write a length-prefixed value to a writer