pub struct PiiAttachmentsProcessor<'a> { /* private fields */ }Expand description
A PII processor for attachment files.
Implementations§
Source§impl<'a> PiiAttachmentsProcessor<'a>
impl<'a> PiiAttachmentsProcessor<'a>
Sourcepub fn new(compiled_config: &'a CompiledPiiConfig) -> Self
pub fn new(compiled_config: &'a CompiledPiiConfig) -> Self
Creates a new PiiAttachmentsProcessor from the given PII config.
Sourcepub fn scrub_attachment(&self, filename: &str, data: &mut [u8]) -> bool
pub fn scrub_attachment(&self, filename: &str, data: &mut [u8]) -> bool
Applies PII scrubbing rules to a plain attachment.
Returns true, if the attachment was modified.
Sourcepub fn scrub_utf8_filepath(
&self,
path: &mut str,
state: &ProcessingState<'_>,
) -> bool
pub fn scrub_utf8_filepath( &self, path: &mut str, state: &ProcessingState<'_>, ) -> bool
Scrub a filepath, preserving the basename.
Sourcepub fn scrub_utf16_filepath(
&self,
path: &mut WStr<LittleEndian>,
state: &ProcessingState<'_>,
) -> bool
pub fn scrub_utf16_filepath( &self, path: &mut WStr<LittleEndian>, state: &ProcessingState<'_>, ) -> bool
Scrub a filepath, preserving the basename.
Sourcepub fn scrub_json(&self, payload: &[u8]) -> Result<Vec<u8>, JsonScrubError>
pub fn scrub_json(&self, payload: &[u8]) -> Result<Vec<u8>, JsonScrubError>
Applies PII rules to the given JSON.
This function will perform PII scrubbing using serde_transcode, which means that it
does not have to read the entire document in memory but will rather perform in on a
per-item basis using a streaming approach.
Returns a scrubbed copy of the JSON document.
Source§impl PiiAttachmentsProcessor<'_>
impl PiiAttachmentsProcessor<'_>
Sourcepub fn scrub_minidump(
&self,
filename: &str,
data: &mut [u8],
) -> Result<bool, ScrubMinidumpError>
pub fn scrub_minidump( &self, filename: &str, data: &mut [u8], ) -> Result<bool, ScrubMinidumpError>
Applies PII rules to the given minidump.
This function selectively opens minidump streams in order to avoid destroying the stack memory required for minidump processing. It visits:
- All stack memory regions with
ValueType::StackMemory - All other memory regions with
ValueType::HeapMemory - Linux auxiliary streams with
ValueType::Binary
Returns true, if the minidump was modified.
Auto Trait Implementations§
impl<'a> Freeze for PiiAttachmentsProcessor<'a>
impl<'a> RefUnwindSafe for PiiAttachmentsProcessor<'a>
impl<'a> Send for PiiAttachmentsProcessor<'a>
impl<'a> Sync for PiiAttachmentsProcessor<'a>
impl<'a> Unpin for PiiAttachmentsProcessor<'a>
impl<'a> UnsafeUnpin for PiiAttachmentsProcessor<'a>
impl<'a> UnwindSafe for PiiAttachmentsProcessor<'a>
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> 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