Enum banyan_utils::tag_index::Expression[][src]

pub enum Expression {
    Literal(SmolStr),
    And(Vec<Expression>),
    Or(Vec<Expression>),
}

a boolean expression, consisting of literals, union and intersection.

no attempt of simplification is made, except flattening identical operators.

And([And([a,b]),c]) will be flattened to And([a,b,c]).

Variants

Literal(SmolStr)

Implementations

impl Expression[src]

pub fn literal(text: SmolStr) -> Self[src]

pub fn or(e: Vec<Expression>) -> Self[src]

pub fn and(e: Vec<Expression>) -> Self[src]

pub fn simplify(&self) -> Self[src]

pub fn dnf(self) -> Dnf[src]

convert the expression into disjunctive normal form

careful, for some expressions this can have exponential runtime. E.g. the disjunctive normal form of (a | b) & (c | d) & (e | f) & ... will be very complex.

Trait Implementations

impl BitAnd<Expression> for Expression[src]

type Output = Expression

The resulting type after applying the & operator.

impl BitOr<Expression> for Expression[src]

type Output = Expression

The resulting type after applying the | operator.

impl Clone for Expression[src]

impl Debug for Expression[src]

impl Display for Expression[src]

prints the expression with a minimum of brackets

impl Eq for Expression[src]

impl From<Dnf> for Expression[src]

impl From<Expression> for Dnf[src]

impl Ord for Expression[src]

impl PartialEq<Expression> for Expression[src]

impl PartialOrd<Expression> for Expression[src]

impl StructuralEq for Expression[src]

impl StructuralPartialEq for Expression[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> References<RawCodec> for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,