use derive_more::{AsRef, From}; use serde::{Deserialize, Serialize}; /// Wrapper type to prevent secrets from accidentally getting leaked into traces #[derive(From, Clone, Deserialize, Serialize, AsRef)] pub struct Secret(pub T); impl Secret { pub fn into_inner(self) -> T { self.0 } } impl std::fmt::Debug for Secret { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_str("Secret") } }