use serde::{Deserialize, Serialize};
#[derive(Debug, PartialEq, Eq, Clone, Hash, Deserialize)]
#[serde(transparent)]
pub struct InlineMessageId(pub String);
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, Serialize)]
#[serde(transparent)]
pub struct Ref<'a>(pub &'a str);
impl InlineMessageId {
pub fn as_ref(&self) -> Ref<'_> {
Ref(&self.0)
}
}
impl<'a> Ref<'a> {
pub fn to_owned(&self) -> InlineMessageId {
InlineMessageId(self.0.into())
}
}
impl From<String> for InlineMessageId {
fn from(id: String) -> Self {
Self(id)
}
}
impl<'a> From<&'a str> for Ref<'a> {
fn from(id: &'a str) -> Self {
Self(id)
}
}
impl<'a> PartialEq<Ref<'a>> for InlineMessageId {
fn eq(&self, other: &Ref<'a>) -> bool {
self.0 == other.0
}
}
impl<'a> PartialEq<InlineMessageId> for Ref<'a> {
fn eq(&self, other: &InlineMessageId) -> bool {
self.0 == other.0
}
}