pub struct ConfigBuilder<S: ConfigState, OutputTime: OutputTimeRepresentation> { /* private fields */ }
Expand description

The main entry point of the application. Use the various methods to construct a configuration either for running the interpreter directly or to use the Monitor API interface.

An example construction of the API:

use rtlola_interpreter::monitor::{EventInput, Incremental};
use rtlola_interpreter::time::RelativeFloat;
use rtlola_interpreter::{ConfigBuilder, Monitor, Value};

let monitor: Monitor<_, _, Incremental, _> = ConfigBuilder::new()
    .spec_str("input i: Int64")
    .offline::<RelativeFloat>()
    .event_input::<Vec<Value>>()
    .with_verdict::<Incremental>()
    .monitor().expect("Failed to create monitor.");

Implementations§

Creates a new configuration to be used with the API.

Examples found in repository?
src/configuration/config_builder.rs (line 105)
104
105
106
    fn default() -> Self {
        Self::new()
    }

Sets the format in which time is returned. See the README for more details on time formats. For possible formats see the OutputTimeRepresentation trait.

Sets the start time of the execution.

Use an existing ir with the configuration

Read the specification from a file at the given path.

Read the specification from the given string.

Sets the execute mode to be online, i.e. the time of events is taken by the interpreter.

Sets the execute mode to be offline, i.e. takes the time of events from the input source. How the input timestamps are interpreted is defined by the type parameter. See the README for further details on timestamp representations. For possible TimeRepresentations see the Time Module.

Use the predefined EventInput method to provide inputs to the API.

Use the predefined RecordInput method to provide inputs to the API.

Use a custom input method to provide inputs to the API.

Sets the VerdictRepresentation for the monitor

Adds tracing functionality to the evaluator

Finalize the configuration and generate a configuration.

Examples found in repository?
src/configuration/config_builder.rs (line 422)
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
    pub fn monitor_with_data(
        self,
        data: Source::CreationData,
    ) -> Result<Monitor<Source, InputTime, Verdict, OutputTime>, Source::Error> {
        self.build().monitor_with_data(data)
    }

    /// Create a [Monitor] from the configuration. The entrypoint of the API.
    pub fn monitor(self) -> Result<Monitor<Source, InputTime, Verdict, OutputTime>, Source::Error>
    where
        Source: Input<CreationData = ()> + 'static,
    {
        self.build().monitor()
    }

    #[cfg(feature = "queued-api")]
    /// Create a [QueuedMonitor] from the configuration. The entrypoint of the API. The data is provided to the [Input](crate::monitor::Input) source at creation.
    pub fn queued_monitor_with_data(
        self,
        data: Source::CreationData,
    ) -> QueuedMonitor<Source, InputTime, Verdict, OutputTime> {
        self.build().queued_monitor_with_data(data)
    }

    #[cfg(feature = "queued-api")]
    /// Create a [QueuedMonitor] from the configuration. The entrypoint of the API.
    pub fn queued_monitor(self) -> QueuedMonitor<Source, InputTime, Verdict, OutputTime>
    where
        Source: Input<CreationData = ()> + 'static,
    {
        self.build().queued_monitor()
    }

Create a Monitor from the configuration. The entrypoint of the API. The data is provided to the Input source at creation.

Create a Monitor from the configuration. The entrypoint of the API.

Create a QueuedMonitor from the configuration. The entrypoint of the API. The data is provided to the Input source at creation.

Create a QueuedMonitor from the configuration. The entrypoint of the API.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.