Skip to content

More strongly type fix messages after parsing #74

@wbjohnston

Description

@wbjohnston

Deserializing a fixer_upper::Message from json results in a loosely typed struct. all of the body fields are optional. We can do better. By examining the MsgType field in the header struct, we can better determine what fields are required and remove the Option<_> wrapper from them.

The Header and Trailer objects are common between all fix messages, but the body fields are different.

Requirements

  1. Create a way to convert a fixer_upper::Message into a more strongly typed struct. The fields that are required, determined by the MsgType should not be Option<_>. When converting, if a required field is missing, an error should be returned [1].

Footnotes

  1. Rusts std::convert::TryInto and std::convert::TryFrom may be a good path to accomplish this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-maintenanceCategory: PRs that clean code up or issues documenting cleanup.E-mediumCall for participation: Experience needed to fix: Medium / intermediateM-fixer-upperModule: fixer-upper

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions