Skip to main content

ConversationTable

Struct ConversationTable 

Source
pub struct ConversationTable { /* private fields */ }
Expand description

Thread-safe conversation tracking table backed by DashMap.

Supports concurrent packet ingestion from multiple threads while maintaining per-conversation state including TCP state machines and stream reassembly. Optionally tracks memory usage and spills reassembly buffers to disk when a budget is exceeded.

Implementations§

Source§

impl ConversationTable

Source

pub fn new(config: FlowConfig) -> Self

Create a new table with the given configuration.

Source

pub fn with_default_config() -> Self

Create a new table with default configuration.

Source

pub fn conversation_count(&self) -> usize

Number of tracked conversations.

Source

pub fn ingest_packet( &self, packet: &Packet, timestamp: Duration, packet_index: usize, ) -> Result<(), FlowError>

Ingest a single parsed packet, updating or creating conversation state.

timestamp is the packet capture timestamp (from PCAP metadata). packet_index is the index of this packet in the original capture (used for cross-referencing).

Source

pub fn memory_usage(&self) -> usize

Estimated memory usage of the flow table (tracked reassembly buffers).

Source

pub fn spill_count(&self) -> usize

Number of spill operations performed.

Source

pub fn get_conversation( &self, key: &CanonicalKey, ) -> Option<Ref<'_, CanonicalKey, ConversationState>>

Get a read reference to a specific conversation.

Source

pub fn evict_idle(&self, now: Duration) -> usize

Evict conversations that have exceeded their idle timeout.

Returns the number of evicted conversations.

Source

pub fn into_conversations(self) -> Vec<ConversationState>

Consume the table and return all conversations sorted by start time.

Source

pub fn config(&self) -> &FlowConfig

Get a reference to the configuration.

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V