ExtcapControlSenderTrait

Trait ExtcapControlSenderTrait 

Source
pub trait ExtcapControlSenderTrait: Sized {
    // Required method
    fn send(self, packet: ControlPacket<'_>) -> Result<()>;

    // Provided methods
    fn info_message(self, message: &str) -> Result<()> { ... }
    fn warning_message(self, message: &str) -> Result<()> { ... }
    fn error_message(self, message: &str) -> Result<()> { ... }
    fn status_message(self, message: &str) -> Result<()> { ... }
}
Expand description

Sender for extcap control packets. These control packets controls the UI generated by Wireshark. This trait also provides convenience functions for sending control packets formatted for particular usages like info_message and status_message. For other functions controlling various toolbar controls, see the methods in the control module instead.

Required Methods§

Source

fn send(self, packet: ControlPacket<'_>) -> Result<()>

Sends the given packet by writing it to the given output file (or fifo).

Provided Methods§

Source

fn info_message(self, message: &str) -> Result<()>

Shows a message in an information dialog popup. The message will show on the screen until the user dismisses the popup.

Source

fn warning_message(self, message: &str) -> Result<()>

Shows a message in a warning dialog popup. The message will show on the screen until the user dismisses the popup.

Source

fn error_message(self, message: &str) -> Result<()>

Shows a message in an error dialog popup. The message will show on the screen until the user dismisses the popup.

Source

fn status_message(self, message: &str) -> Result<()>

Shows a message in the status bar at the bottom of the Wireshark window. When the message is shown, the status bar will also flash yellow to bring it to the user’s attention. The message will stay on the status bar for a few seconds, or until another message overwrites it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> ExtcapControlSenderTrait for &Mutex<T>

Just for syntactic niceness when working with a control sender behind a mutex. This usage allows the sender to be locked only for the duration of that one control packet, without holding the lock longer than it needs to.

Source§

fn send(self, packet: ControlPacket<'_>) -> Result<(), Error>

Sends a control message to Wireshark.

Source§

impl<T> ExtcapControlSenderTrait for &mut Option<T>

An implementation of ExtcapControlSenderTrait that is no-op when the Option is None. Since Wireshark may not include the --extcap-control-out flag (e.g. when no controls are returned during --extcap-interfaces, or when running in tshark), this allows an easier but less efficient way to say option_extcap_sender.status_message(...) without constantly checking for the option.

Source§

fn send(self, packet: ControlPacket<'_>) -> Result<(), Error>

Implementors§