pub struct ProjectionConfig { /* private fields */ }Expand description
Configuration for field projection during parsing.
Stores per-protocol field sets that control which fields are extracted. Fields not in the set are skipped during parsing, reducing CPU usage.
Implementations§
Source§impl ProjectionConfig
impl ProjectionConfig
Sourcepub fn with_chain_fields(self) -> Self
pub fn with_chain_fields(self) -> Self
Create configuration that includes chain fields.
Chain fields are those needed to detect and parse child protocols, such as IP protocol number or TCP/UDP ports.
Sourcepub fn without_chain_fields(self) -> Self
pub fn without_chain_fields(self) -> Self
Disable automatic inclusion of chain fields.
Sourcepub fn add_protocol_fields<I, S>(&mut self, protocol: &str, fields: I)
pub fn add_protocol_fields<I, S>(&mut self, protocol: &str, fields: I)
Add required fields for a protocol.
§Arguments
protocol- Protocol name (e.g., “tcp”, “dns”)fields- Field names to extract (e.g., “src_port”, “dst_port”)
Sourcepub fn with_protocol_fields<I, S>(self, protocol: &str, fields: I) -> Self
pub fn with_protocol_fields<I, S>(self, protocol: &str, fields: I) -> Self
Builder-style method to add protocol fields.
Sourcepub fn get(&self, protocol: &str) -> Option<&HashSet<String>>
pub fn get(&self, protocol: &str) -> Option<&HashSet<String>>
Get the projection for a specific protocol.
Returns None if no projection is configured for this protocol, meaning all fields should be extracted.
Sourcepub fn include_chain_fields(&self) -> bool
pub fn include_chain_fields(&self) -> bool
Check if chain fields should be included.
Sourcepub fn protocols(&self) -> impl Iterator<Item = &str>
pub fn protocols(&self) -> impl Iterator<Item = &str>
Get all protocol names with configured projections.
Sourcepub fn from_field_names<I, S>(protocol: &str, field_names: I) -> Self
pub fn from_field_names<I, S>(protocol: &str, field_names: I) -> Self
Create a projection config from DataFusion projection indices.
Converts projection indices to field names based on schema.
§Arguments
protocol- Protocol namefield_names- Iterator of field names to include
Trait Implementations§
Source§impl Clone for ProjectionConfig
impl Clone for ProjectionConfig
Source§fn clone(&self) -> ProjectionConfig
fn clone(&self) -> ProjectionConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more