vortex_scalar/
null.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use vortex_error::VortexError;

use crate::{Scalar, ScalarValue};

impl TryFrom<&Scalar> for () {
    type Error = VortexError;

    fn try_from(scalar: &Scalar) -> Result<Self, Self::Error> {
        scalar.value().as_null()
    }
}

impl TryFrom<Scalar> for () {
    type Error = VortexError;

    fn try_from(scalar: Scalar) -> Result<Self, Self::Error> {
        <()>::try_from(&scalar)
    }
}

impl TryFrom<&ScalarValue> for () {
    type Error = VortexError;

    fn try_from(value: &ScalarValue) -> Result<Self, Self::Error> {
        value.as_null()
    }
}

impl TryFrom<ScalarValue> for () {
    type Error = VortexError;

    fn try_from(value: ScalarValue) -> Result<Self, Self::Error> {
        <()>::try_from(&value)
    }
}