From 8503be38e5b5cceefb020510db0d4bfb4d4aecec Mon Sep 17 00:00:00 2001 From: Grzegorz Nosek Date: Mon, 11 Mar 2024 16:50:17 +0100 Subject: [PATCH] cleanup(event): move all exports in falco_event::types to module root --- falco_event/src/event_field_type.rs | 38 ++++++++++++-------------- falco_event/src/lib.rs | 6 ++++ falco_event/src/types/mod.rs | 19 ++++++++----- falco_event/src/types/net/mod.rs | 22 +++++++++------ falco_event/src/types/path/mod.rs | 6 ++-- falco_event/src/types/primitive/mod.rs | 8 ++++-- falco_event/src/types/string/mod.rs | 6 ++-- falco_event/src/types/time/mod.rs | 4 +-- 8 files changed, 64 insertions(+), 45 deletions(-) diff --git a/falco_event/src/event_field_type.rs b/falco_event/src/event_field_type.rs index 5a698771..2ad14081 100644 --- a/falco_event/src/event_field_type.rs +++ b/falco_event/src/event_field_type.rs @@ -7,28 +7,26 @@ pub use std::net::Ipv6Addr as PT_IPV6ADDR; use std::path::Path; use std::time::{Duration, SystemTime}; -pub use newtypes::Bool as PT_BOOL; -pub use newtypes::Errno as PT_ERRNO; -pub use newtypes::Fd as PT_FD; -pub use newtypes::Gid as PT_GID; -pub use newtypes::Pid as PT_PID; -pub use newtypes::Port as PT_PORT; -pub use newtypes::SigSet as PT_SIGSET; -pub use newtypes::SigType as PT_SIGTYPE; -pub use newtypes::SockFamily as PT_SOCKFAMILY; -pub use newtypes::SyscallId as PT_SYSCALLID; -pub use newtypes::Uid as PT_UID; - pub use crate::dynamic_params::*; pub use crate::event_flags::*; -pub use crate::types::fd_list::FdList as PT_FDLIST; -pub use crate::types::net::ipnet as PT_IPNET; -pub use crate::types::net::ipv4net as PT_IPV4NET; -pub use crate::types::net::ipv6net as PT_IPV6NET; -pub use crate::types::net::sockaddr::SockAddr as PT_SOCKADDR; -pub use crate::types::net::socktuple::SockTuple as PT_SOCKTUPLE; -pub use crate::types::path::relative_path::RelativePath as PT_FSRELPATH; -use crate::types::primitive::newtypes; +pub use crate::types::Bool as PT_BOOL; +pub use crate::types::Errno as PT_ERRNO; +pub use crate::types::Fd as PT_FD; +pub use crate::types::FdList as PT_FDLIST; +pub use crate::types::Gid as PT_GID; +pub use crate::types::IpNet as PT_IPNET; +pub use crate::types::Ipv4Net as PT_IPV4NET; +pub use crate::types::Ipv6Net as PT_IPV6NET; +pub use crate::types::Pid as PT_PID; +pub use crate::types::Port as PT_PORT; +pub use crate::types::RelativePath as PT_FSRELPATH; +pub use crate::types::SigSet as PT_SIGSET; +pub use crate::types::SigType as PT_SIGTYPE; +pub use crate::types::SockAddr as PT_SOCKADDR; +pub use crate::types::SockFamily as PT_SOCKFAMILY; +pub use crate::types::SockTuple as PT_SOCKTUPLE; +pub use crate::types::SyscallId as PT_SYSCALLID; +pub use crate::types::Uid as PT_UID; pub type PT_INT8 = i8; pub type PT_INT16 = i16; diff --git a/falco_event/src/lib.rs b/falco_event/src/lib.rs index e404168a..e2066948 100644 --- a/falco_event/src/lib.rs +++ b/falco_event/src/lib.rs @@ -1,3 +1,6 @@ +#![warn(missing_docs)] +#![deny(rustdoc::broken_intra_doc_links)] + use std::fmt::{Debug, Formatter}; use std::io::Write; use std::time::{Duration, SystemTime, UNIX_EPOCH}; @@ -7,7 +10,9 @@ use crate::payload::PayloadToBytes; pub mod dynamic_params; pub mod event_field_type; +#[allow(missing_docs)] pub mod event_flags; +#[allow(missing_docs)] pub mod events; pub mod from_bytes; pub mod payload; @@ -20,6 +25,7 @@ pub mod types; #[allow(non_snake_case)] #[allow(non_camel_case_types)] #[allow(non_upper_case_globals)] +#[allow(missing_docs)] mod ffi; #[derive(Clone)] diff --git a/falco_event/src/types/mod.rs b/falco_event/src/types/mod.rs index 4f5f07ff..52469ac3 100644 --- a/falco_event/src/types/mod.rs +++ b/falco_event/src/types/mod.rs @@ -1,7 +1,12 @@ -pub mod bytebuf; -pub mod fd_list; -pub mod net; -pub mod path; -pub mod primitive; -pub mod string; -pub mod time; +mod bytebuf; +mod fd_list; +mod net; +mod path; +mod primitive; +mod string; +mod time; + +pub use fd_list::*; +pub use net::*; +pub use path::*; +pub use primitive::*; diff --git a/falco_event/src/types/net/mod.rs b/falco_event/src/types/net/mod.rs index 03f60644..937e44c6 100644 --- a/falco_event/src/types/net/mod.rs +++ b/falco_event/src/types/net/mod.rs @@ -1,8 +1,14 @@ -pub mod ipaddr; -pub mod ipnet; -pub mod ipv4addr; -pub mod ipv4net; -pub mod ipv6addr; -pub mod ipv6net; -pub mod sockaddr; -pub mod socktuple; +mod ipaddr; +mod ipnet; +mod ipv4addr; +mod ipv4net; +mod ipv6addr; +mod ipv6net; +mod sockaddr; +mod socktuple; + +pub use ipnet::*; +pub use ipv4net::*; +pub use ipv6net::*; +pub use sockaddr::*; +pub use socktuple::*; diff --git a/falco_event/src/types/path/mod.rs b/falco_event/src/types/path/mod.rs index e7e709e9..3fbd1da8 100644 --- a/falco_event/src/types/path/mod.rs +++ b/falco_event/src/types/path/mod.rs @@ -1,2 +1,4 @@ -pub mod absolute_path; -pub mod relative_path; +mod absolute_path; +mod relative_path; + +pub use relative_path::*; diff --git a/falco_event/src/types/primitive/mod.rs b/falco_event/src/types/primitive/mod.rs index c72e8f33..08a3051a 100644 --- a/falco_event/src/types/primitive/mod.rs +++ b/falco_event/src/types/primitive/mod.rs @@ -1,3 +1,5 @@ -pub mod bool; -pub mod integers; -pub mod newtypes; +mod bool; +mod integers; +mod newtypes; + +pub use newtypes::*; diff --git a/falco_event/src/types/string/mod.rs b/falco_event/src/types/string/mod.rs index 11c94fb4..e0f6d832 100644 --- a/falco_event/src/types/string/mod.rs +++ b/falco_event/src/types/string/mod.rs @@ -1,3 +1,3 @@ -pub mod cstr; -pub mod cstr_array; -pub mod cstr_pair_array; +mod cstr; +mod cstr_array; +mod cstr_pair_array; diff --git a/falco_event/src/types/time/mod.rs b/falco_event/src/types/time/mod.rs index af9022f9..1b3f20b4 100644 --- a/falco_event/src/types/time/mod.rs +++ b/falco_event/src/types/time/mod.rs @@ -1,2 +1,2 @@ -pub mod duration; -pub mod system_time; +mod duration; +mod system_time;