pub struct WindowTransformer<T: Debug + Clone + Send + Sync + 'static> {
pub size: usize,
pub config: TransformerConfig<T>,
pub _phantom: PhantomData<T>,
}Expand description
A transformer that creates sliding windows of items from a stream.
This transformer groups consecutive items into windows of a specified size, producing vectors of items as the window slides over the input stream.
Fields§
§size: usizeThe size of each window.
config: TransformerConfig<T>Configuration for the transformer, including error handling strategy.
_phantom: PhantomData<T>Phantom data to track the type parameter.
Implementations§
Source§impl<T: Debug + Clone + Send + Sync + 'static> WindowTransformer<T>
impl<T: Debug + Clone + Send + Sync + 'static> WindowTransformer<T>
Sourcepub fn new(size: usize) -> Self
pub fn new(size: usize) -> Self
Creates a new WindowTransformer with the given window size.
§Arguments
size- The size of each window.
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.
§Arguments
strategy- The error handling strategy to use.
Trait Implementations§
Source§impl<T: Clone + Debug + Clone + Send + Sync + 'static> Clone for WindowTransformer<T>
impl<T: Clone + Debug + Clone + Send + Sync + 'static> Clone for WindowTransformer<T>
Source§fn clone(&self) -> WindowTransformer<T>
fn clone(&self) -> WindowTransformer<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 + Clone + Send + Sync + 'static> Transformer for WindowTransformer<T>
impl<T: Debug + Clone + Send + Sync + 'static> Transformer for WindowTransformer<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<T>)
fn set_config_impl(&mut self, config: TransformerConfig<T>)
Sets the configuration implementation. Read more
Source§fn get_config_impl(&self) -> &TransformerConfig<T>
fn get_config_impl(&self) -> &TransformerConfig<T>
Returns a reference to the configuration implementation. Read more
Source§fn get_config_mut_impl(&mut self) -> &mut TransformerConfig<T>
fn get_config_mut_impl(&mut self) -> &mut TransformerConfig<T>
Returns a mutable reference to the configuration implementation. Read more
Source§fn handle_error(&self, error: &StreamError<T>) -> ErrorAction
fn handle_error(&self, error: &StreamError<T>) -> ErrorAction
Handles an error that occurred during stream processing. Read more
Source§fn create_error_context(&self, item: Option<T>) -> ErrorContext<T>
fn create_error_context(&self, item: Option<T>) -> ErrorContext<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<T> Freeze for WindowTransformer<T>
impl<T> !RefUnwindSafe for WindowTransformer<T>
impl<T> Send for WindowTransformer<T>
impl<T> Sync for WindowTransformer<T>
impl<T> Unpin for WindowTransformer<T>where
T: Unpin,
impl<T> !UnwindSafe for WindowTransformer<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