Enum query_structure::walkers::IndexFieldWalker
source · pub enum IndexFieldWalker<'db> {
Scalar(Walker<'db, ScalarFieldId>),
Composite(Walker<'db, (CompositeTypeId, FieldId)>),
}
Expand description
A field in an index definition. It can point to a scalar field in the current model, or through embedding a field in a composite type.
Variants§
Scalar(Walker<'db, ScalarFieldId>)
A field on a model.
Composite(Walker<'db, (CompositeTypeId, FieldId)>)
The path to a field in a composite type.
Implementations§
source§impl<'db> IndexFieldWalker<'db>
impl<'db> IndexFieldWalker<'db>
sourcepub fn is_optional(self) -> bool
pub fn is_optional(self) -> bool
Is the field optional / nullable?
sourcepub fn is_unsupported(self) -> bool
pub fn is_unsupported(self) -> bool
Is the type of the field Unsupported("...")
?
sourcepub fn database_name(self) -> &'db str
pub fn database_name(self) -> &'db str
The final database name of the field. See crate docs for explanations on database names.
sourcepub fn scalar_field_type(self) -> ScalarFieldType
pub fn scalar_field_type(self) -> ScalarFieldType
The type of the field.
sourcepub fn as_scalar_field(self) -> Option<Walker<'db, ScalarFieldId>>
pub fn as_scalar_field(self) -> Option<Walker<'db, ScalarFieldId>>
Convert the walker to a scalar field, if the underlying field is in a model.
sourcepub fn as_composite_field(
self
) -> Option<Walker<'db, (CompositeTypeId, FieldId)>>
pub fn as_composite_field( self ) -> Option<Walker<'db, (CompositeTypeId, FieldId)>>
Convert the walker to a composite field, if the underlying field is in a composite type.
sourcepub fn is_scalar_field(self) -> bool
pub fn is_scalar_field(self) -> bool
True if the index field is a scalar field.
sourcepub fn is_composite_field(self) -> bool
pub fn is_composite_field(self) -> bool
True if the index field is a composite field.
sourcepub fn is_single_pk(self) -> bool
pub fn is_single_pk(self) -> bool
Does the field define a primary key by its own.
Trait Implementations§
source§impl<'db> Clone for IndexFieldWalker<'db>
impl<'db> Clone for IndexFieldWalker<'db>
source§fn clone(&self) -> IndexFieldWalker<'db>
fn clone(&self) -> IndexFieldWalker<'db>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'db> From<Walker<'db, (CompositeTypeId, FieldId)>> for IndexFieldWalker<'db>
impl<'db> From<Walker<'db, (CompositeTypeId, FieldId)>> for IndexFieldWalker<'db>
source§fn from(cf: Walker<'db, (CompositeTypeId, FieldId)>) -> IndexFieldWalker<'db>
fn from(cf: Walker<'db, (CompositeTypeId, FieldId)>) -> IndexFieldWalker<'db>
Converts to this type from the input type.
source§impl<'db> From<Walker<'db, ScalarFieldId>> for IndexFieldWalker<'db>
impl<'db> From<Walker<'db, ScalarFieldId>> for IndexFieldWalker<'db>
source§fn from(sf: Walker<'db, ScalarFieldId>) -> IndexFieldWalker<'db>
fn from(sf: Walker<'db, ScalarFieldId>) -> IndexFieldWalker<'db>
Converts to this type from the input type.
source§impl<'db> PartialEq for IndexFieldWalker<'db>
impl<'db> PartialEq for IndexFieldWalker<'db>
source§fn eq(&self, other: &IndexFieldWalker<'db>) -> bool
fn eq(&self, other: &IndexFieldWalker<'db>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl ScalarFieldWalkerExt for IndexFieldWalker<'_>
impl ScalarFieldWalkerExt for IndexFieldWalker<'_>
source§fn native_type_instance(
&self,
connector: &dyn Connector
) -> Option<NativeTypeInstance>
fn native_type_instance( &self, connector: &dyn Connector ) -> Option<NativeTypeInstance>
This will return None when: Read more
impl<'db> Copy for IndexFieldWalker<'db>
impl<'db> StructuralPartialEq for IndexFieldWalker<'db>
Auto Trait Implementations§
impl<'db> RefUnwindSafe for IndexFieldWalker<'db>
impl<'db> Send for IndexFieldWalker<'db>
impl<'db> Sync for IndexFieldWalker<'db>
impl<'db> Unpin for IndexFieldWalker<'db>
impl<'db> UnwindSafe for IndexFieldWalker<'db>
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