#[non_exhaustive]pub struct WatchHealth {
pub degraded: Vec<ProxyConfigSource>,
pub has_live_notifications: bool,
pub poll_interval: Option<Duration>,
pub stopped: bool,
}Expand description
Liveness of change-notification routes (ProxyWatcher::health).
degraded: route is not delivering; set WatchOptions::poll_interval.
is_frozen: nothing arrives on its own (no route and no poll, or a stopped
thread). ProxyWatcher::poll_now still delivers until the thread stops.
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.degraded: Vec<ProxyConfigSource>Routes that could not be established, or that were established and later lost. An
entry names the source a dead route stops reporting on, which is not always the
store the reader opens; a source that is not configured here is nothing to watch
rather than a failed watch, and is not listed. Windows is the exception: a missing
per-user Internet Settings key lists
Registry, because a key created later has no
notification armed on it. Do not expect every entry to appear in
ProxyConfig::sources: notification routes are per
store, so a lost kioslaverc watch is reported as
Kioslaverc even on a machine whose
ProxyType = 4 makes that store report
KioslavercEnv. Only ever grows: a
source that degrades stays listed for the life of the watcher, the same one-way
shape as has_live_notifications.
has_live_notifications: boolAt least one native notification route is still live. Starts from what was
established at construction and only ever falls to false, once every route is
gone. A backend thread that stopped is reported by stopped
instead; that is not a statement about the routes.
poll_interval: Option<Duration>Poll interval copied from WatchOptions::poll_interval at construction: what the
caller asked for, not the floor a shorter request is raised to before any backend
uses it. The floor is never reported, because this field says whether polling was
asked for and stopped says whether the request is still met.
stopped: boolThe backend thread has stopped, so poll_interval no longer has any effect: the
polling this type reports happens on that thread. The stream ends with None
once drained, but a caller that only reads health would otherwise keep waiting.
Implementations§
Source§impl WatchHealth
impl WatchHealth
Sourcepub fn is_fully_live(&self) -> bool
pub fn is_fully_live(&self) -> bool
Every route is delivering: nothing degraded, at least one live native
notification, and a backend thread still running to serve them. A
stopped thread is never fully live, whatever the routes
reported while it ran.
Sourcepub fn is_frozen(&self) -> bool
pub fn is_frozen(&self) -> bool
No live native notification and no WatchOptions::poll_interval, or a
stopped thread, which takes the polling with it.