Struct BooleanControl

Source
pub struct BooleanControl {
    pub control_number: u8,
    pub display: String,
    pub tooltip: Option<String>,
    pub default_value: bool,
}
Expand description

A checkbox which lets the user set a true / false value.

The extcap utility can set a default value at startup, change the value using set_checked, and receive value changes from an ExtcapControlReader. When starting a capture Wireshark will send the value if different from the default value.

Fields§

§control_number: u8

The control number, a unique identifier for this control.

§display: String

The user-visible label for the check box.

§tooltip: Option<String>

Tooltip shown when hovering over the UI element.

§default_value: bool

Whether the control should be checked or unchecked by default

Implementations§

Source§

impl BooleanControl

Source

pub fn builder() -> BooleanControlBuilder<((), (), (), ())>

Create a builder for building BooleanControl. On the builder, call .control_number(...), .display(...), .tooltip(...)(optional), .default_value(...)(optional) to set the values of the fields. Finally, call .build() to create the instance of BooleanControl.

Source§

impl BooleanControl

Source

pub fn set_checked<'a>(&self, checked: bool) -> ControlPacket<'a>

Set whether this checkbox is checked.

Trait Implementations§

Source§

impl ControlWithLabel for BooleanControl

Source§

fn set_label<'a>(&self, label: &'a str) -> ControlPacket<'a>

Sets the label of this control. Read more
Source§

impl Debug for BooleanControl

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl EnableableControl for BooleanControl

Source§

fn set_enabled(&self, enabled: bool) -> ControlPacket<'static>

Sets whether the control is enabled or disabled. Read more
Source§

impl PrintSentence for BooleanControl

Source§

fn format_sentence(&self, f: &mut Formatter<'_>) -> Result

The extcap interface expects certain output “sentences” to stdout to communicate with Wireshark, like Read more
Source§

fn print_sentence(&self)

Prints the extcap sentence to stdout.
Source§

impl ToolbarControl for BooleanControl

Source§

fn control_number(&self) -> u8

The control number, a unique identifier for this control.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.