Convert variants of the BSON enum to use structs instead of multiple fields

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • bson-0.15.0
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently, we represent many of the BSON types as enum variants with multiple fields; for example, binary values are represented as Bson::Binary(BinarySubtype, Vec<u8>). These multi-field enum variants are a bit unwieldy, as they make it tough for users to define a struct field of an exact BSON type, as they lack a concrete type that they map to. To make them easier to use, we should consider replacing all multi-field enum variants with a single field of a concrete struct type defined specifically for that type. This also will allow us to define type-specific functionality on the subtypes, which could potentially be useful.

              Assignee:
              Samuel Rossi (Inactive)
              Reporter:
              Samuel Rossi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: