redacted 0.2.0

Wrappers to control debug formatting of potentially sensitive byte arrays
Documentation
//! Trait for controlling the formatting of a [`Redacted`](crate::Redacted) instance, and implementations there of

#[cfg(feature = "hex")]
mod hex_impl;
mod redact_contents;

#[cfg(feature = "hex")]
pub use hex_impl::{FullHex, TruncHex};
pub use redact_contents::RedactContents;

/// Formatter
#[allow(clippy::missing_errors_doc)]
pub trait Formatter {
    /// Debugging format for the type
    fn debug_fmt(
        bytes: &[u8],
        type_name: &str,
        f: &mut std::fmt::Formatter<'_>,
    ) -> std::fmt::Result;
    /// Display format for the type
    fn display_fmt(
        bytes: &[u8],
        type_name: &str,
        f: &mut std::fmt::Formatter<'_>,
    ) -> std::fmt::Result {
        Self::debug_fmt(bytes, type_name, f)
    }
}