pub struct PrivacyManager { /* private fields */ }Expand description
Privacy manager handles consent and privacy settings
Implementations§
Source§impl PrivacyManager
impl PrivacyManager
Sourcepub fn new(config: PrivacyConfig, service_name: &str) -> Result<Self>
pub fn new(config: PrivacyConfig, service_name: &str) -> Result<Self>
Create a new privacy manager
Sourcepub fn should_track(&self) -> Result<bool>
pub fn should_track(&self) -> Result<bool>
Check if tracking should proceed
Sourcepub fn is_do_not_track_enabled() -> bool
pub fn is_do_not_track_enabled() -> bool
Check if DO_NOT_TRACK environment variable is set
Sourcepub fn load_consent(&self) -> Result<ConsentInfo>
pub fn load_consent(&self) -> Result<ConsentInfo>
Load consent information from disk
Sourcepub fn save_consent(
&self,
status: ConsentStatus,
service_name: &str,
) -> Result<()>
pub fn save_consent( &self, status: ConsentStatus, service_name: &str, ) -> Result<()>
Save consent information to disk
Sourcepub fn grant_consent(&self, service_name: &str) -> Result<()>
pub fn grant_consent(&self, service_name: &str) -> Result<()>
Grant consent for tracking
Sourcepub fn deny_consent(&self, service_name: &str) -> Result<()>
pub fn deny_consent(&self, service_name: &str) -> Result<()>
Deny consent for tracking
Sourcepub fn opt_out(&self, service_name: &str) -> Result<()>
pub fn opt_out(&self, service_name: &str) -> Result<()>
Opt out of tracking (DO_NOT_TRACK equivalent)
Sourcepub fn sanitize_path(path: &str) -> String
pub fn sanitize_path(path: &str) -> String
Sanitize a path by removing username components
Sourcepub fn sanitize_email(email: &str) -> String
pub fn sanitize_email(email: &str) -> String
Sanitize an email address by hashing it
Sourcepub fn sanitize_data(&self, data: &mut Value)
pub fn sanitize_data(&self, data: &mut Value)
Apply sanitization to data based on config
Auto Trait Implementations§
impl Freeze for PrivacyManager
impl RefUnwindSafe for PrivacyManager
impl Send for PrivacyManager
impl Sync for PrivacyManager
impl Unpin for PrivacyManager
impl UnwindSafe for PrivacyManager
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