Struct RtLolaMir

Source
pub struct RtLolaMir {
    pub inputs: Vec<InputStream>,
    pub outputs: Vec<OutputStream>,
    pub time_driven: Vec<TimeDrivenStream>,
    pub event_driven: Vec<EventDrivenStream>,
    pub discrete_windows: Vec<DiscreteWindow>,
    pub sliding_windows: Vec<SlidingWindow>,
    pub instance_aggregations: Vec<InstanceAggregation>,
    pub triggers: Vec<Trigger>,
    pub global_tags: HashMap<String, Option<String>>,
}
Expand description

This struct constitutes the Mid-Level Intermediate Representation (MIR) of an RTLola specification.

The RtLolaMir is specifically designed to allow convenient navigation and access to data. Hence, it is perfect for working with the specification rather than work on it.

§Most Notable Structs and Enums

  • Stream is a trait offering several convenient access methods for everything constituting a stream.
  • OutputStream represents a single output stream. The data structure is enriched with information regarding streams accessing it or accessed by it and much more. For input streams confer InputStream.
  • StreamReference used for referencing streams within the Mir.
  • Spawn and Close contain all information regarding the parametrization, spawning and closing behavior of streams.
  • Eval contains the information regarding the evaluation condition and the expression of the stream. The Expression represents an computational evaluation. It contains its ExpressionKind and its type. The latter contains all information specific to a certain kind of expression such as sub-expressions of operators.

§See Also

Fields§

§inputs: Vec<InputStream>

Contains all input streams.

§outputs: Vec<OutputStream>

Contains all output streams including all triggers. They only contain the information relevant for every single kind of output stream. Refer to RtLolaMir::time_driven, RtLolaMir::event_driven, and RtLolaMir::triggers for more information.

§time_driven: Vec<TimeDrivenStream>

References and pacing information of all time-driven streams.

§event_driven: Vec<EventDrivenStream>

References and pacing information of all event-driven streams.

§discrete_windows: Vec<DiscreteWindow>

A collection of all discrete windows.

§sliding_windows: Vec<SlidingWindow>

A collection of all sliding windows.

§instance_aggregations: Vec<InstanceAggregation>

A collection of all instance aggregations.

§triggers: Vec<Trigger>

The references of all outputs that represent triggers

§global_tags: HashMap<String, Option<String>>

The global tags of the specification

Implementations§

Source§

impl RtLolaMir

Source

pub fn hash(self, config: &ParserConfig) -> HashedMir

Adds a hash of the specification and frontend version to the mir.

Source§

impl RtLolaMir

Source

pub fn from_hir(hir: RtLolaHir<CompleteMode>) -> RtLolaMir

Generates an Mir from a complete Hir.

Source§

impl RtLolaMir

Source

pub fn input_refs(&self) -> impl Iterator<Item = InputReference>

Returns a collection containing a reference to each input stream in the specification.

Source

pub fn output_refs(&self) -> impl Iterator<Item = OutputReference>

Returns a collection containing a reference to each output stream in the specification.

Source

pub fn input_mut(&mut self, reference: StreamReference) -> &mut InputStream

Provides mutable access to an input stream.

§Panic

Panics if reference is a StreamReference::Out.

Source

pub fn input(&self, reference: StreamReference) -> &InputStream

Provides immutable access to an input stream.

§Panic

Panics if reference is a StreamReference::Out.

Source

pub fn output_mut(&mut self, reference: StreamReference) -> &mut OutputStream

Provides mutable access to an output stream.

§Panic

Panics if reference is a StreamReference::In.

Source

pub fn output(&self, reference: StreamReference) -> &OutputStream

Provides immutable access to an output stream.

§Panic

Panics if reference is a StreamReference::In.

Source

pub fn stream(&self, reference: StreamReference) -> &dyn Stream

Provides immutable access to a stream.

Source

pub fn all_streams(&self) -> impl Iterator<Item = StreamReference>

Produces an iterator over all stream references.

Source

pub fn all_triggers(&self) -> Vec<&OutputStream>

Provides a collection of all output streams representing a trigger.

Source

pub fn all_event_driven(&self) -> Vec<&OutputStream>

Provides a collection of all event-driven output streams.

Source

pub fn has_time_driven_features(&self) -> bool

Return true if the specification contains any time-driven features. This includes time-driven streams and time-driven spawn conditions.

Source

pub fn all_time_driven(&self) -> Vec<&OutputStream>

Provides a collection of all time-driven output streams.

Source

pub fn get_ac(&self, sref: StreamReference) -> Option<&ActivationCondition>

Provides the activation contion of a event-driven stream and none if the stream is time-driven

Source

pub fn discrete_window(&self, window: WindowReference) -> &DiscreteWindow

Provides immutable access to a discrete window.

§Panic

Panics if window is not a WindowReference::Discrete.

Source

pub fn instance_aggregation( &self, window: WindowReference, ) -> &InstanceAggregation

Provides immutable access to a instance aggregation.

§Panic

Panics if window is not a WindowReference::Instance.

Source

pub fn sliding_window(&self, window: WindowReference) -> &SlidingWindow

Provides immutable access to a sliding window.

§Panic

Panics if window is not a WindowReference::Sliding.

Source

pub fn window(&self, window: WindowReference) -> &dyn Window

Provides immutable access to a window.

Source

pub fn get_event_driven_layers(&self) -> Vec<Vec<Task>>

Provides a representation for the evaluation layers of all event-driven output streams. Each element of the outer Vec represents a layer, each element of the inner Vec an output stream in the layer.

Source

pub fn compute_schedule(&self) -> Result<Schedule, String>

Attempts to compute a schedule for all time-driven streams.

§Fail

Fails if the resulting schedule would require at least 10^7 deadlines.

Source

pub fn display<'a, T>(&'a self, target: &'a T) -> RtLolaMirPrinter<'a, T>

Creates a new RtLolaMirPrinter for the Mir type T. It implements the Display Trait for type T.

Source

pub fn dependency_graph(&self) -> DependencyGraph<'_>

Represents the specification as a dependency graph

Source

pub fn get_input_by_name(&self, name: &str) -> Option<&InputStream>

Returns the input stream with the given name if it exists.

Source

pub fn get_output_by_name(&self, name: &str) -> Option<&OutputStream>

Returns the output stream with the given name if it exists.

Source

pub fn get_stream_by_name(&self, name: &str) -> Option<&dyn Stream>

Returns the stream with the given name if it exists.

Source§

impl RtLolaMir

Source

pub fn parse_tags<T: TagParser>( &self, p: T, ) -> Result<ParseResult<T::GlobalTags, T::LocalTags>, RtLolaError>

Checks and applies the given parser to the specification to return a list of ParseResult’s.

Source

pub fn validate_tags( &self, parser: &[&dyn TagValidator], ) -> Result<(), RtLolaError>

Checks whether the specification contains tags that are not handled by any parser

Source

pub fn all_global_tags(&self) -> HashSet<&str>

Returns the keys of all global tags in the specification

Source

pub fn all_local_tags(&self) -> HashSet<&str>

Returns the keys of all local tags used anywhere in the specification

Trait Implementations§

Source§

impl Clone for RtLolaMir

Source§

fn clone(&self) -> RtLolaMir

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RtLolaMir

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RtLolaMir

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for RtLolaMir

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for RtLolaMir

Source§

fn eq(&self, other: &RtLolaMir) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for RtLolaMir

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for RtLolaMir

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,