pub struct SecretRegistry { /* private fields */ }Expand description
Registry for managing secrets that should be masked in AI outputs.
Secrets are registered with a name and value, and optionally a custom mask.
The registry can mask occurrences of secret values in text, and inject
secret values into templates using {{secret:name}} syntax.
Implementations§
Source§impl SecretRegistry
impl SecretRegistry
pub fn new() -> Self
Sourcepub fn register(&self, name: &str, value: &str)
pub fn register(&self, name: &str, value: &str)
Register a secret with default mask [REDACTED:name].
Sourcepub fn register_with_mask(&self, name: &str, value: &str, mask: &str)
pub fn register_with_mask(&self, name: &str, value: &str, mask: &str)
Register a secret with a custom mask string.
Sourcepub fn mask_output(&self, text: &str) -> String
pub fn mask_output(&self, text: &str) -> String
Replace all secret values in the text with their masks.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SecretRegistry
impl RefUnwindSafe for SecretRegistry
impl Send for SecretRegistry
impl Sync for SecretRegistry
impl Unpin for SecretRegistry
impl UnsafeUnpin for SecretRegistry
impl UnwindSafe for SecretRegistry
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