Skip to main content

Dictionary

Struct Dictionary 

Source
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

Source

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.

Source

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.

Source

pub fn version(&self) -> Version

Returns the version of this dictionary

Source

pub fn begin_string(&self) -> String

Returns the BeginString representation of this dictionary’s version.

Source

pub fn field_by_name(&self, name: &FixStr) -> Option<&Field>

Looks up a field by name

Source

pub fn field_by_id(&self, id: u16) -> Option<&Field>

Looks up a field by tag number

Source

pub fn fields(&self) -> impl Iterator<Item = &Field>

Returns an iterator over all fields in this dictionary

Source

pub fn component(&self, name: &FixStr) -> Option<&Component>

Looks up a component by name

Source

pub fn components(&self) -> impl Iterator<Item = &Component>

Returns an iterator over all components in this dictionary

Source

pub fn group(&self, name: &FixStr) -> Option<&Group>

Looks up a group by name

Source

pub fn groups(&self) -> impl Iterator<Item = &Group>

Returns an iterator over all groups in this dictionary

Source

pub fn message_by_name(&self, name: &FixStr) -> Option<&Message>

Looks up a message by name

Source

pub fn message_by_type(&self, msg_type: &[u8]) -> Option<&Message>

Looks up a message by message type

Source

pub fn messages(&self) -> impl Iterator<Item = &Message>

Returns an iterator over all messages in this dictionary, in definition order

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for Dictionary

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.