Struct rtlola_interpreter::ConfigBuilder
source · [−]pub struct ConfigBuilder<C: SubConfig, 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::ConfigBuilder;
use rtlola_interpreter::monitor::{EventInput, Incremental};
use rtlola_interpreter::{Monitor, Value};
use rtlola_interpreter::time::RelativeFloat;
let monitor: Monitor<_,_,Incremental,_> =
ConfigBuilder::api()
.spec_str("input i: Int64")
.input_time::<RelativeFloat>()
.event_input::<Vec<Value>>()
.with_verdict::<Incremental>()
.monitor();
An example configuration to run the interpreter:
use rtlola_interpreter::ConfigBuilder;
use rtlola_interpreter::monitor::{EventInput, Incremental};
use rtlola_interpreter::{Monitor, Value};
use rtlola_interpreter::config::Verbosity;
use std::path::PathBuf;
use rtlola_interpreter::time::RelativeFloat;
ConfigBuilder::runnable()
.spec_str("input a: Int64")
.input_time::<RelativeFloat>()
.offline()
.verbosity(Verbosity::Silent)
.csv_file_input(PathBuf::from("traces/tests/count_1_2.csv"), None)
.run();
Implementations
sourceimpl ConfigBuilder<ExecConfig<ConfigureMode>, ConfigureIR, RelativeFloat>
impl ConfigBuilder<ExecConfig<ConfigureMode>, ConfigureIR, RelativeFloat>
sourceimpl ConfigBuilder<ApiConfig<ConfigureInput>, ConfigureIR, RelativeFloat>
impl ConfigBuilder<ApiConfig<ConfigureInput>, ConfigureIR, RelativeFloat>
sourceimpl<C: SubConfig, S: ConfigState, OutputTime: OutputTimeRepresentation> ConfigBuilder<C, S, OutputTime>
impl<C: SubConfig, S: ConfigState, OutputTime: OutputTimeRepresentation> ConfigBuilder<C, S, OutputTime>
sourcepub fn output_time<T: OutputTimeRepresentation>(self) -> ConfigBuilder<C, S, T>
pub fn output_time<T: OutputTimeRepresentation>(self) -> ConfigBuilder<C, S, T>
Sets the format in which time is returned. See the README for more details on time formats. For possible formats see the OutputTimeRepresentation trait.
sourcepub fn start_time(self, time: SystemTime) -> Self
pub fn start_time(self, time: SystemTime) -> Self
Sets the start time of the execution.
sourceimpl<C: SubConfig, OutputTime: OutputTimeRepresentation> ConfigBuilder<C, ConfigureIR, OutputTime>
impl<C: SubConfig, OutputTime: OutputTimeRepresentation> ConfigBuilder<C, ConfigureIR, OutputTime>
sourcepub fn with_ir(
self,
ir: RtLolaMir
) -> ConfigBuilder<C, IrConfigured, OutputTime>
pub fn with_ir(
self,
ir: RtLolaMir
) -> ConfigBuilder<C, IrConfigured, OutputTime>
Use an existing ir with the configuration
sourcepub fn spec_file(
self,
path: PathBuf
) -> ConfigBuilder<C, IrConfigured, OutputTime>
pub fn spec_file(
self,
path: PathBuf
) -> ConfigBuilder<C, IrConfigured, OutputTime>
Read the specification from a file at the given path.
sourcepub fn spec_str(self, spec: &str) -> ConfigBuilder<C, IrConfigured, OutputTime>
pub fn spec_str(self, spec: &str) -> ConfigBuilder<C, IrConfigured, OutputTime>
Read the specification from the given string.
sourceimpl<C: SubConfig, OutputTime: OutputTimeRepresentation> ConfigBuilder<C, IrConfigured, OutputTime>
impl<C: SubConfig, OutputTime: OutputTimeRepresentation> ConfigBuilder<C, IrConfigured, OutputTime>
sourcepub fn input_time<InputTime: TimeRepresentation>(
self
) -> ConfigBuilder<C, TimeConfigured<InputTime>, OutputTime>
pub fn input_time<InputTime: TimeRepresentation>(
self
) -> ConfigBuilder<C, TimeConfigured<InputTime>, OutputTime>
Use an existing ir with the configuration
sourceimpl<InputTime: TimeRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<ExecConfig<ConfigureMode>, TimeConfigured<InputTime>, OutputTime>
impl<InputTime: TimeRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<ExecConfig<ConfigureMode>, TimeConfigured<InputTime>, OutputTime>
sourcepub fn offline(
self
) -> ConfigBuilder<ExecConfig<ConfigureSource>, TimeConfigured<InputTime>, OutputTime>
pub fn offline(
self
) -> ConfigBuilder<ExecConfig<ConfigureSource>, TimeConfigured<InputTime>, OutputTime>
Sets the execute mode to be offline, i.e. takes the time of events from the input source. The time representation is given as the type parameter. See the README for further details on time representations. For possible TimeRepresentations see the Time Module.
sourcepub fn online(
self
) -> ConfigBuilder<ExecConfig<ConfigureSource>, TimeConfigured<RealTime>, OutputTime>
pub fn online(
self
) -> ConfigBuilder<ExecConfig<ConfigureSource>, TimeConfigured<RealTime>, OutputTime>
Sets the execute mode to be online, i.e. the time of events is taken by the interpreter.
sourceimpl<InputTime: TimeRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<ExecConfig<ConfigureSource>, TimeConfigured<InputTime>, OutputTime>
impl<InputTime: TimeRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<ExecConfig<ConfigureSource>, TimeConfigured<InputTime>, OutputTime>
sourcepub fn csv_file_input(
self,
path: PathBuf,
time_col: Option<usize>
) -> ConfigBuilder<ExecConfig<SourceConfigured>, TimeConfigured<InputTime>, OutputTime>
pub fn csv_file_input(
self,
path: PathBuf,
time_col: Option<usize>
) -> ConfigBuilder<ExecConfig<SourceConfigured>, TimeConfigured<InputTime>, OutputTime>
Take the events from a given CSV file at ‘path’. Optionally, the time column in the input can be specified.
sourcepub fn csv_stdin_input(
self,
time_col: Option<usize>
) -> ConfigBuilder<ExecConfig<SourceConfigured>, TimeConfigured<InputTime>, OutputTime>
pub fn csv_stdin_input(
self,
time_col: Option<usize>
) -> ConfigBuilder<ExecConfig<SourceConfigured>, TimeConfigured<InputTime>, OutputTime>
Take the events in CSV format from stdin. Optionally, the time column in the input can be specified.
sourceimpl<InputTime: TimeRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<ExecConfig<SourceConfigured>, TimeConfigured<InputTime>, OutputTime>
impl<InputTime: TimeRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<ExecConfig<SourceConfigured>, TimeConfigured<InputTime>, OutputTime>
sourcepub fn delay(
self,
delay: Duration
) -> ConfigBuilder<ExecConfig<SourceConfigured>, TimeConfigured<DelayTime>, OutputTime>
pub fn delay(
self,
delay: Duration
) -> ConfigBuilder<ExecConfig<SourceConfigured>, TimeConfigured<DelayTime>, OutputTime>
A delay is set to ignore the given timestamps in the input and take the delay as the time between the events.
sourceimpl<ES: ExecConfigState, S: ConfigState, OutputTime: OutputTimeRepresentation> ConfigBuilder<ExecConfig<ES>, S, OutputTime>
impl<ES: ExecConfigState, S: ConfigState, OutputTime: OutputTimeRepresentation> ConfigBuilder<ExecConfig<ES>, S, OutputTime>
sourcepub fn enable_statistics(self) -> Self
pub fn enable_statistics(self) -> Self
Enable the output of statistics like processes events per second.
sourcepub fn output_to_file(self, path: PathBuf) -> Self
pub fn output_to_file(self, path: PathBuf) -> Self
Print the output to a file at path
sourcepub fn output_to_stdout(self) -> Self
pub fn output_to_stdout(self) -> Self
Print the output to stdout
sourcepub fn output_to_stderr(self) -> Self
pub fn output_to_stderr(self) -> Self
Print the output to stderr
sourceimpl<S: ConfigState, OutputTime: OutputTimeRepresentation> ConfigBuilder<ApiConfig<ConfigureInput>, S, OutputTime>
impl<S: ConfigState, OutputTime: OutputTimeRepresentation> ConfigBuilder<ApiConfig<ConfigureInput>, S, OutputTime>
sourcepub fn event_input<E: Into<Event>>(
self
) -> ConfigBuilder<ApiConfig<InputConfigured<EventInput<E>>>, S, OutputTime>
pub fn event_input<E: Into<Event>>(
self
) -> ConfigBuilder<ApiConfig<InputConfigured<EventInput<E>>>, S, OutputTime>
Use the predefined EventInput method to provide inputs to the API.
sourcepub fn record_input<Inner: Record>(
self
) -> ConfigBuilder<ApiConfig<InputConfigured<RecordInput<Inner>>>, S, OutputTime>
pub fn record_input<Inner: Record>(
self
) -> ConfigBuilder<ApiConfig<InputConfigured<RecordInput<Inner>>>, S, OutputTime>
Use the predefined RecordInput method to provide inputs to the API.
sourcepub fn custom_input<Source: Input>(
self
) -> ConfigBuilder<ApiConfig<InputConfigured<Source>>, S, OutputTime>
pub fn custom_input<Source: Input>(
self
) -> ConfigBuilder<ApiConfig<InputConfigured<Source>>, S, OutputTime>
Use a custom input method to provide inputs to the API.
sourceimpl<S: ConfigState, OutputTime: OutputTimeRepresentation, Source: Input> ConfigBuilder<ApiConfig<InputConfigured<Source>>, S, OutputTime>
impl<S: ConfigState, OutputTime: OutputTimeRepresentation, Source: Input> ConfigBuilder<ApiConfig<InputConfigured<Source>>, S, OutputTime>
sourcepub fn with_verdict<Verdict: VerdictRepresentation>(
self
) -> ConfigBuilder<ApiConfig<VerdictConfigured<Source, Verdict>>, S, OutputTime>
pub fn with_verdict<Verdict: VerdictRepresentation>(
self
) -> ConfigBuilder<ApiConfig<VerdictConfigured<Source, Verdict>>, S, OutputTime>
Sets the VerdictRepresentation for the monitor
sourceimpl<Source: Input, InputTime: TimeRepresentation, Verdict: VerdictRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<ApiConfig<VerdictConfigured<Source, Verdict>>, TimeConfigured<InputTime>, OutputTime>
impl<Source: Input, InputTime: TimeRepresentation, Verdict: VerdictRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<ApiConfig<VerdictConfigured<Source, Verdict>>, TimeConfigured<InputTime>, OutputTime>
sourcepub fn build(self) -> MonitorConfig<Source, InputTime, Verdict, OutputTime>
pub fn build(self) -> MonitorConfig<Source, InputTime, Verdict, OutputTime>
Finalize the configuration and generate a configuration.
sourcepub fn monitor_with_data(
self,
data: Source::CreationData
) -> Monitor<Source, InputTime, Verdict, OutputTime>
pub fn monitor_with_data(
self,
data: Source::CreationData
) -> Monitor<Source, InputTime, Verdict, OutputTime>
sourceimpl<InputTime: TimeRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<ExecConfig<SourceConfigured>, TimeConfigured<InputTime>, OutputTime>
impl<InputTime: TimeRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<ExecConfig<SourceConfigured>, TimeConfigured<InputTime>, OutputTime>
Trait Implementations
sourceimpl<C: Clone + SubConfig, S: Clone + ConfigState, OutputTime: Clone + OutputTimeRepresentation> Clone for ConfigBuilder<C, S, OutputTime>
impl<C: Clone + SubConfig, S: Clone + ConfigState, OutputTime: Clone + OutputTimeRepresentation> Clone for ConfigBuilder<C, S, OutputTime>
sourcefn clone(&self) -> ConfigBuilder<C, S, OutputTime>
fn clone(&self) -> ConfigBuilder<C, S, OutputTime>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<C, S, OutputTime> RefUnwindSafe for ConfigBuilder<C, S, OutputTime> where
C: RefUnwindSafe,
OutputTime: RefUnwindSafe,
S: RefUnwindSafe,
impl<C, S, OutputTime> Send for ConfigBuilder<C, S, OutputTime> where
C: Send,
S: Send,
impl<C, S, OutputTime> Sync for ConfigBuilder<C, S, OutputTime> where
C: Sync,
S: Sync,
impl<C, S, OutputTime> Unpin for ConfigBuilder<C, S, OutputTime> where
C: Unpin,
OutputTime: Unpin,
S: Unpin,
impl<C, S, OutputTime> UnwindSafe for ConfigBuilder<C, S, OutputTime> where
C: UnwindSafe,
OutputTime: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more