1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! CSV adapter — read and write comma-separated values files.
//!
//! Provides one read function and a fluent write operator:
//!
//! - [`csv_read`] — producer that emits each tick's records as a [`Burst<T>`]
//! - [`CsvOperators::csv_write`] — consumer that writes a `Burst<T>` stream to a CSV file
//!
//! Record types must implement [`serde::Serialize`] and [`serde::de::DeserializeOwned`].
//!
//! # Reading
//!
//! ```ignore
//! use wingfoil::adapters::csv::*;
//! use wingfoil::*;
//!
//! #[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
//! struct Row { timestamp: u64, value: f64 }
//!
//! // Multiple rows with the same timestamp arrive as a Burst.
//! // Use .collapse() when the source is strictly ascending.
//! csv_read("data.csv", |r: &Row| NanoTime::new(r.timestamp), true)
//! .collapse()
//! .for_each(|row, _| println!("{:?}", row))
//! .run(RunMode::HistoricalFrom(NanoTime::ZERO), RunFor::Forever)
//! .unwrap();
//! ```
//!
//! # Writing
//!
//! ```ignore
//! use wingfoil::adapters::csv::*;
//! use wingfoil::*;
//!
//! csv_read("input.csv", get_time, true)
//! .csv_write("output.csv")
//! .run(RunMode::HistoricalFrom(NanoTime::ZERO), RunFor::Forever)
//! .unwrap();
//! ```
pub use *;
pub use *;