pub trait Take: Sized {
    fn dummy() -> Self;

    fn take(&mut self) -> Self { ... }
    fn map_with_mut<F>(&mut self, op: F)
    where
        F: FnOnce(Self) -> Self
, { ... } }
Expand description

Helper for people who are working on VisitMut.

This trait is implemented for ast nodes. If not and you need it, please file an issue.

Required Methods

Create a dummy value of this type.

Provided Methods

Mutate self using op, which accepts owned data.

Implementations on Foreign Types

Implementors

impl Take for Enum

impl Take for ClassDef

impl Take for TypeElement

impl Take for Class

impl Take for ClassMember

impl Take for StaticBlock

impl Take for Decl

impl Take for FnDecl

impl Take for VarDecl

impl Take for Expr

impl Take for ArrayLit

impl Take for ObjectLit

impl Take for UnaryExpr

impl Take for UpdateExpr

impl Take for BinExpr

impl Take for FnExpr

impl Take for ClassExpr

impl Take for AssignExpr

impl Take for MemberExpr

impl Take for MemberProp

impl Take for SuperProp

impl Take for CondExpr

impl Take for CallExpr

impl Take for NewExpr

impl Take for SeqExpr

impl Take for ArrowExpr

impl Take for YieldExpr

impl Take for Tpl

impl Take for TaggedTpl

impl Take for TplElement

impl Take for ParenExpr

impl Take for Callee

impl Take for Super

impl Take for Import

impl Take for PatOrExpr

impl Take for OptCall

impl Take for Function

impl Take for Ident

impl Take for JSXElement

impl Take for JSXFragment

impl Take for Str

impl Take for Bool

impl Take for Null

impl Take for Regex

impl Take for Module

impl Take for Script

impl Take for ModuleItem

impl Take for ModuleDecl

impl Take for ImportDecl

impl Take for ExportAll

impl Take for NamedExport

impl Take for Pat

impl Take for PropName

impl Take for BlockStmt

impl Take for Stmt

impl Take for ForOfStmt

impl Take for SwitchCase