Struct ClassicReading

Source
pub struct ClassicReading {
Show 21 fields pub joystick_left_x: u8, pub joystick_left_y: u8, pub joystick_right_x: u8, pub joystick_right_y: u8, pub trigger_left: u8, pub trigger_right: u8, pub dpad_up: bool, pub dpad_down: bool, pub dpad_left: bool, pub dpad_right: bool, pub button_b: bool, pub button_a: bool, pub button_x: bool, pub button_y: bool, pub button_trigger_l: bool, pub button_trigger_r: bool, pub button_zl: bool, pub button_zr: bool, pub button_minus: bool, pub button_plus: bool, pub button_home: bool,
}
Expand description

Data from a classic controller after it has been deserialized

In low-res mode, axes with less than 8 bits of range will be scaled to approximate an 8 bit range. in hi-res mode, all axes arleady have 8 bits of range

Fields§

§joystick_left_x: u8§joystick_left_y: u8§joystick_right_x: u8§joystick_right_y: u8§trigger_left: u8§trigger_right: u8§dpad_up: bool§dpad_down: bool§dpad_left: bool§dpad_right: bool§button_b: bool§button_a: bool§button_x: bool§button_y: bool§button_trigger_l: bool§button_trigger_r: bool§button_zl: bool§button_zr: bool§button_minus: bool§button_plus: bool§button_home: bool

Implementations§

Source§

impl ClassicReading

Source

pub fn from_data(data: &[u8]) -> Option<ClassicReading>

Convert from a wii-ext report into controller data

Trait Implementations§

Source§

impl Debug for ClassicReading

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ClassicReading

Source§

fn default() -> ClassicReading

Returns the “default value” for a type. Read more
Source§

impl Format for ClassicReading

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.