Struct rtlola_hir::hir::RtLolaHir[][src]

pub struct RtLolaHir<M: HirMode> { /* fields omitted */ }
Expand description

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

The RtLolaHir is specifically designed to allow for convenient manipulation and analysis. Hence, it is perfect for working on the specification rather than work with it.

Most Notable Structs and Enums

  • RtLolaMir is the root data structure representing the specification.
  • Output 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 Input.
  • StreamReference used for referencing streams within the Mir.
  • Expression represents an expression. 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.

Type-State

The Hir follows a type-state pattern. To this end, it has a type parameter, its HirMode. The Hir starts in the BaseMode and progresses through different stages until reaching CompleteMode.
Each stage constitutes another level of refinement and adds functionality. The functionality can be accesses by importing the respective trait and requiring the mode of the Hir to implement the trait. The following traits exist.

Progression through different stages is managed by the HirStage trait, in particular HirStage::progress.

See Also

Implementations

impl<M: HirMode> RtLolaHir<M>[src]

pub fn inputs(&self) -> impl Iterator<Item = &Input>[src]

Provides access to an iterator over all input streams.

pub fn outputs(&self) -> impl Iterator<Item = &Output>[src]

Provides access to an iterator over all output streams.

pub fn triggers(&self) -> impl Iterator<Item = &Trigger>[src]

Provides access to an iterator over all triggers.

pub fn num_inputs(&self) -> usize[src]

Yields the number of input streams present in the Hir. Not necessarily equal to the number of input streams in the specification.

pub fn num_outputs(&self) -> usize[src]

Yields the number of output streams present in the Hir. Not necessarily equal to the number of output streams in the specification.

pub fn num_triggers(&self) -> usize[src]

Yields the number of triggers present in the Hir. Not necessarily equal to the number of triggers in the specification.

pub fn all_streams(&self) -> impl Iterator<Item = StreamReference> + '_[src]

Provides access to an iterator over all streams, i.e., inputs, outputs, and triggers.

pub fn get_input_with_name(&self, name: &str) -> Option<&Input>[src]

Retrieves an input stream based on its name. Fails if no such input stream exists.

pub fn get_output_with_name(&self, name: &str) -> Option<&Output>[src]

Retrieves an output stream based on its name. Fails if no such output stream exists.

pub fn output(&self, sref: StreamReference) -> Option<&Output>[src]

Retrieves an output stream based on a stream reference. Fails if no such stream exists or sref is a StreamReference::In.

pub fn input(&self, sref: StreamReference) -> Option<&Input>[src]

Retrieves an input stream based on a stream reference. Fails if no such stream exists or sref is a StreamReference::Out.

pub fn window_refs(&self) -> Vec<WindowReference>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

Provides access to a collection of references for all windows occurring in the Hir.

pub fn sliding_windows(&self) -> Vec<&Window<SlidingAggr>>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

Provides access to a collection of references for all sliding windows occurring in the Hir.

pub fn discrete_windows(&self) -> Vec<&Window<DiscreteAggr>>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[src]

Provides access to a collection of references for all discrete windows occurring in the Hir.

pub fn expression(&self, id: ExprId) -> &Expression[src]

Retrieves an expression for a given expression id.

Panic

Panics if the expression does not exist.

pub fn func_declaration(&self, func_name: &str) -> &FuncDecl[src]

Retrieves a function declaration for a given function name.

Panic

Panics if the declaration does not exist.

pub fn single_sliding(&self, window: WindowReference) -> Window<SlidingAggr>[src]

Retrieves a single sliding window for a given reference.

Panic

Panics if no such window exists.

pub fn single_discrete(&self, window: WindowReference) -> Window<DiscreteAggr>[src]

Retrieves a single discrete window for a given reference.

Panic

Panics if no such window exists.

pub fn expr(&self, sr: StreamReference) -> &Expression[src]

Retrieves the stream expression of a particular output stream or trigger.

Panic

Panics if the reference is a StreamReference::In or the stream does not exist.

pub fn act_cond(&self, sr: StreamReference) -> Option<&Expression>[src]

Retrieves the expression representing the activation condition of a particular output stream or trigger or None for input references.

Panic

Panics if the stream does not exist.

pub fn spawn(&self, sr: StreamReference) -> Option<SpawnDef<'_>>[src]

Retrieves the spawn definition of a particular output stream or trigger or None for input references.

Panic

Panics if the stream does not exist.

pub fn filter(&self, sr: StreamReference) -> Option<&Expression>[src]

Retrieves the expression representing the filter condition of a particular output stream or trigger or None for input references.

Panic

Panics if the stream does not exist.

pub fn close(&self, sr: StreamReference) -> Option<&Expression>[src]

Retrieves the expression representing the close condition of a particular output stream or trigger or None for input references.

Panic

Panics if the stream does not exist.

impl RtLolaHir<BaseMode>[src]

pub fn analyze_dependencies(
    self,
    handler: &Handler
) -> Result<RtLolaHir<DepAnaMode>, DependencyErr>
[src]

Returns the RtLolaHir with additional information about the dependencies between streams

The function returns the RtLolaHir after the dependency analysis. The new mode implements the same functionality as the BaseMode and additionally contains the dependencies between streams in the specification. The function moves the information of the previous mode to the new one and therefore destroys the current mode.

Fails

The function returns a DependencyErr if the specification is not well-formed.

impl RtLolaHir<DepAnaMode>[src]

pub fn check_types(
    self,
    handler: &Handler
) -> Result<RtLolaHir<TypedMode>, String>
[src]

Returns the RtLolaHir with the type information for each stream and expression

The function returns the RtLolaHir after the type analysis. The new mode implements the same functionality as the DepAnaMode and additionally holds for each stream and expression its StreamType. The function moves the information of the previous mode to the new one and therefore destroys the current mode.

Fails

The function fails if the type checker finds a type error in the specification and returns a string with a detailed description.

impl RtLolaHir<TypedMode>[src]

pub fn determine_evaluation_order(
    self,
    handler: &Handler
) -> Result<RtLolaHir<OrderedMode>, OrderErr>
[src]

Returns the RtLolaHir with the spawn and evaluation layer of each stream

Fails

The function fails if the evaluation order cannot be determined.

impl RtLolaHir<OrderedMode>[src]

pub fn determine_memory_bounds(
    self,
    handler: &Handler
) -> Result<RtLolaHir<MemBoundMode>, MemBoundErr>
[src]

Returns the RtLolaHir with the memory-bound for each stream

Fails

The function fails if the memory cannot be determined.

impl RtLolaHir<MemBoundMode>[src]

pub fn finalize(
    self,
    handler: &Handler
) -> Result<RtLolaHir<CompleteMode>, CompletionErr>
[src]

Returns the RtLolaHir in the last mode

The function returns the RtLolaHir in the CompleteMode. This mode indicates that the RtLolaHir has passed all analyzes and now contains all information. The function moves the information of the previous mode to the new one and therefore destroys the current mode.

Trait Implementations

impl<M: Clone + HirMode> Clone for RtLolaHir<M>[src]

fn clone(&self) -> RtLolaHir<M>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<M: Debug + HirMode> Debug for RtLolaHir<M>[src]

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

Formats the value using the given formatter. Read more

impl HirStage for RtLolaHir<BaseMode>[src]

type Error = DependencyErr

Defines the Error type of the progress function

type NextStage = DepAnaMode

Defines the next mode that is produced by the progress function

fn progress(
    self,
    _handler: &Handler
) -> Result<RtLolaHir<Self::NextStage>, Self::Error>
[src]

Returns an RtLolaHir with additional functionality

impl HirStage for RtLolaHir<DepAnaMode>[src]

type Error = String

Defines the Error type of the progress function

type NextStage = TypedMode

Defines the next mode that is produced by the progress function

fn progress(
    self,
    handler: &Handler
) -> Result<RtLolaHir<Self::NextStage>, Self::Error>
[src]

Returns an RtLolaHir with additional functionality

impl HirStage for RtLolaHir<TypedMode>[src]

type Error = OrderErr

Defines the Error type of the progress function

type NextStage = OrderedMode

Defines the next mode that is produced by the progress function

fn progress(
    self,
    _handler: &Handler
) -> Result<RtLolaHir<Self::NextStage>, Self::Error>
[src]

Returns an RtLolaHir with additional functionality

impl HirStage for RtLolaHir<OrderedMode>[src]

type Error = MemBoundErr

Defines the Error type of the progress function

type NextStage = MemBoundMode

Defines the next mode that is produced by the progress function

fn progress(
    self,
    _handler: &Handler
) -> Result<RtLolaHir<Self::NextStage>, Self::Error>
[src]

Returns an RtLolaHir with additional functionality

impl HirStage for RtLolaHir<MemBoundMode>[src]

type Error = CompletionErr

Defines the Error type of the progress function

type NextStage = CompleteMode

Defines the next mode that is produced by the progress function

fn progress(
    self,
    _handler: &Handler
) -> Result<RtLolaHir<Self::NextStage>, Self::Error>
[src]

Returns an RtLolaHir with additional functionality

Auto Trait Implementations

impl<M> RefUnwindSafe for RtLolaHir<M> where
    M: RefUnwindSafe

impl<M> Send for RtLolaHir<M> where
    M: Send

impl<M> Sync for RtLolaHir<M> where
    M: Sync

impl<M> Unpin for RtLolaHir<M> where
    M: Unpin

impl<M> UnwindSafe for RtLolaHir<M> where
    M: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.