pub struct IndexWalker<'db> { /* private fields */ }
Expand description

An index, unique or fulltext attribute.

Implementations§

source§

impl<'db> IndexWalker<'db>

source

pub fn mapped_name(self) -> Option<&'db str>

The mapped name of the index.

@@index([a, b], map: "theName")
                     ^^^^^^^^^
source

pub fn attribute_name(self) -> &'static str

The attribute name: "index" for @@unique, "fulltext" for @@fultext and "index" for @index and @@index.

source

pub fn attribute_id(self) -> AttributeId

The id of the index, if explicitly defined.

source

pub fn index_type(self) -> IndexType

The index type.

source

pub fn name(self) -> Option<&'db str>

The name argument of the index attribute. The client name.

@@index([a, b], name: "theName")
                     ^^^^^^^^^
source

pub fn algorithm(self) -> Option<IndexAlgorithm>

The index algorithm, if a specific one was specified for the index.

source

pub fn ast_attribute(self) -> &'db Attribute

The AST node of the index/unique attribute.

source

pub fn all_field_names(self) -> impl Iterator<Item = &'db str>

Iterate over all the names in all the paths in the fields argument.

For example, @@index([a, b.c.d]) would return an iterator over “a”, “b”, “c”, “d”.

source

pub fn fields(self) -> impl ExactSizeIterator<Item = IndexFieldWalker<'db>>

The scalar fields covered by the index.

source

pub fn scalar_field_attributes( self ) -> impl ExactSizeIterator<Item = ScalarFieldAttributeWalker<'db>>

The scalar fields covered by the index, and their arguments.

source

pub fn contains_field(self, field: ScalarFieldWalker<'db>) -> bool

True, if given field is a part of the indexed fields.

source

pub fn contains_exactly_the_fields( self, fields: impl ExactSizeIterator<Item = ScalarFieldAttributeWalker<'db>> ) -> bool

True if the field contains exactly the same fields in the same order, and with the same attributes.

source

pub fn is_defined_on_field(self) -> bool

Whether the index is defined on a single field (otherwise: on the model).

source

pub fn is_unique(self) -> bool

Is this an @@unique?

source

pub fn is_fulltext(self) -> bool

Is this a @@fulltext?

source

pub fn is_normal(self) -> bool

Is this an @@index?

source

pub fn clustered(self) -> Option<bool>

If true, the index defines the storage and ordering of the row. Mostly matters on SQL Server where one can change the clustering.

source

pub fn model(self) -> ModelWalker<'db>

The model the index is defined on.

source

pub fn source_field(self) -> Option<ScalarFieldWalker<'db>>

The field the model was defined on, if any.

Trait Implementations§

source§

impl<'db> Clone for IndexWalker<'db>

source§

fn clone(&self) -> IndexWalker<'db>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'db> Copy for IndexWalker<'db>

Auto Trait Implementations§

§

impl<'db> RefUnwindSafe for IndexWalker<'db>

§

impl<'db> Send for IndexWalker<'db>

§

impl<'db> Sync for IndexWalker<'db>

§

impl<'db> Unpin for IndexWalker<'db>

§

impl<'db> UnwindSafe for IndexWalker<'db>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.