-
Type: New Feature
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: BSON
-
None
The raw serializer and deserializer currently return false from is_human_readable, since BSON is a binary format. The Bson serializer / deserializer returns true for this method, however. This can cause identical values to serialize differently depending on whether to_vec or to_bson is used, which can be confusing. See this user's comment on a related GitHub issue for a good overview of some of the problems.
Unfortunately, changing is_human_readable to return false would constitute a breaking change, since the output formats that users' existing code produces may change. To alleviate this issue in a non-backwards-breaking way, we should introduce some way of allowing users to serialize to / deserialize from Bson using is_human_readable = false. Some options include a new function specifically for this (e.g. to_bson_not_human_readable), a more general options-configurable to_bson, or even a bson-not-human-readable feature flag.
- is depended on by
-
RUST-1033 Can't serialize/deserialize uuid properly
- Closed