pub fn encrypt<T>(&self, plaintext: &T) -> Result<Vec<u8>, EncryptionError>
    where
        T: Serialize,
    {
        self.encrypt_bytes(&serialize(plaintext)?)
    }
/// Encrypts serialisable `plaintext` using authenticated encryption.
///
/// With authenticated encryption the recipient will be able to verify the authenticity
/// of the sender using a sender's public key.
/// If you wish to encrypt bytestring plaintext, use `encrypt_bytes`.
/// If you want to use anonymous encryption, use the functions provided by `PublicKeys`
/// and `SecretKeys`.
///
/// Returns ciphertext in case of success.
/// Can return an `Error` in case of a serialisation error.
Encrypts serialisable `plaintext` using authenticated encryption.
With authenticated encryption the recipient will be able to verify the authenticity
of the sender using a sender's public key.
If you wish to encrypt bytestring plaintext, use `encrypt_bytes`.
If you want to use anonymous encryption, use the functions provided by `PublicKeys`
and `SecretKeys`.

Returns ciphertext in case of success.
Can return an `Error` in case of a serialisation error.
Encrypts serialisable ` plaintext ` using authenticated encryption . With authenticated encryption the recipient will be able to verify the authenticity of the sender using a sender ' s public key . If you wish to encrypt bytestring plaintext use ` encrypt_bytes ` . If you want to use anonymous encryption use the functions provided by ` PublicKeys ` and ` SecretKeys ` . Returns ciphertext in case of success . Can return an ` Error ` in case of a serialisation error .
pub fn encrypt<T>(&self, plaintext: &T) -> Result<Vec<u8>, EncryptionError>
    where
        T: Serialize,
    {
        self.encrypt_bytes(&serialize(plaintext)?)
    }
pub fn encrypt < T > ( & self , plaintext : & T ) -> Result < Vec < u8 > , EncryptionError > where T : Serialize , { self . encrypt_bytes ( & serialize ( plaintext ) ? ) }
Encrypts serialisable `plaintext` using authenticated encryption.
Encrypts serialisable ` plaintext ` using authenticated encryption .
&self
plaintext
&T
&self
plaintext
&T