swc_core::common::util::take

Trait Take

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

    // Provided methods
    fn take(&mut self) -> Self { ... }
    fn map_with_mut<F>(&mut self, op: F)
       where F: FnOnce(Self) -> Self { ... }
}
Available on crate feature __common only.
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§

fn dummy() -> Self

Create a dummy value of this type.

Provided Methods§

fn take(&mut self) -> Self

fn map_with_mut<F>(&mut self, op: F)
where F: FnOnce(Self) -> Self,

Mutate self using op, which accepts owned data.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl Take for ComplexSelector

§

fn dummy() -> ComplexSelector

§

impl Take for CustomMediaQuery

§

fn dummy() -> CustomMediaQuery

§

impl Take for CustomMediaQueryMediaType

§

fn dummy() -> CustomMediaQueryMediaType

§

impl Take for ExtensionName

§

fn dummy() -> ExtensionName

§

impl Take for Ident

§

fn dummy() -> Ident

§

impl Take for MediaQuery

§

fn dummy() -> MediaQuery

§

impl Take for QualifiedRule

§

fn dummy() -> QualifiedRule

§

impl Take for QualifiedRulePrelude

§

fn dummy() -> QualifiedRulePrelude

§

impl Take for Rule

§

fn dummy() -> Rule

§

impl Take for SelectorList

§

fn dummy() -> SelectorList

§

impl Take for SimpleBlock

§

fn dummy() -> SimpleBlock

§

impl Take for Token

§

fn dummy() -> Token

§

impl Take for TokenAndSpan

§

fn dummy() -> TokenAndSpan

§

impl<T> Take for Option<T>

§

fn dummy() -> Option<T>

§

impl<T> Take for Box<T>
where T: Take,

§

fn dummy() -> Box<T>

§

impl<T> Take for Vec<T>

§

fn dummy() -> Vec<T>

§

impl<T> Take for Box<T>
where T: Take,

§

fn dummy() -> Box<T>

§

impl<T> Take for Vec<T>

§

fn dummy() -> Vec<T>

Implementors§

§

impl Take for AssignTarget

§

impl Take for AssignTargetPat

§

impl Take for BlockStmtOrExpr

§

impl Take for Callee

§

impl Take for ClassMember

§

impl Take for Decl

§

impl Take for Expr

§

impl Take for ForHead

§

impl Take for JSXElementName

§

impl Take for Key

§

impl Take for MemberProp

§

impl Take for ModuleDecl

§

impl Take for ModuleItem

§

impl Take for Pat

§

impl Take for Program

§

impl Take for PropName

§

impl Take for PropOrSpread

§

impl Take for SimpleAssignTarget

§

impl Take for Stmt

§

impl Take for SuperProp

§

impl Take for VarDeclOrExpr

§

impl Take for ArrayLit

§

impl Take for ArrowExpr

§

impl Take for AssignExpr

§

impl Take for AutoAccessor

§

impl Take for BinExpr

§

impl Take for BindingIdent

§

impl Take for BlockStmt

§

impl Take for Bool

§

impl Take for CallExpr

§

impl Take for Class

§

impl Take for ClassDecl

§

impl Take for ClassExpr

§

impl Take for ComputedPropName

§

impl Take for CondExpr

§

impl Take for ExportAll

§

impl Take for FnDecl

§

impl Take for FnExpr

§

impl Take for ForOfStmt

§

impl Take for Function

§

impl Take for swc_core::ecma::utils::swc_ecma_ast::Ident

§

impl Take for IdentName

§

impl Take for Import

§

impl Take for ImportDecl

§

impl Take for Invalid

§

impl Take for JSXClosingFragment

§

impl Take for JSXElement

§

impl Take for JSXFragment

§

impl Take for JSXOpeningElement

§

impl Take for JSXOpeningFragment

§

impl Take for MemberExpr

§

impl Take for Module

§

impl Take for NamedExport

§

impl Take for NewExpr

§

impl Take for Null

§

impl Take for ObjectLit

§

impl Take for OptCall

§

impl Take for OptChainExpr

§

impl Take for ParenExpr

§

impl Take for Regex

§

impl Take for Script

§

impl Take for SeqExpr

§

impl Take for SpreadElement

§

impl Take for StaticBlock

§

impl Take for Str

§

impl Take for Super

§

impl Take for SwitchCase

§

impl Take for TaggedTpl

§

impl Take for ThisExpr

§

impl Take for Tpl

§

impl Take for TplElement

§

impl Take for UnaryExpr

§

impl Take for UpdateExpr

§

impl Take for UsingDecl

§

impl Take for VarDecl

§

impl Take for VarDeclarator

§

impl Take for YieldExpr

§

impl Take for Span