Trait ethrecv::PacketHandler
source · pub trait PacketHandler {
type Error;
// Required method
fn proc(&mut self, pkt: Packet<'_>) -> Result<(), Self::Error>;
// Provided methods
fn init(&mut self) -> Result<(), Self::Error> { ... }
fn idle(&mut self) -> Result<(), Self::Error> { ... }
fn inspect(&self, info: &RecvInfo) { ... }
fn shutdown(&mut self) { ... }
}
Expand description
Application-defined packet handler callback.
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn init(&mut self) -> Result<(), Self::Error>
fn init(&mut self) -> Result<(), Self::Error>
Called on the receiver thread before the processing reading and processing loop has been entered.
sourcefn idle(&mut self) -> Result<(), Self::Error>
Available on crate feature idle
only.
fn idle(&mut self) -> Result<(), Self::Error>
idle
only.Called whenever a timeout has been reached without any new packets arriving.