Struct gilrs_core::Gamepad
source · #[repr(transparent)]pub struct Gamepad {
pub(crate) inner: Gamepad,
}
Expand description
Provides information about gamepad.
Fields§
§inner: Gamepad
Implementations§
source§impl Gamepad
impl Gamepad
sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Returns true if gamepad is connected.
sourcepub fn uuid(&self) -> [u8; 16]
pub fn uuid(&self) -> [u8; 16]
Returns UUID that represents gamepad model.
Returned UUID should be the same as SLD2 uses. If platform does not provide any method to distinguish between gamepad models, nil UUID is returned.
It is recommended to process with the UUID crate.
Use Uuid::from_bytes
method to create a Uuid
from the returned bytes.
sourcepub fn vendor_id(&self) -> Option<u16>
pub fn vendor_id(&self) -> Option<u16>
Returns the vendor ID, as assigned by the USB-IF, when available.
sourcepub fn product_id(&self) -> Option<u16>
pub fn product_id(&self) -> Option<u16>
Returns the product ID, as assigned by the vendor, when available.
sourcepub fn power_info(&self) -> PowerInfo
pub fn power_info(&self) -> PowerInfo
Returns device’s power supply state.
sourcepub fn is_ff_supported(&self) -> bool
pub fn is_ff_supported(&self) -> bool
Returns true if force feedback is supported by device,
Returns slice with EvCodes that may appear in button related events.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Gamepad
impl RefUnwindSafe for Gamepad
impl Send for Gamepad
impl Sync for Gamepad
impl Unpin for Gamepad
impl UnwindSafe for Gamepad
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