pub enum BackendMessage {
Show 16 variants
AuthenticationOk,
AuthenticationCleartextPassword,
AuthenticationMD5Password {
salt: [u8; 4],
},
ParameterStatus {
name: String,
value: String,
},
BackendKeyData {
process_id: i32,
secret_key: i32,
},
ReadyForQuery {
status: TransactionStatus,
},
RowDescription {
fields: Vec<FieldDescription>,
},
DataRow {
values: Vec<Option<Vec<u8>>>,
},
CommandComplete {
tag: String,
},
ErrorResponse {
fields: HashMap<u8, String>,
},
NoticeResponse {
fields: HashMap<u8, String>,
},
EmptyQueryResponse,
SubscriptionData {
subscription_id: [u8; 16],
update_type: SubscriptionUpdateType,
rows: Vec<Vec<Option<Vec<u8>>>>,
},
SubscriptionError {
subscription_id: [u8; 16],
message: String,
},
SubscriptionAck {
subscription_id: [u8; 16],
table_count: u16,
},
SubscriptionPartialData {
subscription_id: [u8; 16],
rows: Vec<PartialRowUpdate>,
},
}Expand description
Backend message types (server -> client)
Variants§
AuthenticationOk
Authentication request
AuthenticationCleartextPassword
AuthenticationMD5Password
ParameterStatus
Parameter status
BackendKeyData
Backend key data (for cancellation)
ReadyForQuery
Ready for query
Fields
§
status: TransactionStatusRowDescription
Row description (result set schema)
Fields
§
fields: Vec<FieldDescription>DataRow
Data row
CommandComplete
Command complete
ErrorResponse
Error response
NoticeResponse
Notice response
EmptyQueryResponse
Empty query response
SubscriptionData
Subscription data (0xF2) - query result update
Fields
§
update_type: SubscriptionUpdateTypeSubscriptionError
Subscription error (0xF3) - subscription error notification
SubscriptionAck
Subscription acknowledgment (0xF4) - confirms subscription registration Sent immediately after a subscription is registered, before initial data
Fields
SubscriptionPartialData
Subscription partial data (0xF7) - selective column update
Used for sending only changed columns in row updates, reducing bandwidth for wide tables where only a few columns change frequently.
Wire format:
- 1 byte: Message type (0xF7)
- 4 bytes: Length (big-endian)
- 16 bytes: Subscription ID
- 1 byte: Update type (always SelectiveUpdate = 4)
- 4 bytes: Row count (big-endian)
- For each row:
- 2 bytes: Total column count (big-endian)
- N bytes: Column presence bitmap (ceil(total_columns / 8) bytes)
- For each present column (bit=1):
- 4 bytes: Value length (-1 for NULL)
- M bytes: Value data (if length >= 0)
Implementations§
Trait Implementations§
Source§impl Clone for BackendMessage
impl Clone for BackendMessage
Source§fn clone(&self) -> BackendMessage
fn clone(&self) -> BackendMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BackendMessage
impl Debug for BackendMessage
Source§impl PartialEq for BackendMessage
impl PartialEq for BackendMessage
Source§fn eq(&self, other: &BackendMessage) -> bool
fn eq(&self, other: &BackendMessage) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BackendMessage
Auto Trait Implementations§
impl Freeze for BackendMessage
impl RefUnwindSafe for BackendMessage
impl Send for BackendMessage
impl Sync for BackendMessage
impl Unpin for BackendMessage
impl UnsafeUnpin for BackendMessage
impl UnwindSafe for BackendMessage
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request