Enum modus_lib::modusfile::Expression
source · [−]pub enum Expression {
Literal(Literal<ModusTerm>),
OperatorApplication(Option<SpannedPosition>, Box<Expression>, Operator),
And(Option<SpannedPosition>, bool, Box<Expression>, Box<Expression>),
Or(Option<SpannedPosition>, bool, Box<Expression>, Box<Expression>),
}
Expand description
Represents expressions that could be found in the body of a ModusClause. Each enum variant will have some notion of span and whether it’s negated. False would mean it is negated.
Variants
Literal(Literal<ModusTerm>)
OperatorApplication(Option<SpannedPosition>, Box<Expression>, Operator)
And(Option<SpannedPosition>, bool, Box<Expression>, Box<Expression>)
Or(Option<SpannedPosition>, bool, Box<Expression>, Box<Expression>)
Implementations
sourceimpl Expression
impl Expression
pub fn get_spanned_position(&self) -> &Option<SpannedPosition>
pub fn without_position(&self) -> Self
pub fn literals(&self) -> HashSet<Literal<ModusTerm>>
sourcepub fn negate_current(&self) -> Expression
pub fn negate_current(&self) -> Expression
Negates at the current expression level. So, does not apply De Morgan’s laws.
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 more
sourceimpl Debug for Expression
impl Debug for Expression
sourceimpl Display for Expression
impl Display for Expression
sourceimpl From<Literal<ModusTerm>> for Expression
impl From<Literal<ModusTerm>> 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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Expression) -> bool
fn ne(&self, other: &Expression) -> bool
This method tests for !=
.
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more