Struct turtle::event::ControllerButton
[−]
pub struct ControllerButton { pub id: i32, pub button: u8, }
Components of a controller button event. Not guaranteed consistent across backends.
Fields
id: i32
Which controller was the button on.
Which button was pressed.
Methods
impl ControllerButton
pub fn new(id: i32, button: u8) -> ControllerButton
Create a new ControllerButton object. Intended for use by backends when emitting events.
Trait Implementations
impl Copy for ControllerButton
impl Hash for ControllerButton
fn hash<__H>(&self, __arg_0: &mut __H) where
__H: Hasher,
__H: Hasher,
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialEq<ControllerButton> for ControllerButton
fn eq(&self, __arg_0: &ControllerButton) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ControllerButton) -> bool
This method tests for !=
.
impl Debug for ControllerButton
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Eq for ControllerButton
impl From<ControllerButton> for Button
fn from(btn: ControllerButton) -> Button
Performs the conversion.
impl<'de> Deserialize<'de> for ControllerButton
fn deserialize<__D>(
__deserializer: __D
) -> Result<ControllerButton, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
__deserializer: __D
) -> Result<ControllerButton, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Clone for ControllerButton
fn clone(&self) -> ControllerButton
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Serialize for ControllerButton
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
&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