[][src]Enum pg_wire::BackendMessage

pub enum BackendMessage {
    NoticeResponse,
    AuthenticationCleartextPassword,
    AuthenticationMD5Password,
    AuthenticationOk,
    BackendKeyData(ConnIdConnSecretKey),
    ReadyForQuery,
    DataRow(Vec<String>),
    RowDescription(Vec<ColumnMetadata>),
    CommandComplete(String),
    EmptyQueryResponse,
    ErrorResponse(Option<&'static str>, Option<&'static str>, Option<String>),
    ParameterStatus(StringString),
    ParameterDescription(Vec<PgType>),
    NoData,
    ParseComplete,
    BindComplete,
    CloseComplete,
}

Backend PostgreSQL Wire Protocol messages see Protocol Flow

Variants

NoticeResponse

A warning message has been issued. The frontend should display the message but continue listening for ReadyForQuery or ErrorResponse.

AuthenticationCleartextPassword

The frontend must now send a PasswordMessage containing the password in clear-text form. If this is the correct password, the server responds with an AuthenticationOk, otherwise it responds with an ErrorResponse.

AuthenticationMD5Password

The frontend must now send a PasswordMessage containing the password (with user name) encrypted via MD5, then encrypted again using the 4-byte random salt specified in the AuthenticationMD5Password message. If this is the correct password, the server responds with an AuthenticationOk, otherwise it responds with an ErrorResponse. The actual PasswordMessage can be computed in SQL as concat('md5', md5(concat(md5(concat(password, username)), random-salt))). (Keep in mind the md5() function returns its result as a hex string.)

AuthenticationOk

The authentication exchange is successfully completed.

BackendKeyData(ConnIdConnSecretKey)

Identifies as cancellation key data. The frontend must save these values if it wishes to be able to issue CancelRequest messages later.

ReadyForQuery

Start-up is completed. The frontend can now issue commands.

DataRow(Vec<String>)

One of the set of rows returned by a SELECT, FETCH, etc query.

RowDescription(Vec<ColumnMetadata>)

Indicates that rows are about to be returned in response to a SELECT, FETCH, etc query. The contents of this message describe the column layout of the rows. This will be followed by a DataRow message for each row being returned to the frontend.

CommandComplete(String)

An SQL command completed normally.

EmptyQueryResponse

An empty query string was recognized.

ErrorResponse(Option<&'static str>, Option<&'static str>, Option<String>)

An error has occurred. Contains (Severity, Error Code, Error Message) all of them are optional

ParameterStatus(StringString)

This message informs the frontend about the current (initial) setting of backend parameters, such as client_encoding or DateStyle

see https://www.postgresql.org/docs/12/protocol-flow.html#PROTOCOL-ASYNC 3rd and 4th paragraph

ParameterDescription(Vec<PgType>)

Indicates that parameters are needed by a prepared statement.

NoData

Indicates that the statement will not return rows.

ParseComplete

This message informs the frontend about the previous Parse frontend message is successful.

BindComplete

This message informs the frontend about the previous Bind frontend message is successful.

CloseComplete

This message informs the frontend about the previous Close frontend message is successful.

Implementations

impl BackendMessage[src]

pub fn as_vec(&self) -> Vec<u8>[src]

returns binary representation of a backend message

Trait Implementations

impl Debug for BackendMessage[src]

impl PartialEq<BackendMessage> for BackendMessage[src]

impl StructuralPartialEq for BackendMessage[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.