Skip to main content

ToTsIdent

Trait ToTsIdent 

Source
pub trait ToTsIdent {
    // Required method
    fn to_ts_ident(self) -> Ident;
}
Expand description

Converts common Rust values into SWC Ident nodes.

This enables ergonomic interpolation in template literals where an identifier is expected.

Required Methods§

Implementations on Foreign Types§

Source§

impl ToTsIdent for &str

Available on crate feature swc only.
Source§

impl ToTsIdent for &String

Available on crate feature swc only.
Source§

impl ToTsIdent for Box<TsType>

Available on crate feature swc only.
Source§

impl ToTsIdent for String

Available on crate feature swc only.

Implementors§

Source§

impl ToTsIdent for &Expr

Available on crate feature swc only.
Source§

impl ToTsIdent for &TsType

Available on crate feature swc only.
Source§

impl ToTsIdent for &Ident

Available on crate feature swc only.
Source§

impl ToTsIdent for Expr

Available on crate feature swc only.

Convert an Expr to an Ident. Only works for identifier expressions.

Source§

impl ToTsIdent for TsType

Available on crate feature swc only.

Convert a TsType to an Ident. Only works for type references with simple names.

Source§

impl ToTsIdent for Ident

Available on crate feature swc only.