#[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-ipc/tests/wire_format.rs).
Variants§
Implementations§
Source§impl SmartShiftMode
impl SmartShiftMode
Sourcepub fn flipped(self) -> SmartShiftMode
pub fn flipped(self) -> SmartShiftMode
The opposite mode — used when toggling SmartShift between free-spin and ratchet in the write path.
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<SmartShiftMode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SmartShiftMode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SmartShiftMode
Source§impl From<WheelMode> for SmartShiftMode
impl From<WheelMode> for SmartShiftMode
Source§fn from(mode: WheelMode) -> SmartShiftMode
fn from(mode: WheelMode) -> SmartShiftMode
Converts to this type from the input type.
Source§impl PartialEq for SmartShiftMode
impl PartialEq for SmartShiftMode
Source§impl Serialize for SmartShiftMode
impl Serialize for SmartShiftMode
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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§fn try_from(
number: u8,
) -> Result<SmartShiftMode, TryFromPrimitiveError<SmartShiftMode>>
fn try_from( number: u8, ) -> Result<SmartShiftMode, TryFromPrimitiveError<SmartShiftMode>>
Performs the conversion.
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: <SmartShiftMode as TryFromPrimitive>::Primitive, ) -> Result<SmartShiftMode, TryFromPrimitiveError<SmartShiftMode>>
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Casts the value.
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.