DataSource

Trait DataSource 

Source
pub trait DataSource {
    type Data: Clone + 'static;
    type Error;

    // Required method
    fn read(&self) -> Result<Self::Data, Self::Error>;
}
Expand description

Describes an object which is a source of data, such as a sensor.

Used to facilitate broadcasting readings via IntoBroadcast.

Required Associated Types§

Source

type Data: Clone + 'static

The type of data produced by the data source.

Source

type Error

The type of errors which could occur while reading data.

Required Methods§

Source

fn read(&self) -> Result<Self::Data, Self::Error>

Tries to read a new value form the data source.

Implementors§