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

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

Variants

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

Represents c1 || c2.

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

Represents c1 && c2.

Not(Box<Guard<T>>)

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

Info(T)

Other types of information.

Implementations

Returns true definitely Guard::True. Returning false does not mean that the guard is not true.

Checks if the guard is always false. Returning false does not mean that the guard is not false.

returns true if the self is !cell_name, false otherwise.

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.

Returns all the ports used by this guard.

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.

runs f(info) on each Guard::Info in guard. if f(info) = Some(result)replaces interval with result. iff(info) = None does nothing.

runs f(info) on each info in guard. f should return Result<(), Error>, meaning that it essentially does nothing if the f returns OK(()), but returns an appropraite error otherwise

updates self -> self & interval

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

Turns a normal guard into a static guard

Construct guards from ports

Converts to this type from the input type.
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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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 their ordering.
Checks if this value is equivalent to the given key. 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
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.