use super::{
redact::{PolicyApplicable, PolicyApplicableRef, RedactableMapper},
traits::RedactableWithMapper,
};
use crate::policy::RedactionPolicy;
impl PolicyApplicable for serde_json::Value {
fn apply_policy<P, M>(self, _mapper: &M) -> Self
where
P: RedactionPolicy,
M: RedactableMapper,
{
serde_json::Value::String("[REDACTED]".to_string())
}
}
impl PolicyApplicableRef for serde_json::Value {
type Output = serde_json::Value;
fn apply_policy_ref<P, M>(&self, _mapper: &M) -> Self::Output
where
P: RedactionPolicy,
M: RedactableMapper,
{
serde_json::Value::String("[REDACTED]".to_string())
}
}
impl RedactableWithMapper for serde_json::Value {
fn redact_with<M: RedactableMapper>(self, _mapper: &M) -> Self {
serde_json::Value::String("[REDACTED]".to_string())
}
}