pub struct EagerQuery<'a, T: Model> { /* private fields */ }Available on crate features
model-mysql or model-postgres or model-sqlite only.Expand description
A QueryBuilder with relations to load: from
QueryBuilder::with. Its fetch_* answer
Loaded models.
Implementations§
Source§impl<'a, T: Model + 'static> EagerQuery<'a, T>
impl<'a, T: Model + 'static> EagerQuery<'a, T>
Sourcepub fn with<R: Model + Clone + 'static>(self, relation: Relation<T, R>) -> Self
pub fn with<R: Model + Clone + 'static>(self, relation: Relation<T, R>) -> Self
Load relation too (once, however often it is named).
Sourcepub async fn fetch_all(self) -> Result<Vec<Loaded<T>>, DbError>
pub async fn fetch_all(self) -> Result<Vec<Loaded<T>>, DbError>
The query’s rows, each with its relations: one query for the rows, then one per relation.
Auto Trait Implementations§
impl<'a, T> !RefUnwindSafe for EagerQuery<'a, T>
impl<'a, T> !UnwindSafe for EagerQuery<'a, T>
impl<'a, T> Freeze for EagerQuery<'a, T>
impl<'a, T> Send for EagerQuery<'a, T>
impl<'a, T> Sync for EagerQuery<'a, T>
impl<'a, T> Unpin for EagerQuery<'a, T>
impl<'a, T> UnsafeUnpin for EagerQuery<'a, T>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more