Struct balena_temen::ast::Expression
source · pub struct Expression {
pub value: ExpressionValue,
pub negated: bool,
pub filters: Vec<FunctionCall>,
}
Expand description
An expression
Fields
value: ExpressionValue
An expression value
negated: bool
Is expression negated?
filters: Vec<FunctionCall>
List of filters to apply
Implementations
sourceimpl Expression
impl Expression
sourcepub fn new(value: ExpressionValue) -> Expression
pub fn new(value: ExpressionValue) -> Expression
Creates new expression
Expression is not negated and no filters are applied.
Arguments
value
- An expression value
sourcepub fn new_negated(value: ExpressionValue) -> Expression
pub fn new_negated(value: ExpressionValue) -> Expression
Creates new negated expression
Expression is negated and no filters are applied.
Arguments
value
- An expression value
sourcepub fn new_with_filters(
value: ExpressionValue,
filters: Vec<FunctionCall>
) -> Expression
pub fn new_with_filters(
value: ExpressionValue,
filters: Vec<FunctionCall>
) -> Expression
Creates new expression
Expression is not negated and filters are applied.
Arguments
value
- An expression valuefilters
- List of filters to apply
sourcepub fn into_negated(self) -> Expression
pub fn into_negated(self) -> Expression
Converts self into negated expression
sourcepub fn identifier(&self) -> Option<&Identifier>
pub fn identifier(&self) -> Option<&Identifier>
Returns identifier from an expression value
sourcepub fn into_identifier(self) -> Result<Identifier>
pub fn into_identifier(self) -> Result<Identifier>
Converts self into Identifier
Trait Implementations
sourceimpl Clone for Expression
impl Clone for Expression
sourcefn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for Expression
impl Debug for Expression
sourceimpl FromStr for Expression
impl FromStr for Expression
sourceimpl PartialEq<Expression> for Expression
impl PartialEq<Expression> for Expression
sourcefn eq(&self, other: &Expression) -> bool
fn eq(&self, other: &Expression) -> bool
impl StructuralPartialEq for Expression
Auto Trait Implementations
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more