Struct fefix::tagvalue::RawFrame [−][src]
Expand description
An immutable view over the contents of a FIX message by a RawDecoder
.
Fields
data: T
begin_string: Range<usize>
payload: Range<usize>
Implementations
Returns an immutable reference to the raw contents of self
.
Examples
use fefix::tagvalue::{Config, RawDecoder};
use fefix::prelude::*;
let mut decoder = RawDecoder::<Config>::new();
decoder.config_mut().set_separator(b'|');
let data = b"8=FIX.4.2|9=42|35=0|49=A|56=B|34=12|52=20100304-07:59:30|10=022|";
let message = decoder.decode(data).unwrap();
assert_eq!(message.as_bytes(), data);
Returns an immutable reference to the BeginString <8>
field value of
self
.
Examples
use fefix::tagvalue::{Config, RawDecoder};
use fefix::prelude::*;
let mut decoder = RawDecoder::<Config>::new();
decoder.config_mut().set_separator(b'|');
let data = b"8=FIX.4.2|9=42|35=0|49=A|56=B|34=12|52=20100304-07:59:30|10=022|";
let message = decoder.decode(data).unwrap();
assert_eq!(message.begin_string(), b"FIX.4.2");
Returns an immutable reference to the payload of self
. In this
context, “payload” means all fields besides
BeginString <8>
;BodyLength <9>
;CheckSum <10>
.
According to this definition, the payload may also contain fields that are
technically part of StandardHeader
and StandardTrailer
, i.e. payload
and body and not synonyms.
use fefix::tagvalue::{Config, RawDecoder};
use fefix::prelude::*;
let mut decoder = RawDecoder::<Config>::new();
decoder.config_mut().set_separator(b'|');
let data = b"8=FIX.4.2|9=42|35=0|49=A|56=B|34=12|52=20100304-07:59:30|10=022|";
let message = decoder.decode(data).unwrap();
assert_eq!(message.payload().len(), 42);