mod code;
mod io;
mod parse;
mod wrappers;
pub use code::MessageCode;
#[cfg(feature = "async")]
pub use io::read_message;
#[cfg(feature = "sync")]
pub use io::read_message_sync;
pub use wrappers::{
BackendKeyData, CommandComplete, CopyResponse, DataRow, ErrorResponse, NoticeResponse,
NotificationResponse, ParameterDescription, ParameterStatus, ReadyForQuery, RowDescription,
TransactionStatus,
};
use bytes::Bytes;
#[derive(Debug, Clone)]
pub enum PgMessage {
DataRow(DataRow),
RowDescription(RowDescription),
CommandComplete(CommandComplete),
EmptyQueryResponse,
ErrorResponse(ErrorResponse),
NoticeResponse(NoticeResponse),
ReadyForQuery(ReadyForQuery),
BackendKeyData(BackendKeyData),
ParameterStatus(ParameterStatus),
ParseComplete,
BindComplete,
CloseComplete,
ParameterDescription(ParameterDescription),
NoData,
PortalSuspended,
NotificationResponse(NotificationResponse),
CopyData(Bytes),
CopyDone,
CopyInResponse(CopyResponse),
CopyOutResponse(CopyResponse),
CopyBothResponse(CopyResponse),
Authentication(Bytes),
FunctionCallResponse(Bytes),
NegotiateProtocolVersion(Bytes),
Unknown {
code: MessageCode,
body: Bytes,
},
}