pub struct Gamepads { /* private fields */ }Implementations§
Source§impl Gamepads
impl Gamepads
pub fn new() -> Result<Self, String>
Sourcepub fn poll(&mut self) -> Vec<Event>
pub fn poll(&mut self) -> Vec<Event>
Drain ordered events and update current state. Poll even while unfocused so disconnects/releases are consumed; gate game actions on window focus. Press/release pairs remain in the event list even within a single poll.
pub fn gamepad(&self, id: GamepadId) -> Option<&Gamepad>
pub fn gamepads(&self) -> impl Iterator<Item = (GamepadId, &Gamepad)>
Auto Trait Implementations§
impl !Sync for Gamepads
impl Freeze for Gamepads
impl RefUnwindSafe for Gamepads
impl Send for Gamepads
impl Unpin for Gamepads
impl UnsafeUnpin for Gamepads
impl UnwindSafe for Gamepads
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