pub trait Cipher {
type Key;
type Algorithm;
// Required methods
fn new(key: Self::Key) -> Self::Algorithm;
fn encrypt(&self, message: &str) -> Result<String, &'static str>;
fn decrypt(&self, message: &str) -> Result<String, &'static str>;
}Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".