Skip to main content

aptos_client_icp/models/
move_function.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/// MoveFunction : Move function
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct MoveFunction {
17    #[serde(rename = "name")]
18    pub name: String,
19    #[serde(rename = "visibility")]
20    pub visibility: models::MoveFunctionVisibility,
21    /// Whether the function can be called as an entry function directly in a transaction
22    #[serde(rename = "is_entry")]
23    pub is_entry: bool,
24    /// Whether the function is a view function or not
25    #[serde(rename = "is_view")]
26    pub is_view: bool,
27    /// Generic type params associated with the Move function
28    #[serde(rename = "generic_type_params")]
29    pub generic_type_params: Vec<models::MoveFunctionGenericTypeParam>,
30    /// Parameters associated with the move function
31    #[serde(rename = "params")]
32    pub params: Vec<String>,
33    /// Return type of the function
34    #[serde(rename = "return")]
35    pub r#return: Vec<String>,
36}
37
38impl MoveFunction {
39    /// Move function
40    pub fn new(name: String, visibility: models::MoveFunctionVisibility, is_entry: bool, is_view: bool, generic_type_params: Vec<models::MoveFunctionGenericTypeParam>, params: Vec<String>, r#return: Vec<String>) -> MoveFunction {
41        MoveFunction {
42            name,
43            visibility,
44            is_entry,
45            is_view,
46            generic_type_params,
47            params,
48            r#return,
49        }
50    }
51}
52