Struct fefix::tagvalue::Message [−][src]
pub struct Message<'a, T> { /* fields omitted */ }
Expand description
A FIX message returned by Decoder
or DecoderBuffered
.
Implementations
Returns an Iterator
over all fields in self
, in sequential order
starting from the very first field.
Examples
use fefix::tagvalue::{Config, Decoder};
use fefix::prelude::*;
const DATA: &[u8] = b"8=FIX.4.4|9=42|35=0|49=A|56=B|34=12|52=20100304-07:59:30|10=185|";
let mut decoder = Decoder::<Config>::new(Dictionary::fix44());
decoder.config_mut().set_separator(b'|');
let message = decoder.decode(DATA).unwrap();
let first_field = message.fields().next();
assert_eq!(first_field, Some((TagU16::new(8).unwrap(), b"FIX.4.4" as &[u8])));
Returns the underlying byte contents of self
.
Examples
use fefix::tagvalue::{Config, Decoder};
use fefix::prelude::*;
const DATA: &[u8] = b"8=FIX.4.4|9=42|35=0|49=A|56=B|34=12|52=20100304-07:59:30|10=185|";
let mut decoder = Decoder::<Config>::new(Dictionary::fix44());
decoder.config_mut().set_separator(b'|');
let message = decoder.decode(DATA).unwrap();
assert_eq!(message.as_bytes(), DATA);
Returns the number of FIX tags contained in self
.
Examples
use fefix::tagvalue::{Config, Decoder};
use fefix::prelude::*;
const DATA: &[u8] = b"8=FIX.4.4|9=42|35=0|49=A|56=B|34=12|52=20100304-07:59:30|10=185|";
let mut decoder = Decoder::<Config>::new(Dictionary::fix44());
decoder.config_mut().set_separator(b'|');
let message = decoder.decode(DATA).unwrap();
assert_eq!(message.len(), message.fields().count());
Trait Implementations
impl<'a, F, T> FieldAccess<F> for Message<'a, T> where
F: IsFieldDefinition,
T: AsRef<[u8]> + Clone,
impl<'a, F, T> FieldAccess<F> for Message<'a, T> where
F: IsFieldDefinition,
T: AsRef<[u8]> + Clone,
type Group = MessageGroup<'a, T>
type Group = MessageGroup<'a, T>
The type returned by FieldAccess::group()
and FieldAccess::group_opt()
.
Queries self
for a group tagged with key
which may or may not be
present in self
. This differs from
FieldAccess::group()
as missing groups result in None
rather than
Err
. Read more
Queries self
for field
and returns its raw contents.
Queries self
for a group tagged with key
. An unsuccessful query
results in [Err(None)
]. Read more
Queries self
for field
and deserializes it.
Like FieldAccess::fv()
, but with lossy deserialization.
Queries self
for field
and deserializes it. This
differs from FieldAccess::fv()
as missing fields result in None
rather than Err
. Read more
type Group = MessageGroup<'a, T>
type Group = MessageGroup<'a, T>
The type returned by FieldAccess::group()
and FieldAccess::group_opt()
.
Queries self
for a group tagged with key
which may or may not be
present in self
. This differs from
FieldAccess::group()
as missing groups result in None
rather than
Err
. Read more
Queries self
for field
and returns its raw contents.
Queries self
for a group tagged with key
. An unsuccessful query
results in [Err(None)
]. Read more
Queries self
for field
and deserializes it.
Like FieldAccess::fv()
, but with lossy deserialization.
Queries self
for field
and deserializes it. This
differs from FieldAccess::fv()
as missing fields result in None
rather than Err
. Read more
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Message<'a, T> where
T: RefUnwindSafe,
impl<'a, T> UnwindSafe for Message<'a, T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more