pub struct OutputTracker<M> { /* private fields */ }Expand description
Collects state data or action data of any kind.
This is the non-threadsafe variant.
The tracked data can be read any time and as often as needed by calling the
output(). Each time the output is read, all data
collected so far are returned. To track only new data emitted after the last
read of the output, the clear() function should be
called.
The tracker can be deactivated by calling the stop()
function to stop it from collecting data. Once stopped the tracker can not
be activated again.
Implementations§
Source§impl<M> OutputTracker<M>
impl<M> OutputTracker<M>
Sourcepub fn stop(&self) -> Result<(), Error>
pub fn stop(&self) -> Result<(), Error>
Stops this tracker.
After stopping a tracker it no longer tracks emitted data. Once a tracker is stopped it can not be activated again.
Sourcepub fn clear(&self) -> Result<(), Error>
pub fn clear(&self) -> Result<(), Error>
Clears the data this tracker has been collected so far.
After clearing a tracker it still tracks any data which is emitted after this clear function has been called.
Sourcepub fn output(&self) -> Result<Vec<M>, Error>where
M: Clone,
pub fn output(&self) -> Result<Vec<M>, Error>where
M: Clone,
Returns the data collected by this tracker so far.
Each time this function is called it returns all data collected since
the tracker has been created or since the last call to of the
clear() function. To track only data that are
emitted after the last time the output was read, the
clear() should be called after the output has
been read.