Struct ButtonControl

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

Button that sends a signal when pressed. The button is only enabled when capturing.

The extcap utility can set the button text at startup using the display field, change the button text using set_label, and receive button press signals from an ExtcapControlReader.

The button is disabled and the button text is restored to the default text when not capturing.

Fields§

§control_number: u8

The control number, a unique identifier for this control.

§display: String

The user-visible label for the button.

§tooltip: Option<String>

Tooltip shown when hovering over the UI element.

Implementations§

Source§

impl ButtonControl

Source

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

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

Trait Implementations§

Source§

impl ControlWithLabel for ButtonControl

Source§

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

Sets the label of this control. Read more
Source§

impl Debug for ButtonControl

Source§

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

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

impl EnableableControl for ButtonControl

Source§

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

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

impl PrintSentence for ButtonControl

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 ButtonControl

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.