c3p0_common/json/
types.rs

1use std::fmt::Debug;
2
3use serde::{Serialize, de::DeserializeOwned};
4
5/// A type alias for the version of a model.
6pub type VersionType = u32;
7
8/// A type alias for the epoch millis of a model.
9pub type EpochMillisType = i64;
10
11/// A trait for a data type.
12pub trait DataType:
13    'static + Clone + serde::ser::Serialize + serde::de::DeserializeOwned + Send + Sync + Unpin
14{
15}
16
17impl<T: 'static + Clone + serde::ser::Serialize + serde::de::DeserializeOwned + Send + Sync + Unpin>
18    DataType for T
19{
20}
21
22pub trait IdType:
23    'static
24    + Clone
25    + Serialize
26    + DeserializeOwned
27    + Debug
28    + Send
29    + Sync
30    + Unpin
31    + PartialEq
32    + Eq
33    + PartialOrd
34    + Ord
35{
36}
37
38impl<
39    T: 'static
40        + Clone
41        + Serialize
42        + DeserializeOwned
43        + Debug
44        + Send
45        + Sync
46        + Unpin
47        + PartialEq
48        + Eq
49        + PartialOrd
50        + Ord,
51> IdType for T
52{
53}