pub struct Response { /* private fields */ }Expand description
Result from call to verify the client’s response
Implementations§
Source§impl Response
impl Response
Sourcepub fn success(&self) -> bool
pub fn success(&self) -> bool
Get the value of the success field
§Example
let response = client.verify(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(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(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(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(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(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(request).await?;
if let Some(score_reason) = response.score_reason() {
println!("Score reasons: {:?}", score_reason);
};
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
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 Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.