dpp_calc/co2e/parameters.rs
1//! Input parameters for the cradle-to-gate CO₂e calculator.
2
3use serde::{Deserialize, Serialize};
4
5/// One material line of the bill of materials, with its embodied-emissions factor.
6#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7pub struct MaterialFootprint {
8 /// Mass of this material in the finished product, in kilograms.
9 pub mass_kg: f64,
10 /// Embodied emissions per kilogram of this material, in kg CO₂e/kg
11 /// (e.g. from the EU JRC LCA database or ecoinvent).
12 pub emission_factor_kg_co2e_per_kg: f64,
13}
14
15/// Inputs for a single product's cradle-to-gate footprint.
16#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
17pub struct Co2eInputs {
18 /// Bill of materials with per-material emission factors.
19 pub materials: Vec<MaterialFootprint>,
20 /// Manufacturing energy consumed per unit, in kWh.
21 pub energy_kwh: f64,
22 /// Emissions per kWh of the production grid, in kg CO₂e/kWh.
23 pub grid_factor_kg_co2e_per_kwh: f64,
24}