SQLIndex

Trait SQLIndex 

Source
pub trait SQLIndex<'a, Value: SQLParam + 'a>: ToSQL<'a, Value> {
    type Table: SQLTable<'a, Value>;

    // Required method
    fn name(&self) -> &'static str;

    // Provided method
    fn is_unique(&self) -> bool { ... }
}
Expand description

Trait for types that represent database indexes. Implemented by tuple structs like struct UserEmailIdx(User::email);

Required Associated Types§

Source

type Table: SQLTable<'a, Value>

The table type this index is associated with

Required Methods§

Source

fn name(&self) -> &'static str

The name of this index (for DROP INDEX statements)

Provided Methods§

Source

fn is_unique(&self) -> bool

Whether this is a unique index

Implementors§