summaryrefslogtreecommitdiff
path: root/src/attributes/arrow_type.rs
blob: ac2d49fe4c8f29998107aef6c2ff9e468114776d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use crate::dot::DotString;
use std::borrow::Cow;

pub enum ArrowType {
    Normal,
    Dot,
    Odot,
    None,
    Empty,
    Diamond,
    Ediamond,
    Box,
    Open,
    Vee,
    Inv,
    Invdot,
    Invodot,
    Tee,
    Invempty,
    Odiamond,
    Crow,
    Obox,
    Halfopen,
}

impl<'a> DotString<'a> for ArrowType {
    fn dot_string(&self) -> Cow<'a, str> {
        match self {
            ArrowType::Normal => "normal".into(),
            ArrowType::Dot => "dot".into(),
            ArrowType::Odot => "odot".into(),
            ArrowType::None => "none".into(),
            ArrowType::Empty => "empty".into(),
            ArrowType::Diamond => "diamond".into(),
            ArrowType::Ediamond => "ediamond".into(),
            ArrowType::Box => "box".into(),
            ArrowType::Open => "open".into(),
            ArrowType::Vee => "vee".into(),
            ArrowType::Inv => "inv".into(),
            ArrowType::Invdot => "invdot".into(),
            ArrowType::Invodot => "invodot".into(),
            ArrowType::Tee => "tee".into(),
            ArrowType::Invempty => "invempty".into(),
            ArrowType::Odiamond => "odiamond".into(),
            ArrowType::Crow => "crow".into(),
            ArrowType::Obox => "obox".into(),
            ArrowType::Halfopen => "halfopen".into(),
        }
    }
}