pub struct ModelProjection { /* private fields */ }
Expand description

Projection of a Model. A projection is a (sub)set of fields of a model. There can only ever be fields of one model contained in a particular ModelProjection

Implementations§

source§

impl ModelProjection

source

pub fn new(fields: Vec<Field>) -> Self

source

pub fn new_from_scalar(fields: Vec<ScalarFieldRef>) -> Self

source

pub fn names(&self) -> impl Iterator<Item = &str>

Returns all field names (NOT database level column names!) of contained fields.

source

pub fn db_names(&self) -> impl Iterator<Item = String> + '_

Returns all database (e.g. column or field) names of contained fields.

source

pub fn fields(&self) -> impl Iterator<Item = &Field>

Returns an iterator over all fields contained in this projection.

source

pub fn scalar_length(&self) -> usize

Returns the length of scalar fields contained in this projection, e.g. the actual number of SQL columns or document fields for this model projection.

source

pub fn scalar_fields(&self) -> impl Iterator<Item = ScalarFieldRef> + '_

Returns an iterator over all scalar fields represented by this model projection, in order. Resolves relation fields to all backing scalar fields, if existing.

source

pub fn map_db_name(&self, name: &str) -> Option<ScalarFieldRef>

source

pub fn type_identifiers_with_arities(&self) -> Vec<(TypeIdentifier, FieldArity)>

Trait Implementations§

source§

impl Clone for ModelProjection

source§

fn clone(&self) -> ModelProjection

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 Debug for ModelProjection

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ModelProjection

source§

fn default() -> ModelProjection

Returns the “default value” for a type. Read more
source§

impl From<&FieldSelection> for ModelProjection

[Composites] todo: Temporary converter.

source§

fn from(fs: &FieldSelection) -> Self

Converts to this type from the input type.
source§

impl From<Field> for ModelProjection

source§

fn from(f: Field) -> Self

Converts to this type from the input type.
source§

impl From<FieldSelection> for ModelProjection

source§

fn from(fs: FieldSelection) -> Self

Converts to this type from the input type.
source§

impl IntoIterator for ModelProjection

§

type Item = Field

The type of the elements being iterated over.
§

type IntoIter = IntoIter<<ModelProjection as IntoIterator>::Item>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl PartialEq for ModelProjection

source§

fn eq(&self, other: &ModelProjection) -> 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 ScalarCompare for ModelProjection

source§

fn is_in<T>(&self, values: T) -> Filterwhere T: Into<ConditionListValue>,

Field is in a given value

source§

fn not_in<T>(&self, values: T) -> Filterwhere T: Into<ConditionListValue>,

Field is not in a given value

source§

fn equals<T>(&self, val: T) -> Filterwhere T: Into<ConditionValue>,

Field equals the given value.

source§

fn not_equals<T>(&self, val: T) -> Filterwhere T: Into<ConditionValue>,

Field does not equal the given value.

source§

fn contains<T>(&self, val: T) -> Filterwhere T: Into<ConditionValue>,

Field contains the given value.

source§

fn not_contains<T>(&self, val: T) -> Filterwhere T: Into<ConditionValue>,

Field does not contain the given value.

source§

fn starts_with<T>(&self, val: T) -> Filterwhere T: Into<ConditionValue>,

Field starts with the given value.

source§

fn not_starts_with<T>(&self, val: T) -> Filterwhere T: Into<ConditionValue>,

Field does not start with the given value.

source§

fn ends_with<T>(&self, val: T) -> Filterwhere T: Into<ConditionValue>,

Field ends with the given value.

source§

fn not_ends_with<T>(&self, val: T) -> Filterwhere T: Into<ConditionValue>,

Field does not end with the given value.

source§

fn less_than<T>(&self, val: T) -> Filterwhere T: Into<ConditionValue>,

Field is less than the given value.

source§

fn less_than_or_equals<T>(&self, val: T) -> Filterwhere T: Into<ConditionValue>,

Field is less than or equals the given value.

source§

fn greater_than<T>(&self, val: T) -> Filterwhere T: Into<ConditionValue>,

Field is greater than the given value.

source§

fn greater_than_or_equals<T>(&self, val: T) -> Filterwhere T: Into<ConditionValue>,

Field is greater than or equals the given value.

source§

fn search<T>(&self, val: T) -> Filterwhere T: Into<ConditionValue>,

source§

fn is_set(&self, val: bool) -> Filter

source§

impl StructuralPartialEq for ModelProjection

Auto Trait Implementations§

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> Same for T

§

type Output = T

Should always be Self
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.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V