Skip to main content

FlowEvent

Enum FlowEvent 

Source
pub enum FlowEvent<K> {
    Started {
        key: K,
        side: FlowSide,
        ts: Timestamp,
        l4: Option<L4Proto>,
    },
    Packet {
        key: K,
        side: FlowSide,
        len: usize,
        ts: Timestamp,
    },
    Established {
        key: K,
        ts: Timestamp,
    },
    StateChange {
        key: K,
        from: FlowState,
        to: FlowState,
        ts: Timestamp,
    },
    Ended {
        key: K,
        reason: EndReason,
        stats: FlowStats,
        history: HistoryString,
    },
    Anomaly {
        key: Option<K>,
        kind: AnomalyKind,
        ts: Timestamp,
    },
}
Available on crate feature tracker only.
Expand description

Events emitted by the tracker.

One packet typically produces one or two events. The Started event fires on first sight of a flow and is followed by a Packet event for the same packet. Subsequent packets of the same flow produce a single Packet event each. TCP-aware events (Established, StateChange) fire only when the extractor supplied crate::TcpInfo.

Variants§

§

Started

First packet of a new flow.

Fields

§key: K
§

Packet

Subsequent packet on a known flow.

Fields

§key: K
§len: usize
§

Established

TCP only — 3WHS completed for this flow.

Fields

§key: K
§

StateChange

State machine transitioned. Fires for TCP non-Established transitions (e.g., Established → FinWait).

Fields

§key: K
§

Ended

Flow ended (FIN/RST for TCP, idle/eviction for any flow).

Fields

§key: K
§reason: EndReason
§

Anomaly

Live, in-flight anomaly. The flow is still alive (use Ended for end-of-life events). Opt-in: emitted only when crate::FlowDriver::with_emit_anomalies is true.

key is None for tracker-global anomalies (e.g. AnomalyKind::FlowTableEvictionPressure); Some(key) for per-flow anomalies.

Fields

§key: Option<K>

Implementations§

Source§

impl<K> FlowEvent<K>

Source

pub fn key(&self) -> Option<&K>

Borrow the key without moving it. Useful for filter combinators.

Returns None for tracker-global FlowEvent::Anomaly events that don’t belong to a single flow.

Trait Implementations§

Source§

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

Source§

fn clone(&self) -> FlowEvent<K>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<K: Debug> Debug for FlowEvent<K>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<K> Freeze for FlowEvent<K>
where K: Freeze,

§

impl<K> RefUnwindSafe for FlowEvent<K>
where K: RefUnwindSafe,

§

impl<K> Send for FlowEvent<K>
where K: Send,

§

impl<K> Sync for FlowEvent<K>
where K: Sync,

§

impl<K> Unpin for FlowEvent<K>
where K: Unpin,

§

impl<K> UnsafeUnpin for FlowEvent<K>
where K: UnsafeUnpin,

§

impl<K> UnwindSafe for FlowEvent<K>
where K: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more