imferno_core/assetmap/
volindex_codes.rs1use crate::diagnostics::codes::ValidationCode;
4use crate::diagnostics::{Category, Severity};
5
6#[derive(Debug, Clone, Copy, PartialEq, Eq, strum::EnumIter)]
8pub enum St429_9_2014 {
9 VolindexMissing,
11 MalformedXml,
13}
14
15impl ValidationCode for St429_9_2014 {
16 fn code(&self) -> &'static str {
17 match self {
18 Self::VolindexMissing => "ST429-9:2014:7/VolindexMissing",
19 Self::MalformedXml => "ST429-9:2014:7/MalformedXml",
20 }
21 }
22 fn description(&self) -> &'static str {
23 match self {
24 Self::VolindexMissing => "No volume-index document found in the package root.",
25 Self::MalformedXml => "The VOLINDEX.xml document is not well-formed XML.",
26 }
27 }
28 fn default_severity(&self) -> Severity {
29 match self {
30 Self::VolindexMissing => Severity::Info,
31 Self::MalformedXml => Severity::Error,
32 }
33 }
34 fn category(&self) -> Category {
35 Category::Structure
36 }
37}
38
39impl St429_9_2014 {
40 pub const ALL: &'static [Self] = &[Self::VolindexMissing, Self::MalformedXml];
41}
42
43impl From<St429_9_2014> for String {
44 fn from(c: St429_9_2014) -> String {
45 c.code().to_string()
46 }
47}