pub struct IndexSchema {
pub name: &'static str,
pub columns: &'static [&'static str],
pub unique: bool,
}Expand description
Descriptor for one CREATE INDEX emitted by the migration writer.
Declared via:
#[rustango(index)]on a field → single-column non-unique index#[rustango(index("col1, col2"))]on the model container → composite index- Either form accepts
uniqueandnamesub-attributes.
Fields§
§name: &'static strIndex name used in CREATE INDEX "name" and DROP INDEX "name".
Auto-generated as {table}_{col}_idx when not supplied.
columns: &'static [&'static str]SQL column names included in the index, in order.
unique: booltrue for CREATE UNIQUE INDEX.
Trait Implementations§
Source§impl Clone for IndexSchema
impl Clone for IndexSchema
Source§fn clone(&self) -> IndexSchema
fn clone(&self) -> IndexSchema
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IndexSchema
impl Debug for IndexSchema
impl Copy for IndexSchema
Auto Trait Implementations§
impl Freeze for IndexSchema
impl RefUnwindSafe for IndexSchema
impl Send for IndexSchema
impl Sync for IndexSchema
impl Unpin for IndexSchema
impl UnsafeUnpin for IndexSchema
impl UnwindSafe for IndexSchema
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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