Struct rusty_leveldb::DBIterator
source · [−]pub struct DBIterator { /* private fields */ }
Expand description
DBIterator is an iterator over the contents of a database.
Implementations
sourceimpl DBIterator
impl DBIterator
pub fn new(
cmp: Rc<Box<dyn Cmp>>,
vset: Rc<RefCell<VersionSet>>,
iter: MergingIter,
ss: Snapshot
) -> DBIterator
Trait Implementations
sourceimpl LdbIterator for DBIterator
impl LdbIterator for DBIterator
sourcefn advance(&mut self) -> bool
fn advance(&mut self) -> bool
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
sourcefn current(&self, key: &mut Vec<u8>, val: &mut Vec<u8>) -> bool
fn current(&self, key: &mut Vec<u8>, val: &mut Vec<u8>) -> bool
Return the current item (i.e. the item most recently returned by
next()
).sourcefn prev(&mut self) -> bool
fn prev(&mut self) -> bool
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 moresourcefn valid(&self) -> bool
fn valid(&self) -> bool
Returns true if the iterator is not positioned before the first or after the last element,
i.e. if
current()
would succeed. Read moresourcefn seek(&mut self, to: &[u8])
fn seek(&mut self, to: &[u8])
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 moresourcefn seek_to_first(&mut self)
fn seek_to_first(&mut self)
seek_to_first seeks to the first element.
Auto Trait Implementations
impl !RefUnwindSafe for DBIterator
impl !Send for DBIterator
impl !Sync for DBIterator
impl Unpin for DBIterator
impl !UnwindSafe for DBIterator
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more