pub struct LogColumns { /* private fields */ }Expand description
What each column of a log samples: one column for a Trend Log, one per
member for a Trend Log Multiple, None where the reference is empty;
and, once read, the state texts of the objects whose states columns
sample. The default names no column.
Implementations§
Source§impl LogColumns
impl LogColumns
Sourcepub fn applies(object_type: ObjectType) -> bool
pub fn applies(object_type: ObjectType) -> bool
Whether a log of object_type has a Log_DeviceObjectProperty to
name its values by: a Trend Log or a Trend Log Multiple.
Sourcepub fn decode(data: &[u8]) -> Self
pub fn decode(data: &[u8]) -> Self
The columns a Log_DeviceObjectProperty value names, read whole: its references back to back. Octets that don’t decode to the end name no column, so the values print as the log gives them.
Sourcepub fn column(&self, column: usize) -> Option<LoggedProperty>
pub fn column(&self, column: usize) -> Option<LoggedProperty>
The property column column (from 0) samples, if named.
Sourcepub fn state_texts(&self, column: usize) -> &StateTexts
pub fn state_texts(&self, column: usize) -> &StateTexts
The state texts of the object column column samples, cleaned for
display (StateTexts::cleaned); none unless they were read. A
formatter made with them names the column’s states
(ValueFormat::new). Device-supplied text: a front end shows it
as data.
Sourcepub fn raw_state_texts(&self, column: usize) -> &StateTexts
pub fn raw_state_texts(&self, column: usize) -> &StateTexts
Self::state_texts as the device sent them, uncleaned and uncut,
for a front end that cleans device text its own way (the MCP
server’s envelopes, which also say when they cut it).
Sourcepub async fn read_state_texts<F, Fut>(
&mut self,
log_device: Option<u32>,
read: F,
)
pub async fn read_state_texts<F, Fut>( &mut self, log_device: Option<u32>, read: F, )
Read the state texts of the objects whose states the columns
sample, each once, through read, and keep them to name those
columns. log_device is the log’s device instance, when known: an
object on another device is not read. read gives an object’s
texts (empty ones for a refused read, which leaves its columns as
they were) or breaks off the reading (a device gone silent, a spent
budget). Nothing is read when no column samples a state.
Trait Implementations§
Source§impl Clone for LogColumns
impl Clone for LogColumns
Source§impl Debug for LogColumns
impl Debug for LogColumns
Source§impl Default for LogColumns
impl Default for LogColumns
impl Eq for LogColumns
Source§impl FromIterator<Option<LoggedProperty>> for LogColumns
impl FromIterator<Option<LoggedProperty>> for LogColumns
Source§fn from_iter<I: IntoIterator<Item = Option<LoggedProperty>>>(columns: I) -> Self
fn from_iter<I: IntoIterator<Item = Option<LoggedProperty>>>(columns: I) -> Self
The columns in order, None for one nothing names.