pub struct StorageRangeConstraint { /* private fields */ }Expand description
Mandatory storage bounds and immutable fence for one physical range.
The primary-key interval is always represented as concrete half-open KV
bounds. Even a full logical table uses the canonical table-prefix end,
never scan_prefix.
Implementations§
Source§impl StorageRangeConstraint
impl StorageRangeConstraint
Sourcepub fn new(
range_id: impl Into<String>,
generation: u64,
row_key_range: RowKeyRange,
snapshot: RangeReadSnapshot,
) -> Result<Self, StorageRangeConstraintError>
pub fn new( range_id: impl Into<String>, generation: u64, row_key_range: RowKeyRange, snapshot: RangeReadSnapshot, ) -> Result<Self, StorageRangeConstraintError>
Constructs a validated, range-bound worker constraint.
Sourcepub fn range_id(&self) -> &str
pub fn range_id(&self) -> &str
Returns the physical range identity selected by the route planner.
Sourcepub const fn generation(&self) -> u64
pub const fn generation(&self) -> u64
Returns the immutable range-generation fence.
Sourcepub const fn row_key_range(&self) -> RowKeyRange
pub const fn row_key_range(&self) -> RowKeyRange
Returns the canonical primary-key interval.
Sourcepub fn encoded_bounds(&self) -> (&[u8], &[u8])
pub fn encoded_bounds(&self) -> (&[u8], &[u8])
Returns concrete KV scan bounds [lower_inclusive, upper_exclusive).
Sourcepub fn snapshot(&self) -> &RangeReadSnapshot
pub fn snapshot(&self) -> &RangeReadSnapshot
Returns the immutable catalog/schema/index snapshot fence.
Sourcepub fn validate_table(&self, table_meta: &TableMetadata) -> Result<()>
pub fn validate_table(&self, table_meta: &TableMetadata) -> Result<()>
Validates that a supplied SQL table matches the planned physical range.
Sourcepub fn validate_read_at(&self, actual: Option<ReadAtPoint>) -> Result<()>
pub fn validate_read_at(&self, actual: Option<ReadAtPoint>) -> Result<()>
Validates that the storage transaction is pinned at this exact fence.
Sourcepub fn contains_primary_key(&self, encoded_primary_key: &[u8]) -> Result<bool>
pub fn contains_primary_key(&self, encoded_primary_key: &[u8]) -> Result<bool>
Rechecks a canonical primary key after a secondary-index lookup.
Sourcepub fn recheck_secondary_index_hits<I>(&self, row_ids: I) -> Result<Vec<u64>>where
I: IntoIterator<Item = u64>,
pub fn recheck_secondary_index_hits<I>(&self, row_ids: I) -> Result<Vec<u64>>where
I: IntoIterator<Item = u64>,
Rechecks every secondary-index candidate against the primary-key range.
Index sort order is not a substitute for physical row bounds. A candidate outside the range is omitted before its row can be fetched or emitted.
Trait Implementations§
Source§impl Clone for StorageRangeConstraint
impl Clone for StorageRangeConstraint
Source§fn clone(&self) -> StorageRangeConstraint
fn clone(&self) -> StorageRangeConstraint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StorageRangeConstraint
impl Debug for StorageRangeConstraint
impl Eq for StorageRangeConstraint
Source§impl PartialEq for StorageRangeConstraint
impl PartialEq for StorageRangeConstraint
impl StructuralPartialEq for StorageRangeConstraint
Auto Trait Implementations§
impl Freeze for StorageRangeConstraint
impl RefUnwindSafe for StorageRangeConstraint
impl Send for StorageRangeConstraint
impl Sync for StorageRangeConstraint
impl Unpin for StorageRangeConstraint
impl UnsafeUnpin for StorageRangeConstraint
impl UnwindSafe for StorageRangeConstraint
Blanket Implementations§
impl<T> Allocation for T
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.