pub enum TypedPattern {
Wildcard,
Literal(Literal),
EnumVariant {
enum_name: EcoString,
variant_name: EcoString,
variant_fields: Vec<EnumFieldDefinition>,
fields: Vec<TypedPattern>,
type_args: Vec<Type>,
field_types: Box<[Type]>,
},
EnumStructVariant {
enum_name: EcoString,
variant_name: EcoString,
variant_fields: Vec<EnumFieldDefinition>,
pattern_fields: Vec<(EcoString, TypedPattern)>,
type_args: Vec<Type>,
},
Struct {
struct_name: EcoString,
struct_fields: Vec<StructFieldDefinition>,
pattern_fields: Vec<(EcoString, TypedPattern)>,
type_args: Vec<Type>,
},
Slice {
prefix: Vec<TypedPattern>,
has_rest: bool,
element_type: Type,
},
Tuple {
arity: usize,
elements: Vec<TypedPattern>,
},
Or {
alternatives: Vec<TypedPattern>,
},
}Variants§
Wildcard
Literal(Literal)
EnumVariant
EnumStructVariant
Struct
Slice
Tuple
Or
Fields
§
alternatives: Vec<TypedPattern>Trait Implementations§
Source§impl Clone for TypedPattern
impl Clone for TypedPattern
Source§fn clone(&self) -> TypedPattern
fn clone(&self) -> TypedPattern
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 Debug for TypedPattern
impl Debug for TypedPattern
Source§impl PartialEq for TypedPattern
impl PartialEq for TypedPattern
impl StructuralPartialEq for TypedPattern
Auto Trait Implementations§
impl Freeze for TypedPattern
impl !RefUnwindSafe for TypedPattern
impl !Send for TypedPattern
impl !Sync for TypedPattern
impl Unpin for TypedPattern
impl UnsafeUnpin for TypedPattern
impl !UnwindSafe for TypedPattern
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