pub enum Guard {
    Or(Box<Guard>, Box<Guard>),
    And(Box<Guard>, Box<Guard>),
    Not(Box<Guard>),
    True,
    CompOp(PortCompRRC<Port>, RRC<Port>),
    Port(RRC<Port>),
}
Expand description

An assignment guard which has pointers to the various ports from which it reads.

Variants

Or(Box<Guard>, Box<Guard>)

Represents c1 || c2.

And(Box<Guard>, Box<Guard>)

Represents c1 && c2.

Not(Box<Guard>)

Represents !c1

True

The constant true

CompOp(PortCompRRC<Port>, RRC<Port>)

Comparison operator.

Port(RRC<Port>)

Uses the value on a port as the condition. Same as p1 == true

Implementations

Helper functions for the guard.

Mutates a guard by calling f on every leaf in the guard tree and replacing the leaf with the guard that f returns.

Returns all the ports used by this guard.

Returns true if this is a Guard::True.

Update the guard in place. Replaces this guard with upd(self). Uses std::mem::take for the in-place update.

Return the string corresponding to the guard operation.

Trait Implementations

Construct a Guard::And:

let and_guard = g1 & g2;

The resulting type after applying the & operator.

Performs the & operation. Read more

Update a Guard with Or.

g1 &= g2;

Performs the &= operation. Read more

Construct a Guard::Or:

let or_guard = g1 | g2;

The resulting type after applying the | operator.

Performs the | operation. Read more

Update a Guard with Or.

g1 |= g2;

Performs the |= operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

Performs the conversion.

Construct guards from ports

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Construct a Guard::Or:

let not_guard = !g1;

The resulting type after applying the ! operator.

Performs the unary ! operation. Read more

Define an ordering on the precedence of guards. Guards are considered equal when they have the same precedence.

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Define order on guards

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.