Skip to main content

SessionParserFactory

Trait SessionParserFactory 

Source
pub trait SessionParserFactory<K>: Send + 'static {
    type Parser: SessionParser;

    // Required method
    fn new_parser(&mut self, key: &K) -> Self::Parser;
}
Available on crate feature session only.
Expand description

Builds a fresh SessionParser per session. Modeled on crate::ReassemblerFactory.

Most parsers can skip implementing this manually: any parser that’s SessionParser + Default + Clone automatically becomes a factory via the blanket impl below.

Required Associated Types§

Required Methods§

Source

fn new_parser(&mut self, key: &K) -> Self::Parser

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<K, P> SessionParserFactory<K> for P