pub struct VecProducer<T>{
pub data: Vec<T>,
pub config: ProducerConfig<T>,
}Expand description
A producer that yields items from a Vec.
This producer iterates over all items in the Vec and produces them in order.
Fields§
§data: Vec<T>The Vec data to produce from.
config: ProducerConfig<T>Configuration for the producer, including error handling strategy.
Implementations§
Source§impl<T: Debug + Clone + Send + Sync + 'static> VecProducer<T>
impl<T: Debug + Clone + Send + Sync + 'static> VecProducer<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 producer.
§Arguments
strategy- The error handling strategy to use.
Trait Implementations§
Source§impl<T> Clone for VecProducer<T>
impl<T> Clone for VecProducer<T>
Source§fn clone(&self) -> VecProducer<T>
fn clone(&self) -> VecProducer<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> Producer for VecProducer<T>
impl<T: Debug + Clone + Send + Sync + 'static> Producer for VecProducer<T>
Source§type OutputPorts = (T,)
type OutputPorts = (T,)
The output port tuple type for this producer. Read more
Source§fn produce(&mut self) -> Self::OutputStream
fn produce(&mut self) -> Self::OutputStream
Produces a stream of items. Read more
Source§fn set_config_impl(&mut self, config: ProducerConfig<T>)
fn set_config_impl(&mut self, config: ProducerConfig<T>)
Sets the configuration implementation. Read more
Source§fn get_config_impl(&self) -> &ProducerConfig<T>
fn get_config_impl(&self) -> &ProducerConfig<T>
Returns a reference to the configuration implementation. Read more
Source§fn get_config_mut_impl(&mut self) -> &mut ProducerConfig<T>
fn get_config_mut_impl(&mut self) -> &mut ProducerConfig<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 production. 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: ProducerConfig<Self::Output>) -> Self
fn with_config(&self, config: ProducerConfig<Self::Output>) -> Self
Creates a new producer instance with the given configuration. Read more
Source§fn set_config(&mut self, config: ProducerConfig<Self::Output>)
fn set_config(&mut self, config: ProducerConfig<Self::Output>)
Sets the configuration for this producer. Read more
Source§fn config(&self) -> &ProducerConfig<Self::Output>
fn config(&self) -> &ProducerConfig<Self::Output>
Returns a reference to the producer’s configuration. Read more
Source§fn config_mut(&mut self) -> &mut ProducerConfig<Self::Output>
fn config_mut(&mut self) -> &mut ProducerConfig<Self::Output>
Returns a mutable reference to the producer’s configuration. Read more
Auto Trait Implementations§
impl<T> Freeze for VecProducer<T>
impl<T> !RefUnwindSafe for VecProducer<T>
impl<T> Send for VecProducer<T>
impl<T> Sync for VecProducer<T>
impl<T> Unpin for VecProducer<T>where
T: Unpin,
impl<T> !UnwindSafe for VecProducer<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