pub struct Redacted<T, R = SimpleRedactor> { /* private fields */ }Expand description
A wrapper type for redacting values, so the actual values are not accidentally printed out.
A redacted value comes with a redaction strategy. The strategy provides the Display and
Debug implementations for the inner type.
To access the redacted value proper, you must use the Redacted::unredact method.
Implementations§
Source§impl<T, R> Redacted<T, R>
impl<T, R> Redacted<T, R>
Sourcepub fn with_strategy(value: T, strategy: R) -> Self
pub fn with_strategy(value: T, strategy: R) -> Self
Create a new redacted value with a redaction strategy.
Trait Implementations§
Source§impl<T, R: RedactionStrategy<T>> Debug for Redacted<T, R>
impl<T, R: RedactionStrategy<T>> Debug for Redacted<T, R>
Source§impl<'de, T: Deserialize<'de>, R: Default> Deserialize<'de> for Redacted<T, R>
impl<'de, T: Deserialize<'de>, R: Default> Deserialize<'de> for Redacted<T, R>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T, R: RedactionStrategy<T>> Display for Redacted<T, R>
impl<T, R: RedactionStrategy<T>> Display for Redacted<T, R>
Source§impl<T: FromStr, R: Default> FromStr for Redacted<T, R>
impl<T: FromStr, R: Default> FromStr for Redacted<T, R>
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parse a value from a string with a Default redaction strategy.
use apollo_redaction::Redacted;
use apollo_redaction::strategy::SimpleRedactor;
use url::Url;
let redacted: Redacted<Url, SimpleRedactor> = "https://apollographql.com".parse().expect("it's valid");Auto Trait Implementations§
impl<T, R> Freeze for Redacted<T, R>
impl<T, R> RefUnwindSafe for Redacted<T, R>where
T: RefUnwindSafe,
R: RefUnwindSafe,
impl<T, R> Send for Redacted<T, R>
impl<T, R> Sync for Redacted<T, R>
impl<T, R> Unpin for Redacted<T, R>
impl<T, R> UnsafeUnpin for Redacted<T, R>where
T: UnsafeUnpin,
R: UnsafeUnpin,
impl<T, R> UnwindSafe for Redacted<T, R>where
T: UnwindSafe,
R: UnwindSafe,
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