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 std::convert::Infallible;
use rtlola_interpreter::monitor::Incremental;
use rtlola_interpreter::input::ArrayFactory;
use rtlola_interpreter::time::RelativeFloat;
use rtlola_interpreter::{ConfigBuilder, Monitor, Value};
let monitor: Monitor<_, _, Incremental, _> = ConfigBuilder::new()
.spec_str("input i: Int64")
.offline::<RelativeFloat>()
.with_array_events::<1, Infallible, [Value; 1]>()
.with_verdict::<Incremental>()
.monitor().expect("Failed to create monitor.");
Implementations§
Source§impl ConfigBuilder<ConfigureIR, RelativeFloat>
impl ConfigBuilder<ConfigureIR, RelativeFloat>
Source§impl<S: ConfigState, OutputTime: OutputTimeRepresentation> ConfigBuilder<S, OutputTime>
impl<S: ConfigState, OutputTime: OutputTimeRepresentation> ConfigBuilder<S, OutputTime>
Sourcepub fn output_time<T: OutputTimeRepresentation>(self) -> ConfigBuilder<S, T>
pub fn output_time<T: OutputTimeRepresentation>(self) -> ConfigBuilder<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.
Source§impl<OutputTime: OutputTimeRepresentation> ConfigBuilder<ConfigureIR, OutputTime>
impl<OutputTime: OutputTimeRepresentation> ConfigBuilder<ConfigureIR, OutputTime>
Sourcepub fn with_ir(self, ir: RtLolaMir) -> ConfigBuilder<IrConfigured, OutputTime>
pub fn with_ir(self, ir: RtLolaMir) -> ConfigBuilder<IrConfigured, OutputTime>
Use an existing ir with the configuration
Sourcepub fn spec_file(self, path: PathBuf) -> ConfigBuilder<IrConfigured, OutputTime>
pub fn spec_file(self, path: PathBuf) -> ConfigBuilder<IrConfigured, OutputTime>
Read the specification from a file at the given path.
Sourcepub fn spec_str(self, spec: &str) -> ConfigBuilder<IrConfigured, OutputTime>
pub fn spec_str(self, spec: &str) -> ConfigBuilder<IrConfigured, OutputTime>
Read the specification from the given string.
Source§impl<OutputTime: OutputTimeRepresentation> ConfigBuilder<IrConfigured, OutputTime>
impl<OutputTime: OutputTimeRepresentation> ConfigBuilder<IrConfigured, OutputTime>
Sourcepub fn online(self) -> ConfigBuilder<ModeConfigured<OnlineMode>, OutputTime>
pub fn online(self) -> ConfigBuilder<ModeConfigured<OnlineMode>, OutputTime>
Sets the execute mode to be online, i.e. the time of events is taken by the interpreter.
Sourcepub fn offline<InputTime: TimeRepresentation>(
self,
) -> ConfigBuilder<ModeConfigured<OfflineMode<InputTime>>, OutputTime>
pub fn offline<InputTime: TimeRepresentation>( self, ) -> ConfigBuilder<ModeConfigured<OfflineMode<InputTime>>, OutputTime>
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.
Source§impl<Mode: ExecutionMode, OutputTime: OutputTimeRepresentation> ConfigBuilder<ModeConfigured<Mode>, OutputTime>
impl<Mode: ExecutionMode, OutputTime: OutputTimeRepresentation> ConfigBuilder<ModeConfigured<Mode>, OutputTime>
Sourcepub fn with_array_events<const N: usize, I: Error + Send + 'static, E: TryInto<[Value; N], Error = I> + CondSerialize + CondDeserialize + Send>(
self,
) -> ConfigBuilder<InputConfigured<Mode, ArrayFactory<N, I, E>>, OutputTime>
pub fn with_array_events<const N: usize, I: Error + Send + 'static, E: TryInto<[Value; N], Error = I> + CondSerialize + CondDeserialize + Send>( self, ) -> ConfigBuilder<InputConfigured<Mode, ArrayFactory<N, I, E>>, OutputTime>
Use the predefined ArrayFactory method to provide inputs to the API.
Sourcepub fn with_mapped_events<Inner: InputMap>(
self,
) -> ConfigBuilder<InputConfigured<Mode, MappedFactory<Inner>>, OutputTime>
pub fn with_mapped_events<Inner: InputMap>( self, ) -> ConfigBuilder<InputConfigured<Mode, MappedFactory<Inner>>, OutputTime>
Use the predefined MappedFactory method to provide inputs to the API. Requires implementing InputMap for your type defining how the values of input streams are extracted from it.
Sourcepub fn with_event_factory<Source: EventFactory>(
self,
) -> ConfigBuilder<InputConfigured<Mode, Source>, OutputTime>
pub fn with_event_factory<Source: EventFactory>( self, ) -> ConfigBuilder<InputConfigured<Mode, Source>, OutputTime>
Use a custom input method to provide inputs to the API.
Source§impl<Mode: ExecutionMode, OutputTime: OutputTimeRepresentation, Source: EventFactory> ConfigBuilder<InputConfigured<Mode, Source>, OutputTime>
impl<Mode: ExecutionMode, OutputTime: OutputTimeRepresentation, Source: EventFactory> ConfigBuilder<InputConfigured<Mode, Source>, OutputTime>
Sourcepub fn with_verdict<Verdict: VerdictRepresentation>(
self,
) -> ConfigBuilder<VerdictConfigured<Mode, Source, Verdict>, OutputTime>
pub fn with_verdict<Verdict: VerdictRepresentation>( self, ) -> ConfigBuilder<VerdictConfigured<Mode, Source, Verdict>, OutputTime>
Sets the VerdictRepresentation for the monitor
Source§impl<Source: EventFactory + 'static, Mode: ExecutionMode, Verdict: VerdictRepresentation<Tracing = NoTracer>, OutputTime: OutputTimeRepresentation> ConfigBuilder<VerdictConfigured<Mode, Source, Verdict>, OutputTime>
impl<Source: EventFactory + 'static, Mode: ExecutionMode, Verdict: VerdictRepresentation<Tracing = NoTracer>, OutputTime: OutputTimeRepresentation> ConfigBuilder<VerdictConfigured<Mode, Source, Verdict>, OutputTime>
Sourcepub fn with_tracer<T: Tracer>(
self,
) -> ConfigBuilder<VerdictConfigured<Mode, Source, TracingVerdict<T, Verdict>>, OutputTime>
pub fn with_tracer<T: Tracer>( self, ) -> ConfigBuilder<VerdictConfigured<Mode, Source, TracingVerdict<T, Verdict>>, OutputTime>
Adds tracing functionality to the evaluator
Source§impl<Source: EventFactory + 'static, Mode: ExecutionMode, Verdict: VerdictRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<VerdictConfigured<Mode, Source, Verdict>, OutputTime>
impl<Source: EventFactory + 'static, Mode: ExecutionMode, Verdict: VerdictRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<VerdictConfigured<Mode, Source, Verdict>, OutputTime>
Sourcepub fn build(self) -> MonitorConfig<Source, Mode, Verdict, OutputTime>
pub fn build(self) -> MonitorConfig<Source, Mode, Verdict, OutputTime>
Finalize the configuration and generate a configuration.
Sourcepub fn monitor_with_data(
self,
data: Source::CreationData,
) -> Result<Monitor<Source, Mode, Verdict, OutputTime>, EventFactoryError>
pub fn monitor_with_data( self, data: Source::CreationData, ) -> Result<Monitor<Source, Mode, Verdict, OutputTime>, EventFactoryError>
Sourcepub fn monitor(
self,
) -> Result<Monitor<Source, Mode, Verdict, OutputTime>, EventFactoryError>where
Source: EventFactory<CreationData = ()> + 'static,
pub fn monitor(
self,
) -> Result<Monitor<Source, Mode, Verdict, OutputTime>, EventFactoryError>where
Source: EventFactory<CreationData = ()> + 'static,
Create a Monitor from the configuration. The entrypoint of the API.
Source§impl<Source: EventFactory + 'static, SourceTime: TimeRepresentation, Verdict: VerdictRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<VerdictConfigured<OfflineMode<SourceTime>, Source, Verdict>, OutputTime>
impl<Source: EventFactory + 'static, SourceTime: TimeRepresentation, Verdict: VerdictRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<VerdictConfigured<OfflineMode<SourceTime>, Source, Verdict>, OutputTime>
Sourcepub fn queued_monitor_with_data(
self,
data: Source::CreationData,
) -> QueuedMonitor<Source, OfflineMode<SourceTime>, Verdict, OutputTime>
pub fn queued_monitor_with_data( self, data: Source::CreationData, ) -> QueuedMonitor<Source, OfflineMode<SourceTime>, Verdict, OutputTime>
Create a QueuedMonitor from the configuration. The entrypoint of the API. The data is provided to the Input source at creation.
Sourcepub fn queued_monitor(
self,
) -> QueuedMonitor<Source, OfflineMode<SourceTime>, Verdict, OutputTime>where
Source: EventFactory<CreationData = ()> + 'static,
pub fn queued_monitor(
self,
) -> QueuedMonitor<Source, OfflineMode<SourceTime>, Verdict, OutputTime>where
Source: EventFactory<CreationData = ()> + 'static,
Create a QueuedMonitor from the configuration. The entrypoint of the API.
Source§impl<Source: EventFactory + 'static, Verdict: VerdictRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<VerdictConfigured<OnlineMode, Source, Verdict>, OutputTime>
impl<Source: EventFactory + 'static, Verdict: VerdictRepresentation, OutputTime: OutputTimeRepresentation> ConfigBuilder<VerdictConfigured<OnlineMode, Source, Verdict>, OutputTime>
Sourcepub fn queued_monitor_with_data(
self,
data: Source::CreationData,
) -> QueuedMonitor<Source, OnlineMode, Verdict, OutputTime>
pub fn queued_monitor_with_data( self, data: Source::CreationData, ) -> QueuedMonitor<Source, OnlineMode, Verdict, OutputTime>
Create a QueuedMonitor from the configuration. The entrypoint of the API. The data is provided to the Input source at creation.
Sourcepub fn queued_monitor(
self,
) -> QueuedMonitor<Source, OnlineMode, Verdict, OutputTime>where
Source: EventFactory<CreationData = ()> + 'static,
pub fn queued_monitor(
self,
) -> QueuedMonitor<Source, OnlineMode, Verdict, OutputTime>where
Source: EventFactory<CreationData = ()> + 'static,
Create a QueuedMonitor from the configuration. The entrypoint of the API.
Trait Implementations§
Source§impl<S: Clone + ConfigState, OutputTime: Clone + OutputTimeRepresentation> Clone for ConfigBuilder<S, OutputTime>
impl<S: Clone + ConfigState, OutputTime: Clone + OutputTimeRepresentation> Clone for ConfigBuilder<S, OutputTime>
Source§fn clone(&self) -> ConfigBuilder<S, OutputTime>
fn clone(&self) -> ConfigBuilder<S, OutputTime>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<S: Debug + ConfigState, OutputTime: Debug + OutputTimeRepresentation> Debug for ConfigBuilder<S, OutputTime>
impl<S: Debug + ConfigState, OutputTime: Debug + OutputTimeRepresentation> Debug for ConfigBuilder<S, OutputTime>
Source§impl Default for ConfigBuilder<ConfigureIR, RelativeFloat>
impl Default for ConfigBuilder<ConfigureIR, RelativeFloat>
Auto Trait Implementations§
impl<S, OutputTime> Freeze for ConfigBuilder<S, OutputTime>where
S: Freeze,
impl<S, OutputTime> RefUnwindSafe for ConfigBuilder<S, OutputTime>where
S: RefUnwindSafe,
OutputTime: RefUnwindSafe,
impl<S, OutputTime> Send for ConfigBuilder<S, OutputTime>where
S: Send,
impl<S, OutputTime> Sync for ConfigBuilder<S, OutputTime>
impl<S, OutputTime> Unpin for ConfigBuilder<S, OutputTime>
impl<S, OutputTime> UnwindSafe for ConfigBuilder<S, OutputTime>where
S: UnwindSafe,
OutputTime: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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