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
data
Optional data encryption, negotiated independently on each relay leg. The authenticated setup response selects a format before application I/O.
direct
Opt-in coordination messages. Legacy connections never emit these messages.
forward
secure
Protocol-v2 single-flight authentication framing.
transport
Relay carriers. Dispatch once before forwarding; control I/O may use the enum.

Macros§

with_relay_stream
TCP-only builds erase carrier dispatch entirely, including in downstream crates.

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.