oneline_template/function_executor/
function_argument.rs

1use crate::function_executor::function_argument_type::FunctionArgumentType;
2
3/// Information about function argument schema.
4#[derive(Debug)]
5pub struct FunctionArgument {
6    argument_type: FunctionArgumentType,
7}
8
9impl FunctionArgument {
10    /// Creates function argument schema with string type.
11    pub fn string() -> FunctionArgument {
12        return FunctionArgument {
13            argument_type: FunctionArgumentType::String,
14        }
15    }
16
17    /// Creates function argument schema with bool type.
18    pub fn bool() -> FunctionArgument {
19        return FunctionArgument {
20            argument_type: FunctionArgumentType::Bool,
21        }
22    }
23
24    /// Creates function argument schema with uint type.
25    pub fn uint() -> FunctionArgument {
26        return FunctionArgument {
27            argument_type: FunctionArgumentType::UInt,
28        }
29    }
30    
31    /// Creates function argument schema with int type.
32    pub fn int() -> FunctionArgument {
33        return FunctionArgument {
34            argument_type: FunctionArgumentType::Int,
35        }
36    }
37
38    pub (crate) fn get_type(&self) -> &FunctionArgumentType {
39        return &self.argument_type;
40    }
41}