pub struct ExtcapFormatter<'a, T: ?Sized>(pub &'a T)
where
Self: Display;
Expand description
The extcap interface expects certain output “sentences” to stdout to communicate with Wireshark, like
extcap {version=1.0}{help=Some help url}
This formatter serves as a wrapper to implement that format via the
Display
trait, and the Extcap output can be printed out like this:
use r_extcap::interface::Metadata;
print!("{}", ExtcapFormatter(&Metadata {
version: "1.0".into(),
help_url: "Some help url".into(),
display_description: "Example extcap".into(),
}));
// Output: extcap {version=1.0}{help=Some help url}{display=Example extcap}
Tuple Fields§
§0: &'a T
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for ExtcapFormatter<'a, T>where
T: ?Sized,
impl<'a, T> RefUnwindSafe for ExtcapFormatter<'a, T>where
T: RefUnwindSafe + ?Sized,
impl<'a, T> Send for ExtcapFormatter<'a, T>
impl<'a, T> Sync for ExtcapFormatter<'a, T>
impl<'a, T> Unpin for ExtcapFormatter<'a, T>where
T: ?Sized,
impl<'a, T> UnwindSafe for ExtcapFormatter<'a, T>where
T: RefUnwindSafe + ?Sized,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more