use std::borrow::Cow;
use serde_derive::{Deserialize, Serialize};
#[non_exhaustive]
#[derive(Serialize, Deserialize, Default, Clone, PartialEq, Eq, bon::Builder)]
#[cfg_attr(feature = "debug", derive(Debug))]
#[builder(on(_, into))]
pub struct Xml {
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<Cow<'static, str>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub namespace: Option<Cow<'static, str>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub prefix: Option<Cow<'static, str>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub attribute: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub wrapped: Option<bool>,
}
impl Xml {
pub fn new() -> Self {
Self { ..Default::default() }
}
}
#[cfg(test)]
#[cfg_attr(coverage_nightly, coverage(off))]
mod tests {
use super::Xml;
#[test]
fn xml_new() {
let xml = Xml::new();
assert!(xml.name.is_none());
assert!(xml.namespace.is_none());
assert!(xml.prefix.is_none());
assert!(xml.attribute.is_none());
assert!(xml.wrapped.is_none());
}
}