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>

source

pub fn is_optional(self) -> bool

Is the field optional / nullable?

source

pub fn is_list(self) -> bool

Is the field a list?

source

pub fn is_unsupported(self) -> bool

Is the type of the field Unsupported("...")?

source

pub fn field_id(self) -> FieldId

The ID of the field node in the AST.

source

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

The name of the field.

source

pub fn database_name(self) -> &'db str

The final database name of the field. See crate docs for explanations on database names.

source

pub fn scalar_field_type(self) -> ScalarFieldType

The type of the field.

source

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

Convert the walker to a scalar field, if the underlying field is in a model.

source

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.

source

pub fn is_scalar_field(self) -> bool

True if the index field is a scalar field.

source

pub fn is_composite_field(self) -> bool

True if the index field is a composite field.

source

pub fn is_single_pk(self) -> bool

Does the field define a primary key by its own.

source

pub fn raw_native_type( self ) -> Option<(&'db str, &'db str, &'db [String], Span)>

(attribute scope, native type name, arguments, span)

For example: @db.Text would translate to (“db”, “Text”, &[], )

source

pub fn ast_field(self) -> &'db Field

The field node in the AST.

Trait Implementations§

source§

impl<'db> Clone for IndexFieldWalker<'db>

source§

fn clone(&self) -> IndexFieldWalker<'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> From<Walker<'db, (CompositeTypeId, FieldId)>> for IndexFieldWalker<'db>

source§

fn from(cf: CompositeTypeFieldWalker<'db>) -> Self

Converts to this type from the input type.
source§

impl<'db> From<Walker<'db, ScalarFieldId>> for IndexFieldWalker<'db>

source§

fn from(sf: ScalarFieldWalker<'db>) -> Self

Converts to this type from the input type.
source§

impl<'db> PartialEq for IndexFieldWalker<'db>

source§

fn eq(&self, other: &IndexFieldWalker<'db>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'db> Copy for IndexFieldWalker<'db>

source§

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> 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.