dittolive_ditto::dql

Struct QueryResult

Source
pub struct QueryResult { /* private fields */ }
Expand description

Represents results returned when executing a DQL query containing a QueryResultItem for each match.

Note: More info such as metrics, affected document IDs, etc. will be provided in the near future.

Implementations§

Source§

impl QueryResult

Source

pub fn get_item(&self, index: usize) -> Option<QueryResultItem>

Get the QueryResultItem at the given index. Return None if out of bounds.

Source

pub fn item_count(&self) -> usize

Return the number of available QueryResultItem.

Source

pub fn mutated_document_ids(&self) -> Vec<DocumentId>

IDs of documents that were mutated by the DQL query. Empty array if no documents have been mutated.

Important: The returned document IDs are not cached, make sure to call this method once and keep the return value for as long as needed.

Source

pub fn commit_id(&self) -> Option<NonZeroU64>

The commit ID associated with this query result, if any.

This ID uniquely identifies the commit in which this change was accepted into the local store. The commit ID is available for all query results involving insertions, updates, or deletions. This ID can be used to track whether a local change has been synced to other peers.

For write transactions, the commit ID is only available after the transaction has been successfully committed. Queries executed within an uncommitted transaction will not have a commit ID.

Source§

impl QueryResult

Source

pub fn iter(&self) -> impl '_ + Iterator<Item = QueryResultItem>

Create an iterator over QueryResultItems

Trait Implementations§

Source§

impl From<Box<FfiQueryResult>> for QueryResult

Source§

fn from(raw: Box<FfiQueryResult>) -> QueryResult

Converts to this type from the input type.
Source§

impl<'iter> IntoIterator for &'iter QueryResult

Source§

type IntoIter = QueryResultIterator<'iter>

Which kind of iterator are we turning this into?
Source§

type Item = QueryResultItem

The type of the elements being iterated over.
Source§

fn into_iter(self) -> QueryResultIterator<'iter>

Creates an iterator from a value. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
§

impl<T> FitForCArc for T

§

type CArcWrapped = ThinArc<T>

§

impl<T> FitForCBox for T

§

type CBoxWrapped = ThinBox<T>

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> ManuallyDropMut for T

§

type Ret = ManuallyDrop<T>

§

fn manually_drop_mut<'__>(&'__ mut self) -> &'__ mut ManuallyDrop<T>

§

impl<T> To for T
where T: ?Sized,

§

fn to<T>(self) -> T
where Self: Into<T>,

Converts to T by calling Into<T>::into.
§

fn try_to<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Tries to convert to T by calling TryInto<T>::try_into.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<F> ZeroSizedElseWrathOfTheGඞds for F