pub fn encrypt<M: AsRef<[u8]>>(&self, message: M) -> Result<(Vec<u8>, Vec<u8>)> {
        encrypt_token_protect(
            self.0.master_key.as_bytes(),
            self.0.user_context.as_bytes(),
            message.as_ref(),
        )
    }
/// Encrypts the provided message and returns the encrypted container and the authentication
/// token (in that order).
///
/// The results can be stored or transmitted separately. You will need to provide both later
/// for successful decryption.
///
/// # Examples
///
/// You can use anything convertible into a byte slice as a message: a byte slice or an array,
/// a `Vec<u8>`, or a `String`.
///
/// ```
/// # fn main() -> Result<(), themis::Error> {
/// use themis::secure_cell::SecureCell;
///
/// let cell = SecureCell::with_key(b"password").token_protect();
///
/// cell.encrypt(b"byte string")?;
/// cell.encrypt(&[1, 2, 3, 4, 5])?;
/// cell.encrypt(vec![6, 7, 8, 9])?;
/// cell.encrypt(format!("owned string"))?;
/// # Ok(())
/// # }
/// ```
///
/// However, the message must not be empty:
///
/// ```
/// # use themis::secure_cell::SecureCell;
/// #
/// # let cell = SecureCell::with_key(b"password").token_protect();
/// #
/// assert!(cell.encrypt(&[]).is_err());
/// ```
Encrypts the provided message and returns the encrypted container and the authentication
token (in that order).

The results can be stored or transmitted separately. You will need to provide both later
for successful decryption.
Encrypts the provided message and returns the encrypted container and the authentication token ( in that order ) . The results can be stored or transmitted separately . You will need to provide both later for successful decryption .
pub fn encrypt<M: AsRef<[u8]>>(&self, message: M) -> Result<(Vec<u8>, Vec<u8>)> {
        encrypt_token_protect(
            self.0.master_key.as_bytes(),
            self.0.user_context.as_bytes(),
            message.as_ref(),
        )
    }
pub fn encrypt < M : AsRef < [ u8 ] > > ( & self , message : M ) -> Result < ( Vec < u8 > , Vec < u8 > ) > { encrypt_token_protect ( self . 0 . master_key . as_bytes ( ) , self . 0 . user_context . as_bytes ( ) , message . as_ref ( ) , ) }
Encrypts the provided message and returns the encrypted container and the authentication
token (in that order).
Encrypts the provided message and returns the encrypted container and the authentication token ( in that order ) .
&self
message
M
&self
message
M
examples
You can use anything convertible into a byte slice as a message: a byte slice or an array,
a `Vec`, or a `String`.


You can use anything convertible into a byte slice as a message : a byte slice or an array a ` Vec ` or a ` String ` .
fn main() -> result<(), themis::error> {
use themis::secure_cell::SecureCell.

let cell = SecureCell::with_key(b"password").token_protect().


use themis :: secure_cell :: SecureCell . let cell = SecureCell :: with_key ( b " password " ) . token_protect () .
ok(())
None
}


However, the message must not be empty.


However the message must not be empty .
use themis::secure_cell::securecell;
None
let cell = securecell::with_key(b"password").token_protect();
None