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§
Sourcefn init_cursor<'a, 'b: 'a>(&'a self, cursor: &mut Cursor<'b>) -> bool
fn init_cursor<'a, 'b: 'a>(&'a self, cursor: &mut Cursor<'b>) -> bool
Returns true if initialization successful, for example that the key exists.
Sourcefn move_to_next<'iter, 'cursor: 'iter>(
&'iter self,
cursor: &'cursor mut Cursor<'cursor>,
) -> bool
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