pub struct FieldSpec {
pub name: String,
pub field_type: String,
pub pk: bool,
pub required: bool,
pub index: bool,
pub default: Option<String>,
pub validate: Option<ValidationRule>,
}
Expand description
Field specification for database columns
Fields§
§name: String
§field_type: String
§pk: bool
§required: bool
§index: bool
§default: Option<String>
§validate: Option<ValidationRule>
Implementations§
Source§impl FieldSpec
impl FieldSpec
Sourcepub fn is_primary_key(&self) -> bool
pub fn is_primary_key(&self) -> bool
Check if field is primary key
Sourcepub fn is_required(&self) -> bool
pub fn is_required(&self) -> bool
Check if field is required
Sourcepub fn is_indexed(&self) -> bool
pub fn is_indexed(&self) -> bool
Check if field is indexed
Sourcepub fn has_default(&self) -> bool
pub fn has_default(&self) -> bool
Check if field has a default value
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FieldSpec
impl<'de> Deserialize<'de> for FieldSpec
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
Auto Trait Implementations§
impl Freeze for FieldSpec
impl RefUnwindSafe for FieldSpec
impl Send for FieldSpec
impl Sync for FieldSpec
impl Unpin for FieldSpec
impl UnwindSafe for FieldSpec
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