use serde::{Deserialize, Serialize};
use smol_str::SmolStr;
use std::fmt::{Display, Formatter};
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Deserialize, Serialize)]
pub struct SubscriptionId(pub SmolStr);
impl Display for SubscriptionId {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
impl AsRef<str> for SubscriptionId {
fn as_ref(&self) -> &str {
&self.0
}
}
impl<S> From<S> for SubscriptionId
where
S: Into<SmolStr>,
{
fn from(input: S) -> Self {
Self(input.into())
}
}