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

Consider code-genning builders structs

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      We currently rely on the typed-builder crate to generate the builders for our options structs, which is really nice for us as developers of the driver as it saves a ton of boilerplate. The unfortunate drawback is that the generated builder() method and any actual field builder methods (e.g. .write_concern()) do not place nicely with rust-analyzer, and thus do not appear is user's autocompletion. This can make option discovery and entry a cumbersome experience.

      We should consider manually generating the code for these builders instead and checking it into the repository so that it will play nicely with IDE tooling.

      Note that this would technically be a breaking change as we wouldn't be mimicking the typed-builder API exactly, but in practice it seems extremely unlikely that it will actually break any code if done right.

            Assignee:
            Unassigned Unassigned
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: