ic_dbms_api/dbms/
types.rs1use candid::CandidType;
4use serde::{Deserialize, Serialize};
5
6use crate::dbms::value::Value;
7use crate::memory::Encode;
8
9mod blob;
10mod boolean;
11mod date;
12mod datetime;
13mod decimal;
14mod integers;
15mod nullable;
16mod principal;
17mod text;
18mod uuid;
19
20pub use self::blob::Blob;
21pub use self::boolean::Boolean;
22pub use self::date::Date;
23pub use self::datetime::DateTime;
24pub use self::decimal::Decimal;
25pub use self::integers::{Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64};
26pub use self::nullable::Nullable;
27pub use self::principal::Principal;
28pub use self::text::Text;
29pub use self::uuid::Uuid;
30
31pub trait DataType:
39 Clone
40 + std::fmt::Debug
41 + std::fmt::Display
42 + PartialEq
43 + Eq
44 + Default
45 + PartialOrd
46 + Ord
47 + std::hash::Hash
48 + Encode
49 + CandidType
50 + Serialize
51 + Into<Value>
52 + for<'de> Deserialize<'de>
53{
54}
55
56#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
58pub enum DataTypeKind {
59 Blob,
60 Boolean,
61 Date,
62 DateTime,
63 Decimal,
64 Int32,
65 Int64,
66 Principal,
67 Text,
68 Uint32,
69 Uint64,
70 Uuid,
71}