Implement Display for Timing in iced_sentinel

This commit is contained in:
Héctor Ramón Jiménez 2024-02-28 19:38:08 +01:00
parent 30e6605650
commit 1fda2d151d
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -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),
}
}
}