Skip to main content

HapticHost

Trait HapticHost 

Source
pub trait HapticHost:
    Send
    + Sync
    + 'static {
    // Required methods
    fn impact(&self, request: HapticImpactRequest) -> Result<(), HapticError>;
    fn notification(
        &self,
        request: HapticNotificationRequest,
    ) -> Result<(), HapticError>;
    fn selection(&self) -> Result<(), HapticError>;
    fn pattern(&self, request: HapticPatternRequest) -> Result<(), HapticError>;
}
Expand description

Host-side haptic feedback provider used by shell capability registration.

Required Methods§

Source

fn impact(&self, request: HapticImpactRequest) -> Result<(), HapticError>

Plays impact feedback with the requested strength.

Source

fn notification( &self, request: HapticNotificationRequest, ) -> Result<(), HapticError>

Plays success, warning, or error notification feedback.

Source

fn selection(&self) -> Result<(), HapticError>

Plays lightweight selection-change feedback.

Source

fn pattern(&self, request: HapticPatternRequest) -> Result<(), HapticError>

Plays a bounded custom haptic pattern.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§