pub struct VerificationResult {
pub valid: bool,
pub provider: ProviderId,
pub score: Option<f64>,
pub action: Option<String>,
pub hostname: Option<String>,
pub challenge_time: Option<OffsetDateTime>,
pub reasons: Vec<FailureReason>,
pub metadata: BTreeMap<String, Value>,
}Expand description
Provider-independent outcome of a CAPTCHA verification attempt.
Fields§
§valid: boolWhether the provider accepted the token.
provider: ProviderIdProvider that evaluated the token.
score: Option<f64>Risk score, commonly from 0.0 to 1.0, when provided.
action: Option<String>Action returned by the provider, when provided.
hostname: Option<String>Hostname returned by the provider, when provided.
challenge_time: Option<OffsetDateTime>Time at which the CAPTCHA challenge was issued, when provided.
reasons: Vec<FailureReason>Normalized reasons explaining an invalid result.
metadata: BTreeMap<String, Value>Provider-specific fields not represented by the stable schema.
Implementations§
Source§impl VerificationResult
impl VerificationResult
Sourcepub fn valid(provider: ProviderId) -> Self
pub fn valid(provider: ProviderId) -> Self
Creates a valid result with optional fields left empty.
Sourcepub fn invalid(provider: ProviderId, reasons: Vec<FailureReason>) -> Self
pub fn invalid(provider: ProviderId, reasons: Vec<FailureReason>) -> Self
Creates an invalid result with the supplied normalized reasons.
Trait Implementations§
Source§impl Clone for VerificationResult
impl Clone for VerificationResult
Source§fn clone(&self) -> VerificationResult
fn clone(&self) -> VerificationResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VerificationResult
impl Debug for VerificationResult
Source§impl<'de> Deserialize<'de> for VerificationResult
impl<'de> Deserialize<'de> for VerificationResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for VerificationResult
impl PartialEq for VerificationResult
Source§impl Serialize for VerificationResult
impl Serialize for VerificationResult
impl StructuralPartialEq for VerificationResult
Auto Trait Implementations§
impl Freeze for VerificationResult
impl RefUnwindSafe for VerificationResult
impl Send for VerificationResult
impl Sync for VerificationResult
impl Unpin for VerificationResult
impl UnsafeUnpin for VerificationResult
impl UnwindSafe for VerificationResult
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
Mutably borrows from an owned value. Read more