1use cyfs_base::*;
2
3pub enum PeerOfUnion {
4 Left,
5 Right
6}
7
8#[derive(RawEncode, RawDecode)]
9pub struct UnionBalance {
10 pub total: i64,
11 pub left: i64,
12 pub right: i64,
13 pub deviation: i64
14}
15
16impl std::fmt::Display for UnionBalance {
17 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18 write!(f, "({}, {}, {}, {})", self.left, self.right, self.deviation, self.total)
19 }
20}
21
22impl UnionBalance {
23 pub fn default() -> UnionBalance {
24 UnionBalance {
25 total: 0,
26 left: 0,
27 right: 0,
28 deviation: 0
29 }
30 }
31}
32
33
34pub enum FFSObjectState {
35 Normal,
36 Expire,
37}