pub struct RedactedItems<'a>(pub &'a [String]);Expand description
Debug-formats a list of strings, replacing every entry wholesale with
REDACTED_PLACEHOLDER.
Unlike RedactedMapValues (which redacts only the value half of an
already-split key/value pair), this is for lists where a single entry may
not have a discernible key at all — a raw pre-parse KEY=VALUE CLI
argument may not even contain a =, and a ServerConfig::args entry can
itself be an entire --api-key sk-...-style secret. Since there is no
safe-to-keep half, the whole entry is replaced.
§Examples
use mcp_execution_core::RedactedItems;
let args = vec!["--api-key".to_string(), "sk-secret".to_string()];
let debug_output = format!("{:?}", RedactedItems(&args));
assert!(!debug_output.contains("sk-secret"));
assert!(debug_output.contains("<redacted>"));Tuple Fields§
§0: &'a [String]Trait Implementations§
Source§impl<'a> Clone for RedactedItems<'a>
impl<'a> Clone for RedactedItems<'a>
Source§fn clone(&self) -> RedactedItems<'a>
fn clone(&self) -> RedactedItems<'a>
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 moreimpl<'a> Copy for RedactedItems<'a>
Auto Trait Implementations§
impl<'a> Freeze for RedactedItems<'a>
impl<'a> RefUnwindSafe for RedactedItems<'a>
impl<'a> Send for RedactedItems<'a>
impl<'a> Sync for RedactedItems<'a>
impl<'a> Unpin for RedactedItems<'a>
impl<'a> UnsafeUnpin for RedactedItems<'a>
impl<'a> UnwindSafe for RedactedItems<'a>
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