Struct AstExpression
pub struct AstExpression { /* private fields */ }Expand description
An expression.
Implementations§
§impl AstExpression
impl AstExpression
pub fn new(node_id: AstNodeId, kind: AstExpressionKind) -> Self
pub fn new(node_id: AstNodeId, kind: AstExpressionKind) -> Self
Creates a new AstExpression with the given node ID and kind.
pub fn deconstruct(self) -> (AstNodeId, AstExpressionKind)
pub fn deconstruct(self) -> (AstNodeId, AstExpressionKind)
Deconstructs the expression to allow the caller to take ownership of the expression’s fields.
pub fn kind(&self) -> &AstExpressionKind
pub fn kind(&self) -> &AstExpressionKind
The kind of expression.
pub fn kind_mut(&mut self) -> &mut AstExpressionKind
pub fn kind_mut(&mut self) -> &mut AstExpressionKind
The kind of expression.
pub fn is_literal(&self) -> bool
pub fn is_literal(&self) -> bool
Is the AST expression a literal?
pub fn is_arithmetic_literal(&self) -> bool
pub fn is_arithmetic_literal(&self) -> bool
Is the AST expression an arithmetic (character, integer or floating-point) literal?
pub fn is_single_char_literal(&self) -> bool
pub fn is_single_char_literal(&self) -> bool
Is the AST expression a single character literal?
pub fn is_string_literal(&self) -> bool
pub fn is_string_literal(&self) -> bool
Is the AST expression a string literal?
pub fn is_integer_literal(&self) -> bool
pub fn is_integer_literal(&self) -> bool
Is the AST expression an integer literal?
pub fn is_integer_literal_with_value(&self, value: u64) -> bool
pub fn is_integer_literal_with_value(&self, value: u64) -> bool
Is the AST expression an integer literal with the given value?
pub fn is_identifier_with_name(&self, declared_name: &str) -> bool
pub fn is_identifier_with_name(&self, declared_name: &str) -> bool
Is the AST expression an identifier of the given declared name?
pub fn is_binary_expr(&self) -> bool
pub fn is_binary_expr(&self) -> bool
Is the AST expression a binary operation?
pub fn is_binary_expr_with_op(&self, op: AstBinaryOp) -> bool
pub fn is_binary_expr_with_op(&self, op: AstBinaryOp) -> bool
Is the AST expression a binary operation with the given operator?
Trait Implementations§
§impl Clone for AstExpression
impl Clone for AstExpression
§fn clone(&self) -> AstExpression
fn clone(&self) -> AstExpression
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 more§impl Debug for AstExpression
impl Debug for AstExpression
§impl PartialEq for AstExpression
impl PartialEq for AstExpression
impl StructuralPartialEq for AstExpression
Auto Trait Implementations§
impl Freeze for AstExpression
impl RefUnwindSafe for AstExpression
impl Send for AstExpression
impl Sync for AstExpression
impl Unpin for AstExpression
impl UnwindSafe for AstExpression
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