Skip to main content

Runtime

Struct 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> Freeze for Runtime<'a, S>

§

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> UnsafeUnpin for Runtime<'a, S>

§

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.