Ready to refactor XML parsing
This commit is contained in:
@ -308,6 +308,11 @@ pub struct DomainXML {
|
||||
}
|
||||
|
||||
impl DomainXML {
|
||||
/// Decode Domain structure from XML definition
|
||||
pub fn parse_xml(xml: &str) -> anyhow::Result<Self> {
|
||||
Ok(serde_xml_rs::from_str(xml)?)
|
||||
}
|
||||
|
||||
/// Turn this domain into its XML definition
|
||||
pub fn into_xml(mut self) -> anyhow::Result<String> {
|
||||
// A issue with the disks & network interface definition serialization needs them to be serialized aside
|
||||
|
@ -155,6 +155,9 @@ pub struct NetworkXML {
|
||||
}
|
||||
|
||||
impl NetworkXML {
|
||||
pub fn parse_xml(xml: &str) -> anyhow::Result<Self> {
|
||||
Ok(serde_xml_rs::from_str(xml)?)
|
||||
}
|
||||
pub fn into_xml(mut self) -> anyhow::Result<String> {
|
||||
// A issue with the IPs definition serialization needs them to be serialized aside
|
||||
let mut ips_xml = Vec::with_capacity(self.ips.len());
|
||||
|
Reference in New Issue
Block a user