pub trait Figa {
// Required method
fn update<'de, D>(&mut self, deserializer: D) -> Result<(), D::Error>
where D: Deserializer<'de>;
}Expand description
Trait for loadable layered configuration values.
Uses serde for deserialization.
Can be updated with other values of the same type to make a layered configuration.
Can be derived for user-defined types. Derive macro accepts attributes to control how fields are loaded.
#[figa(update)]causes the field to be updated with the value from the next layer. This is default behavior when no attributes are specified. Field type must implementFigatrait.#[figa(replace)]causes the field to be replaced with the value from the next layer. Field must implementserde::Deserialize.#[figa(append)]causes the field to be appended with the value from the next layer. Works on collections likeVecandHashSet,HashMap. Values with equal keys are replaced. Value type must implementserde::Deserialize.#[figa(union)]similar to the above but works forHashSet,HashMapand similar collections. Values with equal keys are updated. Value type must implementFigatrait. Value type must implementserde::DeserializeandFiga.
This trait only defines load method to load next layer to the existing configuration value.
First should be loaded by other means.
Some functions load the first layer using serde::Deserialize trait.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".