use serde::{Deserialize, Serialize};
use std::fmt;
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Default)]
#[serde(transparent)]
pub struct MarkupLine(pub String);
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Default)]
#[serde(transparent)]
pub struct MarkupMultiline(pub String);
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Default)]
#[serde(transparent)]
pub struct UriReference(pub String);
impl From<&str> for MarkupLine {
#[inline]
fn from(s: &str) -> Self {
Self(s.to_owned())
}
}
impl From<String> for MarkupLine {
#[inline]
fn from(s: String) -> Self {
Self(s)
}
}
impl fmt::Display for MarkupLine {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.0.fmt(f)
}
}
impl AsRef<str> for MarkupLine {
#[inline]
fn as_ref(&self) -> &str {
&self.0
}
}
impl From<&str> for MarkupMultiline {
#[inline]
fn from(s: &str) -> Self {
Self(s.to_owned())
}
}
impl From<String> for MarkupMultiline {
#[inline]
fn from(s: String) -> Self {
Self(s)
}
}
impl fmt::Display for MarkupMultiline {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.0.fmt(f)
}
}
impl AsRef<str> for MarkupMultiline {
#[inline]
fn as_ref(&self) -> &str {
&self.0
}
}
impl From<&str> for UriReference {
#[inline]
fn from(s: &str) -> Self {
Self(s.to_owned())
}
}
impl From<String> for UriReference {
#[inline]
fn from(s: String) -> Self {
Self(s)
}
}
impl fmt::Display for UriReference {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.0.fmt(f)
}
}
impl AsRef<str> for UriReference {
#[inline]
fn as_ref(&self) -> &str {
&self.0
}
}