pub struct TransformerConfig<T: Debug + Clone + Send + Sync> {
pub error_strategy: ErrorStrategy<T>,
pub name: Option<String>,
}Expand description
Configuration for transformers, including error handling strategy and naming.
This struct holds configuration options that can be applied to any transformer, allowing customization of error handling behavior and component identification.
Fields§
§error_strategy: ErrorStrategy<T>The error handling strategy to use when errors occur.
name: Option<String>Optional name for identifying this transformer in logs and metrics.
Implementations§
Source§impl<T: Debug + Clone + Send + Sync> TransformerConfig<T>
impl<T: Debug + Clone + Send + Sync> TransformerConfig<T>
Sourcepub fn with_error_strategy(self, strategy: ErrorStrategy<T>) -> Self
pub fn with_error_strategy(self, strategy: ErrorStrategy<T>) -> Self
Sets the error handling strategy for this transformer configuration.
§Arguments
strategy- The error handling strategy to use.
Sourcepub fn with_name(self, name: String) -> Self
pub fn with_name(self, name: String) -> Self
Sets the name for this transformer configuration.
§Arguments
name- The name to assign to this transformer.
Sourcepub fn error_strategy(&self) -> ErrorStrategy<T>
pub fn error_strategy(&self) -> ErrorStrategy<T>
Returns the current error handling strategy.
Trait Implementations§
Source§impl<T: Clone + Debug + Clone + Send + Sync> Clone for TransformerConfig<T>
impl<T: Clone + Debug + Clone + Send + Sync> Clone for TransformerConfig<T>
Source§fn clone(&self) -> TransformerConfig<T>
fn clone(&self) -> TransformerConfig<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 moreimpl<T: Debug + Clone + Send + Sync> StructuralPartialEq for TransformerConfig<T>
Auto Trait Implementations§
impl<T> Freeze for TransformerConfig<T>
impl<T> !RefUnwindSafe for TransformerConfig<T>
impl<T> Send for TransformerConfig<T>
impl<T> Sync for TransformerConfig<T>
impl<T> Unpin for TransformerConfig<T>
impl<T> !UnwindSafe for TransformerConfig<T>
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