pub struct JoystickHaptic<'joystick> { /* private fields */ }
Expand description

A haptic device got from the joystick.

Implementations§

source§

impl<'joystick> JoystickHaptic<'joystick>

source

pub fn new(joystick: impl AsRef<Joystick> + 'joystick) -> Option<Self>

Constructs from a reference to Joystick.

Methods from Deref<Target = Haptic>§

source

pub fn name(&self) -> String

Returns the name of the haptic device.

source

pub fn num_axes(&self) -> u32

Returns the numbers of the axes on the haptic device.

source

pub fn is_effect_supported(&self, effect: &HapticEffect) -> bool

Returns whether the effect is supported on the haptic device.

source

pub fn new_effect(&self, effect: &HapticEffect) -> Result<PendingEffect<'_>>

Constructs the PendingEffect from the effect specification.

§Errors

Returns Err if this feature is unsupported, or failed to create a new haptic effect on the device.

source

pub fn effects_creation_capacity(&self) -> usize

Returns the capacity of the effects on the haptic device.

source

pub fn effects_playing_capacity(&self) -> usize

Returns the maximum numbers of playing the effects at same time on the haptic device.

source

pub fn stop_all_effect(&self)

Stops all the playing effect.

source

pub fn set_gain(&self, gain: u32)

Sets the global gain. If not supported, this has no effects.

source

pub fn set_auto_center(&self, auto_center: u32)

Sets auto-center. If not supported, this has no effects.

source

pub fn property(&self) -> HapticProperty

Queries a property on the haptic device.

Trait Implementations§

source§

impl Debug for JoystickHaptic<'_>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for JoystickHaptic<'_>

§

type Target = Haptic

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Drop for JoystickHaptic<'_>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'joystick> RefUnwindSafe for JoystickHaptic<'joystick>

§

impl<'joystick> !Send for JoystickHaptic<'joystick>

§

impl<'joystick> !Sync for JoystickHaptic<'joystick>

§

impl<'joystick> Unpin for JoystickHaptic<'joystick>

§

impl<'joystick> UnwindSafe for JoystickHaptic<'joystick>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.