pub struct CheckConstraintDef {
pub table: &'static str,
pub name: &'static str,
pub value: &'static str,
}Available on crate feature
std only.Expand description
Const-friendly check constraint definition
§Examples
use drizzle_types::sqlite::ddl::CheckConstraintDef;
const CHECK: CheckConstraintDef = CheckConstraintDef::new("users", "ck_age")
.value("age >= 0");Fields§
§table: &'static strParent table name
name: &'static strConstraint name
value: &'static strCheck expression
Implementations§
Source§impl CheckConstraintDef
impl CheckConstraintDef
Sourcepub const fn new(table: &'static str, name: &'static str) -> CheckConstraintDef
Available on crate features alloc or std only.
pub const fn new(table: &'static str, name: &'static str) -> CheckConstraintDef
alloc or std only.Create a new check constraint definition
Sourcepub const fn value(self, expression: &'static str) -> CheckConstraintDef
Available on crate features alloc or std only.
pub const fn value(self, expression: &'static str) -> CheckConstraintDef
alloc or std only.Set the check expression
Sourcepub const fn into_check_constraint(self) -> CheckConstraint
Available on crate features alloc or std only.
pub const fn into_check_constraint(self) -> CheckConstraint
alloc or std only.Convert to runtime CheckConstraint type
Trait Implementations§
Source§impl Clone for CheckConstraintDef
impl Clone for CheckConstraintDef
Source§fn clone(&self) -> CheckConstraintDef
fn clone(&self) -> CheckConstraintDef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CheckConstraintDef
Source§impl Debug for CheckConstraintDef
impl Debug for CheckConstraintDef
Source§impl Default for CheckConstraintDef
impl Default for CheckConstraintDef
Source§fn default() -> CheckConstraintDef
fn default() -> CheckConstraintDef
Returns the “default value” for a type. Read more
impl Eq for CheckConstraintDef
Source§impl From<CheckConstraintDef> for CheckConstraint
impl From<CheckConstraintDef> for CheckConstraint
Source§fn from(def: CheckConstraintDef) -> CheckConstraint
fn from(def: CheckConstraintDef) -> CheckConstraint
Converts to this type from the input type.
Source§impl Hash for CheckConstraintDef
impl Hash for CheckConstraintDef
Source§impl PartialEq for CheckConstraintDef
impl PartialEq for CheckConstraintDef
impl StructuralPartialEq for CheckConstraintDef
Auto Trait Implementations§
impl Freeze for CheckConstraintDef
impl RefUnwindSafe for CheckConstraintDef
impl Send for CheckConstraintDef
impl Sync for CheckConstraintDef
impl Unpin for CheckConstraintDef
impl UnsafeUnpin for CheckConstraintDef
impl UnwindSafe for CheckConstraintDef
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