pub struct SecretMaterial(/* private fields */);Expand description
Sensitive byte material that is redacted and zeroized when dropped.
Implementations§
Source§impl SecretMaterial
impl SecretMaterial
Sourcepub fn new(value: Vec<u8>) -> Result<Self, SecurityContractViolation>
pub fn new(value: Vec<u8>) -> Result<Self, SecurityContractViolation>
Creates non-empty secret material.
§Errors
Returns SecurityContractViolation::EmptySecretMaterial when the
supplied material is empty.
Sourcepub fn expose_secret(&self) -> &[u8] ⓘ
pub fn expose_secret(&self) -> &[u8] ⓘ
Borrows the material for the shortest practical operation scope.
Trait Implementations§
Source§impl Debug for SecretMaterial
impl Debug for SecretMaterial
Source§impl Drop for SecretMaterial
impl Drop for SecretMaterial
Auto Trait Implementations§
impl Freeze for SecretMaterial
impl RefUnwindSafe for SecretMaterial
impl Send for SecretMaterial
impl Sync for SecretMaterial
impl Unpin for SecretMaterial
impl UnsafeUnpin for SecretMaterial
impl UnwindSafe for SecretMaterial
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