pub struct Parse<'a> { /* private fields */ }Expand description
The Parse struct represents a message to parse a query string.
Available fields:
-
mtype: Identifies the message as a Parse command. (value ='P') -
mlen: Length of message contents in bytes, including self. -
statement: The name of the destination prepared statement. -
query: The query string to be parsed. -
param_types: OIDs of the parameter data types.
Implementations§
Source§impl<'a> Parse<'a>
impl<'a> Parse<'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 param_types(&self) -> Array<'a, i16, i32>
pub fn param_types(&self) -> Array<'a, i16, i32>
OIDs of the parameter data types.
pub fn to_vec(self) -> Vec<u8> ⓘ
Trait Implementations§
impl<'a> Copy for Parse<'a>
Source§impl<'a> DataType for Parse<'a>
impl<'a> DataType for Parse<'a>
const META: StructFieldMeta
fn encode_usize(buf: &mut BufWriter<'_>, value: usize)
fn decode_usize(buf: &mut &[u8]) -> Result<usize, ParseError>
Source§impl<'a> DecoderFor<'a, Parse<'a>> for Parse<'a>
impl<'a> DecoderFor<'a, Parse<'a>> for Parse<'a>
fn decode_for(buf: &mut &'a [u8]) -> Result<Self, ParseError>
Source§impl<'a> EncoderFor<Parse<'static>> for Parse<'a>
impl<'a> EncoderFor<Parse<'static>> for Parse<'a>
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<STATEMENT, QUERY, PARAM_TYPES> EncoderFor<Parse<'static>> for ParseBuilder<STATEMENT, QUERY, PARAM_TYPES>where
STATEMENT: EncoderFor<ZTString<'static>>,
QUERY: EncoderFor<ZTString<'static>>,
PARAM_TYPES: EncoderFor<Array<'static, i16, i32>>,
impl<STATEMENT, QUERY, PARAM_TYPES> EncoderFor<Parse<'static>> for ParseBuilder<STATEMENT, QUERY, PARAM_TYPES>where
STATEMENT: EncoderFor<ZTString<'static>>,
QUERY: EncoderFor<ZTString<'static>>,
PARAM_TYPES: EncoderFor<Array<'static, i16, i32>>,
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<STATEMENT, QUERY, PARAM_TYPES> EncoderFor<Parse<'static>> for &ParseBuilder<STATEMENT, QUERY, PARAM_TYPES>where
STATEMENT: EncoderFor<ZTString<'static>>,
QUERY: EncoderFor<ZTString<'static>>,
PARAM_TYPES: EncoderFor<Array<'static, i16, i32>>,
impl<STATEMENT, QUERY, PARAM_TYPES> EncoderFor<Parse<'static>> for &ParseBuilder<STATEMENT, QUERY, PARAM_TYPES>where
STATEMENT: EncoderFor<ZTString<'static>>,
QUERY: EncoderFor<ZTString<'static>>,
PARAM_TYPES: EncoderFor<Array<'static, i16, i32>>,
fn encode_for(&self, buf: &mut BufWriter<'_>)
impl Eq for Parse<'_>
impl StructAttributeFieldCount<{<$name<'_> as $crate::prelude::StructMeta>::FIELD_COUNT}> for Parse<'_>
Implements a trait indicating that the struct has a field count.
impl StructAttributeFixedSize<{<$name<'_> as $crate::prelude::StructMeta>::IS_FIXED_SIZE}> for Parse<'_>
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 Parse<'_>
Implements a trait indicating that the struct has a length field.
Source§impl<'a> StructMeta for Parse<'a>
Implements a trait containing the fields of the struct, allowing
us to compute some useful things.
impl<'a> StructMeta for Parse<'a>
Implements a trait containing the fields of the struct, allowing us to compute some useful things.