pub struct GdprManager { /* private fields */ }Expand description
GDPR compliance manager
Implementations§
Source§impl GdprManager
impl GdprManager
Sourcepub async fn register_consent(
&self,
user_id: String,
category: DataCategory,
purpose: String,
legal_basis: String,
) -> Result<(), AppError>
pub async fn register_consent( &self, user_id: String, category: DataCategory, purpose: String, legal_basis: String, ) -> Result<(), AppError>
Register consent for data processing
Sourcepub async fn withdraw_consent(
&self,
user_id: &str,
category: &DataCategory,
) -> Result<(), AppError>
pub async fn withdraw_consent( &self, user_id: &str, category: &DataCategory, ) -> Result<(), AppError>
Withdraw consent for data processing
Sourcepub async fn has_consent(&self, user_id: &str, category: &DataCategory) -> bool
pub async fn has_consent(&self, user_id: &str, category: &DataCategory) -> bool
Check if user has given consent for a data category
Sourcepub async fn export_user_data(&self, user_id: &str) -> Result<Value, AppError>
pub async fn export_user_data(&self, user_id: &str) -> Result<Value, AppError>
Export all user data (GDPR Article 20)
Sourcepub async fn register_data_location(
&self,
category: DataCategory,
path: PathBuf,
)
pub async fn register_data_location( &self, category: DataCategory, path: PathBuf, )
Register data location for tracking
Sourcepub async fn audit_data_operation(
&self,
user_id: String,
operation: DataOperation,
category: DataCategory,
details: String,
legal_basis: String,
)
pub async fn audit_data_operation( &self, user_id: String, operation: DataOperation, category: DataCategory, details: String, legal_basis: String, )
Audit data operation
Sourcepub async fn get_user_audit_trail(&self, user_id: &str) -> Vec<DataAuditEntry>
pub async fn get_user_audit_trail(&self, user_id: &str) -> Vec<DataAuditEntry>
Get audit trail for a specific user
Sourcepub async fn get_audit_trail(&self, limit: Option<usize>) -> Vec<DataAuditEntry>
pub async fn get_audit_trail(&self, limit: Option<usize>) -> Vec<DataAuditEntry>
Get full audit trail
Sourcepub async fn get_user_consents(&self, user_id: &str) -> Vec<ConsentRecord>
pub async fn get_user_consents(&self, user_id: &str) -> Vec<ConsentRecord>
Get consent status for user
Source§impl GdprManager
impl GdprManager
Sourcepub async fn delete_user_data(
&self,
user_id: &str,
verify: bool,
) -> Result<Vec<String>, AppError>
pub async fn delete_user_data( &self, user_id: &str, verify: bool, ) -> Result<Vec<String>, AppError>
Delete all user data (GDPR Article 17 - Right to be forgotten).
If verify is true, this does not delete anything; it returns a list of
items that would be deleted.
Note: this function intentionally avoids holding async lock guards across
.await points (e.g., while deleting files) to prevent deadlocks and satisfy
clippy::await_holding_lock.
Source§impl GdprManager
impl GdprManager
Sourcepub async fn generate_privacy_report(&self) -> Value
pub async fn generate_privacy_report(&self) -> Value
Generate a privacy report summarizing stored GDPR-related metadata.
This report is intended for administrative visibility and does not contain raw user data. It includes counts for consents, audit entries, and tracked data locations.
Auto Trait Implementations§
impl Freeze for GdprManager
impl !RefUnwindSafe for GdprManager
impl Send for GdprManager
impl Sync for GdprManager
impl Unpin for GdprManager
impl !UnwindSafe for GdprManager
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].