use std::fmt; #[derive(sqlx::Type)] #[sqlx(transparent)] pub struct Secret(String); impl Secret { pub fn reveal(self) -> String { let Self(secret) = self; secret } } impl fmt::Debug for Secret { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("IdentityToken").field(&"********").finish() } } impl From for Secret where S: Into, { fn from(value: S) -> Self { Self(value.into()) } }