You need labels to name various things in your app, such as systems, run criteria, stages, and ambiguity sets.

Bevy uses some clever Rust type system magic, to allow you to use strings as well as your own custom types for labels, and even mix them!

You may use a value of any type as a label, as long as it has the following standard Rust traits: Clone + Eq + Hash + Debug (and the implied + Send + Sync + 'static).

You need to derive the appropriate trait: StageLabel, SystemLabel, RunCriteriaLabel, or AmbiguitySetLabel.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
enum MySystems {

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
enum MyStages {

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
struct DebugStage;

fn main() {

        // Add our game systems:

        // temporary debug system, let's just use a string label

        // Add our custom stages:
        // note that Bevy's `CoreStage` is an enum just like ours!
        .add_stage_before(CoreStage::Update, MyStages::Prepare, SystemStage::parallel())
        .add_stage_after(CoreStage::Update, MyStages::Cleanup, SystemStage::parallel())

        .add_stage_after(CoreStage::Update, DebugStage, SystemStage::parallel())

        // we can just use a string for this one:
        .add_stage_before(CoreStage::PostUpdate, "temp-debug-hack", SystemStage::parallel())


For quick prototyping, it is convenient to just use strings as labels.

However, by defining your labels as custom types, the Rust compiler can check them for you, and your IDE can auto-complete them. It is the recommended way, as it prevents mistakes, and helps you stay organized in larger projects.