pub trait PrettyPrint {
    // Required method
    fn pretty_print(
        buffer: &dyn AsRef<[u8]>,
        fmt: &mut Formatter<'_>,
        indent: &mut PrettyIndent
    ) -> Result<(), Error>;
}
Expand description

Interface for printing listings.

Required Methods§

fn pretty_print( buffer: &dyn AsRef<[u8]>, fmt: &mut Formatter<'_>, indent: &mut PrettyIndent ) -> Result<(), Error>

Write a concise, formatted representation of a packet contained in the provided buffer, and any nested packets it may contain.

pretty_print accepts a buffer and not a packet wrapper because the packet might be truncated, and so it might not be possible to create the packet wrapper.

Implementors§

§

impl<T> PrettyPrint for net::wire::ArpPacket<T>where T: AsRef<[u8]>,

§

impl<T> PrettyPrint for Frame<T>where T: AsRef<[u8]>,

§

impl<T> PrettyPrint for net::wire::Icmpv4Packet<T>where T: AsRef<[u8]>,

§

impl<T> PrettyPrint for net::wire::Ipv4Packet<T>where T: AsRef<[u8]>,

§

impl<T> PrettyPrint for net::wire::Ipv6Packet<T>where T: AsRef<[u8]>,

§

impl<T> PrettyPrint for NdiscOption<T>where T: AsRef<[u8]>,

§

impl<T> PrettyPrint for net::wire::TcpPacket<T>where T: AsRef<[u8]>,

§

impl<T> PrettyPrint for net::wire::UdpPacket<T>where T: AsRef<[u8]>,