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§
- Codec
Message Reader - Codec
Message Writer - 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.
- Normal
Message Reader - Normal
Message Writer
Traits§
- Message
Reader - 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
- Message
Writer
Functions§
- get_
decodec - get_
default_ decodec - get_
default_ encodec - get_
encodec - get_
header_ msg_ reader - get_
header_ msg_ writer
Type Aliases§
- Data
LenType - The width of the length prefix on a framed message.