#[repr(u8)]pub enum DataType {
}Variants§
None(u8)
Color(i16, i16)
right, left
Distance(i16)
CalcSpeed(i16, i16)
right, left
SyncSpeed(i16, i16)
right, left
RealSpeeds(i16, i16)
right, left
DrivenDistance(f32, f32)
right, left
SyncError(f32)
Correction(f32, f32)
right, left
AverageSpeed(f32, f32)
right, left
RGB((i16, i16, i16), (i16, i16, i16))
right, left
CurTarSpeeds(i16, i16)
cur_speed, target_speed
InstantDerivative(f32)
Implementations§
Source§impl DataType
impl DataType
pub fn write(&self) -> String
pub fn get_none(i: u8) -> u8
pub fn none(&self) -> u8
pub fn to_u8(&self) -> u8
Sourcepub fn from_string(s: String) -> DataType
pub fn from_string(s: String) -> DataType
This converts a string in this format “1, 30, 30” to a DataType::Color(30, 30)
Sourcepub fn write_description(&self) -> String
pub fn write_description(&self) -> String
Writes the description of the data type like this: for Color: “right color, left color”
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DataType
impl<'de> Deserialize<'de> for DataType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for DataType
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more