pub struct PrivacyFilter { /* private fields */ }Expand description
Privacy filter for sanitizing telemetry events
Implementations§
Source§impl PrivacyFilter
impl PrivacyFilter
Sourcepub fn new(config: PrivacyConfig) -> Self
pub fn new(config: PrivacyConfig) -> Self
Create a new privacy filter
Sourcepub fn hash_query(&self, query: &str) -> String
pub fn hash_query(&self, query: &str) -> String
Hash a query for storage (never store raw queries)
Sourcepub fn contains_sensitive(&self, text: &str) -> bool
pub fn contains_sensitive(&self, text: &str) -> bool
Check if text contains sensitive content
Sourcepub fn sanitize_query_event(
&self,
event: QueryEvent,
) -> TelemetryResult<QueryEvent>
pub fn sanitize_query_event( &self, event: QueryEvent, ) -> TelemetryResult<QueryEvent>
Sanitize a query event
Sourcepub fn sanitize_feedback_event(
&self,
event: FeedbackEvent,
) -> TelemetryResult<FeedbackEvent>
pub fn sanitize_feedback_event( &self, event: FeedbackEvent, ) -> TelemetryResult<FeedbackEvent>
Sanitize a feedback event
Sourcepub fn sanitize_trace_event(
&self,
event: TraceEvent,
) -> TelemetryResult<TraceEvent>
pub fn sanitize_trace_event( &self, event: TraceEvent, ) -> TelemetryResult<TraceEvent>
Sanitize a trace event
Sourcepub fn add_dp_noise(&self, count: u64) -> u64
pub fn add_dp_noise(&self, count: u64) -> u64
Apply differential privacy noise to a count
Auto Trait Implementations§
impl Freeze for PrivacyFilter
impl RefUnwindSafe for PrivacyFilter
impl Send for PrivacyFilter
impl Sync for PrivacyFilter
impl Unpin for PrivacyFilter
impl UnwindSafe for PrivacyFilter
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> 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> 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>
Converts
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>
Converts
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