diff --git a/src/notify/mod.rs b/src/notify/mod.rs index 8b9725a..0b4e489 100644 --- a/src/notify/mod.rs +++ b/src/notify/mod.rs @@ -349,11 +349,11 @@ pub enum NotifyState<'a> { /// Tell the service manager to execute the configured watchdog option. WatchdogTrigger, /// Reset watchdog timeout value during runtime. - /// The value is in milliseconds. - WatchdogUsec(types::Milliseconds), + /// The value is in microseconds. + WatchdogUsec(types::Microseconds), /// Tells the service manager to extend the startup, runtime or shutdown service timeout corresponding the current state. - /// The value is in milliseconds. - ExtendTimeoutUsec(types::Milliseconds), + /// The value is in microseconds. + ExtendTimeoutUsec(types::Microseconds), } impl<'a> Display for NotifyState<'a> { diff --git a/src/notify/types.rs b/src/notify/types.rs index 1f27680..f8fb474 100644 --- a/src/notify/types.rs +++ b/src/notify/types.rs @@ -86,22 +86,23 @@ impl Display for StatusLine<'_> { } } +/// Semantic type representing a number of microseconds. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct Milliseconds(u64); +pub struct Microseconds(u64); -impl From for Milliseconds { +impl From for Microseconds { fn from(value: u64) -> Self { Self(value) } } -impl From for u64 { - fn from(value: Milliseconds) -> Self { +impl From for u64 { + fn from(value: Microseconds) -> Self { value.0 } } -impl Display for Milliseconds { +impl Display for Microseconds { #[inline] fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { Display::fmt(&self.0, f)