Struct ControllerStatus

Source
pub struct ControllerStatus { /* private fields */ }
Expand description

Status of controller for the given port

Implementations§

Source§

impl ControllerStatus

Source

pub const fn new() -> Self

Returns an instance with zero initialized data.

Source§

impl ControllerStatus

Source

pub const fn into_bytes(self) -> [u8; 1]

Returns the underlying bits.

§Layout

The returned byte array is layed out in the same way as described here.

Source

pub const fn from_bytes(bytes: [u8; 1]) -> Self

Converts the given bytes directly into the bitfield struct.

Source§

impl ControllerStatus

Source

pub fn unk(&self) -> <bool as Specifier>::InOut

Returns the value of unk.

Source

pub fn unk_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>

Returns the value of unk.

#Errors

If the returned value contains an invalid bit pattern for unk.

Source

pub fn with_unk(self, new_val: <bool as Specifier>::InOut) -> Self

Returns a copy of the bitfield with the value of unk set to the given value.

#Panics

If the given value is out of bounds for unk.

Source

pub fn with_unk_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>

Returns a copy of the bitfield with the value of unk set to the given value.

#Errors

If the given value is out of bounds for unk.

Source

pub fn set_unk(&mut self, new_val: <bool as Specifier>::InOut)

Sets the value of unk to the given value.

#Panics

If the given value is out of bounds for unk.

Source

pub fn set_unk_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>

Sets the value of unk to the given value.

#Errors

If the given value is out of bounds for unk.

Source

pub fn unk2(&self) -> <bool as Specifier>::InOut

Returns the value of unk2.

Source

pub fn unk2_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>

Returns the value of unk2.

#Errors

If the returned value contains an invalid bit pattern for unk2.

Source

pub fn with_unk2(self, new_val: <bool as Specifier>::InOut) -> Self

Returns a copy of the bitfield with the value of unk2 set to the given value.

#Panics

If the given value is out of bounds for unk2.

Source

pub fn with_unk2_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>

Returns a copy of the bitfield with the value of unk2 set to the given value.

#Errors

If the given value is out of bounds for unk2.

Source

pub fn set_unk2(&mut self, new_val: <bool as Specifier>::InOut)

Sets the value of unk2 to the given value.

#Panics

If the given value is out of bounds for unk2.

Source

pub fn set_unk2_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>

Sets the value of unk2 to the given value.

#Errors

If the given value is out of bounds for unk2.

Source

pub fn has_rumble(&self) -> <bool as Specifier>::InOut

Returns the value of has_rumble.

Source

pub fn has_rumble_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>

Returns the value of has_rumble.

#Errors

If the returned value contains an invalid bit pattern for has_rumble.

Source

pub fn with_has_rumble(self, new_val: <bool as Specifier>::InOut) -> Self

Returns a copy of the bitfield with the value of has_rumble set to the given value.

#Panics

If the given value is out of bounds for has_rumble.

Source

pub fn with_has_rumble_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>

Returns a copy of the bitfield with the value of has_rumble set to the given value.

#Errors

If the given value is out of bounds for has_rumble.

Source

pub fn set_has_rumble(&mut self, new_val: <bool as Specifier>::InOut)

Sets the value of has_rumble to the given value.

#Panics

If the given value is out of bounds for has_rumble.

Source

pub fn set_has_rumble_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>

Sets the value of has_rumble to the given value.

#Errors

If the given value is out of bounds for has_rumble.

Source

pub fn unk3(&self) -> <bool as Specifier>::InOut

Returns the value of unk3.

Source

pub fn unk3_or_err( &self, ) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>

Returns the value of unk3.

#Errors

If the returned value contains an invalid bit pattern for unk3.

Source

pub fn with_unk3(self, new_val: <bool as Specifier>::InOut) -> Self

Returns a copy of the bitfield with the value of unk3 set to the given value.

#Panics

If the given value is out of bounds for unk3.

Source

pub fn with_unk3_checked( self, new_val: <bool as Specifier>::InOut, ) -> Result<Self, OutOfBounds>

Returns a copy of the bitfield with the value of unk3 set to the given value.

#Errors

If the given value is out of bounds for unk3.

Source

pub fn set_unk3(&mut self, new_val: <bool as Specifier>::InOut)

Sets the value of unk3 to the given value.

#Panics

If the given value is out of bounds for unk3.

Source

pub fn set_unk3_checked( &mut self, new_val: <bool as Specifier>::InOut, ) -> Result<(), OutOfBounds>

Sets the value of unk3 to the given value.

#Errors

If the given value is out of bounds for unk3.

Source

pub fn controller_type(&self) -> <ControllerType as Specifier>::InOut

Returns the value of controller_type.

Source

pub fn controller_type_or_err( &self, ) -> Result<<ControllerType as Specifier>::InOut, InvalidBitPattern<<ControllerType as Specifier>::Bytes>>

Returns the value of controller_type.

#Errors

If the returned value contains an invalid bit pattern for controller_type.

Source

pub fn with_controller_type( self, new_val: <ControllerType as Specifier>::InOut, ) -> Self

Returns a copy of the bitfield with the value of controller_type set to the given value.

#Panics

If the given value is out of bounds for controller_type.

Source

pub fn with_controller_type_checked( self, new_val: <ControllerType as Specifier>::InOut, ) -> Result<Self, OutOfBounds>

Returns a copy of the bitfield with the value of controller_type set to the given value.

#Errors

If the given value is out of bounds for controller_type.

Source

pub fn set_controller_type( &mut self, new_val: <ControllerType as Specifier>::InOut, )

Sets the value of controller_type to the given value.

#Panics

If the given value is out of bounds for controller_type.

Source

pub fn set_controller_type_checked( &mut self, new_val: <ControllerType as Specifier>::InOut, ) -> Result<(), OutOfBounds>

Sets the value of controller_type to the given value.

#Errors

If the given value is out of bounds for controller_type.

Trait Implementations§

Source§

impl BinRead for ControllerStatus

Source§

type Args = ()

The type of arguments needed to be supplied in order to read this type, usually a tuple. Read more
Source§

fn read_options<R: Read + Seek>( __binread_generated_var_reader: &mut R, __binread_generated_var_options: &ReadOptions, __binread_generated_var_arguments: Self::Args, ) -> BinResult<Self>

Read the type from the reader
Source§

fn after_parse<R: Read + Seek>( &mut self, __binread_generated_var_reader: &mut R, __binread_generated_var_options: &ReadOptions, __binread_generated_var_arguments: Self::Args, ) -> BinResult<()>

Source§

fn read<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek,

Read the type from the reader while assuming no arguments have been passed Read more
Source§

fn read_args<R>(reader: &mut R, args: Self::Args) -> Result<Self, Error>
where R: Read + Seek,

Read the type from the reader using the specified arguments
Source§

fn args_default() -> Option<Self::Args>

The default arguments to be used when using the read shortcut method. Override this for any type that optionally requries arguments
Source§

impl CheckTotalSizeMultipleOf8 for ControllerStatus

Source§

type Size = TotalSize<[(); 0]>

Source§

impl Clone for ControllerStatus

Source§

fn clone(&self) -> ControllerStatus

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ControllerStatus

Source§

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

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

impl Default for ControllerStatus

Source§

fn default() -> ControllerStatus

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

impl PartialEq for ControllerStatus

Source§

fn eq(&self, other: &ControllerStatus) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for ControllerStatus

Source§

impl StructuralPartialEq for ControllerStatus

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.