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,

source

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)?;
source

pub fn run(&mut self)

Run Retina for the duration specified in the configuration or until ctrl-c to terminate.

Example
runtime.run();

Auto Trait Implementations§

§

impl<'a, S> !RefUnwindSafe for Runtime<'a, S>

§

impl<'a, S> !Send for Runtime<'a, S>

§

impl<'a, S> !Sync for Runtime<'a, S>

§

impl<'a, S> Unpin for Runtime<'a, S>

§

impl<'a, S> !UnwindSafe for Runtime<'a, S>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.