pub trait StateEncryption {
// Required methods
fn encrypt(&self, plain_text: impl Display) -> Result<Vec<u8>>;
fn decrypt(&self, encoded_text: impl AsRef<[u8]>) -> Result<String>;
}Expand description
StateEncryption trait. An encryption/decryption struct must implement this trait.
Only has 2: encrypt and decrypt
Required Methods§
fn encrypt(&self, plain_text: impl Display) -> Result<Vec<u8>>
fn decrypt(&self, encoded_text: impl AsRef<[u8]>) -> Result<String>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".