pub struct GeneratedDef {
pub expression: &'static str,
pub gen_type: GeneratedType,
}Expand description
The GENERATED ALWAYS AS (...) part of a ColumnDef.
Fields§
§expression: &'static strSQL expression for generation
gen_type: GeneratedTypeGeneration type: stored or virtual
Implementations§
Source§impl GeneratedDef
impl GeneratedDef
Sourcepub const fn stored(expression: &'static str) -> Self
pub const fn stored(expression: &'static str) -> Self
Creates a STORED generated column from a SQL expression.
Sourcepub const fn virtual_col(expression: &'static str) -> Self
pub const fn virtual_col(expression: &'static str) -> Self
Creates a VIRTUAL generated column from a SQL expression.
Sourcepub const fn into_generated(self) -> Generated
pub const fn into_generated(self) -> Generated
Converts to the runtime Generated.
Trait Implementations§
Source§impl Clone for GeneratedDef
impl Clone for GeneratedDef
impl Copy for GeneratedDef
Source§impl Debug for GeneratedDef
impl Debug for GeneratedDef
impl Eq for GeneratedDef
Source§impl Hash for GeneratedDef
impl Hash for GeneratedDef
Source§impl PartialEq for GeneratedDef
impl PartialEq for GeneratedDef
impl StructuralPartialEq for GeneratedDef
Auto Trait Implementations§
impl Freeze for GeneratedDef
impl RefUnwindSafe for GeneratedDef
impl Send for GeneratedDef
impl Sync for GeneratedDef
impl Unpin for GeneratedDef
impl UnsafeUnpin for GeneratedDef
impl UnwindSafe for GeneratedDef
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