Trait sstable::iterator::SSIterator
[−]
[src]
pub trait SSIterator: Iterator { fn seek(&mut self, key: &[u8]); fn reset(&mut self); fn valid(&self) -> bool; fn current(&self) -> Option<Self::Item>; fn prev(&mut self) -> Option<Self::Item>; fn seek_to_first(&mut self) { ... } }
An extension of the standard Iterator
trait that supports some methods necessary for LevelDB.
This works because the iterators used are stateful and keep the last returned element.
Note: Implementing types are expected to hold !valid()
before the first call to next()
.
Required Methods
fn seek(&mut self, key: &[u8])
Seek the iterator to key
or the next bigger key. If the seek is invalid (past last
element), the iterator is reset() and not valid.
fn reset(&mut self)
Resets the iterator to be !valid()
again (before first element)
fn valid(&self) -> bool
Returns true if current()
would return a valid item.
fn current(&self) -> Option<Self::Item>
Return the current item.
fn prev(&mut self) -> Option<Self::Item>
Go to the previous item.
Provided Methods
fn seek_to_first(&mut self)
Implementors
impl<'a, C: Comparator, R: Read + Seek> SSIterator for TableIterator<'a, R, C>