pub struct UserConsent {
pub terms: String,
pub accepted_date: String,
}Expand description
User acceptance record for terms of service.
Fields§
§terms: StringIdentifier or URL of the accepted terms.
accepted_date: StringISO 8601 date when the terms were accepted.
Implementations§
Source§impl UserConsent
impl UserConsent
Sourcepub fn new(terms: impl Into<String>, accepted_date: impl Into<String>) -> Self
pub fn new(terms: impl Into<String>, accepted_date: impl Into<String>) -> Self
Construct a UserConsent record for terms-of-service acceptance.
§Parameters
terms— identifier or URL of the accepted terms of service.accepted_date— ISO 8601 date string when the terms were accepted (e.g."2025-04-07").
§Returns
A new UserConsent instance.
§Example
use cow_app_data::types::UserConsent;
let consent = UserConsent::new("https://cow.fi/tos", "2025-04-07");
assert_eq!(consent.terms, "https://cow.fi/tos");Trait Implementations§
Source§impl Clone for UserConsent
impl Clone for UserConsent
Source§fn clone(&self) -> UserConsent
fn clone(&self) -> UserConsent
Returns a duplicate 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 UserConsent
impl Debug for UserConsent
Source§impl<'de> Deserialize<'de> for UserConsent
impl<'de> Deserialize<'de> for UserConsent
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 Display for UserConsent
impl Display for UserConsent
Auto Trait Implementations§
impl Freeze for UserConsent
impl RefUnwindSafe for UserConsent
impl Send for UserConsent
impl Sync for UserConsent
impl Unpin for UserConsent
impl UnsafeUnpin for UserConsent
impl UnwindSafe for UserConsent
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.