Struct rusty_leveldb::DBIterator
[−]
[src]
pub struct DBIterator { /* fields omitted */ }
DBIterator is an iterator over the contents of a database.
Methods
impl DBIterator
[src]
pub fn new(
cmp: Rc<Box<Cmp>>,
vset: Rc<RefCell<VersionSet>>,
iter: MergingIter,
ss: Snapshot
) -> DBIterator
[src]
cmp: Rc<Box<Cmp>>,
vset: Rc<RefCell<VersionSet>>,
iter: MergingIter,
ss: Snapshot
) -> DBIterator
Trait Implementations
impl LdbIterator for DBIterator
[src]
fn advance(&mut self) -> bool
[src]
Advances the position of the iterator by one element (which can be retrieved using current(). If no more elements are available, advance() returns false, and the iterator becomes invalid (i.e. as if reset() had been called). Read more
fn current(&self, key: &mut Vec<u8>, val: &mut Vec<u8>) -> bool
[src]
Return the current item (i.e. the item most recently returned by next()
).
fn prev(&mut self) -> bool
[src]
Go to the previous item; if the iterator is moved beyond the first element, prev()
returns false and it will be !valid()
. This is inefficient for most iterator implementations. Read more
fn valid(&self) -> bool
[src]
Returns true if the iterator is not positioned before the first or after the last element, i.e. if current()
would succeed. Read more
fn seek(&mut self, to: &[u8])
[src]
Seek the iterator to key
or the next bigger key. If the seek is invalid (past last element, or before first element), the iterator is reset()
and not valid. Read more
fn seek_to_first(&mut self)
[src]
seek_to_first seeks to the first element.
fn reset(&mut self)
[src]
Resets the iterator to be !valid()
, i.e. positioned before the first element.
fn next(&mut self) -> Option<(Vec<u8>, Vec<u8>)>
[src]
next is like Iterator::next(). It's implemented here because Rust disallows implementing a foreign trait for any type, thus we can't do impl<T: LdbIterator> Iterator<Item=Vec<u8>> for T {}
. Read more