pub enum TickDemand {
Idle,
NextFrame,
AfterMs(u32),
}Expand description
Unified per-frame scheduling demand reported by FrameTickHooks and aggregated by
FrameTickRegistry / SurfaceRuntime::tick_ex.
Variants§
Idle
No pending work; hosts may sleep at 0% CPU until woken by input or a waker.
NextFrame
Participant needs the next vsync frame.
AfterMs(u32)
Participant needs a tick after at least ms milliseconds (AfterMs(0) normalizes to
Self::NextFrame).
Implementations§
Source§impl TickDemand
impl TickDemand
Sourcepub const fn normalize(self) -> Self
pub const fn normalize(self) -> Self
Normalizes AfterMs(0) into Self::NextFrame.
Sourcepub const fn merge(self, other: Self) -> Self
pub const fn merge(self, other: Self) -> Self
Combines two demands: NextFrame dominates everything; AfterMs(a) + AfterMs(b) keeps
the earlier AfterMs(a.min(b)); Idle is the identity.
Sourcepub const fn is_idle(self) -> bool
pub const fn is_idle(self) -> bool
Returns true when this demand is Self::Idle.
Sourcepub const fn to_abi(self) -> (u32, u32)
pub const fn to_abi(self) -> (u32, u32)
Encodes this demand into the C ABI (NV_TICK_DEMAND_*, next_tick_ms) pair.
Sourcepub const fn from_outcome(outcome: NvTickOutcome) -> Option<Self>
pub const fn from_outcome(outcome: NvTickOutcome) -> Option<Self>
Decodes a C ABI NvTickOutcome into a typed TickDemand.
Trait Implementations§
Source§impl Clone for TickDemand
impl Clone for TickDemand
impl Copy for TickDemand
Source§impl Debug for TickDemand
impl Debug for TickDemand
Source§impl Default for TickDemand
impl Default for TickDemand
impl Eq for TickDemand
Source§impl PartialEq for TickDemand
impl PartialEq for TickDemand
impl StructuralPartialEq for TickDemand
Auto Trait Implementations§
impl Forget for TickDemand
impl Freeze for TickDemand
impl Move for TickDemand
impl RefUnwindSafe for TickDemand
impl Send for TickDemand
impl Sync for TickDemand
impl Unpin for TickDemand
impl UnsafeUnpin for TickDemand
impl UnwindSafe for TickDemand
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