#[non_exhaustive]pub enum Code {
Show 15 variants
MissingSecret,
InvalidSecret,
MissingUserIp,
InvalidUserIp,
MissingSiteKey,
InvalidSiteKey,
MissingResponse,
InvalidResponse,
BadRequest,
InvalidAlreadySeen,
SiteSecretMismatch,
InvalidSecretExtWrongLen,
InvalidSecretExtNotHex,
SecretVersionUnknown,
Unknown(String),
}Expand description
Error code mapping for the error responses from the hcaptcha API. Returned in the Error type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
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.
SecretVersionUnknown
Extended secret check identifies the version of secret by the first two characters.
If the secret is valid there may be a new version that is not yet known.
A false report can be worked around by dropping the ext feature.
hcaptcha-no-wasm = {version = "2.3.0", default-features = false, features = [rustls-backend]}Unknown(String)
Collect any new error codes issued by the API.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Code
impl<'de> Deserialize<'de> for Code
Source§fn deserialize<D>(de: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(de: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
impl Eq for Code
impl StructuralPartialEq for Code
Auto Trait Implementations§
impl Freeze for Code
impl RefUnwindSafe for Code
impl Send for Code
impl Sync for Code
impl Unpin for Code
impl UnwindSafe for Code
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.