diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-06-06 21:13:59 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-06-06 22:06:16 +0200 |
| commit | fd417da04f7ca4b995de7f6510abafd3e9c31307 (patch) | |
| tree | 3675529c75ca7363701ac8ea306de2cc1d3cbcb3 /src/model/label.rs | |
| parent | 168bdf35bd773e67343c965cb473492cc5cae9e7 (diff) | |
Improve value casting infrastructure
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 {} |
