sid/label.rs
1use crate::{NoLabel};
2
3impl Label for NoLabel {
4 fn label() -> &'static str {
5 ""
6 }
7}
8
9pub trait Label {
10 fn label() -> &'static str;
11}
12
13#[macro_export]
14macro_rules! label {
15 ($name:ident, $label:literal) => {
16 pub struct $name;
17 impl Label for $name {
18 fn label() -> &'static str {
19 concat!($label)
20 }
21 }
22 };
23}