#[non_exhaustive]pub enum Annotation {
AutoCreateTime,
AutoUpdateTime,
AutoIncrement,
Choices(Vec<String>),
DefaultValue(DefaultValue),
Index(Option<IndexValue>),
MaxLength(i32),
NotNull,
PrimaryKey,
Unique,
ForeignKey(ForeignKey),
}Expand description
The subset of annotations which need to be communicated with the migration tool
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
AutoCreateTime
Only for DbType::Timestamp, DbType::DateTime, DbType::Time and DbType::Date. Will set the current time of the database when a row is created.
AutoUpdateTime
Only for DbType::Timestamp, DbType::DateTime, DbType::Time and DbType::Date. Will set the current time of the database when a row is updated.
AutoIncrement
AUTO_INCREMENT constraint
Choices(Vec<String>)
A list of choices to set
DefaultValue(DefaultValue)
DEFAULT constraint
Index(Option<IndexValue>)
Create an index. The optional IndexValue can be used, to build more complex indexes.
MaxLength(i32)
Only for VARCHAR, VARBINARY. Specifies the maximum length of the column’s content.
NotNull
NOT NULL constraint
PrimaryKey
The annotated column will be used as primary key
Unique
UNIQUE constraint
ForeignKey(ForeignKey)
Foreign Key constraint
Trait Implementations§
Source§impl Clone for Annotation
impl Clone for Annotation
Source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
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 moreSource§impl Debug for Annotation
impl Debug for Annotation
Source§impl<'de> Deserialize<'de> for Annotation
impl<'de> Deserialize<'de> for Annotation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Annotation
Source§impl Hash for Annotation
impl Hash for Annotation
Source§impl PartialEq for Annotation
impl PartialEq for Annotation
Source§fn eq(&self, other: &Annotation) -> bool
fn eq(&self, other: &Annotation) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for Annotation
impl Serialize for Annotation
impl StructuralPartialEq for Annotation
Auto Trait Implementations§
impl Freeze for Annotation
impl RefUnwindSafe for Annotation
impl Send for Annotation
impl Sync for Annotation
impl Unpin for Annotation
impl UnsafeUnpin for Annotation
impl UnwindSafe for Annotation
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