pub struct RowField<'a> { /* private fields */ }Expand description
The RowField struct represents a row within the RowDescription message.
Available fields:
-
name: The field name -
table_oid: The table ID (OID) of the table the column is from, or 0 if not a column reference -
column_attr_number: The attribute number of the column, or 0 if not a column reference -
data_type_oid: The object ID of the field’s data type -
data_type_size: The data type size (negative if variable size) -
type_modifier: The type modifier -
format_code: The format code being used for the field (0 for text, 1 for binary)
Implementations§
Source§impl<'a> RowField<'a>
impl<'a> RowField<'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 table_oid(&self) -> i32
pub fn table_oid(&self) -> i32
The table ID (OID) of the table the column is from, or 0 if not a column reference
Sourcepub fn column_attr_number(&self) -> i16
pub fn column_attr_number(&self) -> i16
The attribute number of the column, or 0 if not a column reference
Sourcepub fn data_type_oid(&self) -> i32
pub fn data_type_oid(&self) -> i32
The object ID of the field’s data type
Sourcepub fn data_type_size(&self) -> i16
pub fn data_type_size(&self) -> i16
The data type size (negative if variable size)
Sourcepub fn type_modifier(&self) -> i32
pub fn type_modifier(&self) -> i32
The type modifier
Sourcepub fn format_code(&self) -> FormatCode
pub fn format_code(&self) -> FormatCode
The format code being used for the field (0 for text, 1 for binary)
pub fn to_vec(self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl<'a> DataType for RowField<'a>
impl<'a> DataType for RowField<'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, RowField<'a>> for RowField<'a>
impl<'a> DecoderFor<'a, RowField<'a>> for RowField<'a>
fn decode_for(buf: &mut &'a [u8]) -> Result<Self, ParseError>
Source§impl<NAME, TABLE_OID, COLUMN_ATTR_NUMBER, DATA_TYPE_OID, DATA_TYPE_SIZE, TYPE_MODIFIER, FORMAT_CODE> EncoderFor<RowField<'static>> for &RowFieldBuilder<NAME, TABLE_OID, COLUMN_ATTR_NUMBER, DATA_TYPE_OID, DATA_TYPE_SIZE, TYPE_MODIFIER, FORMAT_CODE>where
NAME: EncoderFor<ZTString<'static>>,
TABLE_OID: EncoderFor<i32>,
COLUMN_ATTR_NUMBER: EncoderFor<i16>,
DATA_TYPE_OID: EncoderFor<i32>,
DATA_TYPE_SIZE: EncoderFor<i16>,
TYPE_MODIFIER: EncoderFor<i32>,
FORMAT_CODE: EncoderFor<FormatCode>,
impl<NAME, TABLE_OID, COLUMN_ATTR_NUMBER, DATA_TYPE_OID, DATA_TYPE_SIZE, TYPE_MODIFIER, FORMAT_CODE> EncoderFor<RowField<'static>> for &RowFieldBuilder<NAME, TABLE_OID, COLUMN_ATTR_NUMBER, DATA_TYPE_OID, DATA_TYPE_SIZE, TYPE_MODIFIER, FORMAT_CODE>where
NAME: EncoderFor<ZTString<'static>>,
TABLE_OID: EncoderFor<i32>,
COLUMN_ATTR_NUMBER: EncoderFor<i16>,
DATA_TYPE_OID: EncoderFor<i32>,
DATA_TYPE_SIZE: EncoderFor<i16>,
TYPE_MODIFIER: EncoderFor<i32>,
FORMAT_CODE: EncoderFor<FormatCode>,
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<'a> EncoderFor<RowField<'static>> for RowField<'a>
impl<'a> EncoderFor<RowField<'static>> for RowField<'a>
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<NAME, TABLE_OID, COLUMN_ATTR_NUMBER, DATA_TYPE_OID, DATA_TYPE_SIZE, TYPE_MODIFIER, FORMAT_CODE> EncoderFor<RowField<'static>> for RowFieldBuilder<NAME, TABLE_OID, COLUMN_ATTR_NUMBER, DATA_TYPE_OID, DATA_TYPE_SIZE, TYPE_MODIFIER, FORMAT_CODE>where
NAME: EncoderFor<ZTString<'static>>,
TABLE_OID: EncoderFor<i32>,
COLUMN_ATTR_NUMBER: EncoderFor<i16>,
DATA_TYPE_OID: EncoderFor<i32>,
DATA_TYPE_SIZE: EncoderFor<i16>,
TYPE_MODIFIER: EncoderFor<i32>,
FORMAT_CODE: EncoderFor<FormatCode>,
impl<NAME, TABLE_OID, COLUMN_ATTR_NUMBER, DATA_TYPE_OID, DATA_TYPE_SIZE, TYPE_MODIFIER, FORMAT_CODE> EncoderFor<RowField<'static>> for RowFieldBuilder<NAME, TABLE_OID, COLUMN_ATTR_NUMBER, DATA_TYPE_OID, DATA_TYPE_SIZE, TYPE_MODIFIER, FORMAT_CODE>where
NAME: EncoderFor<ZTString<'static>>,
TABLE_OID: EncoderFor<i32>,
COLUMN_ATTR_NUMBER: EncoderFor<i16>,
DATA_TYPE_OID: EncoderFor<i32>,
DATA_TYPE_SIZE: EncoderFor<i16>,
TYPE_MODIFIER: EncoderFor<i32>,
FORMAT_CODE: EncoderFor<FormatCode>,
fn encode_for(&self, buf: &mut BufWriter<'_>)
Source§impl<'a> StructMeta for RowField<'a>
Implements a trait containing the fields of the struct, allowing
us to compute some useful things.
impl<'a> StructMeta for RowField<'a>
Implements a trait containing the fields of the struct, allowing us to compute some useful things.
const FIELDS: StructFields
type Struct<'__struct> = RowField<'__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 RowField<'a>
impl Eq for RowField<'_>
impl StructAttributeFieldCount<{<$name<'_> as $crate::prelude::StructMeta>::FIELD_COUNT}> for RowField<'_>
Implements a trait indicating that the struct has a field count.
impl StructAttributeFixedSize<{<$name<'_> as $crate::prelude::StructMeta>::IS_FIXED_SIZE}> for RowField<'_>
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 RowField<'_>
Implements a trait indicating that the struct has a length field.