Skip to main content

SerializeSecret

Trait SerializeSecret 

Source
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§

Source

fn from_bytes(bytes: &[u8]) -> Result<Self>

Creates an object from a byte slice. Input should be zeroized after use.

Source

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".

Implementors§