iso_20022_sdk/lib.rs
1// Copyright 2023 Emergent Financial, LLC - All Rights Reserved
2//
3//
4// This software is licensed under the Emergent Financial Limited Public License Version 1.0
5// (EF-LPLv1). You may use, copy, modify, and distribute this software under the terms and
6// conditions of the EF-LPL. For more information, please refer to the full text of the license
7// at https://github.com/emergentfinancial/ef-lpl.
8//
9//
10// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS
11// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
14// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
15// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16//
17//!
18//! # ISO 20022 Software Developer Kit (SDK)
19//!
20//! The `iso-20022-sdk` is a Rust library for working with the <a href="https://iso20022.org" target="_blank">ISO 20022</a> Universal financial industry message scheme.
21//!
22//!
23//! > #
24//! > Need ISO-20022 Integrations? [Contact us](mailto:ryan.tate@emergent.financial) to learn about our software systems and development services.
25//! > #
26//!
27//! ## Install the SDK Library
28//!
29//! Add `iso-20022-sdk` to your `Cargo.toml` dependencies:
30//!
31//! ```toml
32//!
33//! [dependencies]
34//! iso-20022-sdk = { version = "0.1.0" }
35//!
36//! ```
37//!
38//!
39//! ## Features
40//!
41//! By default, `iso-20022-sdk` includes `nvlp`, `head` and `dsig` features, which imports `iso-20022-nvlp`, `iso-20022-head` and `iso-20022-dsig` respectively.
42//!
43//! Documents, e.g. `remt.001.001.01`, are conditionally compiled and need to be added individually, either as a business domain or message set feature, e.g.
44//!
45//! ```toml
46//!
47//! [dependencies]
48//! iso-20022-sdk = { version = "0.1.0", features = ["remt"] }
49//! ```
50//!
51//! Now you can create a `Document` from the `remt.001.001.01` namespace:
52//!
53//! ```rust
54//! use iso_20022_sdk::Document;
55//!
56//! let mut doc = Document::from_namespace("remt.001.001.01")?;
57//!
58//! ```
59//!
60//! ### Business Domains
61//!
62//! To include messages relevant only to the `payments` business domain, add the `payments` feature to your `Cargo.toml`:
63//!
64//! ```toml
65//!
66//! [dependencies]
67//! iso-20022-sdk = { version = "0.1.0", features = ["payments"] }
68//!
69//! ```
70//!
71//! > *Using the payments features will include all message sets in the payments business domain.*
72//! >
73//! ```toml
74//! payments = ["acmt", "auth", "acmt", "admi", "camt", "pacs", "pain", "reda", "remt"]
75//! ```
76//! >
77//! > Available `business domain` features
78//! >
79//! > - `payments`
80//! > - `securities`
81//! > - `trade`
82//! > - `cards`
83//! > - `fx`
84//!
85//!
86//! ### Message Sets
87//!
88//! Each message set, e.g. `acmt`, has its own Rust library, e.g. `iso-20022-acmt`, which can be conditionally compiled using the `Cargo.toml` **features** flag corresponding to the message set.
89//!
90//!
91//! ```toml
92//!
93//! [dependencies]
94//! iso-20022-sdk = { version = "0.1.0", features = ["acmt", "admi"] }
95//!
96//! ```
97//!
98//!
99//! > Available `message set` features
100//! >
101//! > - `acmt`
102//! > - `admi`
103//! > - `auth`
104//! > - `caaa`
105//! > - `caad`
106//! > - `caam`
107//! > - `cafc`
108//! > - `cafm`
109//! > - `cafr`
110//! > - `cain`
111//! > - `camt`
112//! > - `canm`
113//! > - `casp`
114//! > - `casr`
115//! > - `catm`
116//! > - `catp`
117//! > - `colr`
118//! > - `fxtr`
119//! > - `pacs`
120//! > - `pain`
121//! > - `reda`
122//! > - `remt`
123//! > - `secl`
124//! > - `seev`
125//! > - `semt`
126//! > - `sese`
127//! > - `setr`
128//! > - `tsin`
129//! > - `tsmt`
130//! > - `tsrv`
131//!
132#[cfg(feature = "crypto")]
133pub mod crypto;
134#[allow(non_camel_case_types)]
135pub mod documents;
136pub mod external_codes;
137#[cfg(feature = "msg")]
138pub mod message;
139
140// Re-exports
141#[cfg(feature = "nvlp")]
142pub use iso_20022_nvlp::{self as nvlp};
143
144#[cfg(feature = "head")]
145pub use iso_20022_head::{self as head};
146
147#[cfg(feature = "dsig")]
148pub use iso_20022_dsig::{self as dsig};
149
150// Prelude
151pub mod prelude {
152 #[cfg(feature = "nvlp")]
153 pub use super::nvlp;
154
155 #[cfg(feature = "head")]
156 pub use super::head;
157
158 #[cfg(feature = "dsig")]
159 pub use super::dsig;
160
161 #[cfg(feature = "msg")]
162 pub use super::message::*;
163
164 pub use super::documents::*;
165
166 pub use super::crypto::*;
167}