#[repr(C)]
pub enum ErrorCode {
    Success,
    NullPtr,
    NotEnoughSpace,
    InvalidBaseLen,
    InvalidKeyLen,
    CodeTooSmall,
    CodeTooBig,
    InvalidKey,
    InvalidPeriod,
    InvalidUTF8,
}
Expand description

Error codes used both in the rust and C interfaces.

C interface

The C interface uses an enum of type libreauth_oath_errno and the members has been renamed as follows:

Rust C
Success LIBREAUTH_OATH_SUCCESS
NullPtr LIBREAUTH_OATH_NULL_PTR
NotEnoughSpace LIBREAUTH_OATH_NOT_ENOUGH_SPACE
InvalidBaseLen LIBREAUTH_OATH_INVALID_BASE_LEN
InvalidKeyLen LIBREAUTH_OATH_INVALID_KEY_LEN
CodeTooSmall LIBREAUTH_OATH_CODE_TOO_SMALL
CodeTooBig LIBREAUTH_OATH_CODE_TOO_BIG
InvalidKey LIBREAUTH_OATH_INVALID_KEY
InvalidPeriod LIBREAUTH_OATH_INVALID_PERIOD
InvalidUTF8 LIBREAUTH_OATH_INVALID_UTF8

Variants

Success

NullPtr

NotEnoughSpace

InvalidBaseLen

InvalidKeyLen

CodeTooSmall

CodeTooBig

InvalidKey

InvalidPeriod

InvalidUTF8

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.