#[non_exhaustive]pub struct OperStatus {
pub status: OperState,
pub admin: AdminState,
pub reason: Option<String>,
pub recoverable: bool,
pub since: Option<SystemTime>,
}Expand description
What a device says about whether it is working (#121).
Sync and cached, like Report: the management plane polls it, and a
device that needs I/O to answer keeps a snapshot. Every field is a fact
the device has; a device that has none returns OperStatus::unknown,
which is the default and is honest. It cannot be derived from
DeviceEvent, whose detail is free text.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.status: OperStateThe operational status.
admin: AdminStateThe administrative status.
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. false is the
one value that means something — a dead medium — and is what a
supervisor reads before deciding to restart (#96). A coverage gap is
true; so are up and unknown, because neither is a reason to
restart.
since: Option<SystemTime>When the status last changed, on the device’s clock.
Implementations§
Source§impl OperStatus
impl OperStatus
Sourcepub fn down(reason: impl Into<String>, recoverable: bool) -> Self
pub fn down(reason: impl Into<String>, recoverable: bool) -> Self
Not passing traffic, with the reason and whether it expects to again.
Sourcepub fn not_present(reason: impl Into<String>) -> Self
pub fn not_present(reason: impl Into<String>) -> Self
The device node is gone.
Sourcepub fn since(self, at: SystemTime) -> Self
pub fn since(self, at: SystemTime) -> Self
When this status began, on the device’s clock.
Sourcepub fn admin(self, admin: AdminState) -> Self
pub fn admin(self, admin: AdminState) -> Self
With the administrative status.