use std::fmt; /// API key wrapper that avoids exposing raw credentials in formatted output. #[derive(Clone, Eq, PartialEq)] pub struct ApiKey(String); impl ApiKey { pub fn new(value: impl Into) -> Self { Self(value.into()) } pub fn expose_secret(&self) -> &str { &self.0 } } impl fmt::Debug for ApiKey { fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { formatter .debug_tuple("ApiKey") .field(&"") .finish() } } impl fmt::Display for ApiKey { fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { formatter.write_str("") } }