pub struct PiiMaskingService;Expand description
Production PII masking service.
This service demonstrates the complete pattern for implementing pipeline stages:
- Stateless processing (no internal state)
- Thread-safe (
Send + Sync) - Non-reversible operation (masking cannot be undone)
- Type-safe configuration via
FromParameters - Proper error handling with
PipelineError
§Implementation Notes
- Position:
PreBinary- Must execute before compression/encryption - Reversibility:
false- Masking is one-way (Reverse returns error) - Stage Type:
Transform- Data transformation operation - Performance: Regex-based matching with compiled patterns
Implementations§
Trait Implementations§
Source§impl Default for PiiMaskingService
impl Default for PiiMaskingService
Source§impl StageService for PiiMaskingService
Implementation of StageService for PII masking.
impl StageService for PiiMaskingService
Implementation of StageService for PII masking.
This demonstrates the complete pattern that all stages follow:
- Extract typed config via
FromParameters - Dispatch based on
Operation(Forward/Reverse) - Process the chunk
- Update metrics in context
- Return processed chunk
Source§fn process_chunk(
&self,
chunk: FileChunk,
config: &StageConfiguration,
context: &mut ProcessingContext,
) -> Result<FileChunk, PipelineError>
fn process_chunk( &self, chunk: FileChunk, config: &StageConfiguration, context: &mut ProcessingContext, ) -> Result<FileChunk, PipelineError>
Process a file chunk according to the operation (Forward or Reverse). Read more
Source§fn position(&self) -> StagePosition
fn position(&self) -> StagePosition
Returns the position where this stage can execute in the pipeline. Read more
Source§fn is_reversible(&self) -> bool
fn is_reversible(&self) -> bool
Indicates whether this stage supports reverse operations. Read more
Source§fn stage_type(&self) -> StageType
fn stage_type(&self) -> StageType
Returns the type classification of this stage. Read more
Auto Trait Implementations§
impl Freeze for PiiMaskingService
impl RefUnwindSafe for PiiMaskingService
impl Send for PiiMaskingService
impl Sync for PiiMaskingService
impl Unpin for PiiMaskingService
impl UnwindSafe for PiiMaskingService
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