streamweave_tempfile/consumers/
tempfile_consumer.rs1use streamweave::ConsumerConfig;
2use streamweave_error::ErrorStrategy;
3
4pub struct TempFileConsumer {
8 pub path: std::path::PathBuf,
10 pub config: ConsumerConfig<String>,
12}
13
14impl TempFileConsumer {
15 pub fn new(path: std::path::PathBuf) -> Self {
21 Self {
22 path,
23 config: ConsumerConfig::default(),
24 }
25 }
26
27 pub fn with_error_strategy(mut self, strategy: ErrorStrategy<String>) -> Self {
29 self.config.error_strategy = strategy;
30 self
31 }
32
33 pub fn with_name(mut self, name: String) -> Self {
35 self.config.name = name;
36 self
37 }
38}