pub struct Bind<'a> { /* private fields */ }Expand description
The Bind struct represents a message to bind a named portal to a prepared statement.
Available fields:
-
mtype: Identifies the message as a Bind command. (value ='B') -
mlen: Length of message contents in bytes, including self. -
portal: The name of the destination portal. -
statement: The name of the source prepared statement. -
format_codes: The parameter format codes. -
values: Array of parameter values and their lengths. -
result_format_codes: The result-column format codes.
Implementations§
Source§impl<'a> Bind<'a>
impl<'a> Bind<'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 format_codes(&self) -> Array<'a, i16, i16>
pub fn format_codes(&self) -> Array<'a, i16, i16>
The parameter format codes.
Sourcepub fn values(&self) -> Array<'a, i16, Encoded<'a>>
pub fn values(&self) -> Array<'a, i16, Encoded<'a>>
Array of parameter values and their lengths.
Sourcepub fn result_format_codes(&self) -> Array<'a, i16, i16>
pub fn result_format_codes(&self) -> Array<'a, i16, i16>
The result-column format codes.
pub fn to_vec(self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl<'a> DataType for Bind<'a>
impl<'a> DataType for Bind<'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, Bind<'a>> for Bind<'a>
impl<'a> DecoderFor<'a, Bind<'a>> for Bind<'a>
fn decode_for(buf: &mut &'a [u8]) -> Result<Self, ParseError>
Source§impl<PORTAL, STATEMENT, FORMAT_CODES, VALUES, RESULT_FORMAT_CODES> EncoderFor<Bind<'static>> for &BindBuilder<PORTAL, STATEMENT, FORMAT_CODES, VALUES, RESULT_FORMAT_CODES>where
PORTAL: EncoderFor<ZTString<'static>>,
STATEMENT: EncoderFor<ZTString<'static>>,
FORMAT_CODES: EncoderFor<Array<'static, i16, i16>>,
VALUES: EncoderFor<Array<'static, i16, Encoded<'static>>>,
RESULT_FORMAT_CODES: EncoderFor<Array<'static, i16, i16>>,
impl<PORTAL, STATEMENT, FORMAT_CODES, VALUES, RESULT_FORMAT_CODES> EncoderFor<Bind<'static>> for &BindBuilder<PORTAL, STATEMENT, FORMAT_CODES, VALUES, RESULT_FORMAT_CODES>where
PORTAL: EncoderFor<ZTString<'static>>,
STATEMENT: EncoderFor<ZTString<'static>>,
FORMAT_CODES: EncoderFor<Array<'static, i16, i16>>,
VALUES: EncoderFor<Array<'static, i16, Encoded<'static>>>,
RESULT_FORMAT_CODES: EncoderFor<Array<'static, i16, i16>>,
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<'a> EncoderFor<Bind<'static>> for Bind<'a>
impl<'a> EncoderFor<Bind<'static>> for Bind<'a>
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<PORTAL, STATEMENT, FORMAT_CODES, VALUES, RESULT_FORMAT_CODES> EncoderFor<Bind<'static>> for BindBuilder<PORTAL, STATEMENT, FORMAT_CODES, VALUES, RESULT_FORMAT_CODES>where
PORTAL: EncoderFor<ZTString<'static>>,
STATEMENT: EncoderFor<ZTString<'static>>,
FORMAT_CODES: EncoderFor<Array<'static, i16, i16>>,
VALUES: EncoderFor<Array<'static, i16, Encoded<'static>>>,
RESULT_FORMAT_CODES: EncoderFor<Array<'static, i16, i16>>,
impl<PORTAL, STATEMENT, FORMAT_CODES, VALUES, RESULT_FORMAT_CODES> EncoderFor<Bind<'static>> for BindBuilder<PORTAL, STATEMENT, FORMAT_CODES, VALUES, RESULT_FORMAT_CODES>where
PORTAL: EncoderFor<ZTString<'static>>,
STATEMENT: EncoderFor<ZTString<'static>>,
FORMAT_CODES: EncoderFor<Array<'static, i16, i16>>,
VALUES: EncoderFor<Array<'static, i16, Encoded<'static>>>,
RESULT_FORMAT_CODES: EncoderFor<Array<'static, i16, i16>>,
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<'a> StructMeta for Bind<'a>
Implements a trait containing the fields of the struct, allowing
us to compute some useful things.
impl<'a> StructMeta for Bind<'a>
Implements a trait containing the fields of the struct, allowing us to compute some useful things.
const FIELDS: StructFields
type Struct<'__struct> = Bind<'__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 Bind<'a>
impl Eq for Bind<'_>
impl StructAttributeFieldCount<{<$name<'_> as $crate::prelude::StructMeta>::FIELD_COUNT}> for Bind<'_>
Implements a trait indicating that the struct has a field count.
impl StructAttributeFixedSize<{<$name<'_> as $crate::prelude::StructMeta>::IS_FIXED_SIZE}> for Bind<'_>
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 Bind<'_>
Implements a trait indicating that the struct has a length field.