pub struct FieldMap { /* private fields */ }Expand description
An ordered map of FIX fields (and nested groups), preserving wire order.
Implementations§
Source§impl FieldMap
impl FieldMap
Sourcepub fn add_field(&mut self, field: Field)
pub fn add_field(&mut self, field: Field)
Append a field, preserving insertion order (used by the decoder).
Sourcepub fn set(&mut self, field: Field)
pub fn set(&mut self, field: Field)
Set a top-level field, replacing an existing one with the same tag (in place, preserving
its position), else appending. If more than one field with this tag is already present
(NEW-81, feature 009 – e.g. because add_field was used to push duplicates directly,
bypassing this method’s usual dedup), every stale copy is removed, leaving only the new
value at the first occurrence’s position.
Sourcepub fn contains(&self, tag: u32) -> bool
pub fn contains(&self, tag: u32) -> bool
Returns true if a top-level field with tag is present.
Sourcepub fn group(&self, count_tag: u32) -> Option<&[FieldMap]>
pub fn group(&self, count_tag: u32) -> Option<&[FieldMap]>
Get the entries of the first group with count_tag.
Sourcepub fn get_group(&self, count_tag: u32, index: usize) -> Option<&FieldMap>
pub fn get_group(&self, count_tag: u32, index: usize) -> Option<&FieldMap>
Get one entry (by 0-based index) of the first group with count_tag (US9, feature 005,
FR-024/FR-025). None if the group doesn’t exist or index is out of range.
Sourcepub fn replace_group(&mut self, count_tag: u32, index: usize, entry: FieldMap)
pub fn replace_group(&mut self, count_tag: u32, index: usize, entry: FieldMap)
Replace one entry (by 0-based index) of the first group with count_tag (US9, feature
005, FR-024/FR-025). No-op if the group doesn’t exist or index is out of range.
Sourcepub fn remove_group(&mut self, count_tag: u32, index: usize)
pub fn remove_group(&mut self, count_tag: u32, index: usize)
Remove one entry (by 0-based index) of the first group with count_tag (US9, feature
005, FR-024/FR-025), shifting later entries down. No-op if the group doesn’t exist or
index is out of range.
Sourcepub fn fields(&self) -> impl Iterator<Item = &Field>
pub fn fields(&self) -> impl Iterator<Item = &Field>
Iterate the top-level fields (skipping repeating groups), in order.
Sourcepub fn members(&self) -> impl Iterator<Item = MemberRef<'_>>
pub fn members(&self) -> impl Iterator<Item = MemberRef<'_>>
Iterate every top-level member (feature 011, FR-001) — both plain fields and repeating
groups, in wire order. Unlike Self::fields (which silently skips Member::Group
entries), this is the accessor for callers that need to see a message’s real structure —
e.g. a group whose own count tag is itself required at the message level (see
truefix-dict’s present()), or any caller walking a decoded message generically without
assuming every top-level tag is a plain field.