Skip to main content

StatusCode

Enum StatusCode 

Source
#[non_exhaustive]
#[repr(u8)]
pub enum StatusCode {
Show 47 variants Success = 0, InvalidCommand = 1, InvalidParameter = 2, InvalidLength = 3, InvalidSeq = 4, Timeout = 5, ChannelBusy = 6, LockRequired = 10, InvalidChannel = 11, CborUnexpectedType = 17, InvalidCbor = 18, MissingParameter = 20, LimitExceeded = 21, UnsupportedExtension = 22, CredentialExcluded = 25, Processing = 33, InvalidCredential = 34, UserActionPending = 35, OperationPending = 36, NoOperations = 37, UnsupportedAlgorithm = 38, OperationDenied = 39, KeyStoreFull = 40, NotBusy = 41, NoOperationPending = 42, UnsupportedOption = 43, InvalidOption = 44, KeepaliveCancel = 45, NoCredentials = 46, UserActionTimeout = 47, NotAllowed = 48, PinInvalid = 49, PinBlocked = 50, PinAuthInvalid = 51, PinAuthBlocked = 52, PinNotSet = 53, PuatRequired = 54, PinPolicyViolation = 55, RequestTooLarge = 57, ActionTimeout = 58, UpRequired = 59, UvBlocked = 60, IntegrityFailure = 61, InvalidSubcommand = 62, UvInvalid = 63, UnauthorizedPermission = 64, Other = 127,
}
Expand description

CTAP2 status codes

These status codes are returned in CTAP responses to indicate success or various error conditions.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Success = 0

Successful completion of command

§

InvalidCommand = 1

Invalid command

§

InvalidParameter = 2

Invalid parameter in request

§

InvalidLength = 3

Invalid message or item length

§

InvalidSeq = 4

Invalid message sequencing

§

Timeout = 5

Message timed out

§

ChannelBusy = 6

Channel busy

§

LockRequired = 10

Command requires channel lock

§

InvalidChannel = 11

Invalid channel

§

CborUnexpectedType = 17

CBOR unexpected type

§

InvalidCbor = 18

Invalid CBOR encoding

§

MissingParameter = 20

Missing required parameter

§

LimitExceeded = 21

Limit exceeded

§

UnsupportedExtension = 22

Unsupported extension

§

CredentialExcluded = 25

Credential excluded (already exists)

§

Processing = 33

Processing (e.g. waiting for user presence)

§

InvalidCredential = 34

Invalid credential

§

UserActionPending = 35

User action pending

§

OperationPending = 36

Operation pending

§

NoOperations = 37

No operations pending

§

UnsupportedAlgorithm = 38

Unsupported algorithm

§

OperationDenied = 39

Operation denied by user

§

KeyStoreFull = 40

Key store full

§

NotBusy = 41

Not busy

§

NoOperationPending = 42

No operation pending

§

UnsupportedOption = 43

Unsupported option

§

InvalidOption = 44

Invalid option

§

KeepaliveCancel = 45

Keepalive cancel

§

NoCredentials = 46

No credentials found

§

UserActionTimeout = 47

User action timeout

§

NotAllowed = 48

Not allowed

§

PinInvalid = 49

PIN invalid

§

PinBlocked = 50

PIN blocked

§

PinAuthInvalid = 51

PIN/UV auth parameter invalid

§

PinAuthBlocked = 52

PIN/UV auth blocked

§

PinNotSet = 53

PIN not set

§

PuatRequired = 54

PIN/UV auth token required

§

PinPolicyViolation = 55

PIN policy violation

§

RequestTooLarge = 57

Request too large

§

ActionTimeout = 58

Action timeout

§

UpRequired = 59

User presence required

§

UvBlocked = 60

User verification blocked

§

IntegrityFailure = 61

Integrity failure

§

InvalidSubcommand = 62

Invalid subcommand

§

UvInvalid = 63

User verification invalid

§

UnauthorizedPermission = 64

Unauthorized permission

§

Other = 127

Other unspecified error

Implementations§

Source§

impl StatusCode

Source

pub const PinRequired: StatusCode = Self::PuatRequired

👎Deprecated:

use StatusCode::PuatRequired

Deprecated CTAP 2.0 source-level alias. Serializes as CTAP2_ERR_PUAT_REQUIRED (0x36) under the modern registry.

Source

pub const PinTokenExpired: StatusCode = Self::PinAuthInvalid

👎Deprecated:

use StatusCode::PinAuthInvalid

Deprecated CTAP 2.0 source-level alias. The 0x38 wire value is reserved in modern CTAP, so expired tokens map to PIN_AUTH_INVALID.

Source

pub fn to_u8(self) -> u8

Convert status code to byte value

Source

pub fn from_u8(value: u8) -> StatusCode

Create status code from byte value

Source

pub fn is_success(self) -> bool

Check if this is a success status

Trait Implementations§

Source§

impl Clone for StatusCode

Source§

fn clone(&self) -> StatusCode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for StatusCode

Source§

impl Debug for StatusCode

Source§

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

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

impl Display for StatusCode

Source§

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

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

impl Eq for StatusCode

Source§

impl Error for StatusCode

Available on crate feature std only.

Implement std::error::Error only when std is available

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<CredentialKeyError> for StatusCode

Source§

fn from(err: CredentialKeyError) -> StatusCode

Converts to this type from the input type.
Source§

impl From<CryptoError> for StatusCode

Source§

fn from(err: CryptoError) -> StatusCode

Converts to this type from the input type.
Source§

impl From<Error> for StatusCode

Source§

fn from(error: Error) -> Self

Converts to this type from the input type.
Source§

impl From<StatusCode> for Error

Source§

fn from(status: StatusCode) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for StatusCode

Source§

fn from(value: u8) -> StatusCode

Converts to this type from the input type.
Source§

impl FromStr for StatusCode

Source§

type Err = ParseStatusCodeError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<StatusCode, <StatusCode as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for StatusCode

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for StatusCode

Source§

fn eq(&self, other: &StatusCode) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StatusCode

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.