Skip to main content

IPFixParser

Struct IPFixParser 

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

Stateful IPFIX parser with LRU template caches and optional pending flow support. Supports both native IPFIX templates and V9-style templates embedded in IPFIX messages.

Implementations§

Source§

impl IPFixParser

Source

pub fn validate_config(config: &Config) -> Result<(), ConfigError>

Validates a configuration without allocating parser internals.

Source

pub fn try_new(config: Config) -> Result<Self, ConfigError>

Create a new IPFixParser with a custom template cache size and optional TTL configuration.

§Arguments
  • config - Configuration struct containing max_template_cache_size and optional ttl_config
§Errors

Returns ConfigError if max_template_cache_size is 0

Source§

impl IPFixParser

Source

pub fn available_template_ids(&self) -> Vec<u16>

Returns a sorted, deduplicated list of all available template IDs.

Trait Implementations§

Source§

impl Debug for IPFixParser

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for IPFixParser

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl ParserConfig for IPFixParser

Source§

fn set_pending_flows_config( &mut self, config: Option<PendingFlowsConfig>, ) -> Result<(), ConfigError>

Set the pending flows configuration Read more
Source§

fn resize_template_caches(&mut self, cache_size: NonZeroUsize)

Internal helper: resize all template caches to the given size
Source§

fn add_config(&mut self, config: Config) -> Result<(), ConfigError>

Add or update the parser’s configuration
Source§

fn set_max_template_cache_size( &mut self, size: usize, ) -> Result<(), ConfigError>

Set the maximum template cache size
Source§

fn set_ttl_config( &mut self, ttl_config: Option<TtlConfig>, ) -> Result<(), ConfigError>

Set the TTL configuration for templates
Source§

fn pending_flows_enabled(&self) -> bool

Returns whether pending flow caching is enabled.
Source§

fn pending_flow_count(&self) -> usize

Returns the total number of pending flow entries across all template IDs.
Source§

fn clear_pending_flows(&mut self)

Clear all pending flows, recording dropped metrics.

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, 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.