Skip to main content

iota_types/
collection_types.rs

1// Copyright (c) Mysten Labs, Inc.
2// Modifications Copyright (c) 2024 IOTA Stiftung
3// SPDX-License-Identifier: Apache-2.0
4
5use iota_sdk_types::ObjectId;
6use serde::{Deserialize, Serialize};
7
8/// Rust version of the Move iota::table::Table type.
9#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)]
10pub struct TableVec {
11    pub contents: Table,
12}
13
14impl Default for TableVec {
15    fn default() -> Self {
16        TableVec {
17            contents: Table {
18                id: ObjectId::ZERO,
19                size: 0,
20            },
21        }
22    }
23}
24
25/// Rust version of the Move iota::table::Table type.
26#[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)]
27pub struct Table {
28    pub id: ObjectId,
29    pub size: u64,
30}
31
32impl Default for Table {
33    fn default() -> Self {
34        Table {
35            id: ObjectId::ZERO,
36            size: 0,
37        }
38    }
39}