Struct retina_core::Runtime
source · pub struct Runtime<'a, S>where
S: Subscribable,{ /* private fields */ }
Expand description
The Retina runtime.
The runtime initializes the DPDK environment abstraction layer, creates memory pools, launches the packet processing cores, and manages logging and display output.
Implementations§
source§impl<'a, S> Runtime<'a, S>where
S: Subscribable,
impl<'a, S> Runtime<'a, S>where S: Subscribable,
sourcepub fn new(
config: RuntimeConfig,
factory: fn() -> FilterFactory,
cb: impl Fn(S) + 'a
) -> Result<Self>
pub fn new( config: RuntimeConfig, factory: fn() -> FilterFactory, cb: impl Fn(S) + 'a ) -> Result<Self>
Creates a new runtime from the config
settings, filter, and callback.
Remarks
The factory
parameter is a macro-generated function pointer based on the user-defined
filter string, and must take the value “filter
”. cb
is the name of the user-defined
callback function.
Example
let mut runtime = Runtime::new(config, filter, callback)?;