summaryrefslogtreecommitdiff
path: root/src/attributes/label.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/attributes/label.rs')
-rw-r--r--src/attributes/label.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/attributes/label.rs b/src/attributes/label.rs
new file mode 100644
index 0000000..e62de2b
--- /dev/null
+++ b/src/attributes/label.rs
@@ -0,0 +1,34 @@
+use crate::dot::DotString;
+use std::borrow::Cow;
+
+pub enum LabelJustification {
+ Left,
+ Right,
+ Center,
+}
+
+impl<'a> DotString<'a> for LabelJustification {
+ fn dot_string(&self) -> Cow<'a, str> {
+ match self {
+ LabelJustification::Left => "l".into(),
+ LabelJustification::Right => "r".into(),
+ LabelJustification::Center => "c".into(),
+ }
+ }
+}
+
+pub enum LabelLocation {
+ Top,
+ Center,
+ Bottom,
+}
+
+impl<'a> DotString<'a> for LabelLocation {
+ fn dot_string(&self) -> Cow<'a, str> {
+ match self {
+ LabelLocation::Top => "t".into(),
+ LabelLocation::Center => "c".into(),
+ LabelLocation::Bottom => "b".into(),
+ }
+ }
+}