Expand description
Frontend (client → server) message encoding.
Messages are appended to a caller-owned [BytesMut] so that a full request
(Parse + Describe + Bind + Execute + Sync) can be assembled in one
buffer and written with a single syscall.
Counts and lengths taken from the caller are range-checked before being written: a silently truncated length prefix makes the server reinterpret the rest of the buffer as new protocol messages.
Constants§
- MAX_
VALUE_ COUNT - Maximum number of values in one
BindorCOPYrow.
Functions§
- begin
- Starts a tagged message, writing the tag and a placeholder length.
- bind_
finish - Finishes a
Bindmessage. - bind_
start - Starts a
Bindmessage; callwrite_paramfor each value, thenbind_finish. - cancel_
request - Encodes a
CancelRequestmessage (no tag; sent on a fresh connection). - close
- Encodes a
Close(kindisb'S'for a statement orb'P'for a portal). - copy_
data - Encodes a
CopyData. - copy_
done - Encodes a
CopyDone. - copy_
fail - Encodes a
CopyFail. - describe
- Encodes a
Describe(kindisb'S'for a statement orb'P'for a portal). - execute
- Encodes an
Execute. - finish
- Patches the length field written by
begin. - flush
- Encodes a
Flush. - parse
- Encodes a
Parse. - password
- Encodes a cleartext password message (
PasswordMessage). - put_
cstr - Appends a raw C string terminated by a NUL byte.
- query
- Encodes a simple
Query. - sasl_
initial_ response - Encodes a
SASLInitialResponse. - sasl_
response - Encodes a
SASLResponse. - ssl_
request - Encodes an SSLRequest message.
- startup
- Encodes the startup message (no tag).
- sync
- Encodes a
Sync. - terminate
- Encodes a
Terminate. - write_
param - Writes one
Bindparameter;Noneis encoded as SQL NULL.