pub trait ValidateConsent {
// Required method
fn as_bool(&self) -> bool;
// Provided methods
fn accepted(&self) -> bool { ... }
fn declined(&self) -> bool { ... }
}Expand description
A trait for types that can be validated as representing consent.
This trait allows various types (like bool, String, &str) to be
interpreted as either an “accepted” or “declined” state.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl ValidateConsent for &str
Implementation of ValidateConsent for &str.
Recognizes “true”, “1”, “on”, “yes” (case-insensitive) as “accepted”.
All other string slice values are considered “declined”.
impl ValidateConsent for &str
Implementation of ValidateConsent for &str.
Recognizes “true”, “1”, “on”, “yes” (case-insensitive) as “accepted”.
All other string slice values are considered “declined”.
Source§impl ValidateConsent for String
Implementation of ValidateConsent for String.
Recognizes “true”, “1”, “on”, “yes” (case-insensitive) as “accepted”.
All other string values are considered “declined”.
impl ValidateConsent for String
Implementation of ValidateConsent for String.
Recognizes “true”, “1”, “on”, “yes” (case-insensitive) as “accepted”.
All other string values are considered “declined”.
Source§impl ValidateConsent for bool
Implementation of ValidateConsent for bool.
impl ValidateConsent for bool
Implementation of ValidateConsent for bool.
trueis considered “accepted”.falseis considered “declined”.