Add DelayMs type for settings (#40659)

Closes #40610

Release Notes:

- N/A
This commit is contained in:
Julia Ryan
2025-10-20 04:34:55 +00:00
committed by GitHub
parent 59b87d5c71
commit 1d3bf9789e
16 changed files with 132 additions and 127 deletions
+30
View File
@@ -985,3 +985,33 @@ impl merge_from::MergeFrom for SaturatingBool {
self.0 |= other.0
}
}
#[derive(
Copy,
Clone,
Default,
Debug,
PartialEq,
Eq,
PartialOrd,
Ord,
Serialize,
Deserialize,
MergeFrom,
JsonSchema,
derive_more::FromStr,
)]
#[serde(transparent)]
pub struct DelayMs(pub u64);
impl From<u64> for DelayMs {
fn from(n: u64) -> Self {
Self(n)
}
}
impl std::fmt::Display for DelayMs {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}ms", self.0)
}
}