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
impl QueryResult
Sourcepub fn get_item(&self, index: usize) -> Option<QueryResultItem>
pub fn get_item(&self, index: usize) -> Option<QueryResultItem>
Get the QueryResultItem at the given index.
Return None if out of bounds.
Sourcepub fn item_count(&self) -> usize
pub fn item_count(&self) -> usize
Return the number of available QueryResultItem.
Sourcepub fn mutated_document_ids(&self) -> Vec<DocumentId>
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.
Sourcepub fn commit_id(&self) -> Option<NonZeroU64>
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
impl QueryResult
Sourcepub fn iter(&self) -> impl '_ + Iterator<Item = QueryResultItem>
pub fn iter(&self) -> impl '_ + Iterator<Item = QueryResultItem>
Create an iterator over QueryResultItems