1use core::time;
4use std::error::Error;
5
6pub mod arp_packet;
7mod heartbeat_packet;
8pub mod rst_packet;
9pub mod syn_packet;
10pub mod wire;
11
12pub use heartbeat_packet::build as build_heartbeat_packet;
13
14pub const DEFAULT_PACKET_SEND_TIMING: time::Duration = time::Duration::from_micros(50);
16
17pub trait Reader: Send + Sync {
19 fn next_packet(&mut self) -> Result<&[u8], Box<dyn Error>>;
21}
22
23pub trait Sender: Send + Sync {
25 fn send(&mut self, packet: &[u8]) -> Result<(), Box<dyn Error>>;
27}
28
29#[cfg(test)]
30#[path = "./packet_tests.rs"]
31#[doc(hidden)]
32pub mod mocks;