pub struct IndexInfo {
pub name: String,
pub columns: Vec<String>,
pub is_unique: bool,
pub index_type: QueryIndexType,
}Expand description
Information about an index.
Fields§
§name: StringIndex name.
columns: Vec<String>Column names in the index.
is_unique: boolWhether this is a unique index.
index_type: QueryIndexTypeIndex type (BTree or GIN).
Implementations§
Source§impl IndexInfo
impl IndexInfo
Sourcepub fn new(
name: impl Into<String>,
columns: Vec<String>,
is_unique: bool,
) -> Self
pub fn new( name: impl Into<String>, columns: Vec<String>, is_unique: bool, ) -> Self
Creates a new index info with default BTree type.
Sourcepub fn new_gin(name: impl Into<String>, columns: Vec<String>) -> Self
pub fn new_gin(name: impl Into<String>, columns: Vec<String>) -> Self
Creates a new GIN index info.
Sourcepub fn with_type(self, index_type: QueryIndexType) -> Self
pub fn with_type(self, index_type: QueryIndexType) -> Self
Sets the index type.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IndexInfo
impl RefUnwindSafe for IndexInfo
impl Send for IndexInfo
impl Sync for IndexInfo
impl Unpin for IndexInfo
impl UnwindSafe for IndexInfo
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