Struct Monitor

Source
pub struct Monitor<Source, Mode, Verdict = Incremental, VerdictTime = RelativeFloat>
where Source: EventFactory, Mode: ExecutionMode, Verdict: VerdictRepresentation, VerdictTime: OutputTimeRepresentation + 'static,
{ /* private fields */ }
Expand description

The Monitor is the central object exposed by the API.

The Monitor accepts new events and computes streams. It can compute event-based streams based on new events through accept_event. It can also simply advance periodic streams up to a given timestamp through accept_time. The generic argument Source implements the EventFactory trait describing the input source of the API. The generic argument SourceTime implements the TimeRepresentation trait defining the input time format. The generic argument Verdict implements the VerdictRepresentation trait describing the output format of the API that is by default Incremental. The generic argument VerdictTime implements the TimeRepresentation trait defining the output time format. It defaults to RelativeFloat

Implementations§

Source§

impl<Source, Mode, Verdict, VerdictTime> Monitor<Source, Mode, Verdict, VerdictTime>
where Source: EventFactory, Mode: ExecutionMode, Verdict: VerdictRepresentation, VerdictTime: OutputTimeRepresentation,

Crate-public interface

Source

pub fn setup( config: Config<Mode, VerdictTime>, setup_data: Source::CreationData, ) -> Result<Monitor<Source, Mode, Verdict, VerdictTime>, EventFactoryError>

setup

Source§

impl<Source, Mode, Verdict, VerdictTime> Monitor<Source, Mode, Verdict, VerdictTime>
where Source: EventFactory, Mode: ExecutionMode, Verdict: VerdictRepresentation, VerdictTime: OutputTimeRepresentation,

Public interface

Source

pub fn accept_event( &mut self, ev: Source::Record, ts: <Mode::SourceTime as TimeRepresentation>::InnerTime, ) -> Result<Verdicts<Verdict, VerdictTime>, EventFactoryError>

Computes all periodic streams up through the new timestamp and then handles the input event.

The new event is therefore not seen by periodic streams up through a new timestamp.

Source

pub fn accept_time( &mut self, ts: <Mode::SourceTime as TimeRepresentation>::InnerTime, ) -> Vec<(VerdictTime::InnerTime, Verdict)>

Computes all periodic streams up through and including the timestamp.

Source

pub fn ir(&self) -> &RtLolaMir

Returns the underlying representation of the specification as an RtLolaMir

Source

pub fn name_for_input(&self, id: InputReference) -> &str

Get the name of an input stream based on its InputReference.

The reference is valid for the lifetime of the monitor.

Source

pub fn name_for_output(&self, id: OutputReference) -> &str

Get the name of an output stream based on its OutputReference.

The reference is valid for the lifetime of the monitor.

Source

pub fn trigger_stream_index(&self, id: usize) -> usize

Get the OutputReference of a trigger based on its index.

Source

pub fn number_of_input_streams(&self) -> usize

Get the number of input streams.

Source

pub fn number_of_output_streams(&self) -> usize

Get the number of output streams (this includes one output stream for each trigger).

Source

pub fn number_of_triggers(&self) -> usize

Get the number of triggers.

Source

pub fn type_of_input(&self, id: InputReference) -> &Type

Get the type of an input stream based on its InputReference.

The reference is valid for the lifetime of the monitor.

Source

pub fn type_of_output(&self, id: OutputReference) -> &Type

Get the type of an output stream based on its OutputReference.

The reference is valid for the lifetime of the monitor.

Source

pub fn extend_rate_of_output(&self, id: OutputReference) -> Option<Duration>

Get the extend rate of an output stream based on its OutputReference.

The reference is valid for the lifetime of the monitor.

Source

pub fn with_verdict_representation<T: VerdictRepresentation>( self, ) -> Monitor<Source, Mode, T, VerdictTime>

Auto Trait Implementations§

§

impl<Source, Mode, Verdict, VerdictTime> Freeze for Monitor<Source, Mode, Verdict, VerdictTime>
where Source: Freeze, <Mode as ExecutionMode>::SourceTime: Freeze, VerdictTime: Freeze,

§

impl<Source, Mode, Verdict = Vec<(usize, Vec<Change>)>, VerdictTime = RelativeFloat> !RefUnwindSafe for Monitor<Source, Mode, Verdict, VerdictTime>

§

impl<Source, Mode, Verdict = Vec<(usize, Vec<Change>)>, VerdictTime = RelativeFloat> !Send for Monitor<Source, Mode, Verdict, VerdictTime>

§

impl<Source, Mode, Verdict = Vec<(usize, Vec<Change>)>, VerdictTime = RelativeFloat> !Sync for Monitor<Source, Mode, Verdict, VerdictTime>

§

impl<Source, Mode, Verdict, VerdictTime> Unpin for Monitor<Source, Mode, Verdict, VerdictTime>
where Source: Unpin, <Mode as ExecutionMode>::SourceTime: Unpin, VerdictTime: Unpin, Verdict: Unpin,

§

impl<Source, Mode, Verdict = Vec<(usize, Vec<Change>)>, VerdictTime = RelativeFloat> !UnwindSafe for Monitor<Source, Mode, Verdict, VerdictTime>

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> 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, 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> CondDeserialize for T

Source§

impl<T> CondSerialize for T