Skip to main content

aptos_client_icp/models/
move_struct.rs

1/*
2 * Aptos Node API
3 *
4 * The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
5 *
6 * The version of the OpenAPI document: 1.2.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// MoveStruct : A move struct
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct MoveStruct {
17    #[serde(rename = "name")]
18    pub name: String,
19    /// Whether the struct is a native struct of Move
20    #[serde(rename = "is_native")]
21    pub is_native: bool,
22    /// Whether the struct is marked with the #[event] annotation
23    #[serde(rename = "is_event")]
24    pub is_event: bool,
25    /// Abilities associated with the struct
26    #[serde(rename = "abilities")]
27    pub abilities: Vec<String>,
28    /// Generic types associated with the struct
29    #[serde(rename = "generic_type_params")]
30    pub generic_type_params: Vec<models::MoveStructGenericTypeParam>,
31    /// Fields associated with the struct
32    #[serde(rename = "fields")]
33    pub fields: Vec<models::MoveStructField>,
34}
35
36impl MoveStruct {
37    /// A move struct
38    pub fn new(name: String, is_native: bool, is_event: bool, abilities: Vec<String>, generic_type_params: Vec<models::MoveStructGenericTypeParam>, fields: Vec<models::MoveStructField>) -> MoveStruct {
39        MoveStruct {
40            name,
41            is_native,
42            is_event,
43            abilities,
44            generic_type_params,
45            fields,
46        }
47    }
48}
49