Struct query_structure::walkers::IndexWalker
source · pub struct IndexWalker<'db> { /* private fields */ }
Expand description
An index, unique or fulltext attribute.
Implementations§
source§impl<'db> IndexWalker<'db>
impl<'db> IndexWalker<'db>
sourcepub fn mapped_name(self) -> Option<&'db str>
pub fn mapped_name(self) -> Option<&'db str>
The mapped name of the index.
@@index([a, b], map: "theName")
^^^^^^^^^
sourcepub fn attribute_name(self) -> &'static str
pub fn attribute_name(self) -> &'static str
The attribute name: "index"
for @@unique
, "fulltext"
for @@fultext
and "index"
for @index
and @@index
.
sourcepub fn attribute_id(self) -> AttributeId
pub fn attribute_id(self) -> AttributeId
The id of the index, if explicitly defined.
sourcepub fn index_type(self) -> IndexType
pub fn index_type(self) -> IndexType
The index type.
sourcepub fn name(self) -> Option<&'db str>
pub fn name(self) -> Option<&'db str>
The name
argument of the index attribute. The client name.
@@index([a, b], name: "theName")
^^^^^^^^^
sourcepub fn algorithm(self) -> Option<IndexAlgorithm>
pub fn algorithm(self) -> Option<IndexAlgorithm>
The index algorithm, if a specific one was specified for the index.
sourcepub fn ast_attribute(self) -> &'db Attribute
pub fn ast_attribute(self) -> &'db Attribute
The AST node of the index/unique attribute.
sourcepub fn all_field_names(self) -> impl Iterator<Item = &'db str>
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”.
sourcepub fn fields(self) -> impl ExactSizeIterator
pub fn fields(self) -> impl ExactSizeIterator
The scalar fields covered by the index.
sourcepub fn scalar_field_attributes(self) -> impl ExactSizeIterator
pub fn scalar_field_attributes(self) -> impl ExactSizeIterator
The scalar fields covered by the index, and their arguments.
sourcepub fn contains_field(self, field: Walker<'db, ScalarFieldId>) -> bool
pub fn contains_field(self, field: Walker<'db, ScalarFieldId>) -> bool
True, if given field is a part of the indexed fields.
sourcepub fn contains_exactly_the_fields(
self,
fields: impl ExactSizeIterator<Item = ScalarFieldAttributeWalker<'db>>
) -> bool
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.
sourcepub fn is_defined_on_field(self) -> bool
pub fn is_defined_on_field(self) -> bool
Whether the index is defined on a single field (otherwise: on the model).
sourcepub fn is_fulltext(self) -> bool
pub fn is_fulltext(self) -> bool
Is this a @@fulltext
?
sourcepub fn clustered(self) -> Option<bool>
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.
sourcepub fn source_field(self) -> Option<Walker<'db, ScalarFieldId>>
pub fn source_field(self) -> Option<Walker<'db, ScalarFieldId>>
The field the model was defined on, if any.
Trait Implementations§
source§impl<'db> Clone for IndexWalker<'db>
impl<'db> Clone for IndexWalker<'db>
source§fn clone(&self) -> IndexWalker<'db>
fn clone(&self) -> IndexWalker<'db>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more