pub struct IndexStorage<'a, 'txn, T: KVTransaction<'txn>> { /* private fields */ }Expand description
IndexStorage manages secondary index entries and lookups.
The two lifetime parameters serve distinct purposes:
'a: The borrow duration of the transaction reference'txn: The lifetime parameter of the KVTransaction type itself
This separation is necessary to allow SqlTransaction to return IndexStorage instances while maintaining proper lifetime relationships with GATs.
Implementations§
Source§impl<'a, 'txn, T: KVTransaction<'txn>> IndexStorage<'a, 'txn, T>
impl<'a, 'txn, T: KVTransaction<'txn>> IndexStorage<'a, 'txn, T>
Sourcepub fn new(
txn: &'a mut T,
index_id: u32,
unique: bool,
column_indices: Vec<usize>,
) -> Self
pub fn new( txn: &'a mut T, index_id: u32, unique: bool, column_indices: Vec<usize>, ) -> Self
Create a new IndexStorage for the given index definition.
Sourcepub fn insert(&mut self, row: &[SqlValue], row_id: u64) -> Result<()>
pub fn insert(&mut self, row: &[SqlValue], row_id: u64) -> Result<()>
Insert an index entry for the provided row values and RowID.
Sourcepub fn delete(&mut self, row: &[SqlValue], row_id: u64) -> Result<()>
pub fn delete(&mut self, row: &[SqlValue], row_id: u64) -> Result<()>
Delete an index entry associated with the provided row values and RowID.
Sourcepub fn lookup(&mut self, value: &SqlValue) -> Result<Vec<u64>>
pub fn lookup(&mut self, value: &SqlValue) -> Result<Vec<u64>>
Equality lookup for single-column index.
Sourcepub fn lookup_composite(&mut self, values: &[SqlValue]) -> Result<Vec<u64>>
pub fn lookup_composite(&mut self, values: &[SqlValue]) -> Result<Vec<u64>>
Equality lookup for composite index.
Sourcepub fn range_scan(
&mut self,
start: Option<&SqlValue>,
end: Option<&SqlValue>,
start_inclusive: bool,
end_inclusive: bool,
) -> Result<IndexScanIterator<'_>>
pub fn range_scan( &mut self, start: Option<&SqlValue>, end: Option<&SqlValue>, start_inclusive: bool, end_inclusive: bool, ) -> Result<IndexScanIterator<'_>>
Range lookup for single-column index.
Auto Trait Implementations§
impl<'a, 'txn, T> Freeze for IndexStorage<'a, 'txn, T>
impl<'a, 'txn, T> RefUnwindSafe for IndexStorage<'a, 'txn, T>where
T: RefUnwindSafe,
impl<'a, 'txn, T> Send for IndexStorage<'a, 'txn, T>where
T: Send,
impl<'a, 'txn, T> Sync for IndexStorage<'a, 'txn, T>where
T: Sync,
impl<'a, 'txn, T> Unpin for IndexStorage<'a, 'txn, T>
impl<'a, 'txn, T> !UnwindSafe for IndexStorage<'a, 'txn, T>
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