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
use uri::Uri;
pub enum XmlDataTypes {
String,
Decimal,
Double,
Boolean,
Date,
Long,
UnsignedLong,
Int,
Integer,
}
impl XmlDataTypes {
pub fn to_uri(&self) -> Uri {
Uri::new(self.to_string())
}
pub fn to_string(&self) -> String {
let schema_name = "http://www.w3.org/2001/XMLSchema#".to_string();
match *self {
XmlDataTypes::Boolean => schema_name + "boolean",
XmlDataTypes::Integer => schema_name + "integer",
XmlDataTypes::Decimal => schema_name + "decimal",
XmlDataTypes::Double => schema_name + "double",
XmlDataTypes::Date => schema_name + "date",
XmlDataTypes::Long => schema_name + "long",
XmlDataTypes::UnsignedLong => schema_name + "unsignedLong",
XmlDataTypes::Int => schema_name + "int",
XmlDataTypes::String => schema_name + "string",
}
}
}