pub struct Version { /* private fields */ }Expand description
A specific version of the FIX protocol.
Construct via the provided Version::FIX* / Version::FIXT11
constants or via FromStr which parses standard BeginString
representations ("FIX.4.4", "FIXT.1.1", "FIX.5.0SP2").
Only versions listed in Version::known_versions are valid.
Implementations§
Source§impl Version
impl Version
pub const FIX27: Version
pub const FIX30: Version
pub const FIX40: Version
pub const FIX41: Version
pub const FIX42: Version
pub const FIX43: Version
pub const FIX44: Version
pub const FIX50: Version
pub const FIX50SP1: Version
pub const FIX50SP2: Version
pub const FIXT11: Version
Sourcepub const FIX_LATEST: Version = Version::FIX50SP2
pub const FIX_LATEST: Version = Version::FIX50SP2
The rolling FIX Latest application layer, projected onto its base (frozen) version.
FIX Latest = FIX50SP2 plus the cumulative extension-pack stream
(FIX Session Layer §3.1.17), so on the version axis it equals
FIX50SP2 - until the FIX Trading Community ever cuts a new frozen
release. Alias: compares equal to Version::FIX50SP2.
Sourcepub const MAX_BEGIN_STRING_LEN: usize
pub const MAX_BEGIN_STRING_LEN: usize
Length of the longest BeginString among known_versions. A
BeginString(8) value running past this without its SOH cannot name
a version this crate frames, which is what lets a reader bound its
buffer before BodyLength(9) is even in sight.
Sourcepub const fn known_versions() -> &'static [Version]
pub const fn known_versions() -> &'static [Version]
All FIX versions recognized by this crate.
Sourcepub fn new(
session_protocol: SessionProtocol,
major: u8,
minor: u8,
servicepack: u8,
) -> Result<Version, UnknownVersionError>
pub fn new( session_protocol: SessionProtocol, major: u8, minor: u8, servicepack: u8, ) -> Result<Version, UnknownVersionError>
Build a Version from its components.
Returns UnknownVersionError if the combination does not
correspond to a version listed in Version::known_versions.
Sourcepub const fn is_fix(&self) -> bool
pub const fn is_fix(&self) -> bool
Returns true if this is a traditional FIX (FIX 4.x / FIX 5.x) version.
Sourcepub const fn servicepack(&self) -> u8
pub const fn servicepack(&self) -> u8
Returns the service pack level.
Sourcepub const fn begin_str(&self) -> &'static FixStr
pub const fn begin_str(&self) -> &'static FixStr
Returns the canonical BeginString representation as a
&'static FixStr. This is the zero-allocation form intended for
the serialization path.
Sourcepub fn begin_string(&self) -> FixString
pub fn begin_string(&self) -> FixString
Returns an owned FixString copy of the canonical BeginString.
Convenience for callers that need to build outgoing FIX messages;
allocates. Prefer Version::begin_str on the hot path.
Trait Implementations§
impl Copy for Version
impl Eq for Version
Source§impl FromStr for Version
impl FromStr for Version
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parse a BeginString value into a Version.
Accepts strings in the format:
"FIX.MAJOR.MINOR"(e.g.,"FIX.4.4")"FIXT.MAJOR.MINOR"(e.g.,"FIXT.1.1")"FIX.MAJOR.MINORSPx"(e.g.,"FIX.5.0SP2")
Returns UnknownVersionError if the format is invalid or the
parsed version is not in Version::known_versions.