Struct query_structure::prelude::ModelProjection
source · 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
impl ModelProjection
pub fn new(fields: Vec<Field>) -> Self
pub fn new_from_scalar(fields: Vec<ScalarFieldRef>) -> Self
sourcepub fn names(&self) -> impl Iterator<Item = &str>
pub fn names(&self) -> impl Iterator<Item = &str>
Returns all field names (NOT database level column names!) of contained fields.
sourcepub fn db_names(&self) -> impl Iterator<Item = String> + '_
pub fn db_names(&self) -> impl Iterator<Item = String> + '_
Returns all database (e.g. column or field) names of contained fields.
sourcepub fn fields(&self) -> impl Iterator<Item = &Field>
pub fn fields(&self) -> impl Iterator<Item = &Field>
Returns an iterator over all fields contained in this projection.
sourcepub fn scalar_length(&self) -> usize
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.
sourcepub fn scalar_fields(&self) -> impl Iterator<Item = ScalarFieldRef> + '_
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.
pub fn map_db_name(&self, name: &str) -> Option<ScalarFieldRef>
pub fn type_identifiers_with_arities(&self) -> Vec<(TypeIdentifier, FieldArity)>
Trait Implementations§
source§impl Clone for ModelProjection
impl Clone for ModelProjection
source§fn clone(&self) -> ModelProjection
fn clone(&self) -> ModelProjection
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ModelProjection
impl Debug for ModelProjection
source§impl Default for ModelProjection
impl Default for ModelProjection
source§fn default() -> ModelProjection
fn default() -> ModelProjection
source§impl From<&FieldSelection> for ModelProjection
impl From<&FieldSelection> for ModelProjection
[Composites] todo: Temporary converter.
source§fn from(fs: &FieldSelection) -> Self
fn from(fs: &FieldSelection) -> Self
source§impl From<Field> for ModelProjection
impl From<Field> for ModelProjection
source§impl From<FieldSelection> for ModelProjection
impl From<FieldSelection> for ModelProjection
source§fn from(fs: FieldSelection) -> Self
fn from(fs: FieldSelection) -> Self
source§impl IntoIterator for ModelProjection
impl IntoIterator for ModelProjection
source§impl PartialEq for ModelProjection
impl PartialEq for ModelProjection
source§fn eq(&self, other: &ModelProjection) -> bool
fn eq(&self, other: &ModelProjection) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl ScalarCompare for ModelProjection
impl ScalarCompare for ModelProjection
source§fn is_in<T>(&self, values: T) -> Filterwhere
T: Into<ConditionListValue>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
fn greater_than_or_equals<T>(&self, val: T) -> Filterwhere T: Into<ConditionValue>,
Field is greater than or equals the given value.