pub struct Index {
pub unique: bool,
pub using: Option<Using>,
pub default_opclass: Option<OpClass>,
pub with: Option<With>,
/* private fields */
}Expand description
Can appear on columns, scalars, and tables.
Indexed with the same name are merged, if one index is marked as unique, and other isn’t - raises a validation error.
Fields§
§unique: bool§using: Option<Using>§default_opclass: Option<OpClass>§with: Option<With>Implementations§
Source§impl Index
impl Index
pub fn new( name: Option<DbIdent<IndexKind>>, unique: bool, fields: Vec<(ColumnIdent, Option<OpClass>)>, using: Option<Using>, default_opclass: Option<OpClass>, with: Option<With>, ) -> Self
pub fn propagate_to_table(self, column: ColumnIdent) -> Self
pub fn fields(&self) -> &[(ColumnIdent, Option<OpClass>)]
pub fn field_idents(&self) -> impl IntoIterator<Item = ColumnIdent> + '_
pub fn clone_for_propagate(&self) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnwindSafe for Index
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more