Struct hcaptcha::HcaptchaResponse
source · pub struct HcaptchaResponse { /* private fields */ }
Expand description
Result from call to verify the client’s response
Implementations§
source§impl 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§
source§impl Clone for HcaptchaResponse
impl Clone for HcaptchaResponse
source§fn clone(&self) -> HcaptchaResponse
fn clone(&self) -> HcaptchaResponse
Returns a copy of the value. Read more
1.0.0 · 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 HcaptchaResponse
impl Debug for HcaptchaResponse
source§impl Default for HcaptchaResponse
impl Default for HcaptchaResponse
source§fn default() -> HcaptchaResponse
fn default() -> HcaptchaResponse
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for HcaptchaResponse
impl<'de> Deserialize<'de> for HcaptchaResponse
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
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§
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