Skip to main content

MoniData

Trait MoniData 

Source
pub trait MoniData {
    // Required methods
    fn get_board_id(&self) -> u8;
    fn get(&self, varname: &str) -> Option<f32>;
    fn keys() -> Vec<&'static str>;

    // Provided methods
    fn get_timestamp(&self) -> u64 { ... }
    fn set_timestamp(&mut self, _ts: u64) { ... }
}
Expand description

Monitoring data shall share the same kind of interface.

Required Methods§

Source

fn get_board_id(&self) -> u8

Monitoring data is always tied to a specific board. This might not be its own board, but maybe the RB the data was gathered from This is an unique identifier for the monitoring data across the same type.

MoniData which only belongs to a single board will have board id 0

Source

fn get(&self, varname: &str) -> Option<f32>

Access the (data) members by name

Source

fn keys() -> Vec<&'static str>

A list of the variables in this MoniData

Provided Methods§

Source

fn get_timestamp(&self) -> u64

Source

fn set_timestamp(&mut self, _ts: u64)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§