Struct rich_sdl2_rust::haptic::Haptic
source · 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 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