Skip to main content

FixVersion

Enum FixVersion 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub const fn uses_fixt(self) -> bool

Returns true when this version is framed as a FIXT.1.1 session, i.e. FIX 5.0 and later plus FIXT.1.1 itself.

Trait Implementations§

Source§

impl Clone for FixVersion

Source§

fn clone(&self) -> FixVersion

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for FixVersion

Source§

impl Debug for FixVersion

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for FixVersion

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for FixVersion

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for FixVersion

Source§

impl FromStr for FixVersion

Source§

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.

Source§

type Err = UnknownFixVersion

The associated error which can be returned from parsing.
Source§

impl Hash for FixVersion

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for FixVersion

Source§

fn eq(&self, other: &FixVersion) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for FixVersion

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FixVersion

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.