Skip to main content

L3Reader

Trait L3Reader 

Source
pub trait L3Reader {
    // Required methods
    fn recv(&mut self) -> Result<Ipv4Packet<'_>, IoError>;
    fn set_timeout(&mut self, dur: Option<Duration>) -> Result<(), IoError>;
    fn set_header_included(&mut self, on: bool) -> Result<(), IoError>;
}
Expand description

Receiver for raw L3 IPv4 packets.

Required Methods§

Source

fn recv(&mut self) -> Result<Ipv4Packet<'_>, IoError>

Receive a single IPv4 packet and parse it.

Source

fn set_timeout(&mut self, dur: Option<Duration>) -> Result<(), IoError>

Set the receive timeout. None means blocking (no timeout).

Source

fn set_header_included(&mut self, on: bool) -> Result<(), IoError>

Enable or disable IP_HDRINCL (header included in send).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§