pub enum SubClause<Id>{
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:
SubClause::Not: Negates inner conditionSubClause::And: the AND of the two clauses must betrueSubClause::Or: the OR of the two clauses must betrue
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>
impl<Id> SubClause<Id>
sourcepub fn not(clause: Self) -> Self
pub fn not(clause: Self) -> Self
Shortcut for SubClause::Not without specifying Box::new(...)
sourcepub fn and(a: Self, b: Self) -> Self
pub fn and(a: Self, b: Self) -> Self
Shortcut for SubClause::And without specifying Box::new(...)
sourcepub fn or(a: Self, b: Self) -> Self
pub fn or(a: Self, b: Self) -> Self
Shortcut for SubClause::Or without specifying Box::new(...)
Trait Implementations§
impl<Id> StructuralPartialEq for SubClause<Id>
Auto Trait Implementations§
impl<Id> Freeze for SubClause<Id>where
Id: Freeze,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more