#[non_exhaustive]pub enum Message {
Show 26 variants
AuthenticationOk,
AuthenticationCleartextPassword,
AuthenticationMd5Password(AuthenticationMd5PasswordBody),
AuthenticationSasl(AuthenticationSaslBody),
AuthenticationSaslContinue(AuthenticationSaslContinueBody),
AuthenticationSaslFinal(AuthenticationSaslFinalBody),
BackendKeyData(BackendKeyDataBody),
BindComplete,
CloseComplete,
CommandComplete(CommandCompleteBody),
CopyData(CopyDataBody),
CopyDone,
CopyInResponse(CopyInResponseBody),
CopyOutResponse(CopyOutResponseBody),
DataRow(DataRowBody),
EmptyQueryResponse,
ErrorResponse(ErrorResponseBody),
NoData,
NoticeResponse(NoticeResponseBody),
NotificationResponse(NotificationResponseBody),
ParameterDescription(ParameterDescriptionBody),
ParameterStatus(ParameterStatusBody),
ParseComplete,
PortalSuspended,
ReadyForQuery(ReadyForQueryBody),
RowDescription(RowDescriptionBody),
}Expand description
An enum representing backend messages from Hyper server.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AuthenticationOk
Authentication request completed successfully.
AuthenticationCleartextPassword
Authentication via cleartext password.
AuthenticationMd5Password(AuthenticationMd5PasswordBody)
Authentication via MD5 password.
AuthenticationSasl(AuthenticationSaslBody)
Authentication via SASL.
AuthenticationSaslContinue(AuthenticationSaslContinueBody)
SASL authentication continue.
AuthenticationSaslFinal(AuthenticationSaslFinalBody)
SASL authentication final.
BackendKeyData(BackendKeyDataBody)
Backend key data for cancel requests.
BindComplete
Bind operation complete.
CloseComplete
Close operation complete.
CommandComplete(CommandCompleteBody)
Command completed.
CopyData(CopyDataBody)
COPY data.
CopyDone
COPY operation done.
CopyInResponse(CopyInResponseBody)
COPY IN response (client should send data).
CopyOutResponse(CopyOutResponseBody)
COPY OUT response (server will send data).
DataRow(DataRowBody)
A row of data.
EmptyQueryResponse
Empty query response.
ErrorResponse(ErrorResponseBody)
Error response.
NoData
No data (for empty result sets).
NoticeResponse(NoticeResponseBody)
Notice response (warning).
NotificationResponse(NotificationResponseBody)
Notification from LISTEN/NOTIFY.
ParameterDescription(ParameterDescriptionBody)
Parameter description for prepared statement.
ParameterStatus(ParameterStatusBody)
Parameter status update.
ParseComplete
Parse operation complete.
PortalSuspended
Portal suspended (for partial results).
ReadyForQuery(ReadyForQueryBody)
Ready for query.
RowDescription(RowDescriptionBody)
Row description (column metadata).
Implementations§
Source§impl Message
impl Message
Sourcepub fn parse(buf: &mut BytesMut) -> Result<Option<Message>>
pub fn parse(buf: &mut BytesMut) -> Result<Option<Message>>
Parses a backend message from a buffer.
Reads the message header (5 bytes: tag + length) and parses the complete
message body. Returns Ok(None) if the buffer doesn’t contain a complete
message yet. The buffer is advanced when a complete message is parsed.
§Arguments
buf- Buffer containing message data (may be partial)
§Errors
- Returns
io::ErrorKind::InvalidInputif the declared length field is less than 4 (below the minimum valid message size). - Returns an I/O error from the inner
Bufferreads when a body field is truncated, a C-string is not NUL-terminated, or a string field contains invalid UTF-8. - Returns
io::ErrorKind::InvalidInputfor unexpected authentication sub-tags or unknown top-level message tags.
§Panics
Does not panic in practice. The read_u32 call on &buf[1..5]
is proven infallible by the preceding buf.len() < 5 short-circuit.
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request