pub enum Pattern {
Literal {
literal: Literal,
ty: Type,
span: Span,
},
Unit {
ty: Type,
span: Span,
},
EnumVariant {
identifier: EcoString,
fields: Vec<Self>,
rest: bool,
resolution: ConstructorPatternResolution,
ty: Type,
span: Span,
},
Struct {
identifier: EcoString,
fields: Vec<StructFieldPattern>,
rest: bool,
resolution: RecordPatternResolution,
ty: Type,
span: Span,
},
Tuple {
elements: Vec<Self>,
span: Span,
},
WildCard {
span: Span,
},
Identifier {
identifier: EcoString,
span: Span,
binding: Option<BindingId>,
},
Slice {
prefix: Vec<Self>,
rest: RestPattern,
resolution: SequencePatternResolution,
span: Span,
},
Or {
patterns: Vec<Self>,
span: Span,
},
AsBinding {
pattern: Box<Self>,
name: EcoString,
name_span: Span,
span: Span,
binding: Option<BindingId>,
},
}Variants§
Literal
Unit
EnumVariant
Fields
§
resolution: ConstructorPatternResolutionStruct
Tuple
WildCard
Identifier
Fields
Slice
Or
AsBinding
Implementations§
Trait Implementations§
impl StructuralPartialEq for Pattern
Auto Trait Implementations§
impl Forget for Pattern
impl Freeze for Patternwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<FormatStringPart>: Freeze,
PhantomData<Expression>: Freeze,
*const ArcInner<Box<[Type]>> is !null: Freeze,
PhantomData<ArcInner<Box<[Type]>>>: Freeze,
*const ArcInner<FunctionType> is !null: Freeze,
PhantomData<ArcInner<FunctionType>>: Freeze,
PhantomData<Type>: Freeze,
*const Type is !null: Freeze,
*const ArcInner<Spelling> is !null: Freeze,
PhantomData<ArcInner<Spelling>>: Freeze,
PhantomData<Pattern>: Freeze,
PhantomData<StructFieldPattern>: Freeze,
*const Pattern is !null: Freeze,
impl Move for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnsafeUnpin for Patternwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<FormatStringPart>: UnsafeUnpin,
PhantomData<Expression>: UnsafeUnpin,
*const ArcInner<Box<[Type]>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Box<[Type]>>>: UnsafeUnpin,
*const ArcInner<FunctionType> is !null: UnsafeUnpin,
PhantomData<ArcInner<FunctionType>>: UnsafeUnpin,
PhantomData<Type>: UnsafeUnpin,
*const Type is !null: UnsafeUnpin,
*const ArcInner<Spelling> is !null: UnsafeUnpin,
PhantomData<ArcInner<Spelling>>: UnsafeUnpin,
PhantomData<Pattern>: UnsafeUnpin,
PhantomData<StructFieldPattern>: UnsafeUnpin,
*const Pattern is !null: UnsafeUnpin,
impl UnwindSafe for Patternwhere
RawVecInner: UnwindSafe,
BoxRaw<Expression>: UnwindSafe,
Arc<Box<[Type]>>: UnwindSafe,
NonNull<u8>: UnwindSafe,
Arc<FunctionType>: UnwindSafe,
BoxRaw<Type>: UnwindSafe,
Arc<Spelling>: UnwindSafe,
BoxRaw<Annotation>: UnwindSafe,
BoxRaw<Binding>: UnwindSafe,
BoxRaw<Pattern>: 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