pub struct SelectorControl {
pub control_number: u8,
pub display: String,
pub tooltip: Option<String>,
pub options: Vec<SelectorControlOption>,
}
Expand description
A dropdown selector with fixed values which can be selected.
Default values can be provided using the options
field. When starting
a capture, Wireshark will send the value as a command line flag if the
selected value is different from the default value.
Fields§
§control_number: u8
The control number, a unique identifier for this control.
display: String
The user-visible label of this selector, displayed next to the drop down box.
tooltip: Option<String>
Tooltip shown when hovering over the UI element.
options: Vec<SelectorControlOption>
The list of options available for selection in this selector.
Implementations§
Source§impl SelectorControl
impl SelectorControl
Sourcepub fn builder() -> SelectorControlBuilder<((), (), (), ())>
pub fn builder() -> SelectorControlBuilder<((), (), (), ())>
Create a builder for building SelectorControl
.
On the builder, call .control_number(...)
, .display(...)
, .tooltip(...)
(optional), .options(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of SelectorControl
.
Source§impl SelectorControl
impl SelectorControl
Sourcepub fn set_value<'a>(&self, value: &'a str) -> ControlPacket<'a>
pub fn set_value<'a>(&self, value: &'a str) -> ControlPacket<'a>
Add an option to the selector dynamically.
Sourcepub fn add_value<'a>(
&self,
value: &'a str,
display: Option<&'a str>,
) -> ControlPacket<'a>
pub fn add_value<'a>( &self, value: &'a str, display: Option<&'a str>, ) -> ControlPacket<'a>
Add an option to the selector dynamically.
Sourcepub fn remove_value<'a>(&self, value: &'a str) -> ControlPacket<'a>
pub fn remove_value<'a>(&self, value: &'a str) -> ControlPacket<'a>
Removes an option from the selector.
Panics: If value
is an empty string.
Sourcepub fn clear(&self) -> ControlPacket<'static>
pub fn clear(&self) -> ControlPacket<'static>
Clears all options from the selector.