pub struct FieldMap { /* private fields */ }Expand description
Ordered multi-map of FIX fields.
Fields are kept in insertion (wire) order. set replaces the first
occurrence of a tag in place; push always appends, which is what
repeating-group construction requires.
Implementations§
Source§impl FieldMap
impl FieldMap
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
pub fn contains(&self, tag: Tag) -> bool
Sourcepub fn get<T: FixDecode>(&self, tag: Tag) -> Result<T, ConversionError>
pub fn get<T: FixDecode>(&self, tag: Tag) -> Result<T, ConversionError>
Decode the first occurrence of tag as T.
Sourcepub fn get_opt<T: FixDecode>(
&self,
tag: Tag,
) -> Result<Option<T>, ConversionError>
pub fn get_opt<T: FixDecode>( &self, tag: Tag, ) -> Result<Option<T>, ConversionError>
Decode the first occurrence of tag as T, or None when absent.
pub fn get_string(&self, tag: Tag) -> Result<String, ConversionError>
pub fn get_field<F: Field>(&self) -> Result<F::Value, ConversionError>
pub fn get_field_opt<F: Field>( &self, ) -> Result<Option<F::Value>, ConversionError>
pub fn set_field<F: Field>(&mut self, value: F::Value)
pub fn has_field<F: Field>(&self) -> bool
Sourcepub fn set(&mut self, tag: Tag, value: impl FixEncode)
pub fn set(&mut self, tag: Tag, value: impl FixEncode)
Replace the first occurrence of tag (keeping its position), or append.
pub fn set_raw(&mut self, tag: Tag, value: Vec<u8>)
Sourcepub fn push(&mut self, tag: Tag, value: impl FixEncode)
pub fn push(&mut self, tag: Tag, value: impl FixEncode)
Append a field regardless of whether the tag already exists.
Sourcepub fn remove(&mut self, tag: Tag) -> bool
pub fn remove(&mut self, tag: Tag) -> bool
Remove all occurrences of tag. Returns true if anything was removed.
pub fn iter(&self) -> impl Iterator<Item = &TagValue>
Sourcepub fn wire_len(&self) -> usize
pub fn wire_len(&self) -> usize
Total serialized size of these fields: tag=value<SOH> for each.
Sourcepub fn read_groups(
&self,
template: &GroupTemplate,
) -> Result<Vec<FieldMap>, ConversionError>
pub fn read_groups( &self, template: &GroupTemplate, ) -> Result<Vec<FieldMap>, ConversionError>
Read the repeating group counted by template.num_tag.
Group instances are split on template.delimiter(). Any tag that is
not in the template’s member set terminates the group section.
Sourcepub fn write_groups(&mut self, template: &GroupTemplate, groups: &[FieldMap])
pub fn write_groups(&mut self, template: &GroupTemplate, groups: &[FieldMap])
Append repeating-group instances, setting/updating the count field.
Instances must have the delimiter tag as their first field; members are appended verbatim in the order given.