#[non_exhaustive]
pub enum Code {
Show 14 variants MissingSecret, InvalidSecret, MissingUserIp, InvalidUserIp, MissingSiteKey, InvalidSiteKey, MissingResponse, InvalidResponse, BadRequest, InvalidAlreadySeen, SiteSecretMismatch, InvalidSecretExtWrongLen, InvalidSecretExtNotHex, Unknown(String),
}
Expand description

Error code mapping for the error responses from the hcaptcha API. Returned in the HcaptchaError type.

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.

MissingSecret

Secret key is missing.

InvalidSecret

Secret key is invalid or malformed.

MissingUserIp

User IP string is missing.

InvalidUserIp

User IP is invalid or malformed.

MissingSiteKey

Site Key string is missing.

InvalidSiteKey

Site Key is invalid or malformed.

MissingResponse

The response parameter (verification token) is missing.

InvalidResponse

The response parameter (verification token) is invalid or malformed.

BadRequest

The request is invalid or malformed.

InvalidAlreadySeen

The response parameter has already been checked, or has another issue.

SiteSecretMismatch

The sitekey is not registered with the provided secret.

InvalidSecretExtWrongLen

Extended secret check reports that the secret string is the wrong length.

InvalidSecretExtNotHex

Extended secret check reports that the secret string is not a hex string.

Unknown(String)

Collect any new error codes issued by the API.

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

Custom deserialize to map the hcaptcha API error codes for reporting as a Code in HcaptchaError.

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

Converts the given value to a String. 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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more