pub struct OffsetMapper { /* private fields */ }Expand description
Maps a naive offset into a fragment to the local row offset that is not deleted.
For example, if the deletion vector is [0, 1, 2], then the mapping would be:
- 0 -> 3
- 1 -> 4
- 2 -> 5
and so on.
This expects a monotonically increasing sequence of input offsets. State
is re-used between calls to map_offset to make the mapping more efficient.
Implementations§
Source§impl OffsetMapper
impl OffsetMapper
pub fn new(dv: Arc<DeletionVector>) -> Self
pub fn map_offset(&mut self, offset: u32) -> u32
Auto Trait Implementations§
impl Freeze for OffsetMapper
impl RefUnwindSafe for OffsetMapper
impl Send for OffsetMapper
impl Sync for OffsetMapper
impl Unpin for OffsetMapper
impl UnwindSafe for OffsetMapper
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
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>
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