pub trait Key:
'static
+ Sized
+ Send
+ Sync
+ Clone
+ PartialEq
+ Eq {
type Error: 'static + Send + Sync + Error;
// Required methods
fn encrypt(&self, data: &[u8]) -> Vec<u8> ⓘ;
fn decrypt(&self, data: &[u8]) -> Result<Vec<u8>, Self::Error>;
// Provided methods
fn mangle_prefix(&self) -> Vec<u8> ⓘ { ... }
fn encrypt_output(&self, object: impl ToOutput) -> Vec<u8> ⓘ { ... }
}Required Associated Types§
Required Methods§
fn encrypt(&self, data: &[u8]) -> Vec<u8> ⓘ
fn decrypt(&self, data: &[u8]) -> Result<Vec<u8>, Self::Error>
Provided Methods§
fn mangle_prefix(&self) -> Vec<u8> ⓘ
fn encrypt_output(&self, object: impl ToOutput) -> Vec<u8> ⓘ
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<O: Key, I: Key> Key for (O, I)
Inner “key” here is expected to be more of a “data filter” like compression.
impl<O: Key, I: Key> Key for (O, I)
Inner “key” here is expected to be more of a “data filter” like compression.