use crate::RedactionPolicy;
pub trait RedactMut {
fn redact_in_place_with(&mut self, policy: &RedactionPolicy);
#[inline]
fn redact_in_place(&mut self) {
let policy = RedactionPolicy::default();
self.redact_in_place_with(&policy);
}
#[must_use = "use the returned redacted object"]
#[inline]
fn into_redacted_with(mut self, policy: &RedactionPolicy) -> Self
where
Self: Sized,
{
self.redact_in_place_with(policy);
self
}
#[must_use = "use the returned redacted object"]
#[inline]
fn into_redacted(self) -> Self
where
Self: Sized,
{
let policy = RedactionPolicy::default();
self.into_redacted_with(&policy)
}
#[must_use = "use the returned redacted clone"]
#[inline]
fn to_redacted_with(&self, policy: &RedactionPolicy) -> Self
where
Self: Clone + Sized,
{
self.clone().into_redacted_with(policy)
}
#[must_use = "use the returned redacted clone"]
#[inline]
fn to_redacted(&self) -> Self
where
Self: Clone + Sized,
{
let policy = RedactionPolicy::default();
self.to_redacted_with(&policy)
}
}