pub struct Cursor {
pub ts: i64,
pub node: u32,
pub seq: u64,
pub row: u32,
}Expand description
Where the previous page stopped.
Keyset, not offset, and not for tidiness: offset: 20000 forces the engine
to find and discard twenty thousand rows on every page, which turns the
early exit below into a full scan and makes the last page the most expensive
one. It is also wrong on a store that is still being written to — a batch
arriving between two pages shifts every row down and the reader sees a row
twice or never.
This is the sort key of the last row returned, so “the next page” is
“everything that sorts after this”, which is exact whatever else has landed
meanwhile. (node, seq) identifies the block globally with no coordination
(see block::node_id) and row is its offset inside it, so the key is
intrinsic to the record rather than to the query that found it.
Rendered as ts.node.seq.row, in decimal, on purpose: an agent reading a
response can tell what it is holding, and a human debugging a stuck reader
can tell where it stopped.
Fields§
§ts: i64§node: u32§seq: u64§row: u32Implementations§
Trait Implementations§
impl Copy for Cursor
impl Eq for Cursor
impl StructuralPartialEq for Cursor
Auto Trait Implementations§
impl Freeze for Cursor
impl RefUnwindSafe for Cursor
impl Send for Cursor
impl Sync for Cursor
impl Unpin for Cursor
impl UnsafeUnpin for Cursor
impl UnwindSafe for Cursor
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].