swc_common::pass::util::map

Trait Map

Source
pub trait Map<T> {
    // Required method
    fn map<F>(self, f: F) -> Self
       where F: FnOnce(T) -> T;
}
Expand description

Copied from syntax::ptr::P of rustc.

Required Methods§

Source

fn map<F>(self, f: F) -> Self
where F: FnOnce(T) -> T,

Transform the inner value, consuming self and producing a new P<T>.

§Memory leak

This will leak self if the given closure panics.

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.

Implementations on Foreign Types§

Source§

impl<T> Map<T> for Box<T>

Source§

fn map<F>(self, f: F) -> Box<T>
where F: FnOnce(T) -> T,

Implementors§