Skip to main content

PhaseLabel

Trait PhaseLabel 

Source
pub trait PhaseLabel:
    Copy
    + PartialEq
    + 'static {
    const ALL: &'static [Self];

    // Required method
    fn label(&self) -> &'static str;
}
Expand description

A lifecycle-phase enum that can be rendered as a metric label.

The single source of truth for a CRD’s phase labels: PhaseLabel::ALL enumerates every variant and PhaseLabel::label is an exhaustive match. The controller’s kopiur_resource_phase gauge uses these to set the active phase to 1 and the rest to 0 (and to clear all on deletion), so both the label string and the reset set come from the enum itself rather than a stringly-typed table that can silently drift (ADR §5.5 type-safety thesis).

Required Associated Constants§

Source

const ALL: &'static [Self]

Every variant, in declaration order.

Required Methods§

Source

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

The stable metric label string for this variant (exhaustive match).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl PhaseLabel for BackupPhase

Source§

const ALL: &'static [Self]

Source§

impl PhaseLabel for RepositoryPhase

Source§

const ALL: &'static [Self]

Source§

impl PhaseLabel for RestorePhase

Source§

const ALL: &'static [Self]