pub enum SortBy {
Unsorted,
XmlName,
}
pub struct Options {
pub text_identifier: String,
pub attribute_prefix: String,
pub derive: String,
pub sort: SortBy,
}
impl Options {
pub fn quick_xml_de() -> Self {
Self {
text_identifier: "$text".to_string(),
attribute_prefix: '@'.to_string(),
derive: "Serialize, Deserialize".to_string(),
sort: SortBy::Unsorted,
}
}
pub fn serde_xml_rs() -> Self {
Self {
text_identifier: "$text".to_string(),
attribute_prefix: "".to_string(),
derive: "Serialize, Deserialize".to_string(),
sort: SortBy::Unsorted,
}
}
pub fn derive(mut self, derive: &str) -> Self {
self.derive = derive.to_string();
self
}
}