pub trait EncryptableValue {
// Required methods
fn as_bytes(&self) -> &[u8] ⓘ;
fn zeroiize(&mut self);
}Expand description
A trait to get a slice of bytes and to zeroize a data, which are the
required operations for StoreCipher::encrypt_value_data.
The goal of this trait was to call Zeroize efficiently on Vec<u8> and
&[u8]. We could call vec.iter_mut().zeroize() but the implementation of
Zeroize on Vec<u8> does a bit more than that as it clears the vector and
zeroizes the spare capacity as a best effort.
Required Methods§
Sourcefn zeroiize(&mut self)
fn zeroiize(&mut self)
Zeroize the encodable value.
Called zeroiize to avoid clashes with Zeroize::zeroize.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".