pub struct HapticManager { /* private fields */ }Expand description
Collects haptic requests for the platform backend to play.
Implementations§
Source§impl HapticManager
impl HapticManager
pub fn new() -> Self
Sourcepub fn play(&mut self, pattern: HapticPattern, target: HapticTarget)
pub fn play(&mut self, pattern: HapticPattern, target: HapticTarget)
Queue a pattern at full strength.
Sourcepub fn play_request(&mut self, request: HapticRequest)
pub fn play_request(&mut self, request: HapticRequest)
Queue a fully-specified request.
Sourcepub fn take_pending(&mut self) -> Vec<HapticRequest>
pub fn take_pending(&mut self) -> Vec<HapticRequest>
Drain the queue — called by the shell each pass.
Sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Whether anything is queued, so a backend can skip acquiring a native performer (which on macOS means an Objective-C round trip) when there is nothing to play. Called once per pass on every window.
Trait Implementations§
Source§impl Clone for HapticManager
impl Clone for HapticManager
Source§fn clone(&self) -> HapticManager
fn clone(&self) -> HapticManager
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 moreSource§impl Debug for HapticManager
impl Debug for HapticManager
Source§impl Default for HapticManager
impl Default for HapticManager
Source§fn default() -> HapticManager
fn default() -> HapticManager
Returns the “default value” for a type. Read more
Source§impl PartialEq for HapticManager
impl PartialEq for HapticManager
impl StructuralPartialEq for HapticManager
Auto Trait Implementations§
impl Freeze for HapticManager
impl RefUnwindSafe for HapticManager
impl Send for HapticManager
impl Sync for HapticManager
impl Unpin for HapticManager
impl UnsafeUnpin for HapticManager
impl UnwindSafe for HapticManager
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