falco_plugin/event/
mod.rs1mod async_event;
7mod event_input;
8mod json;
9mod plugin_event;
10
11pub use async_event::AsyncEvent;
12pub use event_input::EventInput;
13use falco_event::fields::{FromBytes, ToBytes};
14pub use falco_event::{events, fields};
15pub use json::JsonPayload;
16pub use plugin_event::PluginEvent;
17use std::fmt::Debug;
18
19pub trait EventSource {
23 const SOURCE: Option<&'static str>;
28}
29
30impl EventSource for &[u8] {
31 const SOURCE: Option<&'static str> = None;
32}
33
34#[derive(falco_event::AnyEvent)]
40#[allow(missing_docs)]
41pub enum AnyPluginEvent<'a, P, A>
42where
43 for<'b> P: EventSource + ToBytes + FromBytes<'b> + Debug,
44 A: EventSource + ToBytes + FromBytes<'a> + Debug,
45{
46 Plugin(PluginEvent<P>),
47 Async(AsyncEvent<'a, A>),
48}