redacted 0.2.0

Wrappers to control debug formatting of potentially sensitive byte arrays
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Formatter that completely redacts the contents of the contained bytes

use crate::Formatter;

/// Completly redact the contents of the item
pub struct RedactContents;

impl Formatter for RedactContents {
    fn debug_fmt(
        bytes: &[u8],
        _type_name: &str,
        f: &mut std::fmt::Formatter<'_>,
    ) -> std::fmt::Result {
        write!(f, "[{} BYTES REDACTED]", bytes.len())
    }
}