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§
Sourcefn impact(&self, request: HapticImpactRequest) -> Result<(), HapticError>
fn impact(&self, request: HapticImpactRequest) -> Result<(), HapticError>
Plays impact feedback with the requested strength.
Sourcefn notification(
&self,
request: HapticNotificationRequest,
) -> Result<(), HapticError>
fn notification( &self, request: HapticNotificationRequest, ) -> Result<(), HapticError>
Plays success, warning, or error notification feedback.
Sourcefn selection(&self) -> Result<(), HapticError>
fn selection(&self) -> Result<(), HapticError>
Plays lightweight selection-change feedback.
Sourcefn pattern(&self, request: HapticPatternRequest) -> Result<(), HapticError>
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".