pub struct ManualVsyncPacer { /* private fields */ }Expand description
Deterministic, zero-allocation push-driven VsyncPacer for unit and integration tests.
Implementations§
Source§impl ManualVsyncPacer
impl ManualVsyncPacer
Sourcepub fn new() -> (Self, ManualVsyncHandle)
pub fn new() -> (Self, ManualVsyncHandle)
Creates a new inactive ManualVsyncPacer and its shared ManualVsyncHandle.
Sourcepub fn with_on_trigger(
on_trigger: Arc<dyn Fn() + Send + Sync>,
) -> (Self, ManualVsyncHandle)
pub fn with_on_trigger( on_trigger: Arc<dyn Fn() + Send + Sync>, ) -> (Self, ManualVsyncHandle)
Creates a new inactive ManualVsyncPacer whose ManualVsyncHandle::trigger_tick
invokes on_trigger whenever a coalesced tick is emitted.
Sourcepub fn handle(&self) -> ManualVsyncHandle
pub fn handle(&self) -> ManualVsyncHandle
Clones a ManualVsyncHandle sharing this pacer’s atomic state.
Trait Implementations§
Source§impl Debug for ManualVsyncPacer
impl Debug for ManualVsyncPacer
Source§impl Default for ManualVsyncPacer
impl Default for ManualVsyncPacer
Source§impl VsyncPacer for ManualVsyncPacer
impl VsyncPacer for ManualVsyncPacer
Source§fn set_active(&mut self, active: bool)
fn set_active(&mut self, active: bool)
Starts (
true) or pauses (false) frame delivery. Idle pacers MUST consume 0% CPU.Source§fn on_tick_received(&self)
fn on_tick_received(&self)
Acknowledges receipt of a delivered vsync tick so push-driven pacers can clear their
coalescing latch and emit the next frame tick.
Source§fn nominal_interval_us(&self) -> Option<u32>
fn nominal_interval_us(&self) -> Option<u32>
Nominal frame interval in microseconds if known (e.g.
8_333 for 120 Hz ProMotion).Auto Trait Implementations§
impl !RefUnwindSafe for ManualVsyncPacer
impl !UnwindSafe for ManualVsyncPacer
impl Forget for ManualVsyncPacer
impl Freeze for ManualVsyncPacerwhere
*const ArcInner<ManualVsyncState> is !null: Freeze,
PhantomData<ArcInner<ManualVsyncState>>: Freeze,
impl Move for ManualVsyncPacer
impl Send for ManualVsyncPacer
impl Sync for ManualVsyncPacer
impl Unpin for ManualVsyncPacer
impl UnsafeUnpin for ManualVsyncPacerwhere
*const ArcInner<ManualVsyncState> is !null: UnsafeUnpin,
PhantomData<ArcInner<ManualVsyncState>>: UnsafeUnpin,
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