pub struct QuerySpec {
pub root: PredicateNode,
pub search: Option<SearchSpec>,
pub order_by: Option<OrderBy>,
pub limit: Option<usize>,
pub offset: Option<usize>,
pub count_only: bool,
}Fields§
§root: PredicateNode§search: Option<SearchSpec>§order_by: Option<OrderBy>§limit: Option<usize>§offset: Option<usize>§count_only: boolThe caller wants matched and the plan, not the page: QueryResult::keys comes back empty
and no page is ordered, so a binding has nothing to load records for. What the TS
QueryBuilder.count()/.explain() ask for.
Implementations§
Source§impl QuerySpec
impl QuerySpec
pub fn new(root: PredicateNode) -> Self
pub fn with_search(self, text: impl Into<String>, mode: SearchMode) -> Self
pub fn with_order_by( self, field: impl Into<String>, direction: SortDirection, ) -> Self
pub fn with_limit(self, limit: usize) -> Self
pub fn with_offset(self, offset: usize) -> Self
pub fn counting(self, count_only: bool) -> Self
Sourcepub fn unpaged(&self) -> Self
pub fn unpaged(&self) -> Self
The same spec with the page window dropped — what an aggregate runs, since limit/offset
name a window over the answer, not over the rows an aggregate folds. count_only is dropped
with it: an aggregate folds the matched keys one record at a time, so it needs them listed.
Trait Implementations§
impl StructuralPartialEq for QuerySpec
Auto Trait Implementations§
impl Freeze for QuerySpec
impl RefUnwindSafe for QuerySpec
impl Send for QuerySpec
impl Sync for QuerySpec
impl Unpin for QuerySpec
impl UnsafeUnpin for QuerySpec
impl UnwindSafe for QuerySpec
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