gitql_ast/types/
null.rs

1use std::any::Any;
2
3use super::base::DataType;
4
5#[derive(Clone)]
6pub struct NullType;
7
8impl DataType for NullType {
9    fn literal(&self) -> String {
10        "Null".to_string()
11    }
12
13    fn equals(&self, other: &Box<dyn DataType>) -> bool {
14        other.is_any() || other.is_null() || other.is_variant_with(|t| t.is_null())
15    }
16
17    fn as_any(&self) -> &dyn Any {
18        self
19    }
20}