pub(crate) trait HealthStatus: ExchangeData + Debug + Ord {
    // Required methods
    fn name(&self) -> &'static str;
    fn error(&self) -> Option<&str>;
    fn hint(&self) -> Option<&str>;
    fn should_halt(&self) -> bool;
    fn can_transition_from(&self, other: Option<&Self>) -> bool;
    fn starting() -> Self;
}
Expand description

A trait that lets a user of the health_operator specify a health status object.

In addition to these methods, heath statuses should:

  • Be cloneable/exhangeable so they can be moved around in timely.
  • Debug-printable.
  • Ord, where the order increases in severity. The state returned by starting() should be the minimum.

Required Methods§

source

fn name(&self) -> &'static str

The user-readable name of the status state.

source

fn error(&self) -> Option<&str>

The user-readable error string, if there is one.

source

fn hint(&self) -> Option<&str>

A hint for solving the error, if there is one.

source

fn should_halt(&self) -> bool

Whether or not we should halt the dataflow instances and restart it.

source

fn can_transition_from(&self, other: Option<&Self>) -> bool

Whether or not we can transition from a state (or lack of one).

Each time this returns true, a new status message will be communicated to the user. Note that messages that are identical except for should_halt don’t need to be able to transition between each other, that is handled separately.

source

fn starting() -> Self

A instance of a status that specifies that the object is starting. Used when the dataflow starts up.

Implementors§