use super::Element;
use super::clone::{elements_to_owned, string_to_owned};
use std::borrow::Cow;
pub type DefinitionList<'t> = Vec<DefinitionListItem<'t>>;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
pub struct DefinitionListItem<'t> {
pub key_string: Cow<'t, str>,
#[serde(rename = "key")]
pub key_elements: Vec<Element<'t>>,
#[serde(rename = "value")]
pub value_elements: Vec<Element<'t>>,
}
impl DefinitionListItem<'_> {
pub fn to_owned(&self) -> DefinitionListItem<'static> {
DefinitionListItem {
key_string: string_to_owned(&self.key_string),
key_elements: elements_to_owned(&self.key_elements),
value_elements: elements_to_owned(&self.value_elements),
}
}
}