Skip to main content

SubClause

Enum SubClause 

Source
pub enum SubClause<CID, SID>
where CID: EzCptIds, SID: EzShipIds,
{ Always, HasAttrValue(SubId<CID, SID>, Attribute, AttrValue), IsActive(SubId<CID, SID>), Not(Box<SubClause<CID, SID>>), And(Box<SubClause<CID, SID>>, Box<SubClause<CID, SID>>), Or(Box<SubClause<CID, SID>>, Box<SubClause<CID, SID>>), Xor(Box<SubClause<CID, SID>>, Box<SubClause<CID, SID>>), }
Expand description

SubClause defines unde what conditions the event should be forwarded to the target based on its state.

Variants§

§

Always

Always true

§

HasAttrValue(SubId<CID, SID>, Attribute, AttrValue)

Check if the target has an attribute with a specific value

§

IsActive(SubId<CID, SID>)

Check if the target is mounted/registerd depending if it’s a component or a ship

§

Not(Box<SubClause<CID, SID>>)

Negate another clause

§

And(Box<SubClause<CID, SID>>, Box<SubClause<CID, SID>>)

Combine two clauses with AND

§

Or(Box<SubClause<CID, SID>>, Box<SubClause<CID, SID>>)

Combine two clauses with OR

§

Xor(Box<SubClause<CID, SID>>, Box<SubClause<CID, SID>>)

Combine two clauses with XOR

Implementations§

Source§

impl<CID, SID> SubClause<CID, SID>
where CID: EzCptIds, SID: EzShipIds,

Source

pub fn not(clause: Self) -> Self

Create a new clause that is the inverse of the given clause

Source

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

Create a new clause that is true if the two clauses are true

Source

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

Create a new clause that is true if at least one of the two clauses is true

Source

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

Create a new clause that is true if one and only one of the two clauses is true

Trait Implementations§

Source§

impl<CID, SID> Debug for SubClause<CID, SID>
where CID: EzCptIds + Debug, SID: EzShipIds + Debug,

Source§

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

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

impl<CID, SID> PartialEq for SubClause<CID, SID>
where CID: EzCptIds + PartialEq, SID: EzShipIds + PartialEq,

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<CID, SID> StructuralPartialEq for SubClause<CID, SID>
where CID: EzCptIds + PartialEq, SID: EzShipIds + PartialEq,

Auto Trait Implementations§

§

impl<CID, SID> Freeze for SubClause<CID, SID>
where SubId<CID, SID>: Freeze, Box<SubClause<CID, SID>>: Freeze,

§

impl<CID, SID> RefUnwindSafe for SubClause<CID, SID>
where SubId<CID, SID>: RefUnwindSafe, Box<SubClause<CID, SID>>: RefUnwindSafe,

§

impl<CID, SID> Send for SubClause<CID, SID>
where SubId<CID, SID>: Send, Box<SubClause<CID, SID>>: Send,

§

impl<CID, SID> Sync for SubClause<CID, SID>
where SubId<CID, SID>: Sync, Box<SubClause<CID, SID>>: Sync,

§

impl<CID, SID> Unpin for SubClause<CID, SID>
where SubId<CID, SID>: Unpin, Box<SubClause<CID, SID>>: Unpin,

§

impl<CID, SID> UnsafeUnpin for SubClause<CID, SID>
where SubId<CID, SID>: UnsafeUnpin, Box<SubClause<CID, SID>>: UnsafeUnpin,

§

impl<CID, SID> UnwindSafe for SubClause<CID, SID>
where SubId<CID, SID>: UnwindSafe, Box<SubClause<CID, SID>>: 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more