pub struct Query {
pub space: SpaceId,
pub snapshot: SnapshotId,
pub range: Option<SpatialRange>,
pub key_range: Option<(u128, u128)>,
pub as_of: Option<RevisionId>,
pub include_tombstones: bool,
}Expand description
A read query against a snapshot. Queries are pure descriptors — the storage layer executes them.
Fields§
§space: SpaceId§snapshot: SnapshotId§range: Option<SpatialRange>Spatial bounds to filter records by. None = all records in the space.
key_range: Option<(u128, u128)>Precomputed Hilbert key interval [min, max] for block pruning.
Takes precedence over range when set; None falls back to range.
as_of: Option<RevisionId>Only return records at or before this revision. Defaults to the snapshot’s own revision when None.
include_tombstones: boolInclude tombstoned (deleted) records in results.
Implementations§
Source§impl Query
impl Query
Sourcepub fn new(space: SpaceId, snapshot: SnapshotId) -> Self
pub fn new(space: SpaceId, snapshot: SnapshotId) -> Self
Build a query pinned to a specific space and snapshot.
Sourcepub fn with_range(self, range: SpatialRange) -> Self
pub fn with_range(self, range: SpatialRange) -> Self
Add a spatial range filter.
Sourcepub fn with_key_range(self, lo: u128, hi: u128) -> Self
pub fn with_key_range(self, lo: u128, hi: u128) -> Self
Set a precomputed Hilbert key interval, taking precedence over range.
Sourcepub fn as_of(self, revision: RevisionId) -> Self
pub fn as_of(self, revision: RevisionId) -> Self
Restrict results to records at or before revision.
Sourcepub fn include_tombstones(self) -> Self
pub fn include_tombstones(self) -> Self
Include tombstoned records in query results.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Query
impl<'de> Deserialize<'de> for Query
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin for Query
impl UnwindSafe for Query
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