diff options
Diffstat (limited to 'src/model/label.rs')
| -rw-r--r-- | src/model/label.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/model/label.rs b/src/model/label.rs new file mode 100644 index 00000000..ef8f3edd --- /dev/null +++ b/src/model/label.rs @@ -0,0 +1,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 {} |
