[][src]Struct gilrs_core::Gamepad

pub struct Gamepad { /* fields omitted */ }

Provides information about gamepad.

Methods

impl Gamepad[src]

pub fn name(&self) -> &str[src]

Returns name of gamepad.

pub fn is_connected(&self) -> bool[src]

Returns true if gamepad is connected.

pub fn uuid(&self) -> [u8; 16][src]

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.

pub fn power_info(&self) -> PowerInfo[src]

Returns device's power supply state.

pub fn is_ff_supported(&self) -> bool[src]

Returns true if force feedback is supported by device,

pub fn ff_device(&self) -> Option<FfDevice>[src]

Creates FfDevice corresponding to this gamepad.

pub fn buttons(&self) -> &[EvCode][src]

Returns slice with EvCodes that may appear in button related events.

pub fn axes(&self) -> &[EvCode][src]

Returns slice with EvCodes that may appear in axis related events.

pub fn axis_info(&self, nec: EvCode) -> Option<&AxisInfo>[src]

Returns information about specific axis. None may be returned if device doesn't have axis with provided EvCode.

Trait Implementations

impl Debug for Gamepad[src]

Auto Trait Implementations

impl Send for Gamepad

impl Sync for Gamepad

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]