servlet 1.1.0

A small application runtime with an explicit operational contract
Documentation
//! Explicit access to secret values, without accidental diagnostic formatting.

use std::fmt;

/// A value with redacted `Debug` and `Display`, and no serialization or deref impl.
/// This is an accidental-disclosure guard, not protected memory or zeroization.
#[derive(Clone)]
pub struct Secret<T>(pub(super) T);

impl<T> Secret<T> {
    /// Deliberately borrow plaintext. Its subsequent use is application-owned.
    pub fn expose(&self) -> &T {
        &self.0
    }
}
impl<T> fmt::Debug for Secret<T> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        fmt::Display::fmt(self, f)
    }
}
impl<T> fmt::Display for Secret<T> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.write_str("[REDACTED]")
    }
}