Struct below_store::cursor::StoreCursor
source · [−]pub struct StoreCursor { /* private fields */ }Expand description
For read-only access to a store. Similar to an iterator, but support moving back and forth.
Implementations
Trait Implementations
sourceimpl Cursor for StoreCursor
impl Cursor for StoreCursor
sourcefn advance(&mut self, direction: Direction) -> Result<bool>
fn advance(&mut self, direction: Direction) -> Result<bool>
Move the cursor to a neighbor position. Return if the cursor is updated. Returning false means there is no more valid position in the given direction, although retrying may succeed. Notice that true means the current position is valid, but underlying sample may still be invalid.
sourcefn get(&self) -> Option<(SystemTime, DataFrame)>
fn get(&self) -> Option<(SystemTime, DataFrame)>
Get the sample the cursor is currently pointing at. Notice that a store may contain holes due to data corruption etc, and thus returns None. This does not mean samples are depleted. More could be retrieved by advancing further to skip the holes.
type Offset = StoreOffset
type Item = (SystemTime, DataFrame)
sourcefn get_offset(&self) -> StoreOffset
fn get_offset(&self) -> StoreOffset
sourcefn set_offset(&mut self, offset: StoreOffset)
fn set_offset(&mut self, offset: StoreOffset)
sourceimpl KeyedCursor<u64> for StoreCursor
impl KeyedCursor<u64> for StoreCursor
StoreCursor has each cursor position bound to a SystemTime in monotonic order. This allows moving the cursor relative to SystemTime instances.
sourcefn jump_near_key(&mut self, key: &u64, _direction: Direction)
fn jump_near_key(&mut self, key: &u64, _direction: Direction)
Set the cursor offset near the given timestamp by inferring shard and index offset.