pub struct Dictionary { /* private fields */ }Expand description
The main dictionary representing a FIX protocol specification.
A Dictionary provides access to all elements of a FIX protocol
specification, including fields, components, messages, and version information.
For modern FIX versions (FIXT/FIX5+), it may also contain subdictionaries
for different message categories.
Implementations§
Source§impl Dictionary
impl Dictionary
Sourcepub fn new(path: &str) -> Result<Dictionary, Error>
pub fn new(path: &str) -> Result<Dictionary, Error>
Creates a new Dictionary by parsing a single XML specification file
This is a convenience method for simple cases. For more complex scenarios,
use the DictionaryBuilder instead.
Sourcepub fn flatten(&self) -> Result<Dictionary, Error>
pub fn flatten(&self) -> Result<Dictionary, Error>
Returns a copy of this dictionary with every component inlined into the message, group, header or trailer that used it.
The result has an empty components map and no
MemberDefinition::Component anywhere, so a consumer walking members
never has to resolve one. Everything else survives: message definition
order, group names, and the subdictionaries, which are flattened too.
Each inlined field keeps the required flag from its own definition
inside the component, not the one on the component’s usage site - a
field marked required='Y' within a component stays required even
where that component was included with required='N'.
Returns ValidationError::UnknownComponent if a member references a
component this dictionary does not define.
Sourcepub fn begin_string(&self) -> String
pub fn begin_string(&self) -> String
Returns the BeginString representation of this dictionary’s version.
Sourcepub fn field_by_name(&self, name: &FixStr) -> Option<&Field>
pub fn field_by_name(&self, name: &FixStr) -> Option<&Field>
Looks up a field by name
Sourcepub fn field_by_id(&self, id: u16) -> Option<&Field>
pub fn field_by_id(&self, id: u16) -> Option<&Field>
Looks up a field by tag number
Sourcepub fn fields(&self) -> impl Iterator<Item = &Field>
pub fn fields(&self) -> impl Iterator<Item = &Field>
Returns an iterator over all fields in this dictionary
Sourcepub fn components(&self) -> impl Iterator<Item = &Component>
pub fn components(&self) -> impl Iterator<Item = &Component>
Returns an iterator over all components in this dictionary
Sourcepub fn groups(&self) -> impl Iterator<Item = &Group>
pub fn groups(&self) -> impl Iterator<Item = &Group>
Returns an iterator over all groups in this dictionary
Sourcepub fn message_by_name(&self, name: &FixStr) -> Option<&Message>
pub fn message_by_name(&self, name: &FixStr) -> Option<&Message>
Looks up a message by name
Sourcepub fn message_by_type(&self, msg_type: &[u8]) -> Option<&Message>
pub fn message_by_type(&self, msg_type: &[u8]) -> Option<&Message>
Looks up a message by message type
Sourcepub fn messages(&self) -> impl Iterator<Item = &Message>
pub fn messages(&self) -> impl Iterator<Item = &Message>
Returns an iterator over all messages in this dictionary, in definition order
Sourcepub fn header(&self) -> &Component
pub fn header(&self) -> &Component
Returns a reference to the standard header component
The header component contains fields that appear at the beginning of every message.
Sourcepub fn trailer(&self) -> &Component
pub fn trailer(&self) -> &Component
Returns a reference to the standard trailer component
The trailer component contains fields that appear at the end of every message.
Sourcepub fn subdictionary(&self, version: Version) -> Option<&Dictionary>
pub fn subdictionary(&self, version: Version) -> Option<&Dictionary>
Returns a subdictionary for the specified version, if available
For FIXT-based FIX versions, this allows access to application-level dictionaries.
Sourcepub fn subdictionaries(&self) -> impl Iterator<Item = &Dictionary>
pub fn subdictionaries(&self) -> impl Iterator<Item = &Dictionary>
Returns an iterator over all subdictionaries
For FIXT-based FIX versions, this provides access to application-level dictionaries.