reifydb_core/key/operator/keyspace/
lookup.rs1use reifydb_value::value::row_number::RowNumber;
5
6use crate::{
7 key::{
8 operator::{
9 state::{GroupId, KeyspaceId},
10 traits::Keyspace,
11 },
12 typed::{
13 BoundedKey, DenseKey, KeyLayout,
14 direction::{Asc, Direction, KeyField},
15 layout::{KeyColumn, KeyColumnType, KeyLayout, KeyValue, KeyValues},
16 },
17 },
18 metrics::heap::HeapSize,
19};
20
21#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, KeyLayout, HeapSize)]
22pub struct LookupReadKey {
23 pub row: Asc<RowNumber>,
24}
25
26#[derive(Clone, Copy, Debug, PartialEq, Eq)]
27pub struct LookupRead;
28
29impl Keyspace for LookupRead {
30 const ID: KeyspaceId = KeyspaceId::LOOKUP_READ;
31 const NAME: &'static str = "LOOKUP_READ";
32 const RANGE_CACHED: bool = true;
33
34 type GroupedKey = LookupReadKey;
35 type Suffix = LookupReadKey;
36
37 fn split(key: &Self::GroupedKey) -> (GroupId, Self::Suffix) {
38 (GroupId::ROOT, *key)
39 }
40
41 fn join(_group: GroupId, suffix: Self::Suffix) -> Self::GroupedKey {
42 suffix
43 }
44}