tonbo_predicate/core/
operand.rs1use std::sync::Arc;
2
3use super::ScalarValue;
4
5#[derive(Clone, Debug, PartialEq, Eq, Hash)]
11pub struct ColumnRef {
12 pub name: Arc<str>,
14}
15
16impl ColumnRef {
17 #[must_use]
19 pub fn new<N>(name: N) -> Self
20 where
21 N: Into<Arc<str>>,
22 {
23 Self { name: name.into() }
24 }
25}
26
27#[derive(Clone, Debug, PartialEq)]
29pub enum Operand {
30 Column(ColumnRef),
32 Literal(ScalarValue),
34}
35
36impl From<ColumnRef> for Operand {
37 fn from(value: ColumnRef) -> Self {
38 Self::Column(value)
39 }
40}
41
42impl From<ScalarValue> for Operand {
43 fn from(value: ScalarValue) -> Self {
44 Self::Literal(value)
45 }
46}