iota_types/
collection_types.rs1use iota_sdk_types::ObjectId;
6use serde::{Deserialize, Serialize};
7
8use crate::id::UID;
9
10#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)]
12pub struct TableVec {
13 pub contents: Table,
14}
15
16impl Default for TableVec {
17 fn default() -> Self {
18 TableVec {
19 contents: Table {
20 id: ObjectId::ZERO,
21 size: 0,
22 },
23 }
24 }
25}
26
27#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)]
29pub struct Table {
30 pub id: ObjectId,
31 pub size: u64,
32}
33
34impl Default for Table {
35 fn default() -> Self {
36 Table {
37 id: ObjectId::ZERO,
38 size: 0,
39 }
40 }
41}
42
43#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)]
45pub struct Bag {
46 pub id: UID,
47 pub size: u64,
48}
49
50impl Default for Bag {
51 fn default() -> Self {
52 Self {
53 id: UID::new(ObjectId::ZERO),
54 size: 0,
55 }
56 }
57}