Skip to main content

ConfigField

Trait ConfigField 

Source
pub trait ConfigField {
    // Required method
    fn merge_field(&mut self, field_name: &str, other: Self) -> Result<()>;
}
Expand description

Trait for merging a single config field. The flowey_config! macro calls ConfigField::merge_field on each field during config merging.

Implemented for:

  • Option<T>: first setter wins, subsequent must agree (PartialEq)
  • BTreeMap<K, V>: per-key merge, each key’s value must agree

Required Methods§

Source

fn merge_field(&mut self, field_name: &str, other: Self) -> Result<()>

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<K: Ord + Debug, V: PartialEq> ConfigField for BTreeMap<K, V>

Source§

fn merge_field(&mut self, field_name: &str, other: Self) -> Result<()>

Source§

impl<T: PartialEq> ConfigField for Option<T>

Source§

fn merge_field(&mut self, field_name: &str, other: Self) -> Result<()>

Implementors§