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,
}Available on crate feature
std only.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],
) -> IndexDef
Available on crate features alloc or std only.
pub const fn new( schema: &'static str, table: &'static str, name: &'static str, columns: &'static [IndexColumnDef], ) -> IndexDef
alloc or std only.Create a new index definition
Sourcepub const fn unique(self) -> IndexDef
Available on crate features alloc or std only.
pub const fn unique(self) -> IndexDef
alloc or std only.Make this a unique index
Sourcepub const fn explicit_name(self) -> IndexDef
Available on crate features alloc or std only.
pub const fn explicit_name(self) -> IndexDef
alloc or std only.Mark the name as explicitly specified
Sourcepub const fn where_clause(self, clause: &'static str) -> IndexDef
Available on crate features alloc or std only.
pub const fn where_clause(self, clause: &'static str) -> IndexDef
alloc or std only.Set WHERE clause for partial index
Sourcepub const fn method(self, method: &'static str) -> IndexDef
Available on crate features alloc or std only.
pub const fn method(self, method: &'static str) -> IndexDef
alloc or std only.Set index method
Sourcepub const fn with(self, params: &'static str) -> IndexDef
Available on crate features alloc or std only.
pub const fn with(self, params: &'static str) -> IndexDef
alloc or std only.Set storage parameters (WITH clause)
Sourcepub const fn concurrently(self) -> IndexDef
Available on crate features alloc or std only.
pub const fn concurrently(self) -> IndexDef
alloc or std only.Set concurrently flag
Sourcepub fn into_index(self) -> Index
Available on crate features alloc or std only.
pub fn into_index(self) -> Index
alloc or std only.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 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