Struct promql_parser::parser::ast::BinaryExpr
source · pub struct BinaryExpr {
pub op: TokenType,
pub lhs: Box<Expr>,
pub rhs: Box<Expr>,
pub modifier: Option<BinModifier>,
}
Expand description
Grammar:
<vector expr> <bin-op> ignoring(<label list>) group_left(<label list>) <vector expr>
<vector expr> <bin-op> ignoring(<label list>) group_right(<label list>) <vector expr>
<vector expr> <bin-op> on(<label list>) group_left(<label list>) <vector expr>
<vector expr> <bin-op> on(<label list>) group_right(<label list>) <vector expr>
Fields§
§op: TokenType
The operation of the expression.
lhs: Box<Expr>
The operands on the left sides of the operator.
rhs: Box<Expr>
The operands on the right sides of the operator.
modifier: Option<BinModifier>
Implementations§
source§impl BinaryExpr
impl BinaryExpr
pub fn is_matching_on(&self) -> bool
pub fn is_matching_labels_not_empty(&self) -> bool
pub fn return_bool(&self) -> bool
sourcepub fn is_labels_joint(&self) -> bool
pub fn is_labels_joint(&self) -> bool
check if labels of card and matching are joint
sourcepub fn intersect_labels(&self) -> Option<Vec<String>>
pub fn intersect_labels(&self) -> Option<Vec<String>>
intersect labels of card and matching
Trait Implementations§
source§impl Clone for BinaryExpr
impl Clone for BinaryExpr
source§fn clone(&self) -> BinaryExpr
fn clone(&self) -> BinaryExpr
Returns a copy 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 moresource§impl Debug for BinaryExpr
impl Debug for BinaryExpr
source§impl Display for BinaryExpr
impl Display for BinaryExpr
source§impl PartialEq<BinaryExpr> for BinaryExpr
impl PartialEq<BinaryExpr> for BinaryExpr
source§fn eq(&self, other: &BinaryExpr) -> bool
fn eq(&self, other: &BinaryExpr) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Prettier for BinaryExpr
impl Prettier for BinaryExpr
source§fn format(&self, level: usize, max: usize) -> String
fn format(&self, level: usize, max: usize) -> String
override format if expr needs to be splited into multiple lines
source§fn pretty(&self, level: usize, max: usize) -> String
fn pretty(&self, level: usize, max: usize) -> String
max param is short for max_characters_per_line.
source§fn needs_split(&self, max: usize) -> bool
fn needs_split(&self, max: usize) -> bool
override needs_split to return false, in order not to split multiple lines
impl Eq for BinaryExpr
impl StructuralEq for BinaryExpr
impl StructuralPartialEq for BinaryExpr
Auto Trait Implementations§
impl !RefUnwindSafe for BinaryExpr
impl Send for BinaryExpr
impl Sync for BinaryExpr
impl Unpin for BinaryExpr
impl !UnwindSafe for BinaryExpr
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.