Skip to main content

Cursor

Trait Cursor 

Source
pub(crate) trait Cursor<'a, T>: Send {
    // Required methods
    fn state(&self) -> &State<'a>;
    fn state_mut(&mut self) -> &mut State<'a>;
    fn count(&self) -> (usize, Option<usize>);
    fn fetch(&self) -> Option<T>;
    fn seek(&mut self);

    // Provided methods
    fn get(&self) -> Option<Result<T>> { ... }
    fn seek_and_get(&mut self) -> Option<Result<T>> { ... }
}
Expand description

Defines the polling operations shared by database cursor streams.

Implementations position a State, fetch one borrowed item, and surface RocksDB cursor errors. Borrowed items remain valid only until the next cursor movement and must be owned before they are retained.

Required Methods§

Source

fn state(&self) -> &State<'a>

Source

fn state_mut(&mut self) -> &mut State<'a>

Source

fn count(&self) -> (usize, Option<usize>)

Source

fn fetch(&self) -> Option<T>

Source

fn seek(&mut self)

Provided Methods§

Source

fn get(&self) -> Option<Result<T>>

Source

fn seek_and_get(&mut self) -> Option<Result<T>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a> Cursor<'a, &'a [u8]> for Keys<'a>

Source§

impl<'a> Cursor<'a, &'a [u8]> for KeysRev<'a>

Source§

impl<'a> Cursor<'a, (&'a [u8], &'a [u8])> for Items<'a>

Source§

impl<'a> Cursor<'a, (&'a [u8], &'a [u8])> for ItemsRev<'a>