pub struct RedactedJson(/* private fields */);Expand description
Structured diagnostics payload whose Debug never prints its contents.
Wraps a serde_json::Value while redacting it from every Debug
rendering, so accidental structured logging of a CamelError::Business
cannot leak exchange data. Structural comparison (PartialEq/Eq) and
cloning still go through the wrapped value; the payload is reachable only
through the explicit RedactedJson::as_value accessor.
§Examples
use camel_api::RedactedJson;
let data = RedactedJson::new(serde_json::json!({"secret": "hunter2"}));
assert_eq!(format!("{data:?}"), "[redacted]");
assert_eq!(data.as_value()["secret"], "hunter2");Implementations§
Trait Implementations§
Source§impl Clone for RedactedJson
impl Clone for RedactedJson
Source§impl Debug for RedactedJson
impl Debug for RedactedJson
impl Eq for RedactedJson
Source§impl PartialEq for RedactedJson
impl PartialEq for RedactedJson
impl StructuralPartialEq for RedactedJson
Auto Trait Implementations§
impl Forget for RedactedJson
impl Freeze for RedactedJson
impl Move for RedactedJson
impl RefUnwindSafe for RedactedJson
impl Send for RedactedJson
impl Sync for RedactedJson
impl Unpin for RedactedJson
impl UnsafeUnpin for RedactedJson
impl UnwindSafe for RedactedJson
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more