rust_iso20022 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,6 +6,49 @@ messages with XML and JSON parsing/serialization, message identification, a
6
6
  generic message tree for reading any message without the model, and business
7
7
  metadata extraction.
8
8
 
9
+ ## Installation
10
+
11
+ Add it with cargo (enable only the features you need — see [Features](#features)):
12
+
13
+ ```bash
14
+ cargo add rust_iso20022 # core: identify, MxNode, catalogue
15
+ cargo add rust_iso20022 --features model-pacs # + the typed pacs model
16
+ cargo add rust_iso20022 --features model-pacs,serde,convert
17
+ ```
18
+
19
+ or in `Cargo.toml`:
20
+
21
+ ```toml
22
+ [dependencies]
23
+ # Core only (identification, generic tree, catalogue) — no model compiled.
24
+ rust_iso20022 = "0.1"
25
+
26
+ # Or pull in one or more typed message families plus JSON and typed scalars:
27
+ rust_iso20022 = { version = "0.1", features = ["model-pacs", "serde", "convert"] }
28
+ ```
29
+
30
+ > Enabling the umbrella `model` feature compiles all ~1130 message modules and is
31
+ > slow; prefer the per-area `model-<area>` features for the families you actually
32
+ > use.
33
+
34
+ Minimal first program — no features required:
35
+
36
+ ```rust
37
+ use rust_iso20022::{detect, MxNode};
38
+
39
+ fn main() {
40
+ let xml = r#"<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.008.001.08">
41
+ <FIToFICstmrCdtTrf><GrpHdr><MsgId>ABC-1</MsgId></GrpHdr></FIToFICstmrCdtTrf>
42
+ </Document>"#;
43
+
44
+ let id = detect(xml).expect("recognised");
45
+ println!("type = {}", id.message_name()); // pacs.008.001.08
46
+
47
+ let doc = MxNode::parse(xml).unwrap();
48
+ println!("MsgId = {:?}", doc.find("MsgId").and_then(|n| n.text())); // Some("ABC-1")
49
+ }
50
+ ```
51
+
9
52
  ## What's in the crate
10
53
 
11
54
  | Layer | Module | Always available? |
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "rust_iso20022",
3
3
  "type": "module",
4
4
  "description": "ISO 20022 message definitions and external code sets for Rust, generated from the official XSD schemas.",
5
- "version": "0.1.0",
5
+ "version": "0.1.1",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",
Binary file