Struct grenad::ReaderCursor
source · pub struct ReaderCursor<R> { /* private fields */ }
Expand description
A cursor that can move forward backward and move on a specified key.
Implementations§
source§impl<R> ReaderCursor<R>
impl<R> ReaderCursor<R>
sourcepub fn into_reader(self) -> Reader<R>
pub fn into_reader(self) -> Reader<R>
Consumes the ReaderCursor
and returns the underlying Reader
type.
sourcepub fn into_inner(self) -> R
pub fn into_inner(self) -> R
Consumes the ReaderCursor
and returns the underlying io::Read
type.
The returned io::Read
type has been io::Seek
ed which means that
you must seek it back to the front to be read from the start.
source§impl<R: Read + Seek> ReaderCursor<R>
impl<R: Read + Seek> ReaderCursor<R>
sourcepub fn move_on_first(&mut self) -> Result<Option<(&[u8], &[u8])>, Error>
pub fn move_on_first(&mut self) -> Result<Option<(&[u8], &[u8])>, Error>
Moves the cursor on the first entry and returns it.
sourcepub fn move_on_last(&mut self) -> Result<Option<(&[u8], &[u8])>, Error>
pub fn move_on_last(&mut self) -> Result<Option<(&[u8], &[u8])>, Error>
Moves the cursor on the last entry and returns it.
sourcepub fn move_on_next(&mut self) -> Result<Option<(&[u8], &[u8])>, Error>
pub fn move_on_next(&mut self) -> Result<Option<(&[u8], &[u8])>, Error>
Moves the cursor on the entry following the current one and returns it.
sourcepub fn move_on_prev(&mut self) -> Result<Option<(&[u8], &[u8])>, Error>
pub fn move_on_prev(&mut self) -> Result<Option<(&[u8], &[u8])>, Error>
Moves the cursor on the entry preceding the current one and returns it.
sourcepub fn move_on_key_lower_than_or_equal_to<A: AsRef<[u8]>>(
&mut self,
target_key: A
) -> Result<Option<(&[u8], &[u8])>, Error>
pub fn move_on_key_lower_than_or_equal_to<A: AsRef<[u8]>>( &mut self, target_key: A ) -> Result<Option<(&[u8], &[u8])>, Error>
Moves the cursor on the entry with a key lower than or equal to the specified one and returns the corresponding entry.
Methods from Deref<Target = Reader<R>>§
sourcepub fn file_version(&self) -> FileVersion
pub fn file_version(&self) -> FileVersion
Returns the version of this file.
sourcepub fn compression_type(&self) -> CompressionType
pub fn compression_type(&self) -> CompressionType
Returns the compression type of this file.
Trait Implementations§
source§impl<R: Clone> Clone for ReaderCursor<R>
impl<R: Clone> Clone for ReaderCursor<R>
source§fn clone(&self) -> ReaderCursor<R>
fn clone(&self) -> ReaderCursor<R>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<R> Deref for ReaderCursor<R>
impl<R> Deref for ReaderCursor<R>
source§impl<R, MF> Extend<ReaderCursor<R>> for MergerBuilder<R, MF>
impl<R, MF> Extend<ReaderCursor<R>> for MergerBuilder<R, MF>
source§fn extend<T: IntoIterator<Item = ReaderCursor<R>>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = ReaderCursor<R>>>(&mut self, iter: T)
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)