polars_arrow/scalar/
null.rs1use super::Scalar;
2use crate::datatypes::ArrowDataType;
3
4#[derive(Debug, Clone, PartialEq, Eq)]
6pub struct NullScalar {}
7
8impl NullScalar {
9 #[inline]
11 pub fn new() -> Self {
12 Self {}
13 }
14}
15
16impl Default for NullScalar {
17 fn default() -> Self {
18 Self::new()
19 }
20}
21
22impl Scalar for NullScalar {
23 #[inline]
24 fn as_any(&self) -> &dyn std::any::Any {
25 self
26 }
27
28 #[inline]
29 fn is_valid(&self) -> bool {
30 false
31 }
32
33 #[inline]
34 fn dtype(&self) -> &ArrowDataType {
35 &ArrowDataType::Null
36 }
37}