pub fn read_order<T: Read>(file: &mut T) -> Result<Option<Order>, Error>
Expand description
Read one byte from a file/serial port and convert it to an order
ยงExample
use std::io::Cursor;
use robust_arduino_serial::*;
let mut buffer = Cursor::new(vec![2]);
let order = read_order(&mut buffer).unwrap().unwrap();
// Order::MOTOR has the index 2 in the enum
assert_eq!(Order::MOTOR, order);