pub enum Pattern<I = String> {
Wild,
Var(I),
Unit,
Bool(bool),
Int(i64),
Str(String),
Tuple(Vec<Pattern<I>>),
EmptyList,
Cons(Box<Pattern<I>>, Box<Pattern<I>>),
Ctor(String, Option<Box<Pattern<I>>>),
As(Box<Pattern<I>>, I),
}Expand description
Match patterns (untyped_pattern_tree).
Variants§
Wild
Var(I)
Unit
Bool(bool)
Int(i64)
Str(String)
Tuple(Vec<Pattern<I>>)
EmptyList
Cons(Box<Pattern<I>>, Box<Pattern<I>>)
head :: tail
Ctor(String, Option<Box<Pattern<I>>>)
As(Box<Pattern<I>>, I)
pat as name
Implementations§
Trait Implementations§
impl<I: PartialEq> StructuralPartialEq for Pattern<I>
Auto Trait Implementations§
impl<I> Freeze for Pattern<I>
impl<I> RefUnwindSafe for Pattern<I>where
I: RefUnwindSafe,
Vec<Pattern<I>>: RefUnwindSafe,
Box<Pattern<I>>: RefUnwindSafe,
Option<Box<Pattern<I>>>: RefUnwindSafe,
impl<I> Send for Pattern<I>
impl<I> Sync for Pattern<I>
impl<I> Unpin for Pattern<I>
impl<I> UnsafeUnpin for Pattern<I>where
I: UnsafeUnpin,
Vec<Pattern<I>>: UnsafeUnpin,
Box<Pattern<I>>: UnsafeUnpin,
Option<Box<Pattern<I>>>: UnsafeUnpin,
impl<I> UnwindSafe for Pattern<I>where
I: UnwindSafe,
Vec<Pattern<I>>: UnwindSafe,
Box<Pattern<I>>: UnwindSafe,
Option<Box<Pattern<I>>>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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