pub struct ConsentManager { /* private fields */ }Expand description
Manages consent records for a subject.
Implementations§
Source§impl ConsentManager
impl ConsentManager
Sourcepub fn record_consent(&mut self, consent: ConsentRecord)
pub fn record_consent(&mut self, consent: ConsentRecord)
Record a new consent.
Sourcepub fn revoke_consent(&mut self, id: &str) -> bool
pub fn revoke_consent(&mut self, id: &str) -> bool
Revoke consent by ID.
Sourcepub fn get_consent(&self, id: &str) -> Option<&ConsentRecord>
pub fn get_consent(&self, id: &str) -> Option<&ConsentRecord>
Get a consent record by ID.
Sourcepub fn find_valid_consents(
&self,
recipient: &str,
purpose: &str,
now: &str,
) -> Vec<&ConsentRecord>
pub fn find_valid_consents( &self, recipient: &str, purpose: &str, now: &str, ) -> Vec<&ConsentRecord>
Find all valid consents for a given recipient and purpose.
Sourcepub fn check_all_expiry(&mut self, now: &str)
pub fn check_all_expiry(&mut self, now: &str)
Check expiry on all records and update statuses.
Sourcepub fn consents_for_subject(&self, subject: &str) -> Vec<&ConsentRecord>
pub fn consents_for_subject(&self, subject: &str) -> Vec<&ConsentRecord>
Get all consent records for a subject.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConsentManager
impl RefUnwindSafe for ConsentManager
impl Send for ConsentManager
impl Sync for ConsentManager
impl Unpin for ConsentManager
impl UnwindSafe for ConsentManager
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