Skip to main content

einvoice_xsd/
licences.rs

1//! The licences of the crate, with their texts, embedded from `LICENSES/`.
2
3/// A licence under which part of a crate is distributed: one term of the crate's
4/// licence expression, what it covers, and its full text, as shipped in the crate's
5/// `LICENSES/` directory.
6///
7/// A program that embeds the crate can show these texts to its users (the W3C licence
8/// of the XML Signature schema asks for its notice "in a location viewable to users").
9#[derive(Debug, Clone, Copy, PartialEq, Eq)]
10pub struct Licence {
11    /// The SPDX identifier, or `LicenseRef-` reference, of the licence expression.
12    pub id: &'static str,
13    /// What it covers, in a sentence.
14    pub covers: &'static str,
15    /// The full text.
16    pub text: &'static str,
17}
18
19/// The licences of this crate, one per term of its licence expression (`MIT AND
20/// LicenseRef-OASIS-Copyright-Notice AND LicenseRef-UN-CEFACT-Copyright-Notice AND
21/// W3C-19980720`): its code, then the three sets of terms of the embedded UBL 2.1
22/// schemas ([`UBL_2_1_FILES`](crate::UBL_2_1_FILES)).
23pub const LICENCES: &[Licence] = &[
24    Licence {
25        id: "MIT",
26        covers: "the code of einvoice-xsd",
27        text: include_str!("../LICENSES/MIT.txt"),
28    },
29    Licence {
30        id: "LicenseRef-OASIS-Copyright-Notice",
31        covers: "the OASIS UBL 2.1 schema modules embedded by einvoice-xsd \
32                 (xsd/maindoc/UBL-*-2.1.xsd and xsd/common/UBL-*-2.1.xsd, except \
33                 UBL-xmldsig-core-schema-2.1.xsd), copyright OASIS Open 2013",
34        text: include_str!("../LICENSES/LicenseRef-OASIS-Copyright-Notice.txt"),
35    },
36    Licence {
37        id: "LicenseRef-UN-CEFACT-Copyright-Notice",
38        covers: "xsd/common/CCTS_CCT_SchemaModule-2.1.xsd of the UBL 2.1 schemas embedded \
39                 by einvoice-xsd, copyright UN/CEFACT 2006",
40        text: include_str!("../LICENSES/LicenseRef-UN-CEFACT-Copyright-Notice.txt"),
41    },
42    Licence {
43        id: "W3C-19980720",
44        covers: "xsd/common/UBL-xmldsig-core-schema-2.1.xsd of the UBL 2.1 schemas embedded \
45                 by einvoice-xsd: the W3C XML Signature schema (copyright The Internet \
46                 Society and W3C), as modified by OASIS (DOCTYPE identifiers removed) and \
47                 published in the UBL 2.1 package; einvoice-xsd does not modify it",
48        text: include_str!("../LICENSES/W3C-19980720.txt"),
49    },
50];