pub enum Guard {
Or(Box<Guard>, Box<Guard>),
And(Box<Guard>, Box<Guard>),
Not(Box<Guard>),
True,
CompOp(PortComp, RRC<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(PortComp, RRC<Port>, RRC<Port>)
Comparison operator.
Port(RRC<Port>)
Uses the value on a port as the condition. Same as p1 == true
Implementations
sourceimpl Guard
impl Guard
Helper functions for the guard.
sourcepub fn for_each<F>(&mut self, f: &mut F) where
F: FnMut(RRC<Port>) -> Option<Guard>,
pub fn for_each<F>(&mut self, f: &mut F) where
F: FnMut(RRC<Port>) -> Option<Guard>,
Mutates a guard by calling f
on every leaf in the
guard tree and replacing the leaf with the guard that f
returns.
sourcepub fn update<F>(&mut self, upd: F) where
F: FnOnce(Guard) -> Guard,
pub fn update<F>(&mut self, upd: F) where
F: FnOnce(Guard) -> Guard,
Update the guard in place. Replaces this guard with upd(self)
.
Uses std::mem::take
for the in-place update.
pub fn port(p: RRC<Port>) -> Self
pub fn and(self, rhs: Guard) -> Self
pub fn or(self, rhs: Guard) -> Self
pub fn eq(self, other: Guard) -> Self
pub fn neq(self, other: Guard) -> Self
pub fn le(self, other: Guard) -> Self
pub fn lt(self, other: Guard) -> Self
pub fn ge(self, other: Guard) -> Self
pub fn gt(self, other: Guard) -> Self
Trait Implementations
sourceimpl BitAndAssign<Guard> for Guard
impl BitAndAssign<Guard> for Guard
Update a Guard with Or.
g1 &= g2;
sourcefn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Performs the &=
operation. Read more
sourceimpl BitOrAssign<Guard> for Guard
impl BitOrAssign<Guard> for Guard
Update a Guard with Or.
g1 |= g2;
sourcefn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Performs the |=
operation. Read more
sourceimpl Ord for Guard
impl Ord for Guard
Define an ordering on the precedence of guards. Guards are considered equal when they have the same precedence.
sourceimpl PartialOrd<Guard> for Guard
impl PartialOrd<Guard> for Guard
Define order on guards
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for Guard
Auto Trait Implementations
impl !RefUnwindSafe for Guard
impl !Send for Guard
impl !Sync for Guard
impl Unpin for Guard
impl !UnwindSafe for Guard
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more