pub struct VariantPattern {
pub module: Option<Ident>,
pub type_: Option<Ident>,
pub name: Ident,
pub subpatterns: Vec<SubPattern>,
pub span: Span,
}Expand description
A variant pattern (spec 2.3): name, or type_::name, or
module::type_::name, each with an optional parenthesized list of
sub-patterns. A single remaining segment always fills type_, never
module: unlike ExprKind::Path, a pattern never calls anything, so
there is no bare-module case to weigh it against. A pattern path longer
than three segments is V0001.
Fields§
§module: Option<Ident>§type_: Option<Ident>§name: Ident§subpatterns: Vec<SubPattern>§span: SpanTrait Implementations§
Source§impl Clone for VariantPattern
impl Clone for VariantPattern
Source§impl Debug for VariantPattern
impl Debug for VariantPattern
Source§impl PartialEq for VariantPattern
impl PartialEq for VariantPattern
impl StructuralPartialEq for VariantPattern
Auto Trait Implementations§
impl Freeze for VariantPattern
impl RefUnwindSafe for VariantPattern
impl Send for VariantPattern
impl Sync for VariantPattern
impl Unpin for VariantPattern
impl UnsafeUnpin for VariantPattern
impl UnwindSafe for VariantPattern
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