rite_model/material.rs
1//! Material source types for the ceremony IR.
2
3use serde::{Deserialize, Serialize};
4use std::path::PathBuf;
5
6/// Source for a ceremony material.
7///
8/// A material is either a digital file (loaded at runtime) or a physical item
9/// identified by a human-readable string (serial number, label, batch code).
10///
11/// `MaterialSource` appears in the IR's [`super::MaterialKind`] after the resolver
12/// has merged ceremony defaults with `--material` CLI overrides.
13#[derive(Debug, Clone, Serialize, Deserialize)]
14#[serde(untagged)]
15pub enum MaterialSource {
16 /// Load material content from a file.
17 File {
18 /// Path to the file containing the material.
19 file: PathBuf,
20 },
21 /// Human-readable identifier for a physical item (e.g., serial number).
22 Identifier {
23 /// Display identifier for a physical material.
24 identifier: String,
25 },
26}