Compare commits
2 commits
035f354b04
...
cfac28272b
Author | SHA1 | Date | |
---|---|---|---|
cfac28272b | |||
f5b9796a32 |
|
@ -349,11 +349,11 @@ pub enum NotifyState<'a> {
|
||||||
/// Tell the service manager to execute the configured watchdog option.
|
/// Tell the service manager to execute the configured watchdog option.
|
||||||
WatchdogTrigger,
|
WatchdogTrigger,
|
||||||
/// Reset watchdog timeout value during runtime.
|
/// Reset watchdog timeout value during runtime.
|
||||||
/// The value is in milliseconds.
|
/// The value is in microseconds.
|
||||||
WatchdogUsec(types::Milliseconds),
|
WatchdogUsec(types::Microseconds),
|
||||||
/// Tells the service manager to extend the startup, runtime or shutdown service timeout corresponding the current state.
|
/// Tells the service manager to extend the startup, runtime or shutdown service timeout corresponding the current state.
|
||||||
/// The value is in milliseconds.
|
/// The value is in microseconds.
|
||||||
ExtendTimeoutUsec(types::Milliseconds),
|
ExtendTimeoutUsec(types::Microseconds),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Display for NotifyState<'a> {
|
impl<'a> Display for NotifyState<'a> {
|
||||||
|
|
|
@ -86,22 +86,23 @@ impl Display for StatusLine<'_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Semantic type representing a number of microseconds.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||||
pub struct Milliseconds(u64);
|
pub struct Microseconds(u64);
|
||||||
|
|
||||||
impl From<u64> for Milliseconds {
|
impl From<u64> for Microseconds {
|
||||||
fn from(value: u64) -> Self {
|
fn from(value: u64) -> Self {
|
||||||
Self(value)
|
Self(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<Milliseconds> for u64 {
|
impl From<Microseconds> for u64 {
|
||||||
fn from(value: Milliseconds) -> Self {
|
fn from(value: Microseconds) -> Self {
|
||||||
value.0
|
value.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Display for Milliseconds {
|
impl Display for Microseconds {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
Display::fmt(&self.0, f)
|
Display::fmt(&self.0, f)
|
||||||
|
|
Loading…
Reference in a new issue