1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use crate::{NoLabel};

impl Label for NoLabel {
    fn label() -> &'static str {
        ""
    }
}

pub trait Label {
    fn label() -> &'static str;
}

#[macro_export]
macro_rules! label {
    ($name:ident, $label:literal) => {
        pub struct $name;
        impl Label for $name {
            fn label() -> &'static str {
                concat!($label)
            }
        }
    };
}