#[repr(C, u8)]pub enum HapticTarget {
System,
Gamepad(u32),
Pen,
}Expand description
Which device should play the pattern.
#[repr(C, u8)] rather than #[repr(C)] because Gamepad carries a
payload: a data-carrying enum needs an explicit discriminant type for its
layout to be defined across the FFI boundary, and the API’s FFI checker
rejects repr(C) on one for exactly that reason.
Variants§
System
Whatever the system considers the default — the trackpad on a laptop, the body of a phone.
Gamepad(u32)
A specific gamepad, by its GamepadId. Rumble rather than a tap: a
controller’s actuators are motors, so the light patterns become short
low-amplitude pulses rather than the crisp taps a trackpad gives.
Pen
The pen currently in proximity. Only Apple Pencil Pro and some Surface pens have an actuator; a request to any other pen is silently ignored.
Trait Implementations§
Source§impl Clone for HapticTarget
impl Clone for HapticTarget
Source§fn clone(&self) -> HapticTarget
fn clone(&self) -> HapticTarget
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HapticTarget
Source§impl Debug for HapticTarget
impl Debug for HapticTarget
impl Eq for HapticTarget
Source§impl Hash for HapticTarget
impl Hash for HapticTarget
Source§impl Ord for HapticTarget
impl Ord for HapticTarget
Source§fn cmp(&self, other: &HapticTarget) -> Ordering
fn cmp(&self, other: &HapticTarget) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for HapticTarget
impl PartialEq for HapticTarget
Source§impl PartialOrd for HapticTarget
impl PartialOrd for HapticTarget
impl StructuralPartialEq for HapticTarget
Auto Trait Implementations§
impl Freeze for HapticTarget
impl RefUnwindSafe for HapticTarget
impl Send for HapticTarget
impl Sync for HapticTarget
impl Unpin for HapticTarget
impl UnsafeUnpin for HapticTarget
impl UnwindSafe for HapticTarget
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