#[non_exhaustive]pub struct MysqlColumn {
pub column: String,
pub data_type: String,
pub length: i32,
pub collation: String,
pub primary_key: bool,
pub nullable: bool,
pub ordinal_position: i32,
pub precision: i32,
pub scale: i32,
/* private fields */
}
Expand description
MySQL Column.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.column: String
Column name.
data_type: String
The MySQL data type. Full data types list can be found here: https://dev.mysql.com/doc/refman/8.0/en/data-types.html
length: i32
Column length.
collation: String
Column collation.
primary_key: bool
Whether or not the column represents a primary key.
nullable: bool
Whether or not the column can accept a null value.
ordinal_position: i32
The ordinal position of the column in the table.
precision: i32
Column precision.
scale: i32
Column scale.
Implementations§
Source§impl MysqlColumn
impl MysqlColumn
pub fn new() -> Self
Sourcepub fn set_column<T: Into<String>>(self, v: T) -> Self
pub fn set_column<T: Into<String>>(self, v: T) -> Self
Sets the value of column.
Sourcepub fn set_data_type<T: Into<String>>(self, v: T) -> Self
pub fn set_data_type<T: Into<String>>(self, v: T) -> Self
Sets the value of data_type.
Sourcepub fn set_length<T: Into<i32>>(self, v: T) -> Self
pub fn set_length<T: Into<i32>>(self, v: T) -> Self
Sets the value of length.
Sourcepub fn set_collation<T: Into<String>>(self, v: T) -> Self
pub fn set_collation<T: Into<String>>(self, v: T) -> Self
Sets the value of collation.
Sourcepub fn set_primary_key<T: Into<bool>>(self, v: T) -> Self
pub fn set_primary_key<T: Into<bool>>(self, v: T) -> Self
Sets the value of primary_key.
Sourcepub fn set_nullable<T: Into<bool>>(self, v: T) -> Self
pub fn set_nullable<T: Into<bool>>(self, v: T) -> Self
Sets the value of nullable.
Sourcepub fn set_ordinal_position<T: Into<i32>>(self, v: T) -> Self
pub fn set_ordinal_position<T: Into<i32>>(self, v: T) -> Self
Sets the value of ordinal_position.
Sourcepub fn set_precision<T: Into<i32>>(self, v: T) -> Self
pub fn set_precision<T: Into<i32>>(self, v: T) -> Self
Sets the value of precision.
Trait Implementations§
Source§impl Clone for MysqlColumn
impl Clone for MysqlColumn
Source§fn clone(&self) -> MysqlColumn
fn clone(&self) -> MysqlColumn
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MysqlColumn
impl Debug for MysqlColumn
Source§impl Default for MysqlColumn
impl Default for MysqlColumn
Source§fn default() -> MysqlColumn
fn default() -> MysqlColumn
Returns the “default value” for a type. Read more
Source§impl Message for MysqlColumn
impl Message for MysqlColumn
Source§impl PartialEq for MysqlColumn
impl PartialEq for MysqlColumn
impl StructuralPartialEq for MysqlColumn
Auto Trait Implementations§
impl Freeze for MysqlColumn
impl RefUnwindSafe for MysqlColumn
impl Send for MysqlColumn
impl Sync for MysqlColumn
impl Unpin for MysqlColumn
impl UnwindSafe for MysqlColumn
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more