pub struct RawMessage<'a> {
pub global_mesg_num: u16,
pub fields: Vec<RawField>,
pub dev_fields: Vec<RawDevField<'a>>,
pub starts_new_chain: bool,
}Expand description
One decoded FIT message.
The lifetime 'a ties developer-field byte slices to the input buffer so
they can be borrowed zero-copy. Use RawMessage::into_owned to detach.
Fields§
§global_mesg_num: u16Profile-level message number — index into the codegen-produced
MesgNum enum.
fields: Vec<RawField>Standard fields, in wire order.
dev_fields: Vec<RawDevField<'a>>Developer fields, if any. Without a registered field_description
(mesg_num=206), the wire bytes are stored verbatim; resolving them
to typed values lands in M6.
starts_new_chain: booltrue when this message is the first Data record after a chained-FIT
boundary. Upper layers (e.g. crate::TypedDecoder) use this to
reset per-chain state such as the crate::transforms::Accumulator.
Always false for the very first message of the first chain.
Implementations§
Source§impl<'a> RawMessage<'a>
impl<'a> RawMessage<'a>
Sourcepub fn field(&self, field_def_num: u8) -> Option<&RawField>
pub fn field(&self, field_def_num: u8) -> Option<&RawField>
Look up a standard field by its definition number.
Sourcepub fn into_owned(self) -> RawMessage<'static>
pub fn into_owned(self) -> RawMessage<'static>
Detach from the input buffer by copying any borrowed dev-field bytes
onto the heap. Yields a 'static message that outlives the decoder.
Trait Implementations§
Source§impl<'a> Clone for RawMessage<'a>
impl<'a> Clone for RawMessage<'a>
Source§fn clone(&self) -> RawMessage<'a>
fn clone(&self) -> RawMessage<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for RawMessage<'a>
impl<'a> Debug for RawMessage<'a>
Source§impl<'a> PartialEq for RawMessage<'a>
impl<'a> PartialEq for RawMessage<'a>
Source§fn eq(&self, other: &RawMessage<'a>) -> bool
fn eq(&self, other: &RawMessage<'a>) -> bool
self and other values to be equal, and is used by ==.