pub struct ConfigOption {
pub name: String,
pub description: String,
pub default_value: Value,
pub constraint: Option<Validator>,
pub stability: Stability,
pub active: bool,
pub display_hint: DisplayHint,
}
Expand description
A configuration option.
Fields§
§name: String
The name of the configuration option.
The associated environment variable has the format of
<PREFIX>_CONFIG_<NAME>
.
description: String
The description of the configuration option.
The description will be included in the generated markdown documentation.
default_value: Value
The default value of the configuration option.
constraint: Option<Validator>
An optional validator for the configuration option.
stability: Stability
The stability of the configuration option.
active: bool
Whether the config option should be offered to the user.
Inactive options are not included in the documentation, and accessing them provides the default value.
display_hint: DisplayHint
A display hint (for tooling)
Implementations§
Source§impl ConfigOption
impl ConfigOption
Sourcepub fn full_env_var(&self, crate_name: &str) -> String
pub fn full_env_var(&self, crate_name: &str) -> String
Get the corresponding ENV_VAR name given the crate-name
Trait Implementations§
Source§impl Clone for ConfigOption
impl Clone for ConfigOption
Source§fn clone(&self) -> ConfigOption
fn clone(&self) -> ConfigOption
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 moreSource§impl Debug for ConfigOption
impl Debug for ConfigOption
Source§impl<'de> Deserialize<'de> for ConfigOption
impl<'de> Deserialize<'de> for ConfigOption
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ConfigOption
impl PartialEq for ConfigOption
Source§impl Serialize for ConfigOption
impl Serialize for ConfigOption
impl Eq for ConfigOption
impl StructuralPartialEq for ConfigOption
Auto Trait Implementations§
impl Freeze for ConfigOption
impl RefUnwindSafe for ConfigOption
impl Send for ConfigOption
impl Sync for ConfigOption
impl Unpin for ConfigOption
impl UnwindSafe for ConfigOption
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.