pub struct FrameBudget {
pub total_us: u64,
pub layout_us: u64,
pub shaping_us: u64,
pub diff_us: u64,
pub present_us: u64,
pub headroom_us: u64,
}Expand description
Wall-clock time budget for a single render frame.
All values are in microseconds for sub-millisecond precision without floating point.
Fields§
§total_us: u64Total frame budget (layout + shaping + diff + present).
layout_us: u64Maximum time for the layout solver pass.
shaping_us: u64Maximum time for text shaping (shaped or terminal path).
diff_us: u64Maximum time for buffer-diff computation.
present_us: u64Maximum time for the presenter (ANSI emit).
headroom_us: u64Headroom reserved for widget render + event dispatch + IO.
Implementations§
Source§impl FrameBudget
impl FrameBudget
Sourcepub const fn from_fps(fps: u32) -> u64
pub const fn from_fps(fps: u32) -> u64
Budget for a target frame rate.
Returns the per-frame total in microseconds.
Sourcepub const fn as_duration(&self) -> Duration
pub const fn as_duration(&self) -> Duration
Convert the total budget to a Duration.
Sourcepub const fn is_consistent(&self) -> bool
pub const fn is_consistent(&self) -> bool
Whether the sub-budgets are consistent with total.
Trait Implementations§
Source§impl Clone for FrameBudget
impl Clone for FrameBudget
Source§fn clone(&self) -> FrameBudget
fn clone(&self) -> FrameBudget
Returns a duplicate of the value. Read more
1.0.0 · 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 FrameBudget
impl Debug for FrameBudget
Source§impl Display for FrameBudget
impl Display for FrameBudget
Source§impl PartialEq for FrameBudget
impl PartialEq for FrameBudget
impl Copy for FrameBudget
impl Eq for FrameBudget
impl StructuralPartialEq for FrameBudget
Auto Trait Implementations§
impl Freeze for FrameBudget
impl RefUnwindSafe for FrameBudget
impl Send for FrameBudget
impl Sync for FrameBudget
impl Unpin for FrameBudget
impl UnsafeUnpin for FrameBudget
impl UnwindSafe for FrameBudget
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.