pub struct Base64EncodingService;Expand description
Production Base64 encoding/decoding service.
This service demonstrates the complete pattern for implementing pipeline stages:
- Stateless processing (no internal state)
- Thread-safe (
Send + Sync) - Reversible operations (encode/decode)
- Type-safe configuration via
FromParameters - Proper error handling with
PipelineError
§Implementation Notes
- Position:
PreBinary- Must execute before compression/encryption - Reversibility:
true- Supports both encoding and decoding - Stage Type:
Transform- Data transformation operation - Performance: Single-pass, minimal overhead
Implementations§
Trait Implementations§
Source§impl Default for Base64EncodingService
impl Default for Base64EncodingService
Source§impl StageService for Base64EncodingService
Implementation of StageService for Base64 encoding.
impl StageService for Base64EncodingService
Implementation of StageService for Base64 encoding.
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 Base64EncodingService
impl RefUnwindSafe for Base64EncodingService
impl Send for Base64EncodingService
impl Sync for Base64EncodingService
impl Unpin for Base64EncodingService
impl UnwindSafe for Base64EncodingService
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