RotarySensor

Trait RotarySensor 

Source
pub trait RotarySensor {
    type Error;

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

A sensor that can measure continuous angular rotation, such as an encoder.

Required Associated Types§

Source

type Error

The type of error that the device returns when RotarySensor::position fails to return a value.

Required Methods§

Source

fn position(&self) -> Result<Position, Self::Error>

Reads the angular position of the sensor.

§Errors

Returns Self::Error if the reading failed.

Implementations on Foreign Types§

Source§

impl RotarySensor for AdiEncoder

Source§

impl RotarySensor for Motor

Source§

impl RotarySensor for RotationSensor

Source§

impl<T: RotarySensor> RotarySensor for Rc<RefCell<T>>

Blanket implementation for all Rc<RefCell<T>> wrappers of already implemented sensors.

Source§

impl<T: RotarySensor> RotarySensor for Vec<T>

Source§

impl<const N: usize, T: RotarySensor> RotarySensor for [T; N]

Implementors§