#[repr(u8)]pub enum Speed {
Slow = 3,
Medium = 2,
Fast = 1,
Turbo = 0,
}Expand description
Airfrog speed
Variants§
Slow = 3
Slow speed, 500 kHz
Medium = 2
Medium speed, 1000 kHz
Fast = 1
Fast speed, 2000 kHz
Turbo = 0
Turbo speed, 4000 kHz - this is the default speed
Implementations§
Source§impl Speed
impl Speed
Sourcepub fn from_khz(khz: u32) -> Self
pub fn from_khz(khz: u32) -> Self
Convert from kHz value to Speed
Arguments:
khz: The kHz value to convert.
Returns:
Speed: The corresponding Speed variant.
Sourcepub fn to_khz(self) -> u32
pub fn to_khz(self) -> u32
Convert from Speed to kHz
Returns:
u32: The kHz value corresponding to the Speed variant.
Sourcepub fn from_byte(byte: u8) -> Result<Self, ProtocolError>
pub fn from_byte(byte: u8) -> Result<Self, ProtocolError>
Convert from a byte value to a Speed
Arguments:
byte: The byte value to convert.
Returns:
Ok(Speed): If the byte value is valid.Err(ProtocolError::Arg): If the byte value is not recognized.
Trait Implementations§
impl Copy for Speed
impl Eq for Speed
impl StructuralPartialEq for Speed
Auto Trait Implementations§
impl Freeze for Speed
impl RefUnwindSafe for Speed
impl Send for Speed
impl Sync for Speed
impl Unpin for Speed
impl UnsafeUnpin for Speed
impl UnwindSafe for Speed
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