[][src]Struct rocks::iterator::Iterator

pub struct Iterator<'a> { /* fields omitted */ }

An iterator yields a sequence of key/value pairs from a source.

Multiple threads can invoke const methods on an Iterator without external synchronization, but if any of the threads may call a non-const method, all threads accessing the same Iterator must use external synchronization.

Implementations

impl<'a> Iterator<'a>[src]

pub fn is_valid(&self) -> bool[src]

An iterator is either positioned at a key/value pair, or not valid. This method returns true iff the iterator is valid.

pub fn seek_to_first(&mut self)[src]

Position at the first key in the source. The iterator is_valid() after this call iff the source is not empty.

pub fn seek_to_last(&mut self)[src]

Position at the last key in the source. The iterator is_valid() after this call iff the source is not empty.

pub fn seek(&mut self, target: &[u8])[src]

Position at the first key in the source that at or past target The iterator is_valid() after this call iff the source contains an entry that comes at or past target.

pub fn seek_for_prev(&mut self, target: &[u8])[src]

Position at the last key in the source that at or before target The iterator is_valid() after this call iff the source contains an entry that comes at or before target.

pub fn next(&mut self)[src]

Moves to the next entry in the source. After this call, is_valid() is true iff the iterator was not positioned at the last entry in the source.

REQUIRES: is_valid()

pub fn prev(&mut self)[src]

Moves to the previous entry in the source. After this call, is_valid() is true iff the iterator was not positioned at the first entry in source.

REQUIRES: is_valid()

pub fn key(&self) -> &'a [u8][src]

Return the key for the current entry. The underlying storage for the returned slice is valid only until the next modification of the iterator.

REQUIRES: is_valid()

pub fn value(&self) -> &'a [u8][src]

Return the value for the current entry. The underlying storage for the returned slice is valid only until the next modification of the iterator.

REQUIRES: !AtEnd() && !AtStart()

pub fn status(&self) -> Result<()>[src]

If an error has occurred, return it. Else return an ok status. If non-blocking IO is requested and this operation cannot be satisfied without doing some IO, then this returns Error::Incomplete().

pub fn get_property(&self, property: &str) -> Result<String>[src]

Property "rocksdb.iterator.is-key-pinned":

  • If returning "1", this means that the Slice returned by key() is valid as long as the iterator is not deleted.
  • It is guaranteed to always return "1" if
    • Iterator created with ReadOptions::pin_data = true
    • DB tables were created with BlockBasedTableOptions::use_delta_encoding = false.

Property "rocksdb.iterator.super-version-number":

  • LSM version used by the iterator. The same format as DB Property
  • kCurrentSuperVersionNumber. See its comment for more information.

pub fn rev(self) -> IntoRevIter<'a>[src]

Consume and make a reversed rustic style iterator.

pub fn keys(self) -> Keys<'a>[src]

An iterator visiting all keys in current order.

pub fn values(self) -> Values<'a>[src]

An iterator visiting all values in current order.

Trait Implementations

impl<'a> Debug for Iterator<'a>[src]

impl<'a> Drop for Iterator<'a>[src]

impl<'a> Iterator for Iterator<'a>[src]

type Item = (&'a [u8], &'a [u8])

The type of the elements being iterated over.

impl<'a> Send for Iterator<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Iterator<'a>

impl<'a> !Sync for Iterator<'a>

impl<'a> Unpin for Iterator<'a>

impl<'a> UnwindSafe for Iterator<'a>

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.