pub struct GenericResultBuilder<T>where
T: OperationResult,{ /* private fields */ }Expand description
Generic result builder for fluent API construction
Implementations§
Source§impl<T> GenericResultBuilder<T>where
T: OperationResult,
impl<T> GenericResultBuilder<T>where
T: OperationResult,
Sourcepub fn with_input(self, input: T::Input) -> Self
pub fn with_input(self, input: T::Input) -> Self
Sets the input data
Sourcepub fn with_output(self, output: T::Output) -> Self
pub fn with_output(self, output: T::Output) -> Self
Sets the output data
Sourcepub fn with_metrics(self, metrics: T::Metrics) -> Self
pub fn with_metrics(self, metrics: T::Metrics) -> Self
Sets the metrics
Sourcepub fn with_error(self, error: PipelineError) -> Self
pub fn with_error(self, error: PipelineError) -> Self
Sets an error and marks as failed
Sourcepub fn with_metadata(self, key: String, value: String) -> Self
pub fn with_metadata(self, key: String, value: String) -> Self
Adds metadata
Sourcepub fn with_metadata_map(self, metadata: HashMap<String, String>) -> Self
pub fn with_metadata_map(self, metadata: HashMap<String, String>) -> Self
Adds multiple metadata entries
Sourcepub fn with_warning(self, warning: String) -> Self
pub fn with_warning(self, warning: String) -> Self
Adds a warning
Sourcepub fn with_warnings(self, warnings: Vec<String>) -> Self
pub fn with_warnings(self, warnings: Vec<String>) -> Self
Adds multiple warnings
Sourcepub fn duration(&self) -> Option<Duration>
pub fn duration(&self) -> Option<Duration>
Gets the duration if both start and end times are set
Sourcepub fn build(self) -> Result<T, PipelineError>
pub fn build(self) -> Result<T, PipelineError>
Builds the final result
Sourcepub fn build_with_error(self) -> T
pub fn build_with_error(self) -> T
Builds the result with error handling
§Panics
This convenience method will panic if the build fails. This is
intentional for use cases where the caller knows the build cannot
fail. For error handling, use build() instead.
Trait Implementations§
Source§impl<T> Clone for GenericResultBuilder<T>
impl<T> Clone for GenericResultBuilder<T>
Source§fn clone(&self) -> GenericResultBuilder<T>
fn clone(&self) -> GenericResultBuilder<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for GenericResultBuilder<T>
impl<T> Debug for GenericResultBuilder<T>
Source§impl<T> Default for GenericResultBuilder<T>where
T: OperationResult,
impl<T> Default for GenericResultBuilder<T>where
T: OperationResult,
Auto Trait Implementations§
impl<T> Freeze for GenericResultBuilder<T>where
<T as OperationResult>::Metrics: Freeze,
<T as OperationResult>::Input: Freeze,
<T as OperationResult>::Output: Freeze,
impl<T> RefUnwindSafe for GenericResultBuilder<T>where
<T as OperationResult>::Metrics: RefUnwindSafe,
<T as OperationResult>::Input: RefUnwindSafe,
<T as OperationResult>::Output: RefUnwindSafe,
impl<T> Send for GenericResultBuilder<T>
impl<T> Sync for GenericResultBuilder<T>
impl<T> Unpin for GenericResultBuilder<T>where
<T as OperationResult>::Metrics: Unpin,
<T as OperationResult>::Input: Unpin,
<T as OperationResult>::Output: Unpin,
impl<T> UnwindSafe for GenericResultBuilder<T>where
<T as OperationResult>::Metrics: UnwindSafe,
<T as OperationResult>::Input: UnwindSafe,
<T as OperationResult>::Output: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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