Skip to main content

StateEncryption

Trait StateEncryption 

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

Source

fn encrypt(&self, plain_text: impl Display) -> Result<Vec<u8>>

Source

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

Implementors§