Struct sdl2::JoystickSubsystem
source · [−]pub struct JoystickSubsystem { /* private fields */ }Implementations
sourceimpl JoystickSubsystem
impl JoystickSubsystem
sourcepub fn num_joysticks(&self) -> Result<u32, String>
pub fn num_joysticks(&self) -> Result<u32, String>
Retrieve the total number of attached joysticks and controllers identified by SDL.
sourcepub fn open(&self, joystick_index: u32) -> Result<Joystick, IntegerOrSdlError>
pub fn open(&self, joystick_index: u32) -> Result<Joystick, IntegerOrSdlError>
Attempt to open the joystick at index joystick_index and return it.
sourcepub fn name_for_index(
&self,
joystick_index: u32
) -> Result<String, IntegerOrSdlError>
pub fn name_for_index(
&self,
joystick_index: u32
) -> Result<String, IntegerOrSdlError>
Return the name of the joystick at index joystick_index.
sourcepub fn device_guid(
&self,
joystick_index: u32
) -> Result<Guid, IntegerOrSdlError>
pub fn device_guid(
&self,
joystick_index: u32
) -> Result<Guid, IntegerOrSdlError>
Get the GUID for the joystick at index joystick_index
sourcepub fn set_event_state(&self, state: bool)
pub fn set_event_state(&self, state: bool)
If state is true joystick events are processed, otherwise
they’re ignored.
sourcepub fn event_state(&self) -> bool
pub fn event_state(&self) -> bool
Return true if joystick events are processed.
Trait Implementations
sourceimpl Clone for JoystickSubsystem
impl Clone for JoystickSubsystem
sourcefn clone(&self) -> JoystickSubsystem
fn clone(&self) -> JoystickSubsystem
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl RefUnwindSafe for JoystickSubsystem
impl !Send for JoystickSubsystem
impl !Sync for JoystickSubsystem
impl Unpin for JoystickSubsystem
impl UnwindSafe for JoystickSubsystem
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more