pub enum ScalaPattern {
Wildcard,
Var(String),
Lit(ScalaLit),
Typed(String, ScalaType),
Tuple(Vec<ScalaPattern>),
Extractor(String, Vec<ScalaPattern>),
Alt(Vec<ScalaPattern>),
}Expand description
Scala pattern AST for match expressions.
Variants§
Wildcard
_ — wildcard
Var(String)
Variable binding: x
Lit(ScalaLit)
Literal pattern: 42, "hello", true
Typed(String, ScalaType)
Type pattern: x: SomeType
Tuple(Vec<ScalaPattern>)
Tuple pattern: (a, b, c)
Extractor(String, Vec<ScalaPattern>)
Extractor pattern: Some(x), Cons(h, t)
Alt(Vec<ScalaPattern>)
Alternative patterns: 1 | 2 | 3
Trait Implementations§
Source§impl Clone for ScalaPattern
impl Clone for ScalaPattern
Source§fn clone(&self) -> ScalaPattern
fn clone(&self) -> ScalaPattern
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 ScalaPattern
impl Debug for ScalaPattern
Source§impl Display for ScalaPattern
impl Display for ScalaPattern
Source§impl PartialEq for ScalaPattern
impl PartialEq for ScalaPattern
impl StructuralPartialEq for ScalaPattern
Auto Trait Implementations§
impl Freeze for ScalaPattern
impl RefUnwindSafe for ScalaPattern
impl Send for ScalaPattern
impl Sync for ScalaPattern
impl Unpin for ScalaPattern
impl UnsafeUnpin for ScalaPattern
impl UnwindSafe for ScalaPattern
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