pub struct Masked<S> { /* private fields */ }Expand description
A store that redacts sensitive paths on read.
Paths matching any pattern read back as the mask value instead of
their contents; existence is preserved (a masked path that exists
reads Some(mask), a missing one reads None). Writes pass through
unchanged — masking is a read-side lens, not write protection (wrap
in ReadOnly for that).
Matching is component-wise via PathPattern: masking
gate/api_key does not mask gate/api_key_other, which a string
prefix check would.
Implementations§
Source§impl<S> Masked<S>
impl<S> Masked<S>
Sourcepub fn new(inner: S, patterns: Vec<PathPattern>) -> Self
pub fn new(inner: S, patterns: Vec<PathPattern>) -> Self
Mask paths matching patterns with the default "[masked]".
Sourcepub fn with_mask(inner: S, patterns: Vec<PathPattern>, mask: Value) -> Self
pub fn with_mask(inner: S, patterns: Vec<PathPattern>, mask: Value) -> Self
Mask with a custom mask value.
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Unwrap, returning the inner store.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Masked<S>where
S: Freeze,
impl<S> RefUnwindSafe for Masked<S>where
S: RefUnwindSafe,
impl<S> Send for Masked<S>where
S: Send,
impl<S> Sync for Masked<S>where
S: Sync,
impl<S> Unpin for Masked<S>where
S: Unpin,
impl<S> UnsafeUnpin for Masked<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Masked<S>where
S: 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