ifc_template_catalog/definition/source.rs
1//! Catalog release identity and provenance.
2
3/// Exact IFC publication edition represented by a catalog.
4#[derive(
5 Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, bincode::Encode, bincode::Decode,
6)]
7#[non_exhaustive]
8pub enum CatalogEdition {
9 /// IFC2X3 TC1.
10 Ifc2x3Tc1,
11 /// IFC4 ADD2 TC1.
12 Ifc4Add2Tc1,
13 /// IFC4X3 ADD2.
14 Ifc4x3Add2,
15}
16
17/// Per-template provenance inside a source publication.
18#[derive(Debug, Clone, PartialEq, Eq, bincode::Encode, bincode::Decode)]
19pub struct TemplateSource {
20 /// Path of the source file relative to the publication archive root.
21 pub relative_path: String,
22 /// SHA-256 of the source file's raw bytes.
23 pub sha256: String,
24}
25
26/// Reproducible source identity for a normalized snapshot.
27#[derive(Debug, Clone, PartialEq, Eq, bincode::Encode, bincode::Decode)]
28pub struct SourceManifest {
29 /// IFC publication edition this snapshot was built from.
30 pub edition: CatalogEdition,
31 /// Human-readable name of the source publication.
32 pub source_label: String,
33 /// URL the source publication was retrieved from.
34 pub source_url: String,
35 /// SHA-256 over sorted relative source paths and bytes.
36 pub sha256: String,
37 /// Number of property-set templates included in the snapshot.
38 pub property_set_count: usize,
39 /// Number of quantity-set templates included in the snapshot.
40 pub quantity_set_count: usize,
41}