pub struct FieldAttributes {
pub dtype: FieldType,
pub unique: bool,
pub empty: bool,
pub roster: bool,
pub defval: Option<String>,
pub primary_key: bool,
pub index: bool,
pub only_db: bool,
pub meta_name: Option<String>,
}Expand description
Attributes for fields
Fields§
§dtype: FieldTypeType of field
unique: boolIs it a UNIQUE field?
empty: boolCan be NULL?
roster: boolIs it a roster?
defval: Option<String>Optional default value for thes field
primary_key: boolIs it PRIMARY KEY
index: boolIs it INDEXed?
only_db: boolShould not be used for De/Serialization?
meta_name: Option<String>Optional name for this field
Implementations§
Source§impl FieldAttributes
impl FieldAttributes
Sourcepub fn new_nn_idx(dt: FieldType) -> Self
pub fn new_nn_idx(dt: FieldType) -> Self
Initialize NOT NULL + INDEX FieldAttributes for this FieldType
Sourcepub fn new_nn_def(dt: FieldType, defval: &str) -> Self
pub fn new_nn_def(dt: FieldType, defval: &str) -> Self
Initialize NOT NULL + default value FieldAttributes for this FieldType
Sourcepub fn new_uk_pk(dt: FieldType) -> Self
pub fn new_uk_pk(dt: FieldType) -> Self
Initialize PrimaryKey+UNIQUE FieldAttributes for this FieldType
pub fn new_meta(dt: FieldType, meta: &str) -> Self
Trait Implementations§
Source§impl Clone for FieldAttributes
impl Clone for FieldAttributes
Source§fn clone(&self) -> FieldAttributes
fn clone(&self) -> FieldAttributes
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 FieldAttributes
impl Debug for FieldAttributes
Source§impl<'de> Deserialize<'de> for FieldAttributes
impl<'de> Deserialize<'de> for FieldAttributes
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for FieldAttributes
impl PartialEq for FieldAttributes
Source§impl Serialize for FieldAttributes
impl Serialize for FieldAttributes
impl StructuralPartialEq for FieldAttributes
Auto Trait Implementations§
impl Freeze for FieldAttributes
impl RefUnwindSafe for FieldAttributes
impl Send for FieldAttributes
impl Sync for FieldAttributes
impl Unpin for FieldAttributes
impl UnwindSafe for FieldAttributes
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