Enum tuirealm::SubClause

source ·
pub enum SubClause<Id>
where Id: Eq + PartialEq + Clone + Hash,
{ Always, HasAttrValue(Id, Attribute, AttrValue), HasState(Id, State), IsMounted(Id), Not(Box<SubClause<Id>>), And(Box<SubClause<Id>>, Box<SubClause<Id>>), Or(Box<SubClause<Id>>, Box<SubClause<Id>>), }
Expand description

A subclause indicates the condition that must be satisfied in order to forward ev to target. Usually clauses are single conditions, but there are also some special condition, to create “ligatures”, which are:

  • Not(SubClause): Negates inner condition
  • And(SubClause, SubClause): the AND of the two clauses must be true
  • Or(SubClause, SubClause): the OR of the two clauses must be true

Variants§

§

Always

Always forward event to component

§

HasAttrValue(Id, Attribute, AttrValue)

Forward event if target component has provided attribute with the provided value If the attribute doesn’t exist on component, result is always false.

§

HasState(Id, State)

Forward event if target component has provided state

§

IsMounted(Id)

Forward event if target component is mounted

§

Not(Box<SubClause<Id>>)

Forward event if the inner clause is false

§

And(Box<SubClause<Id>>, Box<SubClause<Id>>)

Forward event if both the inner clauses are true

§

Or(Box<SubClause<Id>>, Box<SubClause<Id>>)

Forward event if at least one of the inner clauses is true

Implementations§

source§

impl<Id> SubClause<Id>
where Id: Eq + PartialEq + Clone + Hash,

source

pub fn not(clause: Self) -> Self

Shortcut for SubClause::Not without specifying Box::new(...)

source

pub fn and(a: Self, b: Self) -> Self

Shortcut for SubClause::And without specifying Box::new(...)

source

pub fn or(a: Self, b: Self) -> Self

Shortcut for SubClause::Or without specifying Box::new(...)

Trait Implementations§

source§

impl<Id> Debug for SubClause<Id>
where Id: Eq + PartialEq + Clone + Hash + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Id> PartialEq for SubClause<Id>
where Id: Eq + PartialEq + Clone + Hash + PartialEq,

source§

fn eq(&self, other: &SubClause<Id>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Id> StructuralPartialEq for SubClause<Id>
where Id: Eq + PartialEq + Clone + Hash,

Auto Trait Implementations§

§

impl<Id> RefUnwindSafe for SubClause<Id>
where Id: RefUnwindSafe,

§

impl<Id> Send for SubClause<Id>
where Id: Send,

§

impl<Id> Sync for SubClause<Id>
where Id: Sync,

§

impl<Id> Unpin for SubClause<Id>
where Id: Unpin,

§

impl<Id> UnwindSafe for SubClause<Id>
where Id: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.