Skip to main content

FieldMap

Struct FieldMap 

Source
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

Source

pub fn new() -> Self

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn clear(&mut self)

Source

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

Source

pub fn get_raw(&self, tag: Tag) -> Option<&[u8]>

Raw bytes of the first occurrence of tag.

Source

pub fn get<T: FixDecode>(&self, tag: Tag) -> Result<T, ConversionError>

Decode the first occurrence of tag as T.

Source

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.

Source

pub fn get_string(&self, tag: Tag) -> Result<String, ConversionError>

Source

pub fn get_field<F: Field>(&self) -> Result<F::Value, ConversionError>

Source

pub fn get_field_opt<F: Field>( &self, ) -> Result<Option<F::Value>, ConversionError>

Source

pub fn set_field<F: Field>(&mut self, value: F::Value)

Source

pub fn has_field<F: Field>(&self) -> bool

Source

pub fn set(&mut self, tag: Tag, value: impl FixEncode)

Replace the first occurrence of tag (keeping its position), or append.

Source

pub fn set_raw(&mut self, tag: Tag, value: Vec<u8>)

Source

pub fn push(&mut self, tag: Tag, value: impl FixEncode)

Append a field regardless of whether the tag already exists.

Source

pub fn remove(&mut self, tag: Tag) -> bool

Remove all occurrences of tag. Returns true if anything was removed.

Source

pub fn iter(&self) -> impl Iterator<Item = &TagValue>

Source

pub fn wire_len(&self) -> usize

Total serialized size of these fields: tag=value<SOH> for each.

Source

pub fn write_to(&self, buf: &mut Vec<u8>)

Serialize fields in stored order as tag=value<SOH>.

Source

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.

Source

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.

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more