The screen keeps the projected tree, milestones and tally and rebuilds them after boot changes, or every 100 ms so finished units still fade on time. Release, 200 units, under load: a frame from the cached projection costs 30-40% of a full frame (0.35-0.53 ms against 1.2-1.9 ms).
22 lines
510 B
Rust
22 lines
510 B
Rust
use std::time::Duration;
|
|
|
|
use super::{BootState, MilestoneRow, Tally, TreeNode};
|
|
|
|
#[derive(Clone, Debug)]
|
|
pub struct BootProjection {
|
|
pub forest: Vec<TreeNode>,
|
|
pub milestones: Vec<MilestoneRow>,
|
|
pub tally: Tally,
|
|
}
|
|
|
|
impl BootState {
|
|
#[must_use]
|
|
pub fn project(&self, finished_since: Duration) -> BootProjection {
|
|
BootProjection {
|
|
forest: self.waiting_forest(finished_since),
|
|
milestones: self.milestones(),
|
|
tally: self.tally(),
|
|
}
|
|
}
|
|
}
|