pub struct IndexDef {
pub name: String,
pub keys: Vec<IndexKey>,
pub unique: bool,
pub predicate_sql: Option<String>,
pub predicate_expr: Option<Expr>,
pub kind: IndexKind,
}Expand description
IndexKey::Column for CREATE INDEX ON t (email), IndexKey::Expr for LOWER(email).
Fields§
§name: String§keys: Vec<IndexKey>§unique: bool§predicate_sql: Option<String>§predicate_expr: Option<Expr>§kind: IndexKindImplementations§
Source§impl IndexDef
impl IndexDef
Sourcepub fn from_column_lists(
name: String,
columns: Vec<u16>,
collations: Vec<Collation>,
unique: bool,
predicate_sql: Option<String>,
predicate_expr: Option<Expr>,
kind: IndexKind,
) -> Self
pub fn from_column_lists( name: String, columns: Vec<u16>, collations: Vec<Collation>, unique: bool, predicate_sql: Option<String>, predicate_expr: Option<Expr>, kind: IndexKind, ) -> Self
Used by FK/UNIQUE auto-indexes; expression-key indexes go through a different path.
Sourcepub fn columns_vec(&self) -> Vec<u16>
pub fn columns_vec(&self) -> Vec<u16>
Expression keys are skipped (positions only come from IndexKey::Column).
Sourcepub fn collations_vec(&self) -> Vec<Collation>
pub fn collations_vec(&self) -> Vec<Collation>
Expression keys default to Binary.
pub fn column_positions_iter(&self) -> impl Iterator<Item = u16> + '_
pub fn collation_at(&self, i: usize) -> Collation
pub fn is_pure_column_index(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IndexDef
impl RefUnwindSafe for IndexDef
impl Send for IndexDef
impl Sync for IndexDef
impl Unpin for IndexDef
impl UnsafeUnpin for IndexDef
impl UnwindSafe for IndexDef
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