pub struct ColumnDef {
pub name: &'static str,
pub ty: ColumnType,
pub nullable: bool,
pub primary_key: bool,
pub unique: bool,
pub index: bool,
pub default: Option<DefaultValue>,
pub references: Option<Reference>,
pub input: bool,
pub returned: bool,
pub owner: &'static str,
}Expand description
One column. Built with const fns so Fields and Model impls can return &'static [ColumnDef].
Fields§
§name: &'static str§ty: ColumnType§nullable: bool§primary_key: bool§unique: bool§index: bool§default: Option<DefaultValue>§references: Option<Reference>§input: boolClients may set it through sign-up and update-user bodies.
returned: boolSerialized to clients.
owner: &'static strThe plugin id, "core" or "app". Filled in when the column joins the schema.
Implementations§
Source§impl ColumnDef
impl ColumnDef
pub const fn new(name: &'static str, ty: ColumnType) -> Self
pub const fn primary_key(self) -> Self
pub const fn nullable(self) -> Self
pub const fn unique(self) -> Self
pub const fn index(self) -> Self
pub const fn default(self, value: DefaultValue) -> Self
pub const fn references( self, table: &'static str, column: &'static str, on_delete: OnDelete, ) -> Self
pub const fn input(self) -> Self
Trait Implementations§
impl Copy for ColumnDef
impl Eq for ColumnDef
impl StructuralPartialEq for ColumnDef
Auto Trait Implementations§
impl Forget for ColumnDef
impl Freeze for ColumnDef
impl Move for ColumnDef
impl RefUnwindSafe for ColumnDef
impl Send for ColumnDef
impl Sync for ColumnDef
impl Unpin for ColumnDef
impl UnsafeUnpin for ColumnDef
impl UnwindSafe for ColumnDef
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