Skip to main content

usage/spec/
data_types.rs

1use serde::Serialize;
2use strum::{Display, EnumString};
3
4/// The type a config property's values take.
5///
6/// `Display` is the KDL spelling, so a parsed spec can be written back out — without it
7/// `data_type` was read and then silently dropped by the serializer, which is how a
8/// `data_type="integer"` came back as `Null` after one round trip.
9#[derive(Debug, Copy, Clone, PartialEq, Eq, Display, EnumString, Serialize, Default)]
10#[strum(serialize_all = "snake_case")]
11#[serde(rename_all = "snake_case")]
12pub enum SpecDataTypes {
13    #[default]
14    Null,
15    String,
16    Integer,
17    Float,
18    Boolean,
19}