pub enum Message {
Show 19 variants
Connect {
db_name: String,
password: Option<Zeroizing<String>>,
username: Option<String>,
},
ConnectOk {
version: String,
},
Query {
query: String,
},
QuerySql {
query: String,
},
QueryWithParams {
query: String,
params: Vec<WireParam>,
},
SyncStatus {
replica_id: String,
},
SyncPull {
replica_id: String,
since_lsn: u64,
max_units: u32,
max_bytes: u64,
database_id: [u8; 16],
primary_generation: u64,
wal_format_version: u16,
catalog_version: u16,
segment_format_version: u16,
},
SyncAck {
replica_id: String,
applied_lsn: u64,
remote_lsn: u64,
},
SyncStatusResult {
status: WireSyncStatus,
},
SyncPullResult {
status: WireSyncStatus,
units: Vec<WireRetainedUnit>,
has_more: bool,
},
SyncAckResult {
previous_applied_lsn: u64,
applied_lsn: u64,
remote_lsn: u64,
advanced: bool,
status: WireSyncStatus,
},
ResultRows {
columns: Vec<String>,
rows: Vec<Vec<String>>,
},
ResultScalar {
value: String,
},
ResultOk {
affected: u64,
},
ResultMessage {
message: String,
},
Error {
message: String,
},
Disconnect,
Ping,
Pong,
}Variants§
Connect
Fields
ConnectOk
Query
QuerySql
A SQL query string.
QueryWithParams
A query string with positional $N parameters bound at the server.
SyncStatus
Request primary-side status for one embedded replica cursor.
SyncPull
Pull a bounded retained-unit chunk after the server-side replica cursor.
Fields
SyncAck
Acknowledge that the replica applied retained history through applied_lsn.
SyncStatusResult
Fields
§
status: WireSyncStatusSyncPullResult
SyncAckResult
Fields
§
status: WireSyncStatusResultRows
ResultScalar
ResultOk
ResultMessage
A descriptive status message (e.g. “type User created”, “index dropped”).
Error
Disconnect
Ping
Pong
Implementations§
Source§impl Message
impl Message
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
Encode message into wire format: [type(1)][flags(1)][len(4)][payload]
Sourcepub async fn write_to<W: AsyncWriteExt + Unpin>(
&self,
writer: &mut W,
) -> Result<()>
pub async fn write_to<W: AsyncWriteExt + Unpin>( &self, writer: &mut W, ) -> Result<()>
Write this message to an async writer.
Sourcepub async fn read_from<R: AsyncReadExt + Unpin>(
reader: &mut R,
) -> Result<Option<Message>>
pub async fn read_from<R: AsyncReadExt + Unpin>( reader: &mut R, ) -> Result<Option<Message>>
Read a message from an async reader.
Sourcepub async fn read_from_preauth<R: AsyncReadExt + Unpin>(
reader: &mut R,
) -> Result<Option<Message>>
pub async fn read_from_preauth<R: AsyncReadExt + Unpin>( reader: &mut R, ) -> Result<Option<Message>>
Read a pre-auth message with a smaller payload limit (4 KB). Use this before authentication is complete to prevent oversized CONNECT payloads from consuming server memory.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
Blanket Implementations§
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