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

Add a Utf8Lossy wrapper type for deserialization

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • bson-2.13.0
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • Rust Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      This user PR adds a feature flag to the driver to enable UTF-8 lossy deserialization, which the user needs to read invalid data inserted by a different driver. Doing so via the BSON library is currently inconvenient because UTF-8 lossy deserialization can only be enabled by calling one of the from_*_utf8_lossy methods, which doesn't play nicely with the driver's serde integration. Instead of exposing the driver feature flag, we should add a new Utf8Lossy wrapper type that users can embed their data types in to enable lossy deserialization. This would be similar to the existing HumanReadable wrapper type.

            Assignee:
            isabel.atkinson@mongodb.com Isabel Atkinson
            Reporter:
            isabel.atkinson@mongodb.com Isabel Atkinson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: