pub struct Column { /* private fields */ }Expand description
Represents MySql Column (column packet).
Implementations§
Source§impl Column
impl Column
pub fn new(column_type: ColumnType) -> Self
pub fn with_schema(self, schema: &[u8]) -> Self
pub fn with_table(self, table: &[u8]) -> Self
pub fn with_org_table(self, org_table: &[u8]) -> Self
pub fn with_name(self, name: &[u8]) -> Self
pub fn with_org_name(self, org_name: &[u8]) -> Self
pub fn with_flags(self, flags: ColumnFlags) -> Self
pub fn with_column_length(self, column_length: u32) -> Self
pub fn with_character_set(self, character_set: u16) -> Self
pub fn with_decimals(self, decimals: u8) -> Self
Sourcepub fn column_length(&self) -> u32
pub fn column_length(&self) -> u32
Returns value of the column_length field of a column packet.
Can be used for text-output formatting.
Sourcepub fn column_type(&self) -> ColumnType
pub fn column_type(&self) -> ColumnType
Returns value of the column_type field of a column packet.
Sourcepub fn character_set(&self) -> u16
pub fn character_set(&self) -> u16
Returns value of the character_set field of a column packet.
Sourcepub fn flags(&self) -> ColumnFlags
pub fn flags(&self) -> ColumnFlags
Returns value of the flags field of a column packet.
Sourcepub fn decimals(&self) -> u8
pub fn decimals(&self) -> u8
Returns value of the decimals field of a column packet.
Max shown decimal digits. Can be used for text-output formatting
0x00for integers and static strings0x1ffor dynamic strings, double, float0x00..=0x51for decimals
Sourcepub fn schema_ref(&self) -> &[u8] ⓘ
pub fn schema_ref(&self) -> &[u8] ⓘ
Returns value of the schema field of a column packet as a byte slice.
Sourcepub fn schema_str(&self) -> Cow<'_, str>
pub fn schema_str(&self) -> Cow<'_, str>
Returns value of the schema field of a column packet as a string (lossy converted).
Sourcepub fn table_ref(&self) -> &[u8] ⓘ
pub fn table_ref(&self) -> &[u8] ⓘ
Returns value of the table field of a column packet as a byte slice.
Sourcepub fn table_str(&self) -> Cow<'_, str>
pub fn table_str(&self) -> Cow<'_, str>
Returns value of the table field of a column packet as a string (lossy converted).
Sourcepub fn org_table_ref(&self) -> &[u8] ⓘ
pub fn org_table_ref(&self) -> &[u8] ⓘ
Returns value of the org_table field of a column packet as a byte slice.
“org_table” is for original table name.
Sourcepub fn org_table_str(&self) -> Cow<'_, str>
pub fn org_table_str(&self) -> Cow<'_, str>
Returns value of the org_table field of a column packet as a string (lossy converted).
Sourcepub fn name_ref(&self) -> &[u8] ⓘ
pub fn name_ref(&self) -> &[u8] ⓘ
Returns value of the name field of a column packet as a byte slice.
Sourcepub fn name_str(&self) -> Cow<'_, str>
pub fn name_str(&self) -> Cow<'_, str>
Returns value of the name field of a column packet as a string (lossy converted).
Sourcepub fn org_name_ref(&self) -> &[u8] ⓘ
pub fn org_name_ref(&self) -> &[u8] ⓘ
Returns value of the org_name field of a column packet as a byte slice.
“org_name” is for original column name.
Sourcepub fn org_name_str(&self) -> Cow<'_, str>
pub fn org_name_str(&self) -> Cow<'_, str>
Returns value of the org_name field of a column packet as a string (lossy converted).