Open LukasKalbertodt opened 1 year ago
@LukasKalbertodt I would really love this. It's a major feature that config/figment do not have which is unfortunate.
Something liket his would be great.
#[config(validate = "some_func")]
pub field: String;
#[config(validate = Validate::NotEmpty)]
pub field: String;
A user defined function that is called when loading a config file. Mostly useful to automatically call
.validate()
on nested fields for example. Or maybe even add built-in attributes likenon_empty
for strings or something like that. This might increase the scope of this library too much though...