pub struct BinaryOp {
pub lhs_expr: Expression,
pub operator: Spanned<BinaryOperator>,
pub rhs_expr: Expression,
/* private fields */
}
Expand description
An operation that applies an operator to two expressions.
Fields§
§lhs_expr: Expression
The expression on the left-hand-side of the operation.
operator: Spanned<BinaryOperator>
The binary operator to use on the expressions.
rhs_expr: Expression
The expression on the right-hand-side of the operation.
Implementations§
Source§impl BinaryOp
impl BinaryOp
Sourcepub fn new(
lhs_expr: impl Into<Expression>,
operator: impl Into<Spanned<BinaryOperator>>,
rhs_expr: impl Into<Expression>,
) -> BinaryOp
pub fn new( lhs_expr: impl Into<Expression>, operator: impl Into<Spanned<BinaryOperator>>, rhs_expr: impl Into<Expression>, ) -> BinaryOp
Creates a new BinaryOp
from two expressions and an operator.
Trait Implementations§
Source§impl From<BinaryOp> for Expression
impl From<BinaryOp> for Expression
impl Eq for BinaryOp
Auto Trait Implementations§
impl Freeze for BinaryOp
impl RefUnwindSafe for BinaryOp
impl Send for BinaryOp
impl Sync for BinaryOp
impl Unpin for BinaryOp
impl UnwindSafe for BinaryOp
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