[][src]Struct gilrs_core::Gilrs

pub struct Gilrs { /* fields omitted */ }

Struct used to manage gamepads and retrieve events.

Methods

impl Gilrs[src]

pub fn new() -> Result<Self, Error>[src]

pub fn next_event(&mut self) -> Option<Event>[src]

Returns oldest event or None if all events were processed.

pub fn gamepad(&self, id: usize) -> Option<&Gamepad>[src]

Borrows Gamrpad or return None if index is invalid. Returned gamepad may be disconnected.

pub fn last_gamepad_hint(&self) -> usize[src]

Returns id greater than id of last connected gamepad. The returned value is only hint and may be much larger than number of observed gamepads. For example, it may return maximum number of connected gamepads on platforms when this limit is small.

gamepad(id) should return Some if using id that is smaller than value returned from this function.

Trait Implementations

impl Debug for Gilrs[src]

Auto Trait Implementations

impl !Send for Gilrs

impl !Sync for Gilrs

impl Unpin for Gilrs

impl UnwindSafe for Gilrs

impl RefUnwindSafe for Gilrs

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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