pub struct SecretApiKey(/* private fields */);Expand description
A wrapper for API keys that redacts the value in Debug output.
This prevents accidental logging of API keys in debug output.
§Example
use yldfi_common::api::SecretApiKey;
let key = SecretApiKey::new("sk-secret-key-12345");
let debug_str = format!("{:?}", key);
assert!(debug_str.contains("REDACTED"));
assert!(!debug_str.contains("sk-secret"));
assert_eq!(key.expose(), "sk-secret-key-12345");Implementations§
Trait Implementations§
Source§impl Clone for SecretApiKey
impl Clone for SecretApiKey
Source§fn clone(&self) -> SecretApiKey
fn clone(&self) -> SecretApiKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SecretApiKey
impl Debug for SecretApiKey
Source§impl From<&str> for SecretApiKey
impl From<&str> for SecretApiKey
Auto Trait Implementations§
impl Freeze for SecretApiKey
impl RefUnwindSafe for SecretApiKey
impl Send for SecretApiKey
impl Sync for SecretApiKey
impl Unpin for SecretApiKey
impl UnwindSafe for SecretApiKey
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