Enum parser_database::walkers::IndexFieldWalker
source · pub enum IndexFieldWalker<'db> {
Scalar(ScalarFieldWalker<'db>),
Composite(CompositeTypeFieldWalker<'db>),
}
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(ScalarFieldWalker<'db>)
A field on a model.
Composite(CompositeTypeFieldWalker<'db>)
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<ScalarFieldWalker<'db>>
pub fn as_scalar_field(self) -> Option<ScalarFieldWalker<'db>>
Convert the walker to a scalar field, if the underlying field is in a model.
sourcepub fn as_composite_field(self) -> Option<CompositeTypeFieldWalker<'db>>
pub fn as_composite_field(self) -> Option<CompositeTypeFieldWalker<'db>>
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: CompositeTypeFieldWalker<'db>) -> Self
fn from(cf: CompositeTypeFieldWalker<'db>) -> Self
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: ScalarFieldWalker<'db>) -> Self
fn from(sf: ScalarFieldWalker<'db>) -> Self
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 ==
.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