use std::fmt::Display;
use std::fmt::Formatter;
use std::fmt::Result as FmtResult;
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ResourceVersion(
String,
);
impl ResourceVersion {
#[inline]
#[must_use]
pub fn new(value: impl Into<String>) -> Self {
Self(value.into())
}
#[inline]
#[must_use]
pub fn as_str(&self) -> &str {
&self.0
}
}
impl Display for ResourceVersion {
#[inline]
fn fmt(&self, formatter: &mut Formatter<'_>) -> FmtResult {
formatter.write_str(self.as_str())
}
}
impl AsRef<str> for ResourceVersion {
#[inline]
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<&str> for ResourceVersion {
#[inline]
fn from(value: &str) -> Self {
Self::new(value)
}
}
impl From<String> for ResourceVersion {
#[inline]
fn from(value: String) -> Self {
Self::new(value)
}
}