pub enum Operator {
Arithmetic(ArithmeticOperator),
Assignment(AssignmentOperator),
Bitwise(BitwiseOperator),
Comparison(ComparisonOperator),
Logical(LogicalOperator),
Other(OtherOperator),
}Expand description
Any operator in the expression language.
A thin wrapper over the six family types, for code that handles operators generically. Reach for the family type directly when only one set applies.
Variants§
Arithmetic(ArithmeticOperator)
An arithmetic operator.
Assignment(AssignmentOperator)
An assignment operator.
Bitwise(BitwiseOperator)
A bitwise operator.
Comparison(ComparisonOperator)
A comparison operator.
Logical(LogicalOperator)
A logical operator.
Other(OtherOperator)
A structural element.
Implementations§
Source§impl Operator
impl Operator
Sourcepub const fn class(self) -> OperatorClass
pub const fn class(self) -> OperatorClass
The family it belongs to.
Sourcepub const fn arity(self) -> Option<Arity>
pub const fn arity(self) -> Option<Arity>
How many operands it takes, for the families where that applies.
None for the structural elements: parentheses and comments do not take
operands in the way an operator does.
Sourcepub const fn precedence(self) -> Option<u8>
pub const fn precedence(self) -> Option<u8>
Binding strength; lower binds tighter. None where it was not measured.
Trait Implementations§
impl Copy for Operator
impl Eq for Operator
impl StructuralPartialEq for Operator
Auto Trait Implementations§
impl Freeze for Operator
impl RefUnwindSafe for Operator
impl Send for Operator
impl Sync for Operator
impl Unpin for Operator
impl UnsafeUnpin for Operator
impl UnwindSafe for Operator
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