pub enum FixVersion {
Fix40,
Fix41,
Fix42,
Fix43,
Fix44,
Fix50,
Fix50Sp1,
Fix50Sp2,
Fixt11,
}Expand description
A FIX protocol version.
The canonical name of a variant is FixVersion::as_str, which is also
the string FromStr accepts. Its wire framing is
FixVersion::begin_string plus FixVersion::appl_ver_id.
Variants§
Fix40
FIX 4.0
Fix41
FIX 4.1
Fix42
FIX 4.2
Fix43
FIX 4.3
Fix44
FIX 4.4
Fix50
FIX 5.0, framed as a FIXT.1.1 session.
Fix50Sp1
FIX 5.0 SP1, framed as a FIXT.1.1 session.
Fix50Sp2
FIX 5.0 SP2, framed as a FIXT.1.1 session.
Fixt11
FIXT 1.1, the transport version used by FIX 5.0 and later.
On its own it names no application version, so it has no
FixVersion::appl_ver_id: a session that must stamp
DefaultApplVerID (1137) cannot be described by this variant alone.
Implementations§
Source§impl FixVersion
impl FixVersion
Sourcepub const ALL: [Self; 9]
pub const ALL: [Self; 9]
Every version this workspace knows, in ascending order.
Iterating this is the way to assert the version mapping exhaustively from a single place, rather than restating the table in a consumer.
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
Returns the version’s canonical name, e.g. FIX.5.0SP2.
This is the version’s own identity — the string a session is
configured with and the string FromStr parses. For the 5.0 family
it is not what goes in BeginString; see
FixVersion::begin_string.
Sourcepub const fn begin_string(self) -> &'static str
pub const fn begin_string(self) -> &'static str
Returns the value stamped into BeginString (tag 8).
Pre-5.0 versions carry their own name. FIX 5.0 and later are framed as
FIXT.1.1 sessions and carry FIXT.1.1, with the application version
in 1137 / 1128 instead.
Sourcepub const fn appl_ver_id(self) -> Option<&'static str>
pub const fn appl_ver_id(self) -> Option<&'static str>
Returns the application version to stamp into DefaultApplVerID
(1137) on the Logon and ApplVerID (1128) on application messages,
or None for a session that carries neither field.
The codes are the ApplVerID enumeration: 7 = FIX.5.0,
8 = FIX.5.0SP1, 9 = FIX.5.0SP2. That enumeration also defines
codes for pre-5.0 versions (2 = FIX.4.0 … 6 = FIX.4.4), but they
are not returned here: a pre-5.0 session is not a FIXT session and
never carries 1137 or 1128, so the honest answer is None.
FixVersion::Fixt11 is also None — it names the transport version
only. A caller that must stamp the required 1137 has to reject
that combination rather than guess an application version.
Trait Implementations§
Source§impl Clone for FixVersion
impl Clone for FixVersion
Source§fn clone(&self) -> FixVersion
fn clone(&self) -> FixVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FixVersion
Source§impl Debug for FixVersion
impl Debug for FixVersion
Source§impl<'de> Deserialize<'de> for FixVersion
impl<'de> Deserialize<'de> for FixVersion
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for FixVersion
impl Display for FixVersion
impl Eq for FixVersion
Source§impl FromStr for FixVersion
impl FromStr for FixVersion
Source§fn from_str(value: &str) -> Result<Self, Self::Err>
fn from_str(value: &str) -> Result<Self, Self::Err>
Parses a version’s canonical name, e.g. FIX.4.4 or FIX.5.0SP2.
Matching is exact: FIX version strings travel on the wire verbatim and are case-sensitive, so a lenient parse here would accept a value that no counterparty would.
§Errors
Returns UnknownFixVersion when the string names no version in
FixVersion::ALL.