pub struct AsyncQuery<T> { /* private fields */ }async only.Expand description
Async-facing query builder. See crate::Query for the surface
semantics; this wrapper only changes the terminal methods to
async fn and adds Send to every stored closure.
Implementations§
Source§impl<T> AsyncQuery<T>
impl<T> AsyncQuery<T>
Sourcepub fn filter<F>(self, predicate: F) -> Self
pub fn filter<F>(self, predicate: F) -> Self
Append a filter predicate. Async sibling of
crate::Query::filter — adds a Send bound so the closure
can ride the blocking-task hop.
Sourcepub fn limit(self, n: usize) -> Self
pub fn limit(self, n: usize) -> Self
Cap the result set at n. See crate::Query::limit.
Sourcepub fn index_range<R>(self, name: &str, range: R) -> Selfwhere
R: RangeBounds<Dynamic>,
pub fn index_range<R>(self, name: &str, range: R) -> Selfwhere
R: RangeBounds<Dynamic>,
Switch the source to a named index’s range. See
crate::Query::index_range.
§Errors
As crate::Query::index_range — note that the underlying
encoder fires at fetch / count time rather than here,
because the async builder stores the structured Dynamic
bounds and forwards them onto the blocking Query inside the
blocking task.
Sourcepub fn sort_by<F>(self, key: F) -> Self
pub fn sort_by<F>(self, key: F) -> Self
Sort the result by key’s output. See crate::Query::sort_by.
Adds a Send bound to the closure so it can ride the
blocking-task hop.
Sourcepub fn sort_by_bytes<F>(self, key: F) -> Self
pub fn sort_by_bytes<F>(self, key: F) -> Self
Sort by raw bytes. See crate::Query::sort_by_bytes.
Sourcepub fn sort_buffer_limit(self, n: usize) -> Self
pub fn sort_buffer_limit(self, n: usize) -> Self
Override the per-query sort-buffer ceiling. See
crate::Query::sort_buffer_limit.
Sourcepub async fn count(self) -> Result<u64>
pub async fn count(self) -> Result<u64>
Count matching documents. See crate::Query::count.
Takes self by value rather than by reference because the
async-builder’s stored closures are !Sync in the general
case; consuming the builder avoids cloning the closures and
keeps the surface honest about ownership.