pub struct BinaryOp {
pub left: Expression,
pub right: Expression,
pub left_comments: Vec<String>,
pub operator_comments: Vec<String>,
pub trailing_comments: Vec<String>,
}Expand description
Represent a binary operation (two operands separated by an operator).
This is the shared payload struct for all binary operator variants in the
Expression enum: arithmetic (Add, Sub, Mul, Div, Mod),
comparison (Eq, Neq, Lt, Gt, etc.), logical (And, Or),
bitwise, and dialect-specific operators. Comment fields enable round-trip
preservation of inline comments around operators.
Fields§
§left: Expression§right: Expression§left_comments: Vec<String>Comments after the left operand (before the operator)
operator_comments: Vec<String>Comments after the operator (before the right operand)
trailing_comments: Vec<String>Comments after the right operand
Implementations§
Source§impl BinaryOp
impl BinaryOp
pub fn new(left: Expression, right: Expression) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BinaryOp
impl<'de> Deserialize<'de> for BinaryOp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq 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