pub struct SortableIndexKey {
pub key: ImmutableRecord,
pub metadata: Arc<IndexInfo>,
}Expand description
Wrapper for index keys that implements collation-aware, ASC/DESC-aware ordering.
Fields§
§key: ImmutableRecordThe key as bytes.
metadata: Arc<IndexInfo>Index metadata containing sort orders and collations
Implementations§
Source§impl SortableIndexKey
impl SortableIndexKey
pub fn new_from_bytes(key_bytes: Vec<u8>, metadata: Arc<IndexInfo>) -> Self
pub fn new_from_record(key: ImmutableRecord, metadata: Arc<IndexInfo>) -> Self
pub fn new_from_values( values: Vec<ValueRef<'_>>, metadata: Arc<IndexInfo>, ) -> Result<Self>
Sourcepub fn contains_null(&self, num_indexed_cols: usize) -> Result<bool>
pub fn contains_null(&self, num_indexed_cols: usize) -> Result<bool>
Check if the index key contains any NULL values (excluding the rowid column). In SQLite, NULLs don’t violate UNIQUE constraints, so we skip conflict checks for NULL keys.
Sourcepub fn matches_prefix(&self, other: &Self, num_cols: usize) -> Result<bool>
pub fn matches_prefix(&self, other: &Self, num_cols: usize) -> Result<bool>
Check if the first num_cols columns of this key match another key.
Used for UNIQUE index conflict detection where we need to compare only
the indexed columns, not the rowid suffix.
Trait Implementations§
Source§impl Clone for SortableIndexKey
impl Clone for SortableIndexKey
Source§fn clone(&self) -> SortableIndexKey
fn clone(&self) -> SortableIndexKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SortableIndexKey
impl Debug for SortableIndexKey
impl Eq for SortableIndexKey
Source§impl Ord for SortableIndexKey
impl Ord for SortableIndexKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for SortableIndexKey
impl PartialEq for SortableIndexKey
Source§impl PartialOrd for SortableIndexKey
impl PartialOrd for SortableIndexKey
Auto Trait Implementations§
impl Freeze for SortableIndexKey
impl RefUnwindSafe for SortableIndexKey
impl Send for SortableIndexKey
impl Sync for SortableIndexKey
impl Unpin for SortableIndexKey
impl UnsafeUnpin for SortableIndexKey
impl UnwindSafe for SortableIndexKey
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<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,
Source§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
Compare self to
key and return true if they are equal.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> ⓘ
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