Skip to main content

Key

Trait Key 

Source
pub trait Key:
    'static
    + Sized
    + Send
    + Sync
    + Clone
    + PartialEq
    + Eq {
    type Error: Into<Error>;

    // Required methods
    fn encrypt(&self, data: &[u8]) -> Vec<u8> ;
    fn decrypt(&self, data: &[u8]) -> Result<Vec<u8>, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

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

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

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§

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>

Implementors§