pub struct Message {
pub header: FieldMap,
pub body: FieldMap,
pub trailer: FieldMap,
/* private fields */
}Expand description
A FIX message split into header, body, and trailer regions.
Decoding routes session-level header tags and trailer tags to their regions; everything
else lands in the body. Encoding always emits the canonical order
8, 9, 35, <rest of header>, <body>, <trailer except 10>, 10.
Fields§
§header: FieldMapHeader fields (BeginString, BodyLength, MsgType, session fields, …).
body: FieldMapApplication/body fields.
trailer: FieldMapTrailer fields (SignatureLength, Signature, CheckSum).
Implementations§
Source§impl Message
impl Message
Sourcepub fn begin_string(&self) -> Option<&str>
pub fn begin_string(&self) -> Option<&str>
The BeginString (tag 8) as a string, if present and valid UTF-8.
Sourcepub fn fields_out_of_order(&self) -> bool
pub fn fields_out_of_order(&self) -> bool
Whether decoding observed header/body/trailer fields out of their wire-sectioning order,
or a third field other than MsgType(35) (ValidateFieldsOutOfOrder; FR-006). Always
false for a Message built in code rather than decoded from the wire.
Sourcepub fn msg_type(&self) -> Option<&str>
pub fn msg_type(&self) -> Option<&str>
The MsgType (tag 35) as a string, if present and valid UTF-8.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, DecodeError>
pub fn decode(bytes: &[u8]) -> Result<Self, DecodeError>
Decode from wire bytes (verifies BodyLength and CheckSum).
Sourcepub fn reverse_route(&mut self, original: &Message)
pub fn reverse_route(&mut self, original: &Message)
Copy original’s routing header fields onto self (a reply/reject being built),
reversed: original’s OnBehalfOfCompID(115) becomes self’s DeliverToCompID(128) and
vice versa; likewise OnBehalfOfSubID(116)/DeliverToSubID(129) and
OnBehalfOfLocationID(144)/DeliverToLocationID(145) (Appendix B ReverseRoute).
A routing tag absent on original is left unset on self — no reversal is attempted and
no error is raised (ReverseRouteWithEmptyRoutingTags: a tag present with an empty value
still reverses, since presence — not content — governs).