pub struct Haptic { /* private fields */ }
Expand description
A haptic device.
Implementations§
Source§impl Haptic
impl Haptic
Sourcepub fn is_effect_supported(&self, effect: &HapticEffect) -> bool
pub fn is_effect_supported(&self, effect: &HapticEffect) -> bool
Returns whether the effect is supported on the haptic device.
Sourcepub fn new_effect(&self, effect: &HapticEffect) -> Result<PendingEffect<'_>>
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.
Sourcepub fn effects_creation_capacity(&self) -> usize
pub fn effects_creation_capacity(&self) -> usize
Returns the capacity of the effects on the haptic device.
Sourcepub fn effects_playing_capacity(&self) -> usize
pub fn effects_playing_capacity(&self) -> usize
Returns the maximum numbers of playing the effects at same time on the haptic device.
Sourcepub fn stop_all_effect(&self)
pub fn stop_all_effect(&self)
Stops all the playing effect.
Sourcepub fn set_auto_center(&self, auto_center: u32)
pub fn set_auto_center(&self, auto_center: u32)
Sets auto-center. If not supported, this has no effects.
Sourcepub fn property(&self) -> HapticProperty
pub fn property(&self) -> HapticProperty
Queries a property on the haptic device.
Sourcepub fn pause(self) -> PausedHaptic
pub fn pause(self) -> PausedHaptic
Pauses the haptic device and converts into PausedHaptic
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Haptic
impl RefUnwindSafe for Haptic
impl !Send for Haptic
impl !Sync for Haptic
impl Unpin for Haptic
impl UnwindSafe for Haptic
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