Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-319

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

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • bson-0.15.0
    • Affects Version/s: None
    • Component/s: BSON
    • 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:
            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            Reporter:
            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: