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 more