Struct hcaptcha::HcaptchaResponse
source · pub struct HcaptchaResponse { /* private fields */ }
Expand description
Result from call to verify the client’s response
Implementations
sourceimpl HcaptchaResponse
impl HcaptchaResponse
sourcepub fn success(&self) -> bool
pub fn success(&self) -> bool
Get the value of the success field
Example
let response = client.verify_client_response(request).await?;
println!("Success returns true: {}", response.success());
sourcepub fn hostname(&self) -> Option<String>
pub fn hostname(&self) -> Option<String>
Get the value of the hostname field
Example
let response = client.verify_client_response(request).await?;
if let Some(hostname) = response.hostname() {
println!("Timestamp: {}", hostname);
};
sourcepub fn timestamp(&self) -> Option<String>
pub fn timestamp(&self) -> Option<String>
Get the value of the timestamp field
Example
let response = client.verify_client_response(request).await?;
if let Some(timestamp) = response.timestamp() {
println!("Timestamp: {}", timestamp);
};
sourcepub fn credit(&self) -> Option<bool>
pub fn credit(&self) -> Option<bool>
Get the value of the credit field
Example
let response = client.verify_client_response(request).await?;
if let Some(credit) = response.credit() {
println!("Timestamp: {}", credit);
};
sourcepub fn error_codes(&self) -> Option<HashSet<Code>>
pub fn error_codes(&self) -> Option<HashSet<Code>>
Get the value of the error_codes field
Example
let response = client.verify_client_response(request).await?;
if let Some(error_codes) = response.error_codes() {
println!("Error Codes: {:?}", error_codes);
};
sourcepub fn score(&self) -> Option<f32>
Available on crate feature enterprise
only.
pub fn score(&self) -> Option<f32>
enterprise
only.Get the value of the score field
Example
let response = client.verify_client_response(request).await?;
if let Some(score) = response.score() {
println!("Score: {}", score);
};
sourcepub fn score_reason(&self) -> Option<HashSet<String>>
Available on crate feature enterprise
only.
pub fn score_reason(&self) -> Option<HashSet<String>>
enterprise
only.Get the value of the score_reason field
Example
let response = client.verify_client_response(request).await?;
if let Some(score_reason) = response.score_reason() {
println!("Score reasons: {:?}", score_reason);
};
Trait Implementations
sourceimpl Clone for HcaptchaResponse
impl Clone for HcaptchaResponse
sourcefn clone(&self) -> HcaptchaResponse
fn clone(&self) -> HcaptchaResponse
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for HcaptchaResponse
impl Debug for HcaptchaResponse
sourceimpl Default for HcaptchaResponse
impl Default for HcaptchaResponse
sourcefn default() -> HcaptchaResponse
fn default() -> HcaptchaResponse
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for HcaptchaResponse
impl<'de> Deserialize<'de> for HcaptchaResponse
sourcefn 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
Auto Trait Implementations
impl RefUnwindSafe for HcaptchaResponse
impl Send for HcaptchaResponse
impl Sync for HcaptchaResponse
impl Unpin for HcaptchaResponse
impl UnwindSafe for HcaptchaResponse
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more