pub enum AirPattern {
Wildcard,
Int(i64),
Bool(bool),
EnumVariant {
enum_id: EnumId,
variant_index: u32,
},
}Expand description
A pattern in a match expression (AIR level - typed).
Variants§
Wildcard
Wildcard pattern _ - matches anything
Int(i64)
Integer literal pattern (can be positive or negative)
Bool(bool)
Boolean literal pattern
EnumVariant
Enum variant pattern (e.g., Color::Red)
Implementations§
Source§impl AirPattern
impl AirPattern
Sourcepub fn encode(&self, body: AirRef, out: &mut Vec<u32>)
pub fn encode(&self, body: AirRef, out: &mut Vec<u32>)
Encode this pattern to the extra array, returning the number of u32s written. Format:
- Wildcard: [tag, body_ref] = 2 words
- Int: [tag, body_ref, lo, hi] = 4 words (i64 as two u32s)
- Bool: [tag, body_ref, value] = 3 words
- EnumVariant: [tag, body_ref, enum_id, variant_index] = 4 words
Trait Implementations§
Source§impl Clone for AirPattern
impl Clone for AirPattern
Source§fn clone(&self) -> AirPattern
fn clone(&self) -> AirPattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AirPattern
impl RefUnwindSafe for AirPattern
impl Send for AirPattern
impl Sync for AirPattern
impl Unpin for AirPattern
impl UnwindSafe for AirPattern
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
An iterator over the items within this container, by reference.
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
Check whether an item is contained within this sequence.
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
Convert an item of the sequence into a [
MaybeRef].