pub enum Pattern {
Identifier(String),
Object(Vec<ObjPatProp>),
Array(Vec<ArrPatElem>),
Expr(Box<Expression>),
}Expand description
束縛パターン(分割代入・引数)。
Variants§
Identifier(String)
Object(Vec<ObjPatProp>)
{ a, b: c, d = 1, ...rest }
Array(Vec<ArrPatElem>)
[ a, , b = 1, ...rest ]
Expr(Box<Expression>)
メンバー/添字式への代入ターゲット(for (obj.prop of arr) / for (obj[k] of arr) 用)。
分割代入の宣言では使わず、非宣言形式 for-of/for-in の代入先としてのみ生成される。
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 UnsafeUnpin 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