pub struct Cursor<'a, K, A, N, T>{ /* private fields */ }Expand description
A cursor for a layer file.
A cursor traverses a RowGroup. It can be positioned on a particular row
or before or after the row group. (If the row group is empty, then the
cursor can only be before or after the row group.)
Implementations§
Source§impl<'a, K, A, N, T> Cursor<'a, K, A, N, T>
impl<'a, K, A, N, T> Cursor<'a, K, A, N, T>
Sourcepub unsafe fn move_next(&mut self) -> Result<(), Error>
pub unsafe fn move_next(&mut self) -> Result<(), Error>
Moves to the next row in the row group. If the cursor was previously before the row group, it moves to the first row; if it was on the last row, it moves after the row group.
§Safety
Unsafe because rkyv deserialization is unsafe.
Sourcepub unsafe fn move_prev(&mut self) -> Result<(), Error>
pub unsafe fn move_prev(&mut self) -> Result<(), Error>
Moves to the previous row in the row group. If the cursor was previously after the row group, it moves to the last row; if it was on the first row, it moves before the row group.
§Safety
Unsafe because rkyv deserialization is unsafe.
Sourcepub unsafe fn move_first(&mut self) -> Result<(), Error>
pub unsafe fn move_first(&mut self) -> Result<(), Error>
Moves to the first row in the row group. If the row group is empty, this has no effect.
§Safety
Unsafe because rkyv deserialization is unsafe.
Sourcepub unsafe fn move_last(&mut self) -> Result<(), Error>
pub unsafe fn move_last(&mut self) -> Result<(), Error>
Moves to the last row in the row group. If the row group is empty, this has no effect.
§Safety
Unsafe because rkyv deserialization is unsafe.
Sourcepub unsafe fn move_to_row(&mut self, row: u64) -> Result<(), Error>
pub unsafe fn move_to_row(&mut self, row: u64) -> Result<(), Error>
Moves to row row. If row >= self.len(), moves after the row group.
§Safety
Unsafe because rkyv deserialization is unsafe.
Sourcepub fn key(&self) -> Option<&K>
pub fn key(&self) -> Option<&K>
Returns the key in the current row, or None if the cursor is before or
after the row group.
Sourcepub unsafe fn aux<'b>(&self, aux: &'b mut A) -> Option<&'b mut A>
pub unsafe fn aux<'b>(&self, aux: &'b mut A) -> Option<&'b mut A>
Returns the auxiliary data in the current row, or None if the cursor
is before or after the row group.
§Safety
Unsafe because rkyv deserialization is unsafe.
Sourcepub unsafe fn item<'b>(
&self,
item: (&'b mut K, &'b mut A),
) -> Option<(&'b mut K, &'b mut A)>
pub unsafe fn item<'b>( &self, item: (&'b mut K, &'b mut A), ) -> Option<(&'b mut K, &'b mut A)>
Returns the key and auxiliary data in the current row, or None if the
cursor is before or after the row group.
§Safety
Unsafe because rkyv deserialization is unsafe.
Sourcepub unsafe fn archived_item(&self) -> Option<&dyn ArchivedItem<'_, K, A>>
pub unsafe fn archived_item(&self) -> Option<&dyn ArchivedItem<'_, K, A>>
Returns archived representation of the key and auxiliary data in the
current row, or None if the cursor is before or after the row
group.
§Safety
Unsafe because rkyv deserialization is unsafe.
Sourcepub fn absolute_position(&self) -> u64
pub fn absolute_position(&self) -> u64
Returns the row number of the current row, as an absolute number relative to the top of the column rather than the top of the row group. If the cursor is before the row group or on the first row, returns the row number of the first row in the row group; if the cursor is after the row group, returns the row number of the row just after the row group.
Sourcepub fn remaining_rows(&self) -> u64
pub fn remaining_rows(&self) -> u64
Returns the number of times move_next may be called
before the cursor is after the row group.
Sourcepub unsafe fn seek_forward_until<P>(
&mut self,
predicate: P,
) -> Result<(), Error>
pub unsafe fn seek_forward_until<P>( &mut self, predicate: P, ) -> Result<(), Error>
Moves the cursor forward past rows for which predicate returns false,
where predicate is a function such that if it is true for a given key,
it is also true for all larger keys.
This function does not move the cursor if predicate is true for the
current row or a previous row.
§Safety
Unsafe because rkyv deserialization is unsafe.
Sourcepub unsafe fn advance_to_value_or_larger(
&mut self,
target: &K,
) -> Result<(), Error>
pub unsafe fn advance_to_value_or_larger( &mut self, target: &K, ) -> Result<(), Error>
Moves the cursor forward past rows whose keys are less than target.
This function does not move the cursor if the current row’s key is
greater than or equal to target.
§Safety
Unsafe because rkyv deserialization is unsafe.
Sourcepub unsafe fn advance_to_first_ge<C>(
&mut self,
compare: &C,
) -> Result<(), Error>
pub unsafe fn advance_to_first_ge<C>( &mut self, compare: &C, ) -> Result<(), Error>
Moves the cursor forward past rows for which compare returns Less,
where compare is a function such that if it returns Equal or
Greater for a given key, it returns Greater for all larger keys.
This function does not move the cursor if compare returns Equal or
Greater for the current row or a previous row.
§Error handling
If this returns an error, then the cursor’s position might be lost. If so, then its position is advanced past the end of the row group.
§Safety
Unsafe because rkyv deserialization is unsafe.
Sourcepub unsafe fn seek_backward_until<P>(
&mut self,
predicate: P,
) -> Result<(), Error>
pub unsafe fn seek_backward_until<P>( &mut self, predicate: P, ) -> Result<(), Error>
Moves the cursor backward past rows for which predicate returns false,
where predicate is a function such that if it is true for a given key,
it is also true for all lesser keys.
This function does not move the cursor if predicate is true for the
current row or a previous row.
§Safety
Unsafe because rkyv deserialization is unsafe.
Sourcepub unsafe fn rewind_to_value_or_smaller(
&mut self,
target: &K,
) -> Result<(), Error>where
K: Ord,
pub unsafe fn rewind_to_value_or_smaller(
&mut self,
target: &K,
) -> Result<(), Error>where
K: Ord,
Moves the cursor backward past rows whose keys are greater than
target. This function does not move the cursor if the current row’s
key is less than or equal to target.
§Safety
Unsafe because rkyv deserialization is unsafe.
Sourcepub unsafe fn rewind_to_last_le<C>(&mut self, compare: &C) -> Result<(), Error>
pub unsafe fn rewind_to_last_le<C>(&mut self, compare: &C) -> Result<(), Error>
Moves the cursor backward past rows for which compare returns
Greater, where compare is a function such that if it returns
Equal or Less for a given key, it returns Less for all
lesser keys.
This function does not move the cursor if compare returns Equal or
Less for the current row or a previous row.
§Safety
Unsafe because rkyv deserialization is unsafe.
Source§impl<'a, K, A, NK, NA, NN, T> Cursor<'a, K, A, (&'static NK, &'static NA, NN), T>
impl<'a, K, A, NK, NA, NN, T> Cursor<'a, K, A, (&'static NK, &'static NA, NN), T>
Sourcepub fn next_column<'b>(&'b self) -> Result<RowGroup<'a, NK, NA, NN, T>, Error>
pub fn next_column<'b>(&'b self) -> Result<RowGroup<'a, NK, NA, NN, T>, Error>
Obtains the row group in the next column associated with the current row. If the cursor is on a row, the returned row group will contain at least one row. If the cursor is before or after the row group, the returned row group will be empty.
This method does not do I/O, but it can report Error::Corruption.
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, A, N, T> !RefUnwindSafe for Cursor<'a, K, A, N, T>
impl<'a, K, A, N, T> !UnwindSafe for Cursor<'a, K, A, N, T>
impl<'a, K, A, N, T> Freeze for Cursor<'a, K, A, N, T>
impl<'a, K, A, N, T> Send for Cursor<'a, K, A, N, T>
impl<'a, K, A, N, T> Sync for Cursor<'a, K, A, N, T>
impl<'a, K, A, N, T> Unpin for Cursor<'a, K, A, N, T>
impl<'a, K, A, N, T> UnsafeUnpin for Cursor<'a, K, A, N, T>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Data for Twhere
T: Clone + 'static,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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