Skip to main content

Censor

Trait Censor 

Source
pub trait Censor {
    // Required method
    fn censor(&mut self);

    // Provided method
    fn censored(self) -> Self
       where Self: Sized { ... }
}
Expand description

Implemented by values carrying secrets, so each one names its own instead of a central list having to track them.

Censoring happens in place and on an owned value rather than during serialization: the same serde::Serialize impls back both the API responses and the jsonb columns these values are stored in, so a serializer that censored would write the placeholder to the database.

Required Methods§

Source

fn censor(&mut self)

Overwrite every secret this value carries, leaving everything else intact.

Provided Methods§

Source

fn censored(self) -> Self
where Self: Sized,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Censor for Config

Source§

fn censor(&mut self)

Source§

impl Censor for Config

Source§

fn censor(&mut self)

Source§

impl<T: Censor> Censor for Option<T>

Source§

fn censor(&mut self)

Implementors§