pub trait SerializeSecret: Sized {
// Required methods
fn from_bytes(bytes: &[u8]) -> Result<Self>;
fn to_bytes_zeroizing(&self) -> ZeroizingBytes;
}Expand description
A trait for secret types that can be securely serialized.
Required Methods§
Sourcefn from_bytes(bytes: &[u8]) -> Result<Self>
fn from_bytes(bytes: &[u8]) -> Result<Self>
Creates an object from a byte slice. Input should be zeroized after use.
Sourcefn to_bytes_zeroizing(&self) -> ZeroizingBytes
fn to_bytes_zeroizing(&self) -> ZeroizingBytes
Converts the object to exact-size bytes that are zeroized on drop.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".