Skip to main content

LifecycleEvent

Trait LifecycleEvent 

Source
pub trait LifecycleEvent<K: Clone> {
    // Required method
    fn as_flow_event(&self) -> Option<Cow<'_, FlowEvent<K>>>;
}
Available on crate feature emit only.
Expand description

A lifecycle event the emit writers can consume — implemented by both FlowEvent (the tracker primitive) and the typed driver’s Event (issue #97).

Lets every write_lifecycle accept either, so a consumer driving the typed Driver<E> can emit its Event<K> stream through the same CSV / Zeek / NDJSON / EVE writers the raw FlowTracker uses — without hand-converting first.

The FlowEvent projection is borrowed for FlowEvent itself (zero-copy) and produced by conversion for Event (see Event::to_flow_event). Event::ParserClosed has no flow-record projection and is skipped.

Required Methods§

Source

fn as_flow_event(&self) -> Option<Cow<'_, FlowEvent<K>>>

Borrow (or produce) this event’s FlowEvent projection, or None if it has none.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<K: Clone> LifecycleEvent<K> for Event<K>

Available on crate features extractors and reassembler and session only.
Source§

impl<K: Clone> LifecycleEvent<K> for FlowEvent<K>