pub struct Field {
pub name: String,
pub field_type: FieldType,
pub auto_generate: bool,
pub unique: bool,
pub indexed: bool,
pub constraints: Vec<Constraint>,
pub index_type: IndexType,
pub is_computed: bool,
pub fulltext_indexed: bool,
pub is_materialized: bool,
pub position: Option<Position>,
}Fields§
§name: String§field_type: FieldType§auto_generate: bool§unique: bool§indexed: bool§constraints: Vec<Constraint>§index_type: IndexType§is_computed: bool§fulltext_indexed: bool§is_materialized: bool§position: Option<Position>Source position of the field name (1-based line/column). None when the
node is synthesized rather than parsed (e.g. test fixtures, migrations).
Implementations§
Source§impl Field
impl Field
Sourcepub fn has_constraint(&self, name: &str) -> bool
pub fn has_constraint(&self, name: &str) -> bool
Check if field has a specific constraint
Sourcepub fn get_constraint(&self, name: &str) -> Option<&Constraint>
pub fn get_constraint(&self, name: &str) -> Option<&Constraint>
Get a constraint by name
Sourcepub fn is_nullable(&self) -> bool
pub fn is_nullable(&self) -> bool
Check if field is nullable (optional references, optional structs, and nullable primitives)
Trait Implementations§
impl StructuralPartialEq for Field
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnsafeUnpin for Field
impl UnwindSafe for Field
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