[−][src]Struct gc_adapter::Buttons
A collection of which buttons are pressed
Note: right_trigger
and left_trigger
refer to the buttons (i.e. the click when you hold
them all the way down). For the analog part of the triggers, see
Controller::triggers
.
Implementations
impl Buttons
[src]
impl Buttons
[src]
pub const fn into_bytes(self) -> [u8; 2]
[src]
Returns the underlying bits.
Layout
The returned byte array is layed out in the same way as described here.
pub const fn from_bytes(bytes: [u8; 2]) -> Self
[src]
Converts the given bytes directly into the bitfield struct.
impl Buttons
[src]
pub fn a(&self) -> <bool as Specifier>::InOut
[src]
Returns the value of a.
pub fn a_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
[src]
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of a.
#Errors
If the returned value contains an invalid bit pattern for a.
pub fn with_a(self, new_val: <bool as Specifier>::InOut) -> Self
[src]
Returns a copy of the bitfield with the value of a set to the given value.
#Panics
If the given value is out of bounds for a.
pub fn with_a_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of a set to the given value.
#Errors
If the given value is out of bounds for a.
pub fn set_a(&mut self, new_val: <bool as Specifier>::InOut)
[src]
Sets the value of a to the given value.
#Panics
If the given value is out of bounds for a.
pub fn set_a_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of a to the given value.
#Errors
If the given value is out of bounds for a.
pub fn b(&self) -> <bool as Specifier>::InOut
[src]
Returns the value of b.
pub fn b_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
[src]
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of b.
#Errors
If the returned value contains an invalid bit pattern for b.
pub fn with_b(self, new_val: <bool as Specifier>::InOut) -> Self
[src]
Returns a copy of the bitfield with the value of b set to the given value.
#Panics
If the given value is out of bounds for b.
pub fn with_b_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of b set to the given value.
#Errors
If the given value is out of bounds for b.
pub fn set_b(&mut self, new_val: <bool as Specifier>::InOut)
[src]
Sets the value of b to the given value.
#Panics
If the given value is out of bounds for b.
pub fn set_b_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of b to the given value.
#Errors
If the given value is out of bounds for b.
pub fn x(&self) -> <bool as Specifier>::InOut
[src]
Returns the value of x.
pub fn x_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
[src]
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of x.
#Errors
If the returned value contains an invalid bit pattern for x.
pub fn with_x(self, new_val: <bool as Specifier>::InOut) -> Self
[src]
Returns a copy of the bitfield with the value of x set to the given value.
#Panics
If the given value is out of bounds for x.
pub fn with_x_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of x set to the given value.
#Errors
If the given value is out of bounds for x.
pub fn set_x(&mut self, new_val: <bool as Specifier>::InOut)
[src]
Sets the value of x to the given value.
#Panics
If the given value is out of bounds for x.
pub fn set_x_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of x to the given value.
#Errors
If the given value is out of bounds for x.
pub fn y(&self) -> <bool as Specifier>::InOut
[src]
Returns the value of y.
pub fn y_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
[src]
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of y.
#Errors
If the returned value contains an invalid bit pattern for y.
pub fn with_y(self, new_val: <bool as Specifier>::InOut) -> Self
[src]
Returns a copy of the bitfield with the value of y set to the given value.
#Panics
If the given value is out of bounds for y.
pub fn with_y_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of y set to the given value.
#Errors
If the given value is out of bounds for y.
pub fn set_y(&mut self, new_val: <bool as Specifier>::InOut)
[src]
Sets the value of y to the given value.
#Panics
If the given value is out of bounds for y.
pub fn set_y_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of y to the given value.
#Errors
If the given value is out of bounds for y.
pub fn dpad_left(&self) -> <bool as Specifier>::InOut
[src]
Returns the value of dpad_left.
pub fn dpad_left_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
[src]
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of dpad_left.
#Errors
If the returned value contains an invalid bit pattern for dpad_left.
pub fn with_dpad_left(self, new_val: <bool as Specifier>::InOut) -> Self
[src]
Returns a copy of the bitfield with the value of dpad_left set to the given value.
#Panics
If the given value is out of bounds for dpad_left.
pub fn with_dpad_left_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of dpad_left set to the given value.
#Errors
If the given value is out of bounds for dpad_left.
pub fn set_dpad_left(&mut self, new_val: <bool as Specifier>::InOut)
[src]
Sets the value of dpad_left to the given value.
#Panics
If the given value is out of bounds for dpad_left.
pub fn set_dpad_left_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of dpad_left to the given value.
#Errors
If the given value is out of bounds for dpad_left.
pub fn dpad_right(&self) -> <bool as Specifier>::InOut
[src]
Returns the value of dpad_right.
pub fn dpad_right_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
[src]
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of dpad_right.
#Errors
If the returned value contains an invalid bit pattern for dpad_right.
pub fn with_dpad_right(self, new_val: <bool as Specifier>::InOut) -> Self
[src]
Returns a copy of the bitfield with the value of dpad_right set to the given value.
#Panics
If the given value is out of bounds for dpad_right.
pub fn with_dpad_right_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of dpad_right set to the given value.
#Errors
If the given value is out of bounds for dpad_right.
pub fn set_dpad_right(&mut self, new_val: <bool as Specifier>::InOut)
[src]
Sets the value of dpad_right to the given value.
#Panics
If the given value is out of bounds for dpad_right.
pub fn set_dpad_right_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of dpad_right to the given value.
#Errors
If the given value is out of bounds for dpad_right.
pub fn dpad_down(&self) -> <bool as Specifier>::InOut
[src]
Returns the value of dpad_down.
pub fn dpad_down_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
[src]
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of dpad_down.
#Errors
If the returned value contains an invalid bit pattern for dpad_down.
pub fn with_dpad_down(self, new_val: <bool as Specifier>::InOut) -> Self
[src]
Returns a copy of the bitfield with the value of dpad_down set to the given value.
#Panics
If the given value is out of bounds for dpad_down.
pub fn with_dpad_down_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of dpad_down set to the given value.
#Errors
If the given value is out of bounds for dpad_down.
pub fn set_dpad_down(&mut self, new_val: <bool as Specifier>::InOut)
[src]
Sets the value of dpad_down to the given value.
#Panics
If the given value is out of bounds for dpad_down.
pub fn set_dpad_down_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of dpad_down to the given value.
#Errors
If the given value is out of bounds for dpad_down.
pub fn dpad_up(&self) -> <bool as Specifier>::InOut
[src]
Returns the value of dpad_up.
pub fn dpad_up_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
[src]
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of dpad_up.
#Errors
If the returned value contains an invalid bit pattern for dpad_up.
pub fn with_dpad_up(self, new_val: <bool as Specifier>::InOut) -> Self
[src]
Returns a copy of the bitfield with the value of dpad_up set to the given value.
#Panics
If the given value is out of bounds for dpad_up.
pub fn with_dpad_up_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of dpad_up set to the given value.
#Errors
If the given value is out of bounds for dpad_up.
pub fn set_dpad_up(&mut self, new_val: <bool as Specifier>::InOut)
[src]
Sets the value of dpad_up to the given value.
#Panics
If the given value is out of bounds for dpad_up.
pub fn set_dpad_up_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of dpad_up to the given value.
#Errors
If the given value is out of bounds for dpad_up.
pub fn start(&self) -> <bool as Specifier>::InOut
[src]
Returns the value of start.
pub fn start_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
[src]
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of start.
#Errors
If the returned value contains an invalid bit pattern for start.
pub fn with_start(self, new_val: <bool as Specifier>::InOut) -> Self
[src]
Returns a copy of the bitfield with the value of start set to the given value.
#Panics
If the given value is out of bounds for start.
pub fn with_start_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of start set to the given value.
#Errors
If the given value is out of bounds for start.
pub fn set_start(&mut self, new_val: <bool as Specifier>::InOut)
[src]
Sets the value of start to the given value.
#Panics
If the given value is out of bounds for start.
pub fn set_start_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of start to the given value.
#Errors
If the given value is out of bounds for start.
pub fn z(&self) -> <bool as Specifier>::InOut
[src]
Returns the value of z.
pub fn z_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
[src]
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of z.
#Errors
If the returned value contains an invalid bit pattern for z.
pub fn with_z(self, new_val: <bool as Specifier>::InOut) -> Self
[src]
Returns a copy of the bitfield with the value of z set to the given value.
#Panics
If the given value is out of bounds for z.
pub fn with_z_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of z set to the given value.
#Errors
If the given value is out of bounds for z.
pub fn set_z(&mut self, new_val: <bool as Specifier>::InOut)
[src]
Sets the value of z to the given value.
#Panics
If the given value is out of bounds for z.
pub fn set_z_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of z to the given value.
#Errors
If the given value is out of bounds for z.
pub fn right_trigger(&self) -> <bool as Specifier>::InOut
[src]
Returns the value of right_trigger.
pub fn right_trigger_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
[src]
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of right_trigger.
#Errors
If the returned value contains an invalid bit pattern for right_trigger.
pub fn with_right_trigger(self, new_val: <bool as Specifier>::InOut) -> Self
[src]
Returns a copy of the bitfield with the value of right_trigger set to the given value.
#Panics
If the given value is out of bounds for right_trigger.
pub fn with_right_trigger_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of right_trigger set to the given value.
#Errors
If the given value is out of bounds for right_trigger.
pub fn set_right_trigger(&mut self, new_val: <bool as Specifier>::InOut)
[src]
Sets the value of right_trigger to the given value.
#Panics
If the given value is out of bounds for right_trigger.
pub fn set_right_trigger_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of right_trigger to the given value.
#Errors
If the given value is out of bounds for right_trigger.
pub fn left_trigger(&self) -> <bool as Specifier>::InOut
[src]
Returns the value of left_trigger.
pub fn left_trigger_or_err(
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
[src]
&self
) -> Result<<bool as Specifier>::InOut, InvalidBitPattern<<bool as Specifier>::Bytes>>
Returns the value of left_trigger.
#Errors
If the returned value contains an invalid bit pattern for left_trigger.
pub fn with_left_trigger(self, new_val: <bool as Specifier>::InOut) -> Self
[src]
Returns a copy of the bitfield with the value of left_trigger set to the given value.
#Panics
If the given value is out of bounds for left_trigger.
pub fn with_left_trigger_checked(
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]
self,
new_val: <bool as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of left_trigger set to the given value.
#Errors
If the given value is out of bounds for left_trigger.
pub fn set_left_trigger(&mut self, new_val: <bool as Specifier>::InOut)
[src]
Sets the value of left_trigger to the given value.
#Panics
If the given value is out of bounds for left_trigger.
pub fn set_left_trigger_checked(
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]
&mut self,
new_val: <bool as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of left_trigger to the given value.
#Errors
If the given value is out of bounds for left_trigger.
pub fn padding(&self) -> <B4 as Specifier>::InOut
[src]
Returns the value of padding.
pub fn padding_or_err(
&self
) -> Result<<B4 as Specifier>::InOut, InvalidBitPattern<<B4 as Specifier>::Bytes>>
[src]
&self
) -> Result<<B4 as Specifier>::InOut, InvalidBitPattern<<B4 as Specifier>::Bytes>>
Returns the value of padding.
#Errors
If the returned value contains an invalid bit pattern for padding.
pub fn with_padding(self, new_val: <B4 as Specifier>::InOut) -> Self
[src]
Returns a copy of the bitfield with the value of padding set to the given value.
#Panics
If the given value is out of bounds for padding.
pub fn with_padding_checked(
self,
new_val: <B4 as Specifier>::InOut
) -> Result<Self, OutOfBounds>
[src]
self,
new_val: <B4 as Specifier>::InOut
) -> Result<Self, OutOfBounds>
Returns a copy of the bitfield with the value of padding set to the given value.
#Errors
If the given value is out of bounds for padding.
pub fn set_padding(&mut self, new_val: <B4 as Specifier>::InOut)
[src]
Sets the value of padding to the given value.
#Panics
If the given value is out of bounds for padding.
pub fn set_padding_checked(
&mut self,
new_val: <B4 as Specifier>::InOut
) -> Result<(), OutOfBounds>
[src]
&mut self,
new_val: <B4 as Specifier>::InOut
) -> Result<(), OutOfBounds>
Sets the value of padding to the given value.
#Errors
If the given value is out of bounds for padding.
Trait Implementations
impl BinRead for Buttons
[src]
type Args = ()
The type of arguments needed to be supplied in order to read this type, usually a tuple. Read more
pub 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>
[src]
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<Self>
pub 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<()>
[src]
&mut self,
__binread_generated_var_reader: &mut R,
__binread_generated_var_options: &ReadOptions,
__binread_generated_var_arguments: Self::Args
) -> BinResult<()>
pub fn read<R>(reader: &mut R) -> Result<Self, Error> where
R: Read + Seek,
[src]
R: Read + Seek,
pub fn read_args<R>(reader: &mut R, args: Self::Args) -> Result<Self, Error> where
R: Read + Seek,
[src]
R: Read + Seek,
pub fn args_default() -> Option<Self::Args>
[src]
impl CheckTotalSizeMultipleOf8 for Buttons
[src]
impl Debug for Buttons
[src]
impl Default for Buttons
[src]
Auto Trait Implementations
impl RefUnwindSafe for Buttons
impl Send for Buttons
impl Sync for Buttons
impl Unpin for Buttons
impl UnwindSafe for Buttons
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,