1use std::fmt::Display;
2
3use num_traits::Num;
4
5pub struct ControlValue {
6 pub value: f64,
7}
8
9pub struct ServoInput<T: Num> {
10 pub process_value: T,
11 pub delta_t: Option<u64>,
12}
13
14#[derive(Debug)]
15pub struct ReadInputError {}
16
17impl std::fmt::Display for ReadInputError {
18 fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19 todo!()
20 }
21}
22
23impl std::error::Error for ReadInputError {}
24
25pub trait Servo: Display {
26 fn read<T: Num>(&mut self, servo_input: &ServoInput<T>)
27 -> Result<ControlValue, ReadInputError>;
28}