summaryrefslogtreecommitdiff
path: root/src/model/label.rs
blob: ef8f3edd61eaa2b699ffd55371e90ee10f9fa19e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::fmt::{self, Debug, Formatter};

use ecow::EcoString;

/// A label for an element.
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct Label(pub EcoString);

impl Debug for Label {
    fn fmt(&self, f: &mut Formatter) -> fmt::Result {
        write!(f, "<{}>", self.0)
    }
}

/// Indicates that an element cannot be labelled.
pub trait Unlabellable {}