laminar_core/lookup/
table.rs1use arrow_array::RecordBatch;
4
5#[derive(Debug, Clone)]
7pub enum LookupResult {
8 Hit(RecordBatch),
10 Pending,
12 NotFound,
14}
15
16impl LookupResult {
17 #[must_use]
19 pub const fn is_hit(&self) -> bool {
20 matches!(self, Self::Hit(_))
21 }
22
23 #[must_use]
25 pub const fn is_not_found(&self) -> bool {
26 matches!(self, Self::NotFound)
27 }
28
29 #[must_use]
31 pub fn into_batch(self) -> Option<RecordBatch> {
32 match self {
33 Self::Hit(b) => Some(b),
34 _ => None,
35 }
36 }
37}
38
39impl PartialEq for LookupResult {
40 fn eq(&self, other: &Self) -> bool {
41 match (self, other) {
42 (Self::Hit(a), Self::Hit(b)) => a == b,
43 (Self::Pending, Self::Pending) | (Self::NotFound, Self::NotFound) => true,
44 _ => false,
45 }
46 }
47}
48
49impl Eq for LookupResult {}