pub struct ReadyForCommand<'a> { /* private fields */ }
Expand description
The ReadyForCommand
struct represents a message indicating the server is ready for a new command.
Available fields:
-
mtype
: Identifies the message as ready for command. (value ='Z'
) -
mlen
: Length of message contents in bytes, including self. -
annotations
: Message annotations. -
transaction_state
: Transaction state.
Implementations§
Source§impl<'a> ReadyForCommand<'a>
impl<'a> ReadyForCommand<'a>
Sourcepub const fn is_buffer(buf: &'a [u8]) -> bool
pub const fn is_buffer(buf: &'a [u8]) -> bool
Checks the constant values for this struct to determine whether this message matches.
Sourcepub fn new(buf: &'a [u8]) -> Result<Self, ParseError>
pub fn new(buf: &'a [u8]) -> Result<Self, ParseError>
Creates a new instance of this struct from a given buffer.
Sourcepub fn annotations(&self) -> Array<'a, i16, Annotation<'a>>
pub fn annotations(&self) -> Array<'a, i16, Annotation<'a>>
Message annotations.
Sourcepub fn transaction_state(&self) -> TransactionState
pub fn transaction_state(&self) -> TransactionState
Transaction state.
pub fn to_vec(self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl AsRef<[u8]> for ReadyForCommand<'_>
impl AsRef<[u8]> for ReadyForCommand<'_>
Source§impl<'a> Clone for ReadyForCommand<'a>
impl<'a> Clone for ReadyForCommand<'a>
Source§fn clone(&self) -> ReadyForCommand<'a>
fn clone(&self) -> ReadyForCommand<'a>
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a> DataType for ReadyForCommand<'a>
impl<'a> DataType for ReadyForCommand<'a>
const META: StructFieldMeta
fn encode_usize(buf: &mut BufWriter<'_>, value: usize)
fn decode_usize(buf: &mut &[u8]) -> Result<usize, ParseError>
Source§impl Debug for ReadyForCommand<'_>
impl Debug for ReadyForCommand<'_>
Source§impl<'a> DecoderFor<'a, ReadyForCommand<'a>> for ReadyForCommand<'a>
impl<'a> DecoderFor<'a, ReadyForCommand<'a>> for ReadyForCommand<'a>
fn decode_for(buf: &mut &'a [u8]) -> Result<Self, ParseError>
Source§impl<'a> Default for ReadyForCommand<'a>
impl<'a> Default for ReadyForCommand<'a>
Source§fn default() -> ReadyForCommand<'a>
fn default() -> ReadyForCommand<'a>
Source§impl<ANNOTATIONS, TRANSACTION_STATE> EncoderFor<ReadyForCommand<'static>> for &ReadyForCommandBuilder<ANNOTATIONS, TRANSACTION_STATE>where
ANNOTATIONS: EncoderFor<Array<'static, i16, Annotation<'static>>>,
TRANSACTION_STATE: EncoderFor<TransactionState>,
impl<ANNOTATIONS, TRANSACTION_STATE> EncoderFor<ReadyForCommand<'static>> for &ReadyForCommandBuilder<ANNOTATIONS, TRANSACTION_STATE>where
ANNOTATIONS: EncoderFor<Array<'static, i16, Annotation<'static>>>,
TRANSACTION_STATE: EncoderFor<TransactionState>,
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<'a> EncoderFor<ReadyForCommand<'static>> for ReadyForCommand<'a>
impl<'a> EncoderFor<ReadyForCommand<'static>> for ReadyForCommand<'a>
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<ANNOTATIONS, TRANSACTION_STATE> EncoderFor<ReadyForCommand<'static>> for ReadyForCommandBuilder<ANNOTATIONS, TRANSACTION_STATE>where
ANNOTATIONS: EncoderFor<Array<'static, i16, Annotation<'static>>>,
TRANSACTION_STATE: EncoderFor<TransactionState>,
impl<ANNOTATIONS, TRANSACTION_STATE> EncoderFor<ReadyForCommand<'static>> for ReadyForCommandBuilder<ANNOTATIONS, TRANSACTION_STATE>where
ANNOTATIONS: EncoderFor<Array<'static, i16, Annotation<'static>>>,
TRANSACTION_STATE: EncoderFor<TransactionState>,
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl PartialEq for ReadyForCommand<'_>
impl PartialEq for ReadyForCommand<'_>
Source§impl<'a> StructMeta for ReadyForCommand<'a>
Implements a trait containing the fields of the struct, allowing
us to compute some useful things.
impl<'a> StructMeta for ReadyForCommand<'a>
Implements a trait containing the fields of the struct, allowing us to compute some useful things.
const FIELDS: StructFields
type Struct<'__struct> = ReadyForCommand<'__struct>
fn new<'__next_lifetime>( buf: &'__next_lifetime [u8], ) -> Result<Self::Struct<'__next_lifetime>, ParseError>
fn to_vec(&self) -> Vec<u8> ⓘ
const FIELD_COUNT: usize = _
const IS_FIXED_SIZE: bool = _
const FIXED_SIZE: Option<usize> = _
const LENGTH_FIELD_INDEX: Option<usize> = _
const HAS_LENGTH_FIELD: bool = _
impl<'a> Copy for ReadyForCommand<'a>
impl Eq for ReadyForCommand<'_>
impl StructAttributeFieldCount<{<$name<'_> as $crate::prelude::StructMeta>::FIELD_COUNT}> for ReadyForCommand<'_>
Implements a trait indicating that the struct has a field count.
impl StructAttributeFixedSize<{<$name<'_> as $crate::prelude::StructMeta>::IS_FIXED_SIZE}> for ReadyForCommand<'_>
Implements a trait indicating that the struct has a fixed size. This needs to be a trait-generic rather than and associated constant for us to use elsewhere.
impl StructAttributeHasLengthField<{<$name<'_> as $crate::prelude::StructMeta>::HAS_LENGTH_FIELD}> for ReadyForCommand<'_>
Implements a trait indicating that the struct has a length field.