[][src]Trait rawsock::traits::StaticInterface

pub trait StaticInterface<'a>: DynamicInterface<'a> {
    fn loop_infinite<F>(&self, callback: F) -> Result<(), Error>
    where
        F: FnMut(&BorrowedPacket)
; }

Contains static part of the interface trait.

Template functions cannot be used for dynamic dispatch (&dyn) and it was necessary to split the interface trait into two parts - static and dynamic, depending how user uses the trait. StaticInterface contains only the part of trait that cannot be used in the dynamic way.

Required methods

fn loop_infinite<F>(&self, callback: F) -> Result<(), Error> where
    F: FnMut(&BorrowedPacket), 

Runs infinite loop and passes received packets via callback.

Exits when the break_loop() function is called or on error.

Loading content...

Implementors

impl<'a> StaticInterface<'a> for rawsock::pcap::Interface<'a>[src]

impl<'a> StaticInterface<'a> for rawsock::pfring::Interface<'a>[src]

impl<'a> StaticInterface<'a> for rawsock::wpcap::Interface<'a>[src]

Loading content...