pub enum ExprKind {
Pointer(Sid),
Literal(Vec<u8>),
Call(Box<Call>),
Function(Box<Function>),
Tuple(Box<Tuple>),
Array(Box<Array>),
EnumVariant(Box<EnumVariant>),
EnumEq(Box<EnumEq>),
Offset(Box<Offset>),
Deref(Box<Deref>),
Binding(Box<Binding>),
Switch(Vec<SwitchBranch>),
}Variants§
Pointer(Sid)
Literal(Vec<u8>)
Call(Box<Call>)
Function(Box<Function>)
Tuple(Box<Tuple>)
Array(Box<Array>)
EnumVariant(Box<EnumVariant>)
EnumEq(Box<EnumEq>)
Offset(Box<Offset>)
Deref(Box<Deref>)
Binding(Box<Binding>)
Switch(Vec<SwitchBranch>)
Implementations§
Source§impl ExprKind
impl ExprKind
Sourcepub fn is_pointer(&self) -> bool
pub fn is_pointer(&self) -> bool
Returns true if this is a ExprKind::Pointer, otherwise false
Sourcepub fn as_pointer_mut(&mut self) -> Option<&mut Sid>
pub fn as_pointer_mut(&mut self) -> Option<&mut Sid>
Optionally returns mutable references to the inner fields if this is a ExprKind::Pointer, otherwise None
Sourcepub fn as_pointer(&self) -> Option<&Sid>
pub fn as_pointer(&self) -> Option<&Sid>
Optionally returns references to the inner fields if this is a ExprKind::Pointer, otherwise None
Sourcepub fn into_pointer(self) -> Result<Sid, Self>
pub fn into_pointer(self) -> Result<Sid, Self>
Returns the inner fields if this is a ExprKind::Pointer, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_literal(&self) -> bool
pub fn is_literal(&self) -> bool
Returns true if this is a ExprKind::Literal, otherwise false
Sourcepub fn as_literal_mut(&mut self) -> Option<&mut Vec<u8>>
pub fn as_literal_mut(&mut self) -> Option<&mut Vec<u8>>
Optionally returns mutable references to the inner fields if this is a ExprKind::Literal, otherwise None
Sourcepub fn as_literal(&self) -> Option<&Vec<u8>>
pub fn as_literal(&self) -> Option<&Vec<u8>>
Optionally returns references to the inner fields if this is a ExprKind::Literal, otherwise None
Sourcepub fn into_literal(self) -> Result<Vec<u8>, Self>
pub fn into_literal(self) -> Result<Vec<u8>, Self>
Returns the inner fields if this is a ExprKind::Literal, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_call_mut(&mut self) -> Option<&mut Box<Call>>
pub fn as_call_mut(&mut self) -> Option<&mut Box<Call>>
Optionally returns mutable references to the inner fields if this is a ExprKind::Call, otherwise None
Sourcepub fn as_call(&self) -> Option<&Box<Call>>
pub fn as_call(&self) -> Option<&Box<Call>>
Optionally returns references to the inner fields if this is a ExprKind::Call, otherwise None
Sourcepub fn into_call(self) -> Result<Box<Call>, Self>
pub fn into_call(self) -> Result<Box<Call>, Self>
Returns the inner fields if this is a ExprKind::Call, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Returns true if this is a ExprKind::Function, otherwise false
Sourcepub fn as_function_mut(&mut self) -> Option<&mut Box<Function>>
pub fn as_function_mut(&mut self) -> Option<&mut Box<Function>>
Optionally returns mutable references to the inner fields if this is a ExprKind::Function, otherwise None
Sourcepub fn as_function(&self) -> Option<&Box<Function>>
pub fn as_function(&self) -> Option<&Box<Function>>
Optionally returns references to the inner fields if this is a ExprKind::Function, otherwise None
Sourcepub fn into_function(self) -> Result<Box<Function>, Self>
pub fn into_function(self) -> Result<Box<Function>, Self>
Returns the inner fields if this is a ExprKind::Function, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_tuple_mut(&mut self) -> Option<&mut Box<Tuple>>
pub fn as_tuple_mut(&mut self) -> Option<&mut Box<Tuple>>
Optionally returns mutable references to the inner fields if this is a ExprKind::Tuple, otherwise None
Sourcepub fn as_tuple(&self) -> Option<&Box<Tuple>>
pub fn as_tuple(&self) -> Option<&Box<Tuple>>
Optionally returns references to the inner fields if this is a ExprKind::Tuple, otherwise None
Sourcepub fn into_tuple(self) -> Result<Box<Tuple>, Self>
pub fn into_tuple(self) -> Result<Box<Tuple>, Self>
Returns the inner fields if this is a ExprKind::Tuple, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_array_mut(&mut self) -> Option<&mut Box<Array>>
pub fn as_array_mut(&mut self) -> Option<&mut Box<Array>>
Optionally returns mutable references to the inner fields if this is a ExprKind::Array, otherwise None
Sourcepub fn as_array(&self) -> Option<&Box<Array>>
pub fn as_array(&self) -> Option<&Box<Array>>
Optionally returns references to the inner fields if this is a ExprKind::Array, otherwise None
Sourcepub fn into_array(self) -> Result<Box<Array>, Self>
pub fn into_array(self) -> Result<Box<Array>, Self>
Returns the inner fields if this is a ExprKind::Array, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_enum_variant(&self) -> bool
pub fn is_enum_variant(&self) -> bool
Returns true if this is a ExprKind::EnumVariant, otherwise false
Sourcepub fn as_enum_variant_mut(&mut self) -> Option<&mut Box<EnumVariant>>
pub fn as_enum_variant_mut(&mut self) -> Option<&mut Box<EnumVariant>>
Optionally returns mutable references to the inner fields if this is a ExprKind::EnumVariant, otherwise None
Sourcepub fn as_enum_variant(&self) -> Option<&Box<EnumVariant>>
pub fn as_enum_variant(&self) -> Option<&Box<EnumVariant>>
Optionally returns references to the inner fields if this is a ExprKind::EnumVariant, otherwise None
Sourcepub fn into_enum_variant(self) -> Result<Box<EnumVariant>, Self>
pub fn into_enum_variant(self) -> Result<Box<EnumVariant>, Self>
Returns the inner fields if this is a ExprKind::EnumVariant, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_enum_eq(&self) -> bool
pub fn is_enum_eq(&self) -> bool
Returns true if this is a ExprKind::EnumEq, otherwise false
Sourcepub fn as_enum_eq_mut(&mut self) -> Option<&mut Box<EnumEq>>
pub fn as_enum_eq_mut(&mut self) -> Option<&mut Box<EnumEq>>
Optionally returns mutable references to the inner fields if this is a ExprKind::EnumEq, otherwise None
Sourcepub fn as_enum_eq(&self) -> Option<&Box<EnumEq>>
pub fn as_enum_eq(&self) -> Option<&Box<EnumEq>>
Optionally returns references to the inner fields if this is a ExprKind::EnumEq, otherwise None
Sourcepub fn into_enum_eq(self) -> Result<Box<EnumEq>, Self>
pub fn into_enum_eq(self) -> Result<Box<EnumEq>, Self>
Returns the inner fields if this is a ExprKind::EnumEq, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_offset_mut(&mut self) -> Option<&mut Box<Offset>>
pub fn as_offset_mut(&mut self) -> Option<&mut Box<Offset>>
Optionally returns mutable references to the inner fields if this is a ExprKind::Offset, otherwise None
Sourcepub fn as_offset(&self) -> Option<&Box<Offset>>
pub fn as_offset(&self) -> Option<&Box<Offset>>
Optionally returns references to the inner fields if this is a ExprKind::Offset, otherwise None
Sourcepub fn into_offset(self) -> Result<Box<Offset>, Self>
pub fn into_offset(self) -> Result<Box<Offset>, Self>
Returns the inner fields if this is a ExprKind::Offset, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_deref_mut(&mut self) -> Option<&mut Box<Deref>>
pub fn as_deref_mut(&mut self) -> Option<&mut Box<Deref>>
Optionally returns mutable references to the inner fields if this is a ExprKind::Deref, otherwise None
Sourcepub fn as_deref(&self) -> Option<&Box<Deref>>
pub fn as_deref(&self) -> Option<&Box<Deref>>
Optionally returns references to the inner fields if this is a ExprKind::Deref, otherwise None
Sourcepub fn into_deref(self) -> Result<Box<Deref>, Self>
pub fn into_deref(self) -> Result<Box<Deref>, Self>
Returns the inner fields if this is a ExprKind::Deref, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_binding(&self) -> bool
pub fn is_binding(&self) -> bool
Returns true if this is a ExprKind::Binding, otherwise false
Sourcepub fn as_binding_mut(&mut self) -> Option<&mut Box<Binding>>
pub fn as_binding_mut(&mut self) -> Option<&mut Box<Binding>>
Optionally returns mutable references to the inner fields if this is a ExprKind::Binding, otherwise None
Sourcepub fn as_binding(&self) -> Option<&Box<Binding>>
pub fn as_binding(&self) -> Option<&Box<Binding>>
Optionally returns references to the inner fields if this is a ExprKind::Binding, otherwise None
Sourcepub fn into_binding(self) -> Result<Box<Binding>, Self>
pub fn into_binding(self) -> Result<Box<Binding>, Self>
Returns the inner fields if this is a ExprKind::Binding, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_switch_mut(&mut self) -> Option<&mut Vec<SwitchBranch>>
pub fn as_switch_mut(&mut self) -> Option<&mut Vec<SwitchBranch>>
Optionally returns mutable references to the inner fields if this is a ExprKind::Switch, otherwise None
Sourcepub fn as_switch(&self) -> Option<&Vec<SwitchBranch>>
pub fn as_switch(&self) -> Option<&Vec<SwitchBranch>>
Optionally returns references to the inner fields if this is a ExprKind::Switch, otherwise None
Sourcepub fn into_switch(self) -> Result<Vec<SwitchBranch>, Self>
pub fn into_switch(self) -> Result<Vec<SwitchBranch>, Self>
Returns the inner fields if this is a ExprKind::Switch, otherwise returns back the enum in the Err case of the result