Skip to main content

FixMessage

Struct FixMessage 

Source
pub struct FixMessage { /* private fields */ }
Expand description

An ordered collection of FIX fields.

Implementations§

Source§

impl FixMessage

Source

pub fn new() -> Self

A new, empty message.

Source

pub fn of_type(msg_type: MsgType) -> Self

Build a message of a given type (tag 35). The MsgType field is the first body field; header framing fields (8/9) are added at encode time.

Source

pub fn get(&self, tag: u32) -> Option<&str>

First value for tag, if present.

Source

pub fn get_u64(&self, tag: u32) -> Option<u64>

Convenience: parse a field value as a u64.

Source

pub fn set(&mut self, tag: u32, value: impl Into<String>) -> &mut Self

Set tag to value, replacing the first existing occurrence or appending if absent. Returns &mut self for chaining.

Source

pub fn fields(&self) -> &[FixField]

All fields in insertion order (header framing fields excluded — they are only materialised by to_wire).

Source

pub fn msg_type(&self) -> Option<MsgType>

The message type from tag 35, if present.

Source

pub fn seq_num(&self) -> Option<u64>

The MsgSeqNum (tag 34), if present and numeric.

Source

pub fn to_wire(&self) -> Bytes

Encode the message to wire bytes.

Ordering: 8=BeginString | 9=BodyLength | 35=MsgType | <body…> | 10=CheckSum. BodyLength(9) counts every byte after the SOH that terminates field 9 up to and including the SOH that terminates the last field before CheckSum(10). CheckSum(10) is the sum of all bytes up to and including the SOH before the 10= field, taken mod 256 and rendered as three decimal digits.

Source

pub fn parse(input: &[u8]) -> Result<FixMessage, FixParseError>

Parse a single SOH-delimited FIX frame.

The frame may or may not include the trailing SOH after 10=NNN; both are accepted. When a CheckSum(10) field is present it is verified against the recomputed checksum.

Trait Implementations§

Source§

impl Clone for FixMessage

Source§

fn clone(&self) -> FixMessage

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 Debug for FixMessage

Source§

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

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

impl Default for FixMessage

Source§

fn default() -> FixMessage

Returns the “default value” for a type. Read more
Source§

impl PartialEq for FixMessage

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for FixMessage

Source§

impl StructuralPartialEq for FixMessage

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Extension for T
where T: Any + Send + Sync,