pub struct ReadOptions {
pub group: Option<String>,
pub start_time: Option<f64>,
pub end_time: Option<f64>,
pub start_record: Option<u64>,
pub record_count: Option<u64>,
pub raw: bool,
}Expand description
Options for read / values: which group to look in, and which part of
the channel to read.
Select either a time window (start_time / end_time, inclusive, in
the master channel’s unit — seconds relative to the measurement start for
a time master) or a record window (start_record / record_count).
Omitted bounds are open.
use mf4_rs::ReadOptions;
let opts = ReadOptions::new().group("Engine").time(Some(1.0), Some(2.5));
let page = ReadOptions::new().records(1_000, 500);
let stored = ReadOptions::new().raw(true); // skip the conversionraw returns the values as stored in the file, without the channel’s
conversion (a linear channel gives its stored numbers, a value-to-text
channel its keys instead of the texts). Only the requested channel is
affected: timestamps and time windows still use the physical (converted)
time axis. unit is the channel’s (physical) unit, unchanged.
Fields§
§group: Option<String>Group name, to disambiguate a channel name used by several groups.
start_time: Option<f64>Inclusive lower time bound.
end_time: Option<f64>Inclusive upper time bound.
start_record: Option<u64>First record of a record window (0-based).
record_count: Option<u64>Number of records in a record window.
raw: boolReturn the stored values, without applying the channel’s conversion.
Implementations§
Source§impl ReadOptions
impl ReadOptions
Sourcepub fn group(self, group: impl Into<String>) -> Self
pub fn group(self, group: impl Into<String>) -> Self
Restrict the lookup to the group(s) with this name.
Sourcepub fn time(self, start: Option<f64>, end: Option<f64>) -> Self
pub fn time(self, start: Option<f64>, end: Option<f64>) -> Self
Select samples whose master (time) value lies in [start, end].