swc_config::merge

Trait Merge

source
pub trait Merge: Sized {
    // Required method
    fn merge(&mut self, other: Self);
}
Expand description

Deriavable trait for overrding configurations.

Typically, correct implementation of this trait for a struct is calling merge for all fields, and #[derive(Merge)] will do it for you.

Required Methods§

source

fn merge(&mut self, other: Self)

self has higher priority.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Merge for String

Modifies self iff self is empty.

source§

fn merge(&mut self, other: Self)

source§

impl Merge for PathBuf

Modifies self iff self is empty.

source§

fn merge(&mut self, other: Self)

source§

impl<K, V, S> Merge for HashMap<K, V, S>

Modifies self iff self is empty.

source§

fn merge(&mut self, other: Self)

source§

impl<K, V, S> Merge for IndexMap<K, V, S>

Modifies self iff self is empty.

source§

fn merge(&mut self, other: Self)

source§

impl<T> Merge for Option<T>

Modifies self iff self is None

source§

fn merge(&mut self, other: Self)

source§

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

source§

fn merge(&mut self, other: Self)

source§

impl<T> Merge for Vec<T>

Modifies self iff self is empty.

source§

fn merge(&mut self, other: Self)

Implementors§

source§

impl Merge for IsModule

source§

impl<T> Merge for BoolOrDataConfig<T>

source§

impl<T> Merge for MergingOption<T>
where T: Merge + Default,

source§

impl<const DEFAULT: bool> Merge for BoolConfig<DEFAULT>