Implement Display for Timing in iced_sentinel
This commit is contained in:
parent
30e6605650
commit
1fda2d151d
1 changed files with 16 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ use crate::core::time::{Duration, SystemTime};
|
|||
use crate::core::window;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
#[derive(
|
||||
Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize,
|
||||
|
|
@ -25,3 +26,18 @@ pub enum Stage {
|
|||
Render(window::Id),
|
||||
Custom(window::Id, String),
|
||||
}
|
||||
|
||||
impl fmt::Display for Stage {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::Boot => write!(f, "Boot"),
|
||||
Self::Update => write!(f, "Update"),
|
||||
Self::View(_) => write!(f, "View"),
|
||||
Self::Layout(_) => write!(f, "Layout"),
|
||||
Self::Interact(_) => write!(f, "Interact"),
|
||||
Self::Draw(_) => write!(f, "Draw"),
|
||||
Self::Render(_) => write!(f, "Render"),
|
||||
Self::Custom(_, name) => f.write_str(name),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue