pub enum VarPattern {
Discard(Token),
Glob(Token),
Ident(Identifier),
Phi(Identifier),
List(VarListPattern),
Tuple(VarTuplePattern),
Record(VarRecordPattern),
DataPack(VarDataPackPattern),
}
Variants§
Discard(Token)
Glob(Token)
Ident(Identifier)
Phi(Identifier)
Used when a different value is assigned in a branch other than Ident
.
(e.g. the else variable when a variable is defined with Python if-else)
Not used in Erg mode at this time
List(VarListPattern)
e.g. [x, y, z]
of [x, y, z] = [1, 2, 3]
Tuple(VarTuplePattern)
e.g. (x, y, z)
of (x, y, z) = (1, 2, 3)
Record(VarRecordPattern)
DataPack(VarDataPackPattern)
Implementations§
Trait Implementations§
Source§impl Clone for VarPattern
impl Clone for VarPattern
Source§fn clone(&self) -> VarPattern
fn clone(&self) -> VarPattern
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 VarPattern
impl Debug for VarPattern
Source§impl Display for VarPattern
impl Display for VarPattern
Source§impl Hash for VarPattern
impl Hash for VarPattern
Source§impl Locational for VarPattern
impl Locational for VarPattern
Source§impl NestedDisplay for VarPattern
impl NestedDisplay for VarPattern
Source§impl PartialEq for VarPattern
impl PartialEq for VarPattern
impl Eq for VarPattern
impl StructuralPartialEq for VarPattern
Auto Trait Implementations§
impl Freeze for VarPattern
impl RefUnwindSafe for VarPattern
impl Send for VarPattern
impl Sync for VarPattern
impl Unpin for VarPattern
impl UnwindSafe for VarPattern
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