pub enum ChainNode {
Root(AstIndex),
Id(ConstantIndex),
Str(AstString),
Index(AstIndex),
Call {
args: AstVec<AstIndex>,
with_parens: bool,
},
NullCheck,
}Expand description
A node in a chained expression
Chains are any expressions that contain two or more nodes in a sequence.
In other words, some series of operations involving indexing, . accesses, and function calls.
e.g.
foo.bar."baz"[0]?(42)
| | | | |^ Call {args: 42, with_parens: true}
| | | | ^ NullCheck
| | | ^ Index (0)
| | ^ Str (baz)
| ^ Id (bar)
^ Root (foo)
Variants§
Root(AstIndex)
The root of the chain
Id(ConstantIndex)
A . access using an identifier
Str(AstString)
A . access using a string
Index(AstIndex)
An index operation using square [] brackets.
Call
A function call
Fields
NullCheck
A ? short-circuiting null check
Trait Implementations§
impl Eq for ChainNode
impl StructuralPartialEq for ChainNode
Auto Trait Implementations§
impl Freeze for ChainNode
impl RefUnwindSafe for ChainNode
impl Send for ChainNode
impl Sync for ChainNode
impl Unpin for ChainNode
impl UnwindSafe for ChainNode
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