Struct routinator::engine::Engine

source ·
pub struct Engine { /* private fields */ }
Expand description

The mechanism to update and process RPKI data.

A validation value can be created from the configuration via Engine::new. If you don’t actually want to perform a validation run but just initialize everything, Engine::init will suffice.

When created, the set of TALs is loaded and kept around. It will only be refreshed explicitly through the reload_tals method.

Before starting the very first validation run, you need to call ignite at least once. As this may spawn threads, this must happen after a possible fork.

A run is started via the start method, providing a processor that handles valid data. The method returns a Run value that drives the validation run.

Implementations§

source§

impl Engine

source

pub fn init(config: &Config) -> Result<(), Failed>

Initializes the engine without creating a value.

This ensures that the TAL directory is present and logs a hint how to achieve that if not.

The function is called implicitly by new.

source

pub fn new(config: &Config, update: bool) -> Result<Self, Failed>

Creates a new engine.

Takes all necessary information from config. It also takes over the provided cache and store for use during validation.

Loads the initial set of TALs and errors out if that fails.

source

pub fn reload_tals(&mut self) -> Result<(), Failed>

Reloads the set of TALs.

Assumes that all regular files with an extension of tal in the TAL directory specified during object creation are TAL files and tries to load and decode them. Fails if that fails for at least one of those files.

It is not considered an error if there are no TAL files in the TAL directory. However, a warning will be logged in this case.

source

pub fn ignite(&mut self) -> Result<(), Failed>

Ignites validation processing.

This spawns threads and therefore needs to be done after a possible fork.

source

pub fn start<P: ProcessRun>(&self, processor: P) -> Result<Run<'_, P>, Failed>

Starts a validation run.

During the run, processor will be responsible for dealing with valid objects. It must implement the ProcessRun trait.

The method returns a Run that drives the validation run.

source

pub fn dump(&self, dir: &Path) -> Result<(), Failed>

Dumps the content of the collector and store owned by the engine.

Trait Implementations§

source§

impl Debug for Engine

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Engine

§

impl Send for Engine

§

impl Sync for Engine

§

impl Unpin for Engine

§

impl !UnwindSafe for Engine

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more