[][src]Enum spectrusty::peripherals::bus::joystick::JoystickSelect

An enum of joystick device implementation variants.

Some of the variants contain more than one joystick device.

Variants

Implementations

impl JoystickSelect[src]

pub const MAX_GLOBAL_INDEX: usize[src]

The largest value that can be passed as a global_index to JoystickSelect::new_with_index.

pub fn new_from_name<S>(name: S) -> Option<(JoystickSelect, usize)> where
    S: AsRef<str>, 
[src]

Creates a new joystick device variant from a given name.

On success returns a tuple with one of the joystick variants and the number of available joysticks in this variant.

pub fn new_with_index(global_index: usize) -> Option<(JoystickSelect, usize)>[src]

Creates a new joystick device variant from a given global_index which counts for all joysticks in every variant.

E.g. 2 and 3 both select Sinclair joystick but with a different resulting index.

On success returns a tuple with one of the joystick variants and an index of the selected joystick in this variant.

See also JoystickSelect::MAX_GLOBAL_INDEX.

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

Returns the number of joysticks in the current variant.

pub fn joystick_interface(
    &mut self,
    index: usize
) -> Option<&mut (dyn JoystickInterface + 'static)>
[src]

Provides a mutable reference to the selected joystick type via a dynamic trait.

Some variants contain more than one joystick, so provide an appropriate index to select one of them.

Returns None if a joystick with the given index doesn't exist.

pub fn select_next_joystick(&mut self, index: usize) -> usize[src]

Returns an index of the next joystick in the current variant. Optionally changes the current joystick device variant to the next one cyclically.

Some variants contain more than one joystick, provide an appropriate index to select one of them. If index + 1 exceeds the number of joysticks available then the next variant is being selected.

pub fn is_last(&self) -> bool[src]

pub fn is_kempston(&self) -> bool[src]

pub fn is_fuller(&self) -> bool[src]

pub fn is_sinclair(&self) -> bool[src]

pub fn is_cursor(&self) -> bool[src]

Trait Implementations

impl Clone for JoystickSelect[src]

impl Copy for JoystickSelect[src]

impl Debug for JoystickSelect[src]

impl Default for JoystickSelect[src]

impl<'de> Deserialize<'de> for JoystickSelect[src]

impl Display for JoystickSelect[src]

impl FromStr for JoystickSelect[src]

type Err = ParseJoystickSelectError

The associated error which can be returned from parsing.

impl Serialize for JoystickSelect[src]

impl<'a> TryFrom<&'a str> for JoystickSelect[src]

type Error = TryFromStrJoystickSelectError<'a>

The type returned in the event of a conversion error.

impl<'a> TryFrom<Cow<'a, str>> for JoystickSelect[src]

type Error = TryFromStrJoystickSelectError<'a>

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> Conv for T

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

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

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

impl<S, T> IntoSample<S> for T where
    S: FromSample<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> TryConv for T

impl<T> TryConv for T

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

type Error = Infallible

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<V, T> VZip<V> for T where
    V: MultiLane<T>,