swc_ecma_transforms_base::rename

Trait Renamer

Source
pub trait Renamer: Send + Sync {
    const RESET_N: bool;
    const MANGLE: bool;

    // Required method
    fn new_name_for(&self, orig: &Id, n: &mut usize) -> JsWord;

    // Provided methods
    fn preserved_ids_for_module(&mut self, _: &Module) -> FxHashSet<Id> { ... }
    fn preserved_ids_for_script(&mut self, _: &Script) -> FxHashSet<Id> { ... }
}

Required Associated Constants§

Source

const RESET_N: bool

Should reset n to 0 for each identifier?

Source

const MANGLE: bool

It should be true if you expect lots of collisions

Required Methods§

Source

fn new_name_for(&self, orig: &Id, n: &mut usize) -> JsWord

Should increment n.

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§