pub struct StdoutConsumer<T>{
pub config: ConsumerConfig<T>,
}Expand description
A consumer that writes items to standard output (stdout).
This consumer writes each item from the stream to stdout, one per line. It’s useful for building command-line tools that output to stdout.
§Example
use streamweave_stdio::StdoutConsumer;
use streamweave::Pipeline;
let consumer = StdoutConsumer::new();
let pipeline = Pipeline::new()
.producer(/* ... */)
.transformer(/* ... */)
.consumer(consumer);Fields§
§config: ConsumerConfig<T>Configuration for the consumer, including error handling strategy.
Implementations§
Source§impl<T> StdoutConsumer<T>
impl<T> StdoutConsumer<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 consumer.
§Arguments
strategy- The error handling strategy to use.
Trait Implementations§
Source§impl<T> Consumer for StdoutConsumer<T>
impl<T> Consumer for StdoutConsumer<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 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 StdoutConsumer<T>
impl<T> Default for StdoutConsumer<T>
Auto Trait Implementations§
impl<T> Freeze for StdoutConsumer<T>
impl<T> !RefUnwindSafe for StdoutConsumer<T>
impl<T> Send for StdoutConsumer<T>
impl<T> Sync for StdoutConsumer<T>
impl<T> Unpin for StdoutConsumer<T>
impl<T> !UnwindSafe for StdoutConsumer<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