pub struct ConfigFieldMeta {
pub name: &'static str,
pub type_name: &'static str,
pub env_var: Option<&'static str>,
pub file_key: Option<&'static str>,
pub default: Option<&'static str>,
pub help: Option<&'static str>,
pub required: bool,
}Expand description
Metadata about a single field in a Config-implementing struct.
Returned by Config::field_meta for runtime introspection — e.g. to
generate a config file template or validate a user-supplied file.
Fields§
§name: &'static strField name as it appears in the struct.
type_name: &'static strRust type name (best-effort string representation).
env_var: Option<&'static str>Environment variable override from #[param(env = "VAR")].
If None, the macro generates {PREFIX}_{FIELD_UPPER} at load time.
file_key: Option<&'static str>Dotted config-file key override from #[param(file_key = "a.b.c")].
If None, the field name is used directly as the TOML key.
default: Option<&'static str>Default value as a display string (from #[param(default = ...)]).
help: Option<&'static str>Help text from #[param(help = "...")].
required: boolWhether the field is required (no default, not Option<T>).
Trait Implementations§
Source§impl Clone for ConfigFieldMeta
impl Clone for ConfigFieldMeta
Source§fn clone(&self) -> ConfigFieldMeta
fn clone(&self) -> ConfigFieldMeta
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ConfigFieldMeta
impl RefUnwindSafe for ConfigFieldMeta
impl Send for ConfigFieldMeta
impl Sync for ConfigFieldMeta
impl Unpin for ConfigFieldMeta
impl UnsafeUnpin for ConfigFieldMeta
impl UnwindSafe for ConfigFieldMeta
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more