pub enum Pattern {
Variant(String),
VariantWithBindings {
name: String,
bindings: Vec<String>,
},
}Expand description
A pattern in a match expression
For Phase 1: just the variant name (stack-based matching)
Later phases will add field bindings: Get { chan }
Variants§
Variant(String)
Match a variant by name, pushing all fields to stack
Example: Get -> pushes response-chan to stack
VariantWithBindings
Match a variant with named field bindings (Phase 5)
Example: Get { chan } -> binds chan to the response-chan field
Trait Implementations§
impl StructuralPartialEq for Pattern
Auto Trait Implementations§
impl Freeze for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnwindSafe for Pattern
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