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

use super::*;

impl Default for DecimalKind {
    fn default() -> Self {
        DecimalKind::Float32
    }
}

impl Deref for DecimalDescription {
    type Target = DecimalKind;

    fn deref(&self) -> &Self::Target {
        &self.kind
    }
}

impl DecimalKind {
    pub fn as_csharp_type(&self) -> &'static str {
        match self {
            DecimalKind::Float32 => "float",
            DecimalKind::Float64 => "double",
            DecimalKind::Decimal128 => "decimal",
        }
    }
    pub fn as_csharp_reader(&self) -> &'static str {
        match self {
            DecimalKind::Float32 => "ReadSingle",
            DecimalKind::Float64 => "ReadDouble",
            DecimalKind::Decimal128 => "ReadDecimal",
        }
    }
}