pub struct VariableDeclaration {
pub name: String,
pub default: Option<ExprNode>,
pub declaration_type: Option<Type>,
pub is_var_arg: bool,
pub is_closure: bool,
pub is_env: bool,
}
Fields§
§name: String
§default: Option<ExprNode>
§declaration_type: Option<Type>
§is_var_arg: bool
§is_closure: bool
§is_env: bool
Implementations§
Source§impl VariableDeclaration
impl VariableDeclaration
pub fn new(name: impl Into<String>) -> Self
pub fn set_name(&mut self, name: impl Into<String>)
pub fn with_type(self, dec: Type) -> Self
pub fn with_env(self, is_env: bool) -> Self
pub fn is_env(&self) -> bool
pub fn with_closure(self, is_closure: bool) -> Self
pub fn with_var_arg(self, is_var_arg: bool) -> Self
pub fn is_var_arg(&self) -> bool
pub fn type(&self) -> Option<Type>
pub fn name(&self) -> String
pub fn has_default(&self) -> bool
pub fn get_default(&self) -> Option<&ExprNode>
pub fn get_mut_default(&mut self) -> Option<&mut ExprNode>
pub fn get_data(&self, key: &str) -> Option<Data>
pub fn set_type(&mut self, ty: Type)
pub fn set_default(&mut self, expr: ExprNode)
pub fn with_default(self, default: ExprNode) -> Self
Sourcepub fn clone_default(&self) -> Option<ExprNode>
pub fn clone_default(&self) -> Option<ExprNode>
克隆默认值表达式,如果存在
Trait Implementations§
Source§impl Clone for VariableDeclaration
impl Clone for VariableDeclaration
Source§fn clone(&self) -> VariableDeclaration
fn clone(&self) -> VariableDeclaration
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 moreAuto Trait Implementations§
impl Freeze for VariableDeclaration
impl RefUnwindSafe for VariableDeclaration
impl Send for VariableDeclaration
impl Sync for VariableDeclaration
impl Unpin for VariableDeclaration
impl UnwindSafe for VariableDeclaration
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