pub struct PrimaryKeyWalker<'db> { /* private fields */ }
Expand description

An @(@)id attribute in the schema.

Implementations§

source§

impl<'db> PrimaryKeyWalker<'db>

source

pub fn ast_attribute(self) -> &'db Attribute

The @(@)id AST node.

source

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

The mapped name of the id.

@@id([a, b], map: "theName")
                  ^^^^^^^^^
source

pub fn is_defined_on_field(self) -> bool

Is this an @id on a specific field, rather than on the model?

source

pub fn attribute_name(self) -> &'static str

If defined on a specific field, returns @id. Otherwise @@id.

source

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.

source

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

The model the id is deined on.

source

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

The name argument of the id attribute. The client name.

@@id([a, b], name: "theName")
                   ^^^^^^^^^
source

pub fn fields( self ) -> impl ExactSizeIterator<Item = ScalarFieldWalker<'db>> + Clone + 'db

The scalar fields constrained by the id.

source

pub fn scalar_field_attributes( self ) -> impl ExactSizeIterator<Item = ScalarFieldAttributeWalker<'db>> + 'db

The scalar fields covered by the id, and their arguments.

source

pub fn contains_exactly_fields( self, fields: impl ExactSizeIterator<Item = ScalarFieldWalker<'db>> ) -> bool

Do the constrained fields match exactly these?

Trait Implementations§

source§

impl<'db> Clone for PrimaryKeyWalker<'db>

source§

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

Auto Trait Implementations§

§

impl<'db> RefUnwindSafe for PrimaryKeyWalker<'db>

§

impl<'db> Send for PrimaryKeyWalker<'db>

§

impl<'db> Sync for PrimaryKeyWalker<'db>

§

impl<'db> Unpin for PrimaryKeyWalker<'db>

§

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