Skip to content

Commit 6f17e3d

Browse files
committed
dictionary: update README
1 parent bbef46e commit 6f17e3d

1 file changed

Lines changed: 21 additions & 36 deletions

File tree

easyfix-dictionary/README.md

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,63 @@
11
# easyfix-dictionary
22

3-
A Rust library for parsing and representing FIX (Financial Information Exchange) protocol dictionaries.
3+
Parses FIX XML specifications into Rust data structures for inspection and code
4+
generation.
45

5-
## Overview
6-
7-
The `easyfix-dictionary` crate provides functionality to parse XML-based FIX protocol specifications into Rust structures. It supports:
6+
Part of the [easyfix](https://github.com/ldanko/easyfix) FIX engine.
87

9-
- Different FIX protocol versions
10-
- Component and group membership
11-
- Field definitions with data types
12-
- Message specifications and categorization
8+
## Overview
139

14-
## Features
10+
The dictionary represents the FIX protocol structure:
1511

16-
- XML parsing of standard FIX dictionary formats
17-
- Rich type representation of FIX protocol components
18-
- Support for field types, message types, and component hierarchies
12+
- **Fields** — data elements with types and possible enumerated values
13+
- **Components** — reusable groups of fields
14+
- **Groups** — repeating sets of fields or components
15+
- **Messages** — message types composed of fields, components, and groups
1916

2017
## Usage
2118

22-
### Basic Usage
23-
2419
```rust
25-
use easyfix_dictionary::{DictionaryBuilder, Version};
26-
use std::path::Path;
20+
use easyfix_dictionary::DictionaryBuilder;
2721

28-
// Parse a standard FIX dictionary
2922
let dictionary = DictionaryBuilder::new()
3023
.with_fix_xml("path/to/FIX50SP2.xml")
3124
.with_strict_check(true)
3225
.build()
3326
.expect("Failed to parse dictionary");
3427

35-
// Access field definitions
3628
if let Some(field) = dictionary.field_by_name("BeginString") {
37-
println!("Field number: {}", field.number);
29+
println!("Field number: {}", field.number());
3830
}
3931

40-
// Access message definitions
4132
if let Some(message) = dictionary.message_by_name("Heartbeat") {
4233
println!("Message type: {}", message.msg_type());
4334

44-
// Iterate through message members
4535
for member in message.members() {
46-
println!("Member: {}, Required: {}", member.definition().name(), member.required());
36+
println!(" {}, required: {}", member.name(), member.required());
4737
}
4838
}
4939
```
5040

51-
### Working with Modern FIX (FIXT)
41+
### FIXT (FIX 5.0+)
42+
43+
FIX 5.0+ splits the protocol into transport (FIXT) and application layers.
44+
Provide both XML files and use `subdictionary()` to access the application
45+
layer:
5246

5347
```rust
5448
use easyfix_dictionary::{DictionaryBuilder, Version};
5549

56-
// Parse FIXT1.1 with application dictionaries
5750
let dictionary = DictionaryBuilder::new()
5851
.with_fixt_xml("path/to/FIXT11.xml")
5952
.with_fix_xml("path/to/FIX50SP2.xml")
6053
.build()
6154
.expect("Failed to parse dictionary");
6255

63-
// Accessing the application-level subdictionary
64-
if let Some(app_dict) = dictionary.subdictionary(Version::FIX50SP2) {
65-
// Use app_dict for application messages
56+
if let Some(app) = dictionary.subdictionary(Version::FIX50SP2) {
57+
// application-level messages and fields
6658
}
6759
```
6860

69-
## Dictionary Structure
70-
71-
The FIX dictionary consists of:
72-
73-
- **Fields**: Individual data elements with types and possible enum values
74-
- **Components**: Reusable groups of fields
75-
- **Groups**: Repeating sets of fields or components
76-
- **Messages**: Specific message types composed of fields, components, and groups
61+
## License
7762

78-
Each element is linked through references, creating a comprehensive representation of the FIX protocol.
63+
MIT

0 commit comments

Comments
 (0)