falco_plugin/plugin/event/
mod.rs1mod async_event;
2mod event_input;
3mod json;
4mod plugin_event;
5
6pub use async_event::AsyncEvent;
7pub use event_input::EventInput;
8use falco_event::fields::{FromBytes, ToBytes};
9pub use json::JsonPayload;
10pub use plugin_event::PluginEvent;
11use std::fmt::Debug;
12
13pub trait EventSource {
17 const SOURCE: Option<&'static str>;
22}
23
24impl EventSource for &[u8] {
25 const SOURCE: Option<&'static str> = None;
26}
27
28#[derive(falco_event::AnyEvent)]
34#[allow(missing_docs)]
35pub enum AnyPluginEvent<'a, P, A>
36where
37 for<'b> P: EventSource + ToBytes + FromBytes<'b> + Debug,
38 A: EventSource + ToBytes + FromBytes<'a> + Debug,
39{
40 Plugin(PluginEvent<P>),
41 Async(AsyncEvent<'a, A>),
42}