Enum lmdb::Iter[][src]

pub enum Iter<'txn> {
    Err(Error),
    Ok {
        cursor: *mut MDB_cursor,
        op: c_uint,
        next_op: c_uint,
        _marker: PhantomData<fn(_: &'txn ())>,
    },
}

An iterator over the key/value pairs in an LMDB database.

Variants

Err(Error)

An iterator that returns an error on every call to Iter.next(). Cursor.iter*() creates an Iter of this type when LMDB returns an error on retrieval of a cursor. Using this variant instead of returning an error makes Cursor.iter()* methods infallible, so consumers only need to check the result of Iter.next().

Ok

An iterator that returns an Item on calls to Iter.next(). The Item is a Result<(&'txn u8, &'txn u8)>, so this variant might still return an error, if retrieval of the key/value pair fails for some reason.

Fields of Ok

cursor: *mut MDB_cursor

The LMDB cursor with which to iterate.

op: c_uint

The first operation to perform when the consumer calls Iter.next().

next_op: c_uint

The next and subsequent operations to perform.

_marker: PhantomData<fn(_: &'txn ())>

A marker to ensure the iterator doesn't outlive the transaction.

Trait Implementations

impl<'txn> Debug for Iter<'txn>[src]

impl<'txn> Iterator for Iter<'txn>[src]

type Item = Result<(&'txn [u8], &'txn [u8])>

The type of the elements being iterated over.

Auto Trait Implementations

impl<'txn> RefUnwindSafe for Iter<'txn>[src]

impl<'txn> !Send for Iter<'txn>[src]

impl<'txn> !Sync for Iter<'txn>[src]

impl<'txn> Unpin for Iter<'txn>[src]

impl<'txn> UnwindSafe for Iter<'txn>[src]

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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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.