Skip to main content

Key

Trait Key 

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

Source

type Error: 'static + Send + Sync + Error

Required Methods§

Source

fn encrypt(&self, data: &[u8]) -> Vec<u8> ⓘ

Source

fn decrypt(&self, data: &[u8]) -> Result<Vec<u8>, Self::Error>

Provided Methods§

Source

fn mangle_prefix(&self) -> Vec<u8> ⓘ

Source

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<__T: Key, __M: 'static + Sized + Send + Sync + Clone + PartialEq + Eq> Key for MappedExtra<__T, __M>

Source§

type Error = <__T as Key>::Error

Source§

fn encrypt(&self, arg1: &[u8]) -> Vec<u8> ⓘ

Source§

fn decrypt(&self, arg1: &[u8]) -> Result<Vec<u8>, Self::Error>

Source§

fn mangle_prefix(&self) -> Vec<u8> ⓘ

Source§

fn encrypt_output(&self, arg1: impl ToOutput) -> Vec<u8> ⓘ

Source§

impl<__T: Key> Key for Lp<__T>

Source§

type Error = <__T as Key>::Error

Source§

fn encrypt(&self, arg1: &[u8]) -> Vec<u8> ⓘ

Source§

fn decrypt(&self, arg1: &[u8]) -> Result<Vec<u8>, Self::Error>

Source§

fn mangle_prefix(&self) -> Vec<u8> ⓘ

Source§

fn encrypt_output(&self, arg1: impl ToOutput) -> Vec<u8> ⓘ

Implementors§