#[repr(u8)]pub enum SmartShiftMode {
Free = 1,
Ratchet = 2,
}Expand description
SmartShift mode values understood by the firmware. Free = free-spin,
Ratchet = clicky / smartshift-off. The discriminant is the wire byte;
reserved values (0 / 3 / future) fail TryFrom and callers fall back
to whatever they consider sane.
Also crosses the agent↔GUI IPC — where serde encodes the variant index
(Free=0, Ratchet=1), not the #[repr(u8)] firmware discriminant — so
variant order is wire format and changes require a PROTOCOL_VERSION bump
(guarded by openlogi-agent-core/tests/wire_format.rs).
Variants§
Implementations§
Source§impl SmartShiftMode
impl SmartShiftMode
Sourcepub fn flipped(self) -> Self
pub fn flipped(self) -> Self
The opposite mode — used by crate::write::toggle_smartshift.
Trait Implementations§
Source§impl Clone for SmartShiftMode
impl Clone for SmartShiftMode
Source§fn clone(&self) -> SmartShiftMode
fn clone(&self) -> SmartShiftMode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SmartShiftMode
Source§impl Debug for SmartShiftMode
impl Debug for SmartShiftMode
Source§impl<'de> Deserialize<'de> for SmartShiftMode
impl<'de> Deserialize<'de> for SmartShiftMode
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 Eq for SmartShiftMode
Source§impl From<SmartShiftMode> for u8
impl From<SmartShiftMode> for u8
Source§fn from(enum_value: SmartShiftMode) -> Self
fn from(enum_value: SmartShiftMode) -> Self
Converts to this type from the input type.
Source§impl From<SmartShiftMode> for WheelMode
impl From<SmartShiftMode> for WheelMode
Source§fn from(mode: SmartShiftMode) -> Self
fn from(mode: SmartShiftMode) -> Self
Converts to this type from the input type.
Source§impl From<WheelMode> for SmartShiftMode
impl From<WheelMode> for SmartShiftMode
Source§impl PartialEq for SmartShiftMode
impl PartialEq for SmartShiftMode
Source§fn eq(&self, other: &SmartShiftMode) -> bool
fn eq(&self, other: &SmartShiftMode) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for SmartShiftMode
impl Serialize for SmartShiftMode
impl StructuralPartialEq for SmartShiftMode
Source§impl TryFrom<u8> for SmartShiftMode
impl TryFrom<u8> for SmartShiftMode
Source§type Error = TryFromPrimitiveError<SmartShiftMode>
type Error = TryFromPrimitiveError<SmartShiftMode>
The type returned in the event of a conversion error.
Source§impl TryFromPrimitive for SmartShiftMode
impl TryFromPrimitive for SmartShiftMode
const NAME: &'static str = "SmartShiftMode"
type Primitive = u8
type Error = TryFromPrimitiveError<SmartShiftMode>
fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>
Auto Trait Implementations§
impl Freeze for SmartShiftMode
impl RefUnwindSafe for SmartShiftMode
impl Send for SmartShiftMode
impl Sync for SmartShiftMode
impl Unpin for SmartShiftMode
impl UnsafeUnpin for SmartShiftMode
impl UnwindSafe for SmartShiftMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.