pub struct RadioConfig {
pub config_number: u8,
pub call: String,
pub display: String,
pub tooltip: Option<String>,
pub group: Option<String>,
pub options: Vec<ConfigOptionValue>,
}Expand description
A list of radio buttons for the user to choose one value from. The list of options should have exactly one item with default=true.
Typically, these configs are created in a lazy_static, and passed to
ConfigStep::list_configs.
§Example
use r_extcap::config::*;
let radio = RadioConfig::builder()
.config_number(3)
.call("remote")
.display("Remote Channel")
.tooltip("Remote Channel Selector")
.options([
ConfigOptionValue::builder().value("if1").display("Remote1").default(true).build(),
ConfigOptionValue::builder().value("if2").display("Remote2").build(),
])
.build();
assert_eq!(
format!("{}", ExtcapFormatter(&radio)),
concat!(
"arg {number=3}{call=--remote}{display=Remote Channel}{tooltip=Remote Channel Selector}{type=radio}\n",
"value {arg=3}{value=if1}{display=Remote1}{default=true}\n",
"value {arg=3}{value=if2}{display=Remote2}{default=false}\n"
)
);Fields§
§config_number: u8The config number, a unique identifier for this config.
call: StringThe command line option that will be sent to this extcap program. For
example, if this field is foobar, and the corresponding value is 42,
then --foobar 42 will be sent to this program during the extcap
capture.
display: StringThe user-friendly label for the radio button.
tooltip: Option<String>The tooltip shown on when hovering over the UI element.
group: Option<String>The (user-visible) name of the tab which this config belongs to. If this
is None, the config will be placed in a tab called “Default”.
options: Vec<ConfigOptionValue>The default list of options presented by this config.
Implementations§
Source§impl RadioConfig
impl RadioConfig
Sourcepub fn builder() -> RadioConfigBuilder<((), (), (), (), (), ())>
pub fn builder() -> RadioConfigBuilder<((), (), (), (), (), ())>
Create a builder for building RadioConfig.
On the builder, call .config_number(...), .call(...), .display(...), .tooltip(...)(optional), .group(...)(optional), .options(...) to set the values of the fields.
Finally, call .build() to create the instance of RadioConfig.