pub trait KnobValue:
Sized
+ Clone
+ Send
+ Sync
+ 'static {
const TYPE_NAME: &'static str;
// Required methods
fn parse_knob(s: &str) -> Option<Self>;
fn render_knob(&self) -> String;
}Expand description
A type usable as a knob value: parseable from the string sources (env / API) and renderable for listing.
Required Associated Constants§
Required Methods§
Sourcefn parse_knob(s: &str) -> Option<Self>
fn parse_knob(s: &str) -> Option<Self>
Parse from a source string. None means “unset/invalid”: the resolver
falls through to the next source rather than overriding with garbage.
fn render_knob(&self) -> String
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<T> KnobValue for Option<T>where
T: KnobValue,
Optional knob: None is the unset/default state (e.g. “autodetect”), Some
is an explicit override. A source string that does not parse as T is
treated as unset, so the resolver falls through to the next source.
impl<T> KnobValue for Option<T>where
T: KnobValue,
Optional knob: None is the unset/default state (e.g. “autodetect”), Some
is an explicit override. A source string that does not parse as T is
treated as unset, so the resolver falls through to the next source.