pub fn joystick_id(&self) -> Result<JoystickID, String> {
    let joystick_ptr: *mut SDL_Joystick = unsafe { SDL_GameControllerGetJoystick(self.ptr) };
    if joystick_ptr.is_null() {
      Err(get_error())
    } else {
      let out = unsafe { SDL_JoystickInstanceID(joystick_ptr) };
      if out < 0 {
        Err(get_error())
      } else {
        Ok(JoystickID(out))
      }
    }
  }
/// Attempts to get the joystick ID of this controller.
Attempts to get the joystick ID of this controller.
Attempts to get the joystick ID of this controller .
pub fn joystick_id(&self) -> Result<JoystickID, String> {
    let joystick_ptr: *mut SDL_Joystick = unsafe { SDL_GameControllerGetJoystick(self.ptr) };
    if joystick_ptr.is_null() {
      Err(get_error())
    } else {
      let out = unsafe { SDL_JoystickInstanceID(joystick_ptr) };
      if out < 0 {
        Err(get_error())
      } else {
        Ok(JoystickID(out))
      }
    }
  }
pub fn joystick_id ( & self ) -> Result < JoystickID , String > { let joystick_ptr : * mut SDL_Joystick = unsafe { SDL_GameControllerGetJoystick ( self . ptr ) } ; if joystick_ptr . is_null ( ) { Err ( get_error ( ) ) } else { let out = unsafe { SDL_JoystickInstanceID ( joystick_ptr ) } ; if out < 0 { Err ( get_error ( ) ) } else { Ok ( JoystickID ( out ) ) } } }
Attempts to get the joystick ID of this controller.
Attempts to get the joystick ID of this controller .
&self
&self