falco_event_schema/
lib.rs

1#![doc = include_str!("../README.md")]
2
3#[cfg(feature = "derive_deftly")]
4pub use derive_deftly;
5use std::ffi::CStr;
6
7/// All the types available in event fields
8pub mod fields;
9mod types;
10
11/// # Event types
12///
13/// This module is automatically generated from the Falco event schema. It provides strongly-typed
14/// structs for each event type supported by Falco, as well as a [`events::AnyEvent`] enum that is capable
15/// of containing an arbitrary event matching the schema.
16#[allow(clippy::crate_in_macro_def)]
17pub mod events;
18
19#[allow(dead_code)]
20#[allow(non_snake_case)]
21#[allow(non_camel_case_types)]
22#[allow(non_upper_case_globals)]
23#[allow(missing_docs)]
24#[allow(unsafe_op_in_unsafe_fn)]
25#[doc(hidden)]
26pub mod ffi;
27
28#[cfg(test)]
29mod tests;
30
31/// The schema version supported by this crate
32///
33/// If you're not using the same version of falco_event_schema and falco_plugin, you need
34/// to expose this constant as `Plugin::SCHEMA_VERSION`.
35pub const SCHEMA_VERSION: &CStr = {
36    match CStr::from_bytes_with_nul(concat!(include_str!("../api/SCHEMA_VERSION"), "\0").as_bytes())
37    {
38        Ok(s) => s,
39        Err(_) => panic!("Failed to parse SCHEMA_VERSION: embedded null byte in string"),
40    }
41};