pub trait Encryption {
// Required methods
fn args_size(&self) -> u8;
fn public_key(&self) -> PublicKey;
fn authenticator(&self) -> Authenticator;
fn handshake(&mut self, peer: PublicKey) -> Result<(), EncryptionError>;
fn authenticate(
&mut self,
peer: Authenticator,
) -> Result<(), EncryptionError>;
fn encrypt(
&mut self,
head: &SessionHeader,
args: &mut [u8],
data: &mut [u8],
) -> Result<(), EncryptionError>;
fn decrypt(
&mut self,
head: &SessionHeader,
args: &[u8],
data: &mut [u8],
) -> Result<(), EncryptionError>;
}Required Methods§
fn args_size(&self) -> u8
fn public_key(&self) -> PublicKey
fn authenticator(&self) -> Authenticator
fn handshake(&mut self, peer: PublicKey) -> Result<(), EncryptionError>
fn authenticate(&mut self, peer: Authenticator) -> Result<(), EncryptionError>
fn encrypt( &mut self, head: &SessionHeader, args: &mut [u8], data: &mut [u8], ) -> Result<(), EncryptionError>
fn decrypt( &mut self, head: &SessionHeader, args: &[u8], data: &mut [u8], ) -> Result<(), EncryptionError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".