pub struct TimestampConfig {
pub config_number: u8,
pub call: String,
pub display: String,
pub tooltip: Option<String>,
pub group: Option<String>,
}
Expand description
A config that is displayed as a date/time editor.
Typically, these configs are created in a lazy_static
, and passed to
ConfigStep::list_configs
.
§Example
use r_extcap::config::*;
let config = TimestampConfig::builder()
.config_number(9)
.call("ts")
.display("Start Time")
.tooltip("Capture start time")
.group("Time / Log")
.build();
assert_eq!(
format!("{}", ExtcapFormatter(&config)),
"arg {number=9}{call=--ts}{display=Start Time}{tooltip=Capture start time}{group=Time / Log}{type=timestamp}\n"
);
Fields§
§config_number: u8
The config number, a unique identifier for this config.
call: String
The 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: String
The user-friendly label for the config.
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”.
Implementations§
Source§impl TimestampConfig
impl TimestampConfig
Sourcepub fn builder() -> TimestampConfigBuilder<((), (), (), (), ())>
pub fn builder() -> TimestampConfigBuilder<((), (), (), (), ())>
Create a builder for building TimestampConfig
.
On the builder, call .config_number(...)
, .call(...)
, .display(...)
, .tooltip(...)
(optional), .group(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of TimestampConfig
.