Expand description
Frontend (client-to-server) messages.
Each function in this module writes a single PostgreSQL wire protocol
message into a BytesMut buffer. All structural fields (tags, lengths,
counts) are written in BigEndian per the PostgreSQL specification.
The functions are intentionally stateless – they append bytes to a buffer
and do not manage connection state. The connection layer in hyper-client
is responsible for sequencing messages correctly (e.g. Parse/Bind/Execute
followed by Sync).
§Attribution
Portions of this module were adapted from
postgres-protocol’s
message/frontend.rs (Copyright (c) 2016 Steven Fackler, MIT or
Apache-2.0). Adapted material includes the PostgreSQL v3.0
protocol-version literal (196608, (3 << 16) | 0), the startup-message
framing layout, and the msg_len helper. Hyper-specific changes added
on top include performance work and Hyper-specific message variants.
See the NOTICE file at the repo root for the full upstream copyright
and reproduced license text.
Functions§
- bind
- Writes a bind message.
- cancel_
request - Writes a cancel request.
- close
- Writes a close message.
- copy_
data - Writes a copy data message.
- copy_
done - Writes a copy done message.
- copy_
fail - Writes a copy fail message.
- describe
- Writes a describe message.
- execute
- Writes an execute message.
- flush
- Writes a flush message.
- parse
- Writes a parse message (prepare statement).
- password_
message - Writes a password message (for authentication).
- query
- Writes a simple query message.
- sasl_
initial_ response - Writes a SASL initial response message.
- sasl_
response - Writes a SASL response message.
- startup_
message - Writes a startup message to the buffer.
- sync
- Writes a sync message.
- terminate
- Writes a terminate message.