pub struct StageProcessorHelper { /* private fields */ }Expand description
Helper utility for common stage processing patterns.
This struct provides reusable methods for the common lifecycle patterns found across stage processors, reducing code duplication.
Implementations§
Source§impl StageProcessorHelper
impl StageProcessorHelper
Sourcepub fn start_timer(&self) -> Instant
pub fn start_timer(&self) -> Instant
Start timing an operation
Sourcepub fn single_item_metrics(
&self,
start_time: Instant,
success: bool,
) -> StageMetrics
pub fn single_item_metrics( &self, start_time: Instant, success: bool, ) -> StageMetrics
Create metrics for a single item operation
Sourcepub fn batch_metrics(
&self,
start_time: Instant,
success_count: usize,
failure_count: usize,
total_items: usize,
parallel: bool,
) -> StageMetrics
pub fn batch_metrics( &self, start_time: Instant, success_count: usize, failure_count: usize, total_items: usize, parallel: bool, ) -> StageMetrics
Create metrics for batch operations
Sourcepub fn wrap_result<T>(&self, data: T, metrics: StageMetrics) -> StageResult<T>
pub fn wrap_result<T>(&self, data: T, metrics: StageMetrics) -> StageResult<T>
Wrap a result with metrics
Auto Trait Implementations§
impl Freeze for StageProcessorHelper
impl RefUnwindSafe for StageProcessorHelper
impl Send for StageProcessorHelper
impl Sync for StageProcessorHelper
impl Unpin for StageProcessorHelper
impl UnwindSafe for StageProcessorHelper
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.