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 · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
sourcefn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
impl<T> Indentable for T where
T: Display,
impl<T> Indentable for T where
T: Display,
fn indented_skip_initial(self, indent: &str) -> IndentedSkipIntial<'_, Self>
fn indented_skip_initial(self, indent: &str) -> IndentedSkipIntial<'_, Self>
sourceimpl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
sourcefn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. 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.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more