use std::ops::Deref;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(transparent)]
pub struct Jti(String);
impl From<String> for Jti {
#[inline]
fn from(val: String) -> Self {
Self(val)
}
}
impl From<Jti> for String {
#[inline]
fn from(val: Jti) -> Self {
val.0
}
}
impl Deref for Jti {
type Target = str;
#[inline]
fn deref(&self) -> &Self::Target {
self.0.as_str()
}
}
impl Jti {
#[inline]
pub fn new_from_uuid4() -> Self {
Self(uuid::Uuid::new_v4().to_string())
}
}