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

Refactor StreamAddress struct to ServerAddress enum

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

      Our public facing StreamAddress type is how users specify which hosts they want to connect to via ClientOptions. This name is slightly inaccurate, however, since it often contains a DNS name that then gets resolved to an actual address to be used for the TCP stream.

      Of the other drivers that have a similar type, Java, C#, and Swift name it (Mongo)ServerAddress, and C++ names it host. For consistency with other drivers, ServerAddress seems like a good name, though Host or HostAddress would also work (given that the ClientOptions field that contains them is named hosts).

      Additionally, in order to support alternative addresses types in the future (e.g. Unix Domain Socket file paths), we could restructure this as an enum like tokio-postgres and redis do.

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

              Created:
              Updated:
              Resolved: