pub struct Cursor<T: CursorValues> {
offset: usize,
values: T,
}Expand description
A comparable cursor, used by sort operations
A Cursor is a pointer into a collection of rows, stored in
CursorValues
┌───────────────────────┐
│ │ ┌──────────────────────┐
│ ┌─────────┐ ┌─────┐ │ ─ ─ ─ ─│ Cursor<T> │
│ │ 1 │ │ A │ │ │ └──────────────────────┘
│ ├─────────┤ ├─────┤ │
│ │ 2 │ │ A │◀─ ┼ ─ ┘ Cursor<T> tracks an
│ └─────────┘ └─────┘ │ offset within a
│ ... ... │ CursorValues
│ │
│ ┌─────────┐ ┌─────┐ │
│ │ 3 │ │ E │ │
│ └─────────┘ └─────┘ │
│ │
│ CursorValues │
└───────────────────────┘
Store logical rows using
one of several formats,
with specialized
implementations
depending on the column
typesFields§
§offset: usize§values: TImplementations§
Source§impl<T: CursorValues> Cursor<T>
impl<T: CursorValues> Cursor<T>
Sourcepub fn new(values: T) -> Self
pub fn new(values: T) -> Self
Create a Cursor from the given CursorValues
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Returns true if there are no more rows in this cursor
pub fn is_eq_to_prev_one(&self, prev_cursor: Option<&Cursor<T>>) -> bool
Source§impl<T: CursorValues> Cursor<T>
impl<T: CursorValues> Cursor<T>
fn is_eq_to_prev_row(&self) -> bool
fn is_eq_to_prev_row_in_prev_batch(&self, other: &Self) -> bool
Trait Implementations§
Source§impl<T: CursorValues> Ord for Cursor<T>
impl<T: CursorValues> Ord for Cursor<T>
Source§impl<T: CursorValues> PartialEq for Cursor<T>
impl<T: CursorValues> PartialEq for Cursor<T>
Source§impl<T: CursorValues> PartialOrd for Cursor<T>
impl<T: CursorValues> PartialOrd for Cursor<T>
impl<T: CursorValues> Eq for Cursor<T>
Auto Trait Implementations§
impl<T> Freeze for Cursor<T>where
T: Freeze,
impl<T> RefUnwindSafe for Cursor<T>where
T: RefUnwindSafe,
impl<T> Send for Cursor<T>where
T: Send,
impl<T> Sync for Cursor<T>where
T: Sync,
impl<T> Unpin for Cursor<T>where
T: Unpin,
impl<T> UnwindSafe for Cursor<T>where
T: UnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.§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
Checks if this value is equivalent to the given key. Read more
§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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more