pub struct BlockCursor<Conf: Config> { /* private fields */ }
Expand description
Block iterator cursor, or position of iterable.
Created by BlockIter::cursor(), used by BlockIter::move_to(). Also can be built from index and DataBlock.
Allows to resume iteration from the last position, even if the source was mutated. Can be used with any BitSetInterface. Default constructed cursor will traverse bitset from the very begin.
§Use-case
This can be used to split long iteration into a few sessions. You may want that in concurrent environment, when you can’t process whole iteration sequence fast, and want not to keep lock on resource all the time you process iteration sequence.
Example: you lock sets, make intersection iterator, read 40 blocks into buffer, take iterator to cursor, unlock sets, process buffer, lock sets, move iterator to cursor, and so on.
Implementations§
Trait Implementations§
Source§impl<Conf: Config> Clone for BlockCursor<Conf>
impl<Conf: Config> Clone for BlockCursor<Conf>
Source§impl<Conf: Config> Default for BlockCursor<Conf>
impl<Conf: Config> Default for BlockCursor<Conf>
Source§impl<Conf: Config> From<&DataBlock<<Conf as Config>::DataBitBlock>> for BlockCursor<Conf>
impl<Conf: Config> From<&DataBlock<<Conf as Config>::DataBitBlock>> for BlockCursor<Conf>
Source§fn from(block: &DataBlock<Conf::DataBitBlock>) -> Self
fn from(block: &DataBlock<Conf::DataBitBlock>) -> Self
Build cursor that points to the block
.