pub enum PatternData<'ast> {
Wildcard,
Any(LocIdent),
Record(&'ast RecordPattern<'ast>),
Array(&'ast ArrayPattern<'ast>),
Enum(&'ast EnumPattern<'ast>),
Constant(&'ast ConstantPattern<'ast>),
Or(&'ast OrPattern<'ast>),
}Variants§
Wildcard
A wildcard pattern, matching any value. As opposed to any, this pattern doesn’t bind any variable.
Any(LocIdent)
A simple pattern consisting of an identifier. Match anything and bind the result to the corresponding identifier.
Record(&'ast RecordPattern<'ast>)
A record pattern as in { a = { b, c } }
Array(&'ast ArrayPattern<'ast>)
An array pattern as in [a, b, c]
Enum(&'ast EnumPattern<'ast>)
An enum pattern as in 'Foo x or 'Foo
Constant(&'ast ConstantPattern<'ast>)
A constant pattern as in 42 or true.
Or(&'ast OrPattern<'ast>)
A sequence of alternative patterns as in 'Foo _ or 'Bar _ or 'Baz _.
Trait Implementations§
Source§impl<'ast> Clone for PatternData<'ast>
impl<'ast> Clone for PatternData<'ast>
Source§fn clone(&self) -> PatternData<'ast>
fn clone(&self) -> PatternData<'ast>
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 moreSource§impl<'ast> Debug for PatternData<'ast>
impl<'ast> Debug for PatternData<'ast>
Source§impl Display for PatternData<'_>
impl Display for PatternData<'_>
Source§impl<'ast> PartialEq for PatternData<'ast>
impl<'ast> PartialEq for PatternData<'ast>
Source§impl<'a> Pretty<'a, Allocator> for &PatternData<'_>
impl<'a> Pretty<'a, Allocator> for &PatternData<'_>
impl<'ast> Eq for PatternData<'ast>
impl<'ast> StructuralPartialEq for PatternData<'ast>
Auto Trait Implementations§
impl<'ast> Freeze for PatternData<'ast>
impl<'ast> RefUnwindSafe for PatternData<'ast>
impl<'ast> Send for PatternData<'ast>
impl<'ast> Sync for PatternData<'ast>
impl<'ast> Unpin for PatternData<'ast>
impl<'ast> UnsafeUnpin for PatternData<'ast>
impl<'ast> UnwindSafe for PatternData<'ast>
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