pub struct GaiaFunction {
pub name: String,
pub parameters: Vec<GaiaType>,
pub return_type: Option<GaiaType>,
pub instructions: Vec<GaiaInstruction>,
pub locals: Vec<GaiaType>,
}Expand description
Gaia 函数定义
Fields§
§name: String函数名
parameters: Vec<GaiaType>参数类型列表
return_type: Option<GaiaType>返回类型
instructions: Vec<GaiaInstruction>指令序列
locals: Vec<GaiaType>局部变量类型列表
Implementations§
Source§impl GaiaFunction
impl GaiaFunction
Sourcepub fn add_parameter(&mut self, param_type: GaiaType)
pub fn add_parameter(&mut self, param_type: GaiaType)
添加参数
Sourcepub fn set_return_type(&mut self, return_type: GaiaType)
pub fn set_return_type(&mut self, return_type: GaiaType)
设置返回类型
Sourcepub fn add_instruction(&mut self, instruction: GaiaInstruction)
pub fn add_instruction(&mut self, instruction: GaiaInstruction)
添加指令
Trait Implementations§
Source§impl Clone for GaiaFunction
impl Clone for GaiaFunction
Source§fn clone(&self) -> GaiaFunction
fn clone(&self) -> GaiaFunction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GaiaFunction
impl Debug for GaiaFunction
Source§impl<'de> Deserialize<'de> for GaiaFunction
impl<'de> Deserialize<'de> for GaiaFunction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for GaiaFunction
impl PartialEq for GaiaFunction
Source§impl Serialize for GaiaFunction
impl Serialize for GaiaFunction
impl StructuralPartialEq for GaiaFunction
Auto Trait Implementations§
impl Freeze for GaiaFunction
impl RefUnwindSafe for GaiaFunction
impl Send for GaiaFunction
impl Sync for GaiaFunction
impl Unpin for GaiaFunction
impl UnwindSafe for GaiaFunction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more