pub struct IndexDef {
pub schema: &'static str,
pub table: &'static str,
pub name: &'static str,
pub name_explicit: bool,
pub columns: &'static [IndexColumnDef],
pub is_unique: bool,
pub where_clause: Option<&'static str>,
pub method: Option<&'static str>,
pub with: Option<&'static str>,
pub concurrently: bool,
}Expand description
Const-friendly index definition
Fields§
§schema: &'static strSchema name
table: &'static strParent table name
name: &'static strIndex name
name_explicit: boolWhether the index name was explicitly specified
columns: &'static [IndexColumnDef]Columns included in the index
is_unique: boolIs this a unique index?
where_clause: Option<&'static str>WHERE clause for partial indexes
method: Option<&'static str>Index method (btree, hash, etc.)
with: Option<&'static str>Storage parameters (WITH clause)
concurrently: boolCreate concurrently?
Implementations§
Source§impl IndexDef
impl IndexDef
Sourcepub const fn new(
schema: &'static str,
table: &'static str,
name: &'static str,
columns: &'static [IndexColumnDef],
) -> Self
pub const fn new( schema: &'static str, table: &'static str, name: &'static str, columns: &'static [IndexColumnDef], ) -> Self
Create a new index definition
Sourcepub const fn explicit_name(self) -> Self
pub const fn explicit_name(self) -> Self
Mark the name as explicitly specified
Sourcepub const fn where_clause(self, clause: &'static str) -> Self
pub const fn where_clause(self, clause: &'static str) -> Self
Set WHERE clause for partial index
Sourcepub const fn concurrently(self) -> Self
pub const fn concurrently(self) -> Self
Set concurrently flag
Sourcepub fn into_index(self) -> Index
pub fn into_index(self) -> Index
Convert to runtime Index type
Trait Implementations§
impl Copy for IndexDef
impl Eq for IndexDef
impl StructuralPartialEq for IndexDef
Auto Trait Implementations§
impl Freeze for IndexDef
impl RefUnwindSafe for IndexDef
impl Send for IndexDef
impl Sync for IndexDef
impl Unpin 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