#[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

Implementations

Alternative shallow equals function.

Returns true on:

use rorm_declaration::imr::Annotation;

assert!(Annotation::MaxLength(0).eq_shallow(&Annotation::MaxLength(255)));

Alternative shallow hash function.

Returns true on:

use rorm_declaration::imr::Annotation;

assert_eq!(Annotation::MaxLength(0).hash_shallow(), Annotation::MaxLength(255).hash_shallow());

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.