Trait IterateCursor

Source
pub trait IterateCursor {
    // Required methods
    fn init_cursor<'a, 'b: 'a>(&'a self, cursor: &mut Cursor<'b>) -> bool;
    fn move_to_next<'iter, 'cursor: 'iter>(
        &'iter self,
        cursor: &'cursor mut Cursor<'cursor>,
    ) -> bool;

    // Provided method
    fn get_size_hint(&self, _cursor: &Cursor<'_>) -> (usize, Option<usize>) { ... }
}
Expand description

Allows the cration of custom cursor iteration behaviours.

Required Methods§

Source

fn init_cursor<'a, 'b: 'a>(&'a self, cursor: &mut Cursor<'b>) -> bool

Returns true if initialization successful, for example that the key exists.

Source

fn move_to_next<'iter, 'cursor: 'iter>( &'iter self, cursor: &'cursor mut Cursor<'cursor>, ) -> bool

Returns true if there is still data and iterator is in correct range

Provided Methods§

Source

fn get_size_hint(&self, _cursor: &Cursor<'_>) -> (usize, Option<usize>)

Returns size hint considering current state of cursor

Implementors§