Skip to main content

transferred_core/
report.rs

1use std::time::Duration;
2
3/// Severity of a recorded coercion. `Info` = Tier 1 lossless. `Warn` = Tier 2 lossy-structural.
4/// Tier 3 (lossy-semantic) coercions are not recorded — they fail the run via `TransferredError::Coercion`.
5#[derive(Debug, Clone, Copy, PartialEq, Eq)]
6pub enum CoercionLevel {
7    /// Tier 1 lossless coercion.
8    Info,
9    /// Tier 2 lossy-structural coercion.
10    Warn,
11}
12
13/// A single type coercion applied during a run.
14#[derive(Debug, Clone)]
15pub struct Coercion {
16    /// Name of the column that was coerced.
17    pub column: String,
18    /// Source type, rendered as a string.
19    pub from: String,
20    /// Target type, rendered as a string.
21    pub to: String,
22    /// Severity of the coercion.
23    pub level: CoercionLevel,
24}
25
26/// Post-run statistics returned by `Transfer::run()`.
27#[derive(Debug, Default, Clone)]
28pub struct RunReport {
29    /// Total rows transferred.
30    pub rows: u64,
31    /// Total bytes written to the destination.
32    pub bytes_written: u64,
33    /// What the destination wrote: file paths, object URIs, `dataset.table`, etc.
34    pub written_objects: Vec<String>,
35    /// Wall-clock duration of the run.
36    pub duration: Duration,
37    /// Coercions applied during the run.
38    pub coercions: Vec<Coercion>,
39}