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.
|
||||
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> {
|
||||
|
|
|
@ -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<u64> for Milliseconds {
|
||||
impl From<u64> for Microseconds {
|
||||
fn from(value: u64) -> Self {
|
||||
Self(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Milliseconds> for u64 {
|
||||
fn from(value: Milliseconds) -> Self {
|
||||
impl From<Microseconds> 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)
|
||||
|
|
Loading…
Reference in a new issue