pub struct Oper {
pub device: String,
pub status: String,
pub admin: String,
pub reason: Option<String>,
pub recoverable: bool,
pub last_change_ms: Option<u64>,
pub uptime_s: u64,
pub boot_id: String,
pub clock_synced: bool,
}Expand description
state/modem/device/{device}/oper — RFC 2863’s operational status, typed
(#121). Only the states something produces are declared: up, down,
notPresent, unknown; a coverage gap is down with recoverable: true,
never dormant, because Linux’s operstate defines dormant as L1 up.
Fields§
§device: StringThe local device.
status: Stringup | down | notPresent | unknown.
admin: Stringup | down: radio silence (EMCON) is down here and distinguishable
from a failure.
reason: Option<String>Why, in the device’s words, when it is not up.
recoverable: boolWhether the device expects to come back on its own — a coverage gap does, a dead medium does not. This is what a supervisor reads before deciding to restart (#96).
last_change_ms: Option<u64>Milliseconds since the epoch of the last status change, as the device’s clock had it.
uptime_s: u64Seconds since this driver started: an ordering a wrong wall clock cannot corrupt.
boot_id: StringOne id per driver start, so two events a second apart on either side of a restart are told apart.
clock_synced: boolWhether the wall clock here is believed synchronised. A field unit may
have no RTC; uptime_s and boot_id are how a reader orders its
events anyway.
Implementations§
Source§impl Oper
impl Oper
Sourcepub fn of(
device: &str,
status: &OperStatus,
uptime_s: u64,
boot_id: &str,
clock_synced: bool,
) -> Oper
pub fn of( device: &str, status: &OperStatus, uptime_s: u64, boot_id: &str, clock_synced: bool, ) -> Oper
The document, from what the device says and what the host knows.
uptime_s, boot_id and clock_synced are the host’s, not the
device’s: they exist so a reader can order this node’s events when
its wall clock is wrong, and one process has one boot.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Oper
impl<'de> Deserialize<'de> for Oper
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Oper, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Oper, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Oper
Source§impl JsonSchema for Oper
impl JsonSchema for Oper
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Serialize for Oper
impl Serialize for Oper
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Oper
Auto Trait Implementations§
impl Freeze for Oper
impl RefUnwindSafe for Oper
impl Send for Oper
impl Sync for Oper
impl Unpin for Oper
impl UnsafeUnpin for Oper
impl UnwindSafe for Oper
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more