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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
use serde::{Deserialize, Serialize};

/// Represents the data types used by [ResultSet](crate::database::results::ResultSet)
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub enum FieldType {
  Unit,

  String,
  EncryptedString,

  Boolean,
  Char,
  I16,
  I32,
  U32,
  I64,
  F32,
  F64,
  Numeric,

  Date,
  Time,
  TimeZoned,
  Timestamp,
  TimestampZoned,
  Interval,

  Uuid,
  Json,
  Xml,
  StringMap,

  ByteArray,
  BitArray,

  Cidr,
  InetAddr,
  MacAddr,

  Box,
  Circle,
  Path,
  Point,
  Polygon,

  TsQuery,
  TsVector,

  List { t: Box<FieldType> },
  Set { t: Box<FieldType> },
  Map { k: Box<FieldType>, v: Box<FieldType> },

  Range { t: Box<FieldType> },
  Domain { t: Box<FieldType> },

  Enum { key: String },
  Struct { key: String },
  Object { key: String, fields: Vec<String> },
  Intersection { key: String, types: Vec<FieldType> },
  Union { key: String, types: Vec<FieldType> },
  Method { params: Vec<String>, ret: Box<FieldType> },

  Unknown { t: String }
}