pub struct TempFileConsumer {
pub path: PathBuf,
pub config: ConsumerConfig<String>,
}Expand description
A consumer that writes items to a temporary file.
The temporary file is managed externally and will be cleaned up when dropped.
Fields§
§path: PathBufThe temporary file path
config: ConsumerConfig<String>Configuration for the consumer
Implementations§
Source§impl TempFileConsumer
impl TempFileConsumer
Sourcepub fn new(path: PathBuf) -> Self
pub fn new(path: PathBuf) -> Self
Creates a new TempFileConsumer from a temporary file path.
§Arguments
path- Path to the temporary file
Sourcepub fn with_error_strategy(self, strategy: ErrorStrategy<String>) -> Self
pub fn with_error_strategy(self, strategy: ErrorStrategy<String>) -> Self
Sets the error handling strategy.
Trait Implementations§
Source§impl Consumer for TempFileConsumer
impl Consumer for TempFileConsumer
Source§type InputPorts = (String,)
type InputPorts = (String,)
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<String>)
fn set_config_impl(&mut self, config: ConsumerConfig<String>)
Internal implementation for setting configuration.
Source§fn get_config_impl(&self) -> &ConsumerConfig<String>
fn get_config_impl(&self) -> &ConsumerConfig<String>
Internal implementation for getting configuration.
Source§fn get_config_mut_impl(&mut self) -> &mut ConsumerConfig<String>
fn get_config_mut_impl(&mut self) -> &mut ConsumerConfig<String>
Internal implementation for getting mutable configuration.
Source§fn handle_error(&self, error: &StreamError<String>) -> ErrorAction
fn handle_error(&self, error: &StreamError<String>) -> ErrorAction
Handles an error according to the consumer’s error strategy. Read more
Source§fn create_error_context(&self, item: Option<String>) -> ErrorContext<String>
fn create_error_context(&self, item: Option<String>) -> ErrorContext<String>
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.
Auto Trait Implementations§
impl Freeze for TempFileConsumer
impl !RefUnwindSafe for TempFileConsumer
impl Send for TempFileConsumer
impl Sync for TempFileConsumer
impl Unpin for TempFileConsumer
impl !UnwindSafe for TempFileConsumer
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
Source§impl<C> ConsumerPorts for C
impl<C> ConsumerPorts for C
Source§type DefaultInputPorts = (<C as Input>::Input,)
type DefaultInputPorts = (<C as Input>::Input,)
The default input port tuple type (single port with the consumer’s input type).