pub struct TimeSeriesReader<T> { /* private fields */ }Expand description
Unevenly-sampled time series reader.
Reads from multiple independent channels at a virtual uniform rate,
using the Interpolate trait for fractional-index interpolation.
§Type parameter
T must implement Transcendental for Linear / Cubic modes.
Nearest mode only requires Copy.
Implementations§
Source§impl<T: Transcendental + Copy> TimeSeriesReader<T>
impl<T: Transcendental + Copy> TimeSeriesReader<T>
Sourcepub fn with_interp(self, mode: InterpMode) -> Self
pub fn with_interp(self, mode: InterpMode) -> Self
Set the interpolation mode (builder pattern).
Sourcepub fn set_interp(&mut self, mode: InterpMode)
pub fn set_interp(&mut self, mode: InterpMode)
Set the interpolation mode.
Sourcepub fn interp_mode(&self) -> InterpMode
pub fn interp_mode(&self) -> InterpMode
Return the current interpolation mode.
Sourcepub fn add_channel(&mut self, channel: TimeSeriesChannel<T>)
pub fn add_channel(&mut self, channel: TimeSeriesChannel<T>)
Add a channel to the reader.
Sourcepub fn num_channels(&self) -> usize
pub fn num_channels(&self) -> usize
Number of registered channels.
Sourcepub fn channel(&self, index: usize) -> Option<&TimeSeriesChannel<T>>
pub fn channel(&self, index: usize) -> Option<&TimeSeriesChannel<T>>
Immutable access to a channel by index.
Sourcepub fn channel_mut(&mut self, index: usize) -> Option<&mut TimeSeriesChannel<T>>
pub fn channel_mut(&mut self, index: usize) -> Option<&mut TimeSeriesChannel<T>>
Mutable access to a channel by index.
Sourcepub fn at_time(&self, channel: usize, t: f64) -> T
pub fn at_time(&self, channel: usize, t: f64) -> T
Read value from a single channel at an arbitrary timestamp.
Sourcepub fn read_block(&self, time: f64, sample_rate: f64, output: &mut [T])
pub fn read_block(&self, time: f64, sample_rate: f64, output: &mut [T])
Fill a planar output buffer.
Layout: [ch0_s0, ch0_s1, ..., ch0_s{BUF-1}, ch1_s0, ...]
i.e. output[ch * buf_size + i].
Sourcepub fn channels(&self) -> &[TimeSeriesChannel<T>]
pub fn channels(&self) -> &[TimeSeriesChannel<T>]
All registered channels as a slice.
Trait Implementations§
Source§impl<T: Transcendental + Copy> Default for TimeSeriesReader<T>
impl<T: Transcendental + Copy> Default for TimeSeriesReader<T>
Auto Trait Implementations§
impl<T> Freeze for TimeSeriesReader<T>
impl<T> RefUnwindSafe for TimeSeriesReader<T>where
T: RefUnwindSafe,
impl<T> Send for TimeSeriesReader<T>where
T: Send,
impl<T> Sync for TimeSeriesReader<T>where
T: Sync,
impl<T> Unpin for TimeSeriesReader<T>where
T: Unpin,
impl<T> UnsafeUnpin for TimeSeriesReader<T>
impl<T> UnwindSafe for TimeSeriesReader<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more