pub struct EmailRedactor;Expand description
Redact email addresses.
use apollo_redaction::Redacted;
use apollo_redaction::strategy::EmailRedactor;
fn email(input: &str) -> String {
Redacted::<_, EmailRedactor>::new(input).to_string()
}
assert_eq!(email("user@example.com"), "u***r@example.com");
assert_eq!(email("ab@example.com"), "***@example.com");Trait Implementations§
Source§impl Clone for EmailRedactor
impl Clone for EmailRedactor
Source§fn clone(&self) -> EmailRedactor
fn clone(&self) -> EmailRedactor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for EmailRedactor
impl Default for EmailRedactor
Source§fn default() -> EmailRedactor
fn default() -> EmailRedactor
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EmailRedactor
impl RefUnwindSafe for EmailRedactor
impl Send for EmailRedactor
impl Sync for EmailRedactor
impl Unpin for EmailRedactor
impl UnsafeUnpin for EmailRedactor
impl UnwindSafe for EmailRedactor
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