[−][src]Crate pcap_async
pcap-async
Async/await wrappers pcap-sys.
use futures::StreamExt; use pcap_async::{Config, Handle, PacketStream}; use std::sync::Arc; fn main() { let handle = Handle::lookup().expect("No handle created"); smol::run(async move { let mut provider = PacketStream::new(Config::default(), Arc::clone(&handle)) .expect("Could not create provider") .boxed(); while let Some(packets) = provider.next().await { } handle.interrupt(); }); }
Re-exports
pub use crate::errors::Error; |
Modules
| bpf | |
| errors | |
| pcap_util |
Structs
| BridgeStream | |
| Config | |
| Handle | Wrapper around a pcap_t handle to indicate live or offline capture, and allow the handle to be interrupted to stop capture. |
| Info | |
| Packet | |
| PacketStream | |
| Stats |
Enums
| BigEndian | Defines big-endian serialization. |
| LittleEndian | Defines little-endian serialization. |
Traits
| WriteBytesExt | Extends |
Type Definitions
| NativeEndian | Defines system native-endian serialization. |
| StreamItem |