Struct smart_config::metadata::ParamMetadata
source · pub struct ParamMetadata {
pub name: &'static str,
pub aliases: &'static [(&'static str, AliasOptions)],
pub help: &'static str,
pub rust_field_name: &'static str,
pub rust_type: RustType,
pub expecting: BasicTypes,
pub tag_variant: Option<&'static ConfigVariant>,
/* private fields */
}
Expand description
Metadata for a specific configuration parameter.
Fields§
§name: &'static str
Canonical param name in the config sources. Not necessarily the Rust field name!
aliases: &'static [(&'static str, AliasOptions)]
Param aliases.
help: &'static str
Human-readable param help parsed from the doc comment.
rust_field_name: &'static str
Name of the param field in Rust code.
rust_type: RustType
Rust type of the parameter.
expecting: BasicTypes
Basic type(s) expected by the param deserializer.
tag_variant: Option<&'static ConfigVariant>
Tag variant in the enclosing ConfigMetadata
that enables this parameter. None
means that the parameter is unconditionally enabled.
Implementations§
source§impl ParamMetadata
impl ParamMetadata
sourcepub fn default_value(&self) -> Option<Box<dyn Any>>
pub fn default_value(&self) -> Option<Box<dyn Any>>
Returns the default value for the param.
sourcepub fn default_value_json(&self) -> Option<Value>
pub fn default_value_json(&self) -> Option<Value>
Returns the default value for the param serialized into JSON.
sourcepub fn example_value_json(&self) -> Option<Value>
pub fn example_value_json(&self) -> Option<Value>
Returns the example value for the param serialized into JSON.
sourcepub fn type_description(&self) -> TypeDescription
pub fn type_description(&self) -> TypeDescription
Returns the type description for this param as provided by its deserializer.
Trait Implementations§
source§impl Clone for ParamMetadata
impl Clone for ParamMetadata
source§fn clone(&self) -> ParamMetadata
fn clone(&self) -> ParamMetadata
Returns a copy 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 moresource§impl Debug for ParamMetadata
impl Debug for ParamMetadata
impl Copy for ParamMetadata
Auto Trait Implementations§
impl Freeze for ParamMetadata
impl !RefUnwindSafe for ParamMetadata
impl Send for ParamMetadata
impl Sync for ParamMetadata
impl Unpin for ParamMetadata
impl !UnwindSafe for ParamMetadata
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)