Enum AstBinaryOp
pub enum AstBinaryOp {
Show 18 variants
Add,
Subtract,
Multiply,
Divide,
Remainder,
BitwiseAnd,
BitwiseXor,
BitwiseOr,
LeftShift,
RightShift,
LogicalAnd,
LogicalOr,
EqualTo,
NotEqualTo,
LessThan,
GreaterThan,
LessThanOrEqualTo,
GreaterThanOrEqualTo,
}Expand description
Binary operators.
Variants§
Add
Subtract
Multiply
Divide
Remainder
BitwiseAnd
BitwiseXor
BitwiseOr
LeftShift
RightShift
LogicalAnd
LogicalOr
EqualTo
NotEqualTo
LessThan
GreaterThan
LessThanOrEqualTo
GreaterThanOrEqualTo
Implementations§
§impl AstBinaryOp
impl AstBinaryOp
pub fn is_relational(&self) -> bool
pub fn is_relational(&self) -> bool
Is the operator a relational operator?
pub fn family(&self) -> AstBinaryOpFamily
pub fn family(&self) -> AstBinaryOpFamily
The family or group that the operator belongs to.
pub fn is_commutative_and_associative(&self) -> bool
pub fn is_commutative_and_associative(&self) -> bool
Is the operator both commutative and associative (Add or Multiply)?
pub fn is_div_or_rem(&self) -> bool
pub fn is_div_or_rem(&self) -> bool
Is the operator either Division or Remainder?
Trait Implementations§
§impl Clone for AstBinaryOp
impl Clone for AstBinaryOp
§fn clone(&self) -> AstBinaryOp
fn clone(&self) -> AstBinaryOp
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 AstBinaryOp
impl Debug for AstBinaryOp
§impl Display for AstBinaryOp
impl Display for AstBinaryOp
§impl From<AstBinaryOp> for TokenType
impl From<AstBinaryOp> for TokenType
§fn from(op: AstBinaryOp) -> Self
fn from(op: AstBinaryOp) -> Self
Converts to this type from the input type.
§impl PartialEq for AstBinaryOp
impl PartialEq for AstBinaryOp
§impl TryFrom<AstAssignmentOp> for AstBinaryOp
impl TryFrom<AstAssignmentOp> for AstBinaryOp
impl Copy for AstBinaryOp
impl Eq for AstBinaryOp
impl StructuralPartialEq for AstBinaryOp
Auto Trait Implementations§
impl Freeze for AstBinaryOp
impl RefUnwindSafe for AstBinaryOp
impl Send for AstBinaryOp
impl Sync for AstBinaryOp
impl Unpin for AstBinaryOp
impl UnwindSafe for AstBinaryOp
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