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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! Enums for XLink.

use std::fmt::{Display, Formatter};

/// See §5.6.2 of XLink.
#[derive(Debug, Clone, Copy)]
pub enum XLinkActuate {
    ///
    OnLoad,
    ///
    OnRequest,
}

impl Display for XLinkActuate {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        match self {
            XLinkActuate::OnLoad => write!(f, "OnLoad"),
            XLinkActuate::OnRequest => write!(f, "OnRequest"),
        }
    }
}

/// See §5.6.1 of XLink.
#[derive(Debug, Clone, Copy)]
pub enum XLinkShow {
    ///
    New,
    ///
    Replace,
}

impl Display for XLinkShow {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        match self {
            XLinkShow::New => write!(f, "new"),
            XLinkShow::Replace => write!(f, "replace"),
        }
    }
}

/// See §3.2 of XLink.
#[derive(Debug, Clone, Copy, Default)]
pub enum XLinkType {
    ///
    #[default]
    Simple,
    ///
    Extended,
    ///
    Locator,
    ///
    Arc,
    ///
    Resource,
    ///
    Title,
    ///
    None,
}

impl Display for XLinkType {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        match self {
            XLinkType::Simple => write!(f, "simple"),
            XLinkType::Extended => write!(f, "extended"),
            XLinkType::Locator => write!(f, "locator"),
            XLinkType::Arc => write!(f, "arc"),
            XLinkType::Resource => write!(f, "resource"),
            XLinkType::Title => write!(f, "title"),
            XLinkType::None => write!(f, "none"),
        }
    }
}