1#![cfg_attr(not(test), deny(clippy::unwrap_used))]
2
3use plain::Plain;
4
5pub mod blob;
6pub mod log_entry;
7mod logger;
8
9pub use log_entry::entry::{flow_entry::TCPFlow, raw::RawLogEntry, tcp_ip_compact::TCPLogEntry};
10pub use logger::{
11 reader::convert_log_to_pcapng, writer::file_logging_thread, FlowDesc, RattanLogOp, LOGGING_TX,
12};
13
14pub trait PlainBytes: Plain + Sized {
15 fn as_bytes(&self) -> &[u8] {
16 unsafe {
17 std::slice::from_raw_parts(
18 self as *const Self as *const u8,
19 std::mem::size_of::<Self>(),
20 )
21 }
22 }
23}
24impl<T: Plain + Sized> PlainBytes for T {}