pub struct VecConsumer<T>{
pub vec: Vec<T>,
pub config: ConsumerConfig<T>,
}Expand description
A consumer that collects items into a Vec.
This consumer collects all items from the stream into an internal Vec,
preserving the order in which they were received.
Fields§
§vec: Vec<T>The internal Vec where items are collected.
config: ConsumerConfig<T>Configuration for the consumer, including error handling strategy.
Implementations§
Source§impl<T> VecConsumer<T>
impl<T> VecConsumer<T>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new VecConsumer with a pre-allocated Vec capacity.
§Arguments
capacity- The initial capacity of the internalVec.
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 consumer.
§Arguments
strategy- The error handling strategy to use.
Trait Implementations§
Source§impl<T> Clone for VecConsumer<T>
impl<T> Clone for VecConsumer<T>
Source§fn clone(&self) -> VecConsumer<T>
fn clone(&self) -> VecConsumer<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> Consumer for VecConsumer<T>
impl<T> Consumer for VecConsumer<T>
Source§type InputPorts = (T,)
type InputPorts = (T,)
The input port tuple type for this consumer. Read more
Source§fn consume<'life0, 'async_trait>(
&'life0 mut self,
stream: Self::InputStream,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn consume<'life0, 'async_trait>(
&'life0 mut self,
stream: Self::InputStream,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Consumes a stream of items. Read more
Source§fn set_config_impl(&mut self, config: ConsumerConfig<T>)
fn set_config_impl(&mut self, config: ConsumerConfig<T>)
Internal implementation for setting configuration.
Source§fn get_config_impl(&self) -> &ConsumerConfig<T>
fn get_config_impl(&self) -> &ConsumerConfig<T>
Internal implementation for getting configuration.
Source§fn get_config_mut_impl(&mut self) -> &mut ConsumerConfig<T>
fn get_config_mut_impl(&mut self) -> &mut ConsumerConfig<T>
Internal implementation for getting mutable configuration.
Source§fn handle_error(&self, error: &StreamError<T>) -> ErrorAction
fn handle_error(&self, error: &StreamError<T>) -> ErrorAction
Handles an error according to the consumer’s error strategy. 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 the given item. Read more
Source§fn component_info(&self) -> ComponentInfo
fn component_info(&self) -> ComponentInfo
Returns information about this consumer component.
Source§fn with_config(&self, config: ConsumerConfig<Self::Input>) -> Self
fn with_config(&self, config: ConsumerConfig<Self::Input>) -> Self
Creates a new consumer instance with the given configuration. Read more
Source§fn set_config(&mut self, config: ConsumerConfig<Self::Input>)
fn set_config(&mut self, config: ConsumerConfig<Self::Input>)
Sets the configuration for this consumer. Read more
Source§fn config(&self) -> &ConsumerConfig<Self::Input>
fn config(&self) -> &ConsumerConfig<Self::Input>
Returns a reference to the consumer’s configuration.
Source§fn config_mut(&mut self) -> &mut ConsumerConfig<Self::Input>
fn config_mut(&mut self) -> &mut ConsumerConfig<Self::Input>
Returns a mutable reference to the consumer’s configuration.
Source§impl<T> Default for VecConsumer<T>
impl<T> Default for VecConsumer<T>
Auto Trait Implementations§
impl<T> Freeze for VecConsumer<T>
impl<T> !RefUnwindSafe for VecConsumer<T>
impl<T> Send for VecConsumer<T>
impl<T> Sync for VecConsumer<T>
impl<T> Unpin for VecConsumer<T>where
T: Unpin,
impl<T> !UnwindSafe for VecConsumer<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