pub struct FixMessage { /* private fields */ }Expand description
An ordered collection of FIX fields.
Implementations§
Source§impl FixMessage
impl FixMessage
Sourcepub fn of_type(msg_type: MsgType) -> Self
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.
Sourcepub fn set(&mut self, tag: u32, value: impl Into<String>) -> &mut Self
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.
Sourcepub fn fields(&self) -> &[FixField]
pub fn fields(&self) -> &[FixField]
All fields in insertion order (header framing fields excluded — they are
only materialised by to_wire).
Sourcepub fn to_wire(&self) -> Bytes
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.
Sourcepub fn parse(input: &[u8]) -> Result<FixMessage, FixParseError>
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
impl Clone for FixMessage
Source§fn clone(&self) -> FixMessage
fn clone(&self) -> FixMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FixMessage
impl Debug for FixMessage
Source§impl Default for FixMessage
impl Default for FixMessage
Source§fn default() -> FixMessage
fn default() -> FixMessage
Source§impl PartialEq for FixMessage
impl PartialEq for FixMessage
Source§fn eq(&self, other: &FixMessage) -> bool
fn eq(&self, other: &FixMessage) -> bool
self and other values to be equal, and is used by ==.impl Eq for FixMessage
impl StructuralPartialEq for FixMessage
Auto Trait Implementations§
impl Freeze for FixMessage
impl RefUnwindSafe for FixMessage
impl Send for FixMessage
impl Sync for FixMessage
impl Unpin for FixMessage
impl UnsafeUnpin for FixMessage
impl UnwindSafe for FixMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.