Struct alexandria::query::QueryIterator[][src]

pub struct QueryIterator { /* fields omitted */ }

A dynamically stepped iterator for query results

See query_iter() to construct an iterator, and for more detailed behaviour. Be sure to drop the iterator when done to allow garbage collection of deleted paths.

Implementations

impl QueryIterator[src]

pub fn merge(&mut self, other: Self) -> Result<()>[src]

Allows merging two iterators with the same query into one

The second iterator will simply be appended. No further sorting is scheduled.

pub fn skip(&self, pos: usize)[src]

Skip ahead to a certain position in the iterator

If the provided position is larger than the iterator set, all future yields will simply return None.

pub fn query(&self) -> &Query[src]

Return a reference to the original query of the iterator

pub fn pos(&self) -> usize[src]

Get the current iterator position

pub fn len(&self) -> usize[src]

Get the absolute length of the iterator

pub fn remaining(&self) -> usize[src]

Return the number of remaining items

pub async fn lock(&self)[src]

Lock the GC for the iterator scope

Normally, when an iterator wants to access records that were deleted by other transactions, it will return an error. To avoid this possible race condition, you can lock the garbage collector for the set of paths the iterator can touch, meaning they will remain accessible until the iterator goes out of scope.

This can have unwanted side-effects, such as having records still accessible by other tasks after they were deleted, when accessed by path directly (but not via tags), or not actually deleting records if the program aborts before the iterator can restart the garbage collector again.

pub async fn next(&self) -> Result<Option<RecordRef>>[src]

Get the next item in the iterator

When the iterator has reached it’s end, it will start returning None, at which point this instance should be dropped to allow freeing records that were held for this iterator.

If any other errors occur during access, this function will return an Error, which doesn’t neccessarily mean no more records can be fetched in the future.

Trait Implementations

impl Debug for QueryIterator[src]

impl Drop for QueryIterator[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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