use ciborium::Value;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct DocType(pub String);
impl std::fmt::Display for DocType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.0)
}
}
impl From<String> for DocType {
fn from(value: String) -> Self {
Self(value)
}
}
impl From<&str> for DocType {
fn from(value: &str) -> Self {
value.to_owned().into()
}
}
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct NameSpace(pub String);
impl std::fmt::Display for NameSpace {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.0)
}
}
impl From<String> for NameSpace {
fn from(value: String) -> Self {
Self(value)
}
}
impl From<&str> for NameSpace {
fn from(value: &str) -> Self {
value.to_owned().into()
}
}
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct DataElementIdentifier(pub String);
impl From<String> for DataElementIdentifier {
fn from(value: String) -> Self {
Self(value)
}
}
impl From<&str> for DataElementIdentifier {
fn from(value: &str) -> Self {
value.to_owned().into()
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct DataElementValue(pub Value);
impl<T: Into<Value>> From<T> for DataElementValue {
fn from(value: T) -> Self {
Self(value.into())
}
}