Enum onionsalt::crypto::NaClError [] [src]

pub enum NaClError {
    AuthFailed,
    WrongKey,
    IOError(Error),
    RecvError(RecvError),
}

The error return type. You can get errors for only one of three reasons:

  1. You passed in slices that were the wrong sizes. This is your bug, and we would be justified in panicking for this.

  2. You called an "open" function, and the message failed to authenticate. This is only a bug if you thought the message should be valid. But you need to handle this, since presumable some bad person could try to corrupt your data.

  3. If you are generating random data (either generating keys or a nonce), you could in principle encounter an IO error. This should be unusual, but could happen.

Variants

Trait Implementations

impl Debug for NaClError
[src]

Formats the value using the given formatter.

impl From<Error> for NaClError
[src]

Performs the conversion.

impl From<RecvError> for NaClError
[src]

Performs the conversion.

impl<'a> From<&'a str> for NaClError
[src]

Performs the conversion.