pub struct Column { /* private fields */ }Implementations§
Source§impl Column
impl Column
pub fn new<S: Into<String>>( schema_name: Option<S>, name: S, column_type: ColumnType, length: i32, scale: i32, required: bool, ) -> Self
pub fn new_all<S: Into<String>>( schema_name: Option<S>, name: S, column_type: ColumnType, length: i32, scale: i32, required: bool, check_constraint: Option<String>, default_constraint: Option<String>, generated: Option<String>, min_value: Option<String>, max_value: Option<String>, enum_type: Option<String>, element_type: Option<String>, ) -> Self
pub fn schema_name(&self) -> Option<&str>
pub fn name(&self) -> &str
pub fn column_type(&self) -> ColumnType
pub fn length(&self) -> i32
pub fn scale(&self) -> i32
pub fn required(&self) -> bool
pub fn is_required(&self) -> bool
Sourcepub fn with_database_checks(
self,
database_checks: HashMap<DatabaseType, String>,
) -> Self
pub fn with_database_checks( self, database_checks: HashMap<DatabaseType, String>, ) -> Self
Replaces the checks that apply to a single database (see check_constraint_for).
Sourcepub fn check_constraint(&self) -> Option<&str>
pub fn check_constraint(&self) -> Option<&str>
The generic check: the one used for any database that has no check of its own.
See check_constraint_for for the check that applies to a given database.
Sourcepub fn check_constraint_for(&self, database_type: DatabaseType) -> Option<&str>
pub fn check_constraint_for(&self, database_type: DatabaseType) -> Option<&str>
The check that applies to database_type: the one declared for that database if there
is one, otherwise the generic check.
Sourcepub fn database_checks(&self) -> &HashMap<DatabaseType, String>
pub fn database_checks(&self) -> &HashMap<DatabaseType, String>
The checks that apply to a single database and override the generic check.
pub fn default_constraint(&self) -> Option<&str>
pub fn generated(&self) -> Option<&str>
pub fn min_value(&self) -> Option<&str>
pub fn max_value(&self) -> Option<&str>
pub fn enum_type(&self) -> Option<&str>
pub fn element_type(&self) -> Option<&str>
pub fn has_min_or_max_value(&self) -> bool
pub fn needs_check_constraints(&self, boolean_mode: BooleanMode) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Column
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnsafeUnpin for Column
impl UnwindSafe for Column
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