pub enum ExpressionNode {
Identifier {
name: String,
span: Range<usize>,
},
Literal(LiteralNode),
MethodCall {
receiver: Option<Box<ExpressionNode>>,
method: String,
args: Vec<ExpressionNode>,
span: Range<usize>,
},
BinaryOp {
left: Box<ExpressionNode>,
operator: String,
right: Box<ExpressionNode>,
span: Range<usize>,
},
UnaryOp {
operator: String,
operand: Box<ExpressionNode>,
span: Range<usize>,
},
Array {
elements: Vec<ExpressionNode>,
span: Range<usize>,
},
Hash {
pairs: Vec<(ExpressionNode, ExpressionNode)>,
span: Range<usize>,
},
}Expand description
Ruby expression node
Variants§
Identifier
Identifier
Literal(LiteralNode)
Literal
MethodCall
Method call
BinaryOp
Binary operation
UnaryOp
Unary operation
Fields
§
operand: Box<ExpressionNode>Operand
Array
Array
Hash
Hash
Fields
§
pairs: Vec<(ExpressionNode, ExpressionNode)>The key-value pairs in the hash.
Trait Implementations§
Source§impl Clone for ExpressionNode
impl Clone for ExpressionNode
Source§fn clone(&self) -> ExpressionNode
fn clone(&self) -> ExpressionNode
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 ExpressionNode
impl Debug for ExpressionNode
Source§impl<'de> Deserialize<'de> for ExpressionNode
impl<'de> Deserialize<'de> for ExpressionNode
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 ExpressionNode
impl PartialEq for ExpressionNode
Source§impl Serialize for ExpressionNode
impl Serialize for ExpressionNode
impl StructuralPartialEq for ExpressionNode
Auto Trait Implementations§
impl Freeze for ExpressionNode
impl RefUnwindSafe for ExpressionNode
impl Send for ExpressionNode
impl Sync for ExpressionNode
impl Unpin for ExpressionNode
impl UnsafeUnpin for ExpressionNode
impl UnwindSafe for ExpressionNode
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