#[non_exhaustive]pub enum HapticEffect {
Constant(Direction, Play, Trigger, Level, Envelope),
Periodic(Direction, Play, Trigger, Wave, Envelope),
Condition(Play, Trigger, Condition),
Ramp(Direction, Play, Trigger, Ramp, Envelope),
LeftRight {
length: u32,
large_magnitude: u16,
small_magnitude: u16,
},
Custom(Direction, Play, Trigger, Custom, Envelope),
}
Expand description
An effect on the haptic device.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Constant(Direction, Play, Trigger, Level, Envelope)
Applies the constant force in the direction.
Periodic(Direction, Play, Trigger, Wave, Envelope)
Applies the force of the periodic waveform.
Condition(Play, Trigger, Condition)
Applies the force on fulfilled the condition.
Ramp(Direction, Play, Trigger, Ramp, Envelope)
Applies the force by linear ramp.
LeftRight
Applies the left/right effect with two motors magnitude. One motor is high frequency, the other is low frequency.
Fields
Custom(Direction, Play, Trigger, Custom, Envelope)
Applies the force of the periodic waveform from your sampled data.
Trait Implementations§
Source§impl Clone for HapticEffect
impl Clone for HapticEffect
Source§fn clone(&self) -> HapticEffect
fn clone(&self) -> HapticEffect
Returns a copy 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 HapticEffect
impl Debug for HapticEffect
Source§impl From<SDL_HapticEffect> for HapticEffect
impl From<SDL_HapticEffect> for HapticEffect
Source§fn from(raw: SDL_HapticEffect) -> Self
fn from(raw: SDL_HapticEffect) -> Self
Converts to this type from the input type.
Source§impl PartialEq for HapticEffect
impl PartialEq for HapticEffect
impl Eq for HapticEffect
impl StructuralPartialEq for HapticEffect
Auto Trait Implementations§
impl Freeze for HapticEffect
impl RefUnwindSafe for HapticEffect
impl Send for HapticEffect
impl Sync for HapticEffect
impl Unpin for HapticEffect
impl UnwindSafe for HapticEffect
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