Skip to main content

FieldMap

Struct FieldMap 

Source
pub struct FieldMap { /* private fields */ }
Expand description

An ordered map of FIX fields (and nested groups), preserving wire order.

Implementations§

Source§

impl FieldMap

Source

pub fn new() -> Self

Create an empty field map.

Source

pub fn add_field(&mut self, field: Field)

Append a field, preserving insertion order (used by the decoder).

Source

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.

Source

pub fn get(&self, tag: u32) -> Option<&Field>

Get the first top-level field with tag.

Source

pub fn contains(&self, tag: u32) -> bool

Returns true if a top-level field with tag is present.

Source

pub fn add_group(&mut self, group: Group)

Append a repeating group.

Source

pub fn group(&self, count_tag: u32) -> Option<&[FieldMap]>

Get the entries of the first group with count_tag.

Source

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.

Source

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.

Source

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.

Source

pub fn fields(&self) -> impl Iterator<Item = &Field>

Iterate the top-level fields (skipping repeating groups), in order.

Source

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.

Trait Implementations§

Source§

impl Clone for FieldMap

Source§

fn clone(&self) -> FieldMap

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FieldMap

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FieldMap

Source§

fn default() -> FieldMap

Returns the “default value” for a type. Read more
Source§

impl Eq for FieldMap

Source§

impl PartialEq for FieldMap

Source§

fn eq(&self, other: &FieldMap) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FieldMap

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.