pub struct HapticEffects<'a, 'b, S: AppState> { /* private fields */ }Expand description
Convenience builder for standard haptic host capabilities.
Implementations§
Source§impl<'a, 'b, S: AppState> HapticEffects<'a, 'b, S>
impl<'a, 'b, S: AppState> HapticEffects<'a, 'b, S>
Sourcepub fn impact(self, request: HapticImpactRequest) -> EffectBuilder<'a, 'b, S>
pub fn impact(self, request: HapticImpactRequest) -> EffectBuilder<'a, 'b, S>
Plays impact-style haptic feedback.
Use this for physical-feeling interactions such as completing a drag,
snapping to a position, or confirming a strong action. The style field
tells the host how heavy the feedback should feel.
Sourcepub fn notification(
self,
request: HapticNotificationRequest,
) -> EffectBuilder<'a, 'b, S>
pub fn notification( self, request: HapticNotificationRequest, ) -> EffectBuilder<'a, 'b, S>
Plays notification-style haptic feedback.
Use this to reinforce success, warning, or error states when tactile feedback improves understanding. It should not replace visible or spoken feedback for accessibility.
Sourcepub fn selection(self) -> EffectBuilder<'a, 'b, S>
pub fn selection(self) -> EffectBuilder<'a, 'b, S>
Plays selection-change haptic feedback.
Use this for picker movement, segmented-control changes, or other repeated selection adjustments where a light tick helps the user track movement.
Sourcepub fn pattern(self, request: HapticPatternRequest) -> EffectBuilder<'a, 'b, S>
pub fn pattern(self, request: HapticPatternRequest) -> EffectBuilder<'a, 'b, S>
Plays a bounded custom haptic pattern.
request.steps contains duration and intensity values. Keep patterns
short and meaningful; hosts may reject long, empty, or unsupported
patterns.
Auto Trait Implementations§
impl<'a, 'b, S> Freeze for HapticEffects<'a, 'b, S>
impl<'a, 'b, S> !RefUnwindSafe for HapticEffects<'a, 'b, S>
impl<'a, 'b, S> Send for HapticEffects<'a, 'b, S>
impl<'a, 'b, S> Sync for HapticEffects<'a, 'b, S>
impl<'a, 'b, S> Unpin for HapticEffects<'a, 'b, S>
impl<'a, 'b, S> UnsafeUnpin for HapticEffects<'a, 'b, S>
impl<'a, 'b, S> !UnwindSafe for HapticEffects<'a, 'b, S>
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.