pub struct IncludeSpec {
pub relation_name: String,
pub filter: Option<Filter>,
pub order_by: Option<OrderBy>,
pub pagination: Option<Pagination>,
pub nested: HashMap<String, IncludeSpec>,
pub include_count: bool,
}Expand description
Specification for including a relation in a query.
Fields§
§relation_name: StringName of the relation to include.
filter: Option<Filter>Filter to apply to the related records.
order_by: Option<OrderBy>Ordering for the related records.
pagination: Option<Pagination>Pagination for the related records.
nested: HashMap<String, IncludeSpec>Nested includes.
include_count: boolWhether to include the count of related records.
Implementations§
Source§impl IncludeSpec
impl IncludeSpec
Sourcepub fn order_by(self, order: impl Into<OrderBy>) -> Self
pub fn order_by(self, order: impl Into<OrderBy>) -> Self
Set ordering for the included relation.
Sourcepub fn include(self, nested: IncludeSpec) -> Self
pub fn include(self, nested: IncludeSpec) -> Self
Include a nested relation.
Sourcepub fn with_count(self) -> Self
pub fn with_count(self) -> Self
Include the count of related records.
Sourcepub fn has_nested(&self) -> bool
pub fn has_nested(&self) -> bool
Check if there are nested includes.
Sourcepub fn nested_specs(&self) -> impl Iterator<Item = &IncludeSpec>
pub fn nested_specs(&self) -> impl Iterator<Item = &IncludeSpec>
Get all nested include specs.
Trait Implementations§
Source§impl Clone for IncludeSpec
impl Clone for IncludeSpec
Source§fn clone(&self) -> IncludeSpec
fn clone(&self) -> IncludeSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IncludeSpec
impl Debug for IncludeSpec
Source§impl From<IncludeSpec> for Include
impl From<IncludeSpec> for Include
Source§fn from(spec: IncludeSpec) -> Self
fn from(spec: IncludeSpec) -> Self
Converts to this type from the input type.
Source§impl FromIterator<IncludeSpec> for Include
impl FromIterator<IncludeSpec> for Include
Source§fn from_iter<T: IntoIterator<Item = IncludeSpec>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = IncludeSpec>>(iter: T) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl Freeze for IncludeSpec
impl RefUnwindSafe for IncludeSpec
impl Send for IncludeSpec
impl Sync for IncludeSpec
impl Unpin for IncludeSpec
impl UnwindSafe for IncludeSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more