pub struct Dictionary { /* private fields */ }Expand description
Specifies business semantics for application-level entities within the FIX Protocol.
You can rely on Dictionary for accessing details about
fields, messages, and other abstract entities as defined in the FIX
specifications. Examples of such information include:
- The mapping of FIX field names to numeric tags (e.g.
BeginStringis 8). - Which FIX fields are mandatory and which are optional.
- The data type of each and every FIX field.
- What fields to expect in FIX headers.
N.B. The FIX Protocol mandates separation of concerns between session and application protocol only for FIX 5.0 and subsequent versions. All FIX Dictionaries for older versions will also contain information about the session layer.
Implementations§
Source§impl Dictionary
impl Dictionary
Sourcepub fn from_quickfix_spec(input: &str) -> Result<Self, ParseDictionaryError>
pub fn from_quickfix_spec(input: &str) -> Result<Self, ParseDictionaryError>
Attempts to read a QuickFIX-style specification file and convert it into
a Dictionary.
Sourcepub fn version(&self) -> &str
pub fn version(&self) -> &str
Returns the version string associated with this Dictionary (e.g.
FIXT.1.1, FIX.4.2).
use hotfix_dictionary::Dictionary;
let dict = Dictionary::fix44();
assert_eq!(dict.version(), "FIX.4.4");Sourcepub fn fix44() -> Self
pub fn fix44() -> Self
Creates a new Dictionary for FIX 4.4.
Sourcepub fn common_dictionaries() -> Vec<Dictionary>
pub fn common_dictionaries() -> Vec<Dictionary>
Returns a Vec of FIX Dictionary’s for the most common FIX
versions (that have been enabled via feature flags). This is only
intended for testing purposes.
Sourcepub fn abbreviation_for(&self, term: &str) -> Option<Abbreviation<'_>>
pub fn abbreviation_for(&self, term: &str) -> Option<Abbreviation<'_>>
Return the known abbreviation for term -if any- according to the
documentation of this FIX Dictionary.
Sourcepub fn message_by_name(&self, name: &str) -> Option<Message<'_>>
pub fn message_by_name(&self, name: &str) -> Option<Message<'_>>
Returns the Message associated with name, if any.
use hotfix_dictionary::Dictionary;
let dict = Dictionary::fix44();
let msg1 = dict.message_by_name("Heartbeat").unwrap();
let msg2 = dict.message_by_msgtype("0").unwrap();
assert_eq!(msg1.name(), msg2.name());Sourcepub fn message_by_msgtype(&self, msgtype: &str) -> Option<Message<'_>>
pub fn message_by_msgtype(&self, msgtype: &str) -> Option<Message<'_>>
Returns the Message that has the given msgtype, if any.
use hotfix_dictionary::Dictionary;
let dict = Dictionary::fix44();
let msg1 = dict.message_by_msgtype("0").unwrap();
let msg2 = dict.message_by_name("Heartbeat").unwrap();
assert_eq!(msg1.name(), msg2.name());Sourcepub fn component_by_name(&self, name: &str) -> Option<Component<'_>>
pub fn component_by_name(&self, name: &str) -> Option<Component<'_>>
Returns the Component named name, if any.
Sourcepub fn datatype_by_name(&self, name: &str) -> Option<Datatype<'_>>
pub fn datatype_by_name(&self, name: &str) -> Option<Datatype<'_>>
Returns the Datatype named name, if any.
use hotfix_dictionary::Dictionary;
let dict = Dictionary::fix44();
let dt = dict.datatype_by_name("String").unwrap();
assert_eq!(dt.name(), "String");Sourcepub fn field_by_tag(&self, tag: u32) -> Option<Field<'_>>
pub fn field_by_tag(&self, tag: u32) -> Option<Field<'_>>
Returns the Field associated with tag, if any.
use hotfix_dictionary::Dictionary;
let dict = Dictionary::fix44();
let field1 = dict.field_by_tag(112).unwrap();
let field2 = dict.field_by_name("TestReqID").unwrap();
assert_eq!(field1.name(), field2.name());Sourcepub fn field_by_name(&self, name: &str) -> Option<Field<'_>>
pub fn field_by_name(&self, name: &str) -> Option<Field<'_>>
Returns the Field named name, if any.
Sourcepub fn datatypes(&self) -> Vec<Datatype<'_>>
pub fn datatypes(&self) -> Vec<Datatype<'_>>
Returns a Vec of all Datatype’s in this Dictionary. The ordering
of items is not specified.
use hotfix_dictionary::Dictionary;
let dict = Dictionary::fix44();
// FIX 4.4 defines 23 (FIXME) datatypes.
assert_eq!(dict.datatypes().len(), 23);Sourcepub fn messages(&self) -> Vec<Message<'_>>
pub fn messages(&self) -> Vec<Message<'_>>
Returns a Vec of all Message’s in this Dictionary. The ordering
of items is not specified.
use hotfix_dictionary::Dictionary;
let dict = Dictionary::fix44();
let msgs = dict.messages();
let msg = msgs.iter().find(|m| m.name() == "MarketDataRequest");
assert_eq!(msg.unwrap().msg_type(), "V");Sourcepub fn categories(&self) -> Vec<Category<'_>>
pub fn categories(&self) -> Vec<Category<'_>>
Returns a Vec of all Category’s in this Dictionary. The ordering
of items is not specified.
Sourcepub fn fields(&self) -> Vec<Field<'_>>
pub fn fields(&self) -> Vec<Field<'_>>
Returns a Vec of all Field’s in this Dictionary. The ordering
of items is not specified.
Sourcepub fn components(&self) -> Vec<Component<'_>>
pub fn components(&self) -> Vec<Component<'_>>
Returns a Vec of all Component’s in this Dictionary. The ordering
of items is not specified.
Trait Implementations§
Source§impl Clone for Dictionary
impl Clone for Dictionary
Source§fn clone(&self) -> Dictionary
fn clone(&self) -> Dictionary
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more