pub struct InlineRelationWalker<'db>(/* private fields */);
Expand description

An explicitly defined 1:1 or 1:n relation. The walker has the referencing side defined, but might miss the back relation in the AST.

Implementations§

source§

impl<'db> InlineRelationWalker<'db>

source

pub fn is_one_to_one(self) -> bool

The relation is 1:1, having at most one record on both sides of the relation.

source

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

The model which holds the relation arguments.

source

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

The model referenced and which hold the back-relation field.

source

pub fn as_complete(self) -> Option<CompleteInlineRelationWalker<'db>>

If the relation is defined from both sides, convert to an explicit relation walker.

source

pub fn referencing_fields( self ) -> Option<impl ExactSizeIterator<Item = ScalarFieldWalker<'db>>>

The referencing fields, from the forward relation field.

source

pub fn referenced_fields( self ) -> Box<dyn Iterator<Item = ScalarFieldWalker<'db>> + 'db>

The referenced fields. Inferred or specified.

source

pub fn forward_relation_field(self) -> Option<RelationFieldWalker<'db>>

The forward relation field (the relation field on model A, the referencing model).

source

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

The contents of the map: ... argument of the @relation attribute.

source

pub fn back_relation_field(self) -> Option<RelationFieldWalker<'db>>

The back relation field, or virtual relation field (on model B, the referenced model).

source

pub fn relation_id(self) -> RelationId

The unique identifier of the relation.

source

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

The relation name in the schema.

myField OtherModel @relation("thisModelToOtherModel", fields: [fkfield], references: [id])
//                           ^^^^^^^^^^^^^^^^^^^^^^^
source

pub fn relation_name(self) -> RelationName<'db>

The name of the relation. Either uses the name (or default) argument, or generates an implicit name.

Trait Implementations§

source§

impl<'db> Clone for InlineRelationWalker<'db>

source§

fn clone(&self) -> InlineRelationWalker<'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 InlineRelationWalker<'db>

Auto Trait Implementations§

§

impl<'db> RefUnwindSafe for InlineRelationWalker<'db>

§

impl<'db> Send for InlineRelationWalker<'db>

§

impl<'db> Sync for InlineRelationWalker<'db>

§

impl<'db> Unpin for InlineRelationWalker<'db>

§

impl<'db> UnwindSafe for InlineRelationWalker<'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.