pub struct SplitTransformer<F, T>{
pub predicate: F,
pub _phantom: PhantomData<T>,
pub config: TransformerConfig<Vec<T>>,
}Expand description
A transformer that splits a stream of items into groups based on a predicate.
This transformer groups consecutive items where the predicate returns true
into separate vectors, effectively splitting the stream at points where the
predicate returns false.
Fields§
§predicate: FThe predicate function used to determine split points.
_phantom: PhantomData<T>Phantom data to track the item type parameter.
config: TransformerConfig<Vec<T>>Configuration for the transformer, including error handling strategy.
Implementations§
Source§impl<F, T> SplitTransformer<F, T>
impl<F, T> SplitTransformer<F, T>
Sourcepub fn new(predicate: F) -> Self
pub fn new(predicate: F) -> Self
Creates a new SplitTransformer with the given predicate.
§Arguments
predicate- The function to use for determining split points.
Sourcepub fn with_error_strategy(self, strategy: ErrorStrategy<Vec<T>>) -> Self
pub fn with_error_strategy(self, strategy: ErrorStrategy<Vec<T>>) -> Self
Sets the error handling strategy for this transformer.
§Arguments
strategy- The error handling strategy to use.
Trait Implementations§
Source§impl<F, T> Clone for SplitTransformer<F, T>
impl<F, T> Clone for SplitTransformer<F, T>
Source§fn clone(&self) -> SplitTransformer<F, T>
fn clone(&self) -> SplitTransformer<F, 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<F, T> Input for SplitTransformer<F, T>
impl<F, T> Input for SplitTransformer<F, T>
Source§impl<F, T> Output for SplitTransformer<F, T>
impl<F, T> Output for SplitTransformer<F, T>
Source§impl<F, T> Transformer for SplitTransformer<F, T>
impl<F, T> Transformer for SplitTransformer<F, T>
Source§type InputPorts = (T,)
type InputPorts = (T,)
The input port tuple type for this transformer. Read more
Source§type OutputPorts = (Vec<T>,)
type OutputPorts = (Vec<T>,)
The output port tuple type for this transformer. Read more
Source§fn transform(&mut self, input: Self::InputStream) -> Self::OutputStream
fn transform(&mut self, input: Self::InputStream) -> Self::OutputStream
Transforms a stream of input items into a stream of output items. Read more
Source§fn set_config_impl(&mut self, config: TransformerConfig<Vec<T>>)
fn set_config_impl(&mut self, config: TransformerConfig<Vec<T>>)
Sets the configuration implementation. Read more
Source§fn get_config_impl(&self) -> &TransformerConfig<Vec<T>>
fn get_config_impl(&self) -> &TransformerConfig<Vec<T>>
Returns a reference to the configuration implementation. Read more
Source§fn get_config_mut_impl(&mut self) -> &mut TransformerConfig<Vec<T>>
fn get_config_mut_impl(&mut self) -> &mut TransformerConfig<Vec<T>>
Returns a mutable reference to the configuration implementation. Read more
Source§fn handle_error(&self, error: &StreamError<Vec<T>>) -> ErrorAction
fn handle_error(&self, error: &StreamError<Vec<T>>) -> ErrorAction
Handles an error that occurred during stream processing. Read more
Source§fn create_error_context(&self, item: Option<Vec<T>>) -> ErrorContext<Vec<T>>
fn create_error_context(&self, item: Option<Vec<T>>) -> ErrorContext<Vec<T>>
Creates an error context for error reporting. Read more
Source§fn component_info(&self) -> ComponentInfo
fn component_info(&self) -> ComponentInfo
Returns information about the component for error reporting. Read more
Source§fn with_config(&self, config: TransformerConfig<Self::Input>) -> Self
fn with_config(&self, config: TransformerConfig<Self::Input>) -> Self
Creates a new transformer instance with the given configuration. Read more
Source§fn set_config(&mut self, config: TransformerConfig<Self::Input>)
fn set_config(&mut self, config: TransformerConfig<Self::Input>)
Sets the configuration for this transformer. Read more
Source§fn config(&self) -> &TransformerConfig<Self::Input>
fn config(&self) -> &TransformerConfig<Self::Input>
Returns a reference to the transformer’s configuration. Read more
Source§fn config_mut(&mut self) -> &mut TransformerConfig<Self::Input>
fn config_mut(&mut self) -> &mut TransformerConfig<Self::Input>
Returns a mutable reference to the transformer’s configuration. Read more
Auto Trait Implementations§
impl<F, T> Freeze for SplitTransformer<F, T>where
F: Freeze,
impl<F, T> !RefUnwindSafe for SplitTransformer<F, T>
impl<F, T> Send for SplitTransformer<F, T>
impl<F, T> Sync for SplitTransformer<F, T>where
F: Sync,
impl<F, T> Unpin for SplitTransformer<F, T>
impl<F, T> !UnwindSafe for SplitTransformer<F, 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