use crate::traits::ToXml;
use quick_xml::Writer;
use serde::Deserialize;
use std::io::{self, Write};
const NAME: &str = "md:EncryptionMethod";
#[derive(Clone, Debug, Deserialize, Hash, Eq, PartialEq, Ord, PartialOrd)]
pub struct EncryptionMethod {
#[serde(rename = "@Algorithm")]
pub algorithm: String,
}
impl ToXml for EncryptionMethod {
fn write_xml<W: Write>(&self, writer: &mut Writer<W>) -> io::Result<()> {
writer
.create_element(NAME)
.with_attribute(("Algorithm", self.algorithm.as_str()))
.write_empty()?;
Ok(())
}
}