#[non_exhaustive]pub enum WatchEvent {
#[non_exhaustive] Snapshot {
state: WatchState,
},
#[non_exhaustive] Error {
error: Error,
state: WatchState,
},
}Expand description
Stream item of ProxyWatcher: a state snapshot or a failed re-read, each stamped
with the watcher’s WatchState as it stood at delivery.
A snapshot arrives when the configuration changed, when the health changed, or both, so
a lost notification route reaches a subscriber rather than only
ProxyWatcher::health.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
#[non_exhaustive]Snapshot
The configuration, the liveness of the routes, or both moved.
Consecutive undelivered snapshots fold into the newest one, so a subscriber that stops polling loses the history between snapshots, never the current answer.
Fields
This variant is marked as non-exhaustive
state: WatchStateConfiguration and liveness at delivery.
#[non_exhaustive]Error
Re-reading the OS settings failed. This does not end the subscription.
Nothing is guaranteed to follow, and no event reports the recovery. If the next
successful read returns the same configuration and no route changed, the equality
skip publishes nothing, and ProxyWatcher::current and ProxyWatcher::state
return what they returned before the failure, captured_at included, so there is
nothing to wait for: what they hold is what that read agreed with. A
Snapshot does follow whenever the configuration or the health
moved.
Fields
This variant is marked as non-exhaustive
state: WatchStateLiveness at delivery, and the last configuration that did read cleanly.
Implementations§
Source§impl WatchEvent
impl WatchEvent
Sourcepub fn state(&self) -> &WatchState
pub fn state(&self) -> &WatchState
The state stamped on this event, whichever variant it is.