#[repr(u32)]pub enum Controller {
Master = 0,
Partner = 1,
}Expand description
The basic type for a controller. Used to get the state of its joysticks and controllers.
Variants§
Master = 0
The master controller. Controllers default to this value.
Partner = 1
The partner controller.
Implementations§
Source§impl Controller
impl Controller
Sourcepub fn line(&self, line_num: u8) -> ControllerLine
pub fn line(&self, line_num: u8) -> ControllerLine
Returns a line on the controller display that can be used to print to the controller.
Sourcepub fn state(&self) -> Result<ControllerState, ControllerError>
pub fn state(&self) -> Result<ControllerState, ControllerError>
Gets the current state of the controller in its entirety.
Gets the state of a specific button on the controller.
Sourcepub fn joystick_axis(&self, axis: JoystickAxis) -> Result<f32, ControllerError>
pub fn joystick_axis(&self, axis: JoystickAxis) -> Result<f32, ControllerError>
Gets the state of a specific joystick axis on the controller.
Trait Implementations§
Source§impl Clone for Controller
impl Clone for Controller
Source§fn clone(&self) -> Controller
fn clone(&self) -> Controller
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Controller
impl Debug for Controller
Source§impl Default for Controller
impl Default for Controller
Source§fn default() -> Controller
fn default() -> Controller
Returns the “default value” for a type. Read more
impl Copy for Controller
Auto Trait Implementations§
impl Freeze for Controller
impl RefUnwindSafe for Controller
impl Send for Controller
impl Sync for Controller
impl Unpin for Controller
impl UnwindSafe for Controller
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