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.

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 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<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>