pub struct Query<Record> { /* private fields */ }Expand description
A type-checked local collection query.
Implementations§
Source§impl<Record: IrohRecord> Query<Record>
impl<Record: IrohRecord> Query<Record>
Sourcepub fn filter(self, filter: impl Into<Predicate<Record>>) -> Self
pub fn filter(self, filter: impl Into<Predicate<Record>>) -> Self
Adds an equality predicate. V1 accepts one predicate per query.
Sourcepub fn order_by<Value>(
self,
field: TypedField<Record, Value>,
direction: OrderDirection,
) -> Self
pub fn order_by<Value>( self, field: TypedField<Record, Value>, direction: OrderDirection, ) -> Self
Sets the primary typed ordering clause, replacing any earlier ordering.
Sourcepub fn then_by<Value>(
self,
field: TypedField<Record, Value>,
direction: OrderDirection,
) -> Self
pub fn then_by<Value>( self, field: TypedField<Record, Value>, direction: OrderDirection, ) -> Self
Adds a typed tie-breaking clause after all existing ordering clauses.
Sourcepub fn after(self, cursor: Cursor) -> Self
pub fn after(self, cursor: Cursor) -> Self
Continues after a cursor produced by the exact same query shape.
Sourcepub async fn fetch(self) -> Result<Vec<Record>, DbError>
pub async fn fetch(self) -> Result<Vec<Record>, DbError>
Executes against one local redb read snapshot.
Sourcepub async fn fetch_page(self) -> Result<Page<Record>, DbError>
pub async fn fetch_page(self) -> Result<Page<Record>, DbError>
Executes a stable page against one local redb read snapshot.
Auto Trait Implementations§
impl<Record> Freeze for Query<Record>
impl<Record> !RefUnwindSafe for Query<Record>
impl<Record> Send for Query<Record>
impl<Record> Sync for Query<Record>
impl<Record> Unpin for Query<Record>
impl<Record> !UnwindSafe for Query<Record>
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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