#[repr(C)]
pub enum ErrorCode {
    Success,
    PasswordTooShort,
    PasswordTooLong,
    InvalidPasswordFormat,
    IncompatibleOption,
    NotEnoughSpace,
    NullPtr,
    InvalidKeyLen,
}
Expand description

Error codes used in the C interface.

C interface

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

Rust C
Success LIBREAUTH_PASS_SUCCESS
PasswordTooShort LIBREAUTH_PASS_PASSWORD_TOO_SHORT
PasswordTooLong LIBREAUTH_PASS_PASSWORD_TOO_LONG
InvalidPasswordFormat LIBREAUTH_PASS_INVALID_PASSWORD_FORMAT
IncompatibleOption LIBREAUTH_PASS_INCOMPATIBLE_OPTION
NotEnoughSpace LIBREAUTH_PASS_NOT_ENOUGH_SPACE
NullPtr LIBREAUTH_PASS_NULL_PTR
InvalidKeyLen LIBREAUTH_PASS_INVALID_KEY_LEN

Variants§

§

Success

Used in C-bindings to indicate the absence of errors.

§

PasswordTooShort

The password is shorter than the minimal length.

§

PasswordTooLong

The password is longer than the maximal length.

§

InvalidPasswordFormat

The input does not respect the storage format.

§

IncompatibleOption

Some options you specified are incompatible.

§

NotEnoughSpace

Used in C-bindings to indicate the storage does not have enough space to store the data.

§

NullPtr

Used in C-bindings to indicate a NULL pointer.

§

InvalidKeyLen

Used in C-bindings to indicate an invalid key length.

Trait Implementations§

source§

impl Clone for ErrorCode

source§

fn clone(&self) -> ErrorCode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ErrorCode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Error> for ErrorCode

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<InvalidKeyLength> for ErrorCode

source§

fn from(_error: InvalidKeyLength) -> Self

Converts to this type from the input type.
source§

impl Copy for ErrorCode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.