Skip to main content

armour_typ/
scalar.rs

1use serde::Serialize;
2
3/// Leaf schema types — no nested `Typ`. `Copy`, const-constructible,
4/// shared by `Typ` (compile-time) and `SchemaTyp` (runtime).
5#[derive(PartialEq, Eq, Clone, Copy, Hash, Debug, Serialize)]
6#[serde(tag = "type", content = "data")]
7pub enum ScalarTyp {
8    Bool,
9    U8,
10    U16,
11    U32,
12    U64,
13    I32,
14    I64,
15    F32,
16    F64,
17    Str,
18    /// i64 unix timestamp milliseconds
19    Datetime,
20    /// u64 unix timestamp milliseconds
21    Timestamp,
22    /// rust_decimal - 96 bit repr
23    Decimal,
24    /// u32 big endian id type
25    Id32,
26    /// u64 big endian id type
27    Id64,
28    /// Fuid (8 bytes, repr(transparent) over u64_be)
29    Fuid,
30    /// LowId
31    LowId,
32    /// byte array
33    Bytes,
34    Void,
35    /// Rust binary JSON representation
36    #[serde(rename = "Json")]
37    RustJson,
38    /// vector of bytes, representing json string
39    JsonBytes,
40    /// array bytes with bytes count in scheme
41    ArrayBytes(u32),
42}