-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
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.