pub trait ExposeSecret {
type Inner: ?Sized;
// Required methods
fn expose_secret(&self) -> &Self::Inner;
fn len(&self) -> usize;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
Re-export of the traits. Trait for read-only access to secrets, including metadata.
Import this to enable .expose_secret(), .len(), and .is_empty().
For mutable access, see super::ExposeSecretMut.
Required Associated Types§
Required Methods§
Sourcefn expose_secret(&self) -> &Self::Inner
fn expose_secret(&self) -> &Self::Inner
Expose the secret for read-only access.
Provided Methods§
Implementors§
Source§impl ExposeSecret for Base64String
Available on crate feature encoding-base64 only.Implementation for Base64String - read-only access.
impl ExposeSecret for Base64String
encoding-base64 only.Implementation for Base64String - read-only access.
Encoding wrappers only provide read-only access to prevent invalidation of
validation invariants. The Inner type is str since encoded strings are
always valid UTF-8.
Source§impl ExposeSecret for Bech32String
Available on crate feature encoding-bech32 only.Implementation for Bech32String - read-only access.
impl ExposeSecret for Bech32String
encoding-bech32 only.Implementation for Bech32String - read-only access.
Encoding wrappers only provide read-only access to prevent invalidation of
validation invariants. The Inner type is str since encoded strings are
always valid UTF-8.
Source§impl ExposeSecret for HexString
Available on crate feature encoding-hex only.Implementation for HexString - read-only access.
impl ExposeSecret for HexString
encoding-hex only.Implementation for HexString - read-only access.
Encoding wrappers only provide read-only access to prevent invalidation of
validation invariants. The Inner type is str since encoded strings are
always valid UTF-8.
Source§impl ExposeSecret for DynamicRandom
Available on crate feature rand only.Implementation for DynamicRandom - read-only access.
impl ExposeSecret for DynamicRandom
rand only.Implementation for DynamicRandom - read-only access.
Random wrappers only provide read-only access to prevent invalidation of the
randomly generated secret. The Inner type is [u8] (slice) for compatibility
with SecureRandom trait bounds.
Source§impl ExposeSecret for Dynamic<CloneableStringInner>
Available on crate feature zeroize only.Implementation for Dynamic<CloneableStringInner> - exposes the inner wrapper.
impl ExposeSecret for Dynamic<CloneableStringInner>
zeroize only.Implementation for Dynamic<CloneableStringInner> - exposes the inner wrapper.
type Inner = CloneableStringInner
Source§impl ExposeSecret for Dynamic<CloneableVecInner>
Available on crate feature zeroize only.Implementation for Dynamic<CloneableVecInner> - exposes the inner wrapper.
impl ExposeSecret for Dynamic<CloneableVecInner>
zeroize only.Implementation for Dynamic<CloneableVecInner> - exposes the inner wrapper.
type Inner = CloneableVecInner
Source§impl ExposeSecret for Dynamic<String>
Implementation for Dynamic<String> - provides full read/write access.
impl ExposeSecret for Dynamic<String>
Implementation for Dynamic<String> - provides full read/write access.
Dynamic<String> is a core wrapper that allows both reading and mutation of secrets.
This implementation directly accesses the inner field.
Source§impl ExposeSecret for Fixed<u32>
Implementation for Fixed<u32> - provides access for test compatibility.
impl ExposeSecret for Fixed<u32>
Implementation for Fixed<u32> - provides access for test compatibility.
Source§impl<T> ExposeSecret for Dynamic<Vec<T>>
Implementation for Dynamic<Vec<T>> - provides full read/write access.
impl<T> ExposeSecret for Dynamic<Vec<T>>
Implementation for Dynamic<Vec<T>> - provides full read/write access.
Dynamic<Vec<T>> is a core wrapper that allows both reading and mutation of secrets.
This implementation directly accesses the inner field.
Source§impl<const N: usize> ExposeSecret for FixedRandom<N>
Available on crate feature rand only.Implementation for FixedRandom<N> - read-only access.
impl<const N: usize> ExposeSecret for FixedRandom<N>
rand only.Implementation for FixedRandom<N> - read-only access.
Random wrappers only provide read-only access to prevent invalidation of the
randomly generated secret. The Inner type is [u8] (slice) for compatibility
with SecureRandom trait bounds.
Source§impl<const N: usize> ExposeSecret for Fixed<CloneableArrayInner<N>>
Available on crate feature zeroize only.Implementation for Fixed<CloneableArrayInner<N>> - exposes the inner wrapper.
impl<const N: usize> ExposeSecret for Fixed<CloneableArrayInner<N>>
zeroize only.Implementation for Fixed<CloneableArrayInner<N>> - exposes the inner wrapper.