Skip to main content

Crate pb_mapper_protocol

Crate pb_mapper_protocol 

Source
Expand description

Define message protocols and tools for reading and writing messages

The reader and writer traits are async fn in a public trait, which cannot state its auto-trait bounds. That is deliberate: these are only ever awaited on the connection task that owns the stream, never sent across one.

Modules§

buffer
Define the buffer interface for reading data in different situations
command
forward
secure
Protocol-v2 single-flight authentication framing.

Structs§

CodecMessageReader
CodecMessageWriter
NOTE: We copy input data before encryption to avoid mutating shared buffers. This trades some performance for correctness until a zero-copy mutable API is added.
NormalMessageReader
NormalMessageWriter

Traits§

MessageReader
This message protocol contains header and body, and the header includes checksum, datalen,respectively, u32, u32, where datalen represents the length of the body, checksum is used to check the datalen field. This is just the most basic pedestal protocol, in order to solve the sticky packet problem with TCP streams. We can build more advanced communication on top of this protocol, for example, we can use json or other forms of data representation
MessageWriter

Functions§

get_decodec
get_default_decodec
get_default_encodec
get_encodec
get_header_msg_reader
get_header_msg_writer

Type Aliases§

DataLenType
The width of the length prefix on a framed message.