Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-arrow/src/scalar/null.rs
6939 views
1
use super::Scalar;
2
use crate::datatypes::ArrowDataType;
3
4
/// The representation of a single entry of a [`crate::array::NullArray`].
5
#[derive(Debug, Clone, PartialEq, Eq)]
6
pub struct NullScalar {}
7
8
impl NullScalar {
9
/// A new [`NullScalar`]
10
#[inline]
11
pub fn new() -> Self {
12
Self {}
13
}
14
}
15
16
impl Default for NullScalar {
17
fn default() -> Self {
18
Self::new()
19
}
20
}
21
22
impl 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
}
38
39