pub trait Configurable {
type Partial: PartialValue<Resolved = Self>;
type Node: PartialValue + Default + EffectivelyUnset + Merge + Serialize + for<'a> Deserialize<'a>;
}Expand description
Relates a configuration type to how it is represented while a configuration is still being loaded.
This is what lets every field of a partial struct be written the same way,
as <FieldType as Configurable>::Node, without knowing whether the field
holds an atomic value or a nested struct: the type itself answers that.
Required Associated Types§
Sourcetype Partial: PartialValue<Resolved = Self>
type Partial: PartialValue<Resolved = Self>
How this type is represented before defaults are applied.
Sourcetype Node: PartialValue + Default + EffectivelyUnset + Merge + Serialize + for<'a> Deserialize<'a>
type Node: PartialValue + Default + EffectivelyUnset + Merge + Serialize + for<'a> Deserialize<'a>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl Configurable for f32
impl Configurable for f32
Source§impl Configurable for f64
impl Configurable for f64
Source§impl<T> Configurable for Vec<T>
A vector is atomic for merging, so it is stored in a single setting, while
its elements stay partial so that they can be defaulted individually.
impl<T> Configurable for Vec<T>
A vector is atomic for merging, so it is stored in a single setting, while its elements stay partial so that they can be defaulted individually.