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
impl<Source, Mode, Verdict, VerdictTime> Monitor<Source, Mode, Verdict, VerdictTime>where
Source: EventFactory,
Mode: ExecutionMode,
Verdict: VerdictRepresentation,
VerdictTime: OutputTimeRepresentation,
Crate-public interface
Sourcepub fn setup(
config: Config<Mode, VerdictTime>,
setup_data: Source::CreationData,
) -> Result<Monitor<Source, Mode, Verdict, VerdictTime>, EventFactoryError>
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
impl<Source, Mode, Verdict, VerdictTime> Monitor<Source, Mode, Verdict, VerdictTime>where
Source: EventFactory,
Mode: ExecutionMode,
Verdict: VerdictRepresentation,
VerdictTime: OutputTimeRepresentation,
Public interface
Sourcepub fn accept_event(
&mut self,
ev: Source::Record,
ts: <Mode::SourceTime as TimeRepresentation>::InnerTime,
) -> Result<Verdicts<Verdict, VerdictTime>, EventFactoryError>
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.
Sourcepub fn accept_time(
&mut self,
ts: <Mode::SourceTime as TimeRepresentation>::InnerTime,
) -> Vec<(VerdictTime::InnerTime, Verdict)>
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.
Sourcepub fn ir(&self) -> &RtLolaMir
pub fn ir(&self) -> &RtLolaMir
Returns the underlying representation of the specification as an RtLolaMir
Sourcepub fn name_for_input(&self, id: InputReference) -> &str
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.
Sourcepub fn name_for_output(&self, id: OutputReference) -> &str
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.
Sourcepub fn trigger_stream_index(&self, id: usize) -> usize
pub fn trigger_stream_index(&self, id: usize) -> usize
Get the OutputReference of a trigger based on its index.
Sourcepub fn number_of_input_streams(&self) -> usize
pub fn number_of_input_streams(&self) -> usize
Get the number of input streams.
Sourcepub fn number_of_output_streams(&self) -> usize
pub fn number_of_output_streams(&self) -> usize
Get the number of output streams (this includes one output stream for each trigger).
Sourcepub fn number_of_triggers(&self) -> usize
pub fn number_of_triggers(&self) -> usize
Get the number of triggers.
Sourcepub fn type_of_input(&self, id: InputReference) -> &Type
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.
Sourcepub fn type_of_output(&self, id: OutputReference) -> &Type
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.
Sourcepub fn extend_rate_of_output(&self, id: OutputReference) -> Option<Duration>
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.
Sourcepub fn with_verdict_representation<T: VerdictRepresentation>(
self,
) -> Monitor<Source, Mode, T, VerdictTime>
pub fn with_verdict_representation<T: VerdictRepresentation>( self, ) -> Monitor<Source, Mode, T, VerdictTime>
Switch VerdictRepresentations of the Monitor.
Auto Trait Implementations§
impl<Source, Mode, Verdict, VerdictTime> Freeze for Monitor<Source, Mode, Verdict, VerdictTime>
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> 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> 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