pub struct DictionaryBuilder { /* private fields */ }Expand description
Builder for creating and configuring FIX dictionaries.
This builder provides a fluent interface for configuring and creating a FIX protocol dictionary from XML specification files.
Implementations§
Source§impl DictionaryBuilder
impl DictionaryBuilder
Sourcepub fn new() -> DictionaryBuilder
pub fn new() -> DictionaryBuilder
Creates a new, empty DictionaryBuilder with default settings
Use the builder’s methods to configure and then call build() to create
the dictionary.
Sourcepub fn allow_custom_version(self, allow_custom_version: bool) -> Self
pub fn allow_custom_version(self, allow_custom_version: bool) -> Self
Sets whether to allow custom FIX versions not in the standard list
By default, only standard FIX versions are accepted.
Sourcepub fn with_strict_check(self, strict_check: bool) -> Self
pub fn with_strict_check(self, strict_check: bool) -> Self
Sets whether to apply strict validation during dictionary parsing
When enabled, more rigorous checks are applied to the dictionary structure.
Sourcepub fn with_fix_xml(self, path: impl Into<PathBuf>) -> Self
pub fn with_fix_xml(self, path: impl Into<PathBuf>) -> Self
Adds a FIX application-level XML specification file to the builder
For FIX versions prior to 5.0, this is the only XML file needed.
For FIX 5.0+, this should be used along with with_fixt_xml().
Sourcepub fn with_fix_xmls(self, paths: impl IntoIterator<Item = PathBuf>) -> Self
pub fn with_fix_xmls(self, paths: impl IntoIterator<Item = PathBuf>) -> Self
Adds multiple FIX application-level XML specification files to the builder
This is useful when working with multiple FIX versions or custom extensions.
Sourcepub fn with_fixt_xml(self, path: impl Into<PathBuf>) -> Self
pub fn with_fixt_xml(self, path: impl Into<PathBuf>) -> Self
Sets the FIXT transport layer XML specification file
This is required for FIX 5.0+ versions, which separate transport (FIXT) from application (FIX) layer specifications.
Sourcepub fn flatten_components(self, flatten_components: bool) -> Self
pub fn flatten_components(self, flatten_components: bool) -> Self
Sets whether to flatten component hierarchies
When enabled, nested components are flattened into their parent containers. This simplifies the structure by removing intermediate component layers, resulting in direct field references in messages and groups.
For example, if Message A contains Component B which contains Field C, flattening would make Message A directly contain Field C. The resulting dictionary has no components left, so code generation never has to resolve one.
Sourcepub fn build(self) -> Result<Dictionary, Error>
pub fn build(self) -> Result<Dictionary, Error>
Builds the Dictionary from the configured sources
This method parses the XML files and constructs a complete FIX dictionary. It will return an error if the dictionary configuration is invalid or if parsing fails.