pub enum Term {
Wildcard,
Var(VarName),
Apply(SymbolName, Arc<[Term]>),
List(Arc<[SeqPart]>),
Literal(Literal),
Tuple(Arc<[SeqPart]>),
Func(Arc<Region>),
}
Expand description
A term in the hugr AST.
To facilitate sharing where possible, terms in the AST use reference counting. This makes it cheap to clone and share terms.
See table::Term
for the table representation.
Variants§
Wildcard
Standin for any term.
Var(VarName)
Local variable, identified by its name.
Apply(SymbolName, Arc<[Term]>)
Symbol application.
List(Arc<[SeqPart]>)
List of static data.
Literal(Literal)
Static literal value.
Tuple(Arc<[SeqPart]>)
Tuple of static data.
Func(Arc<Region>)
Function constant.
Trait Implementations§
impl Eq for Term
impl StructuralPartialEq for Term
Auto Trait Implementations§
impl Freeze for Term
impl RefUnwindSafe for Term
impl Send for Term
impl Sync for Term
impl Unpin for Term
impl UnwindSafe for Term
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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>
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 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>
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