Trait biometrics::Sensor

source ·
pub trait Sensor {
    type Reading;

    // Required methods
    fn label(&'static self) -> &'static str;
    fn read(&'static self) -> Self::Reading;
}
Expand description

Sensor is the core type of the system. A sensor must be algebraic to be included in this library. An algebraic sensor allows one to take two readings, one on each side of a bucket, and compute the bucket with a single subtraction.

Required Associated Types§

source

type Reading

The type of a sensor reading.

Required Methods§

source

fn label(&'static self) -> &'static str

Every sensor has a label. This is a UTF-8 string. It must be static because sensors are meant to be instantiated statically as well, and having the constraint here enforces that.

source

fn read(&'static self) -> Self::Reading

Return a linearlizable view of the sensor.

Implementors§