Skip to content

(rust): Add an INFO section enum matching the other GLIDE clients #7366

Description

@currantw

Describe the feature

Add an INFO section enum to the Rust client (rust/, crate valkey-glide) that matches the other GLIDE clients.

Today, ServerManagementCommands::info_sections (rust/src/commands/server_management.rs) accepts any &[S] where S: ToValkeyArgs, so callers pass free-form strings:

let info = client.info_sections(&["persistence"]).await?;

The other GLIDE clients have a section enum with the same members, sorted alphabetically since #7364:

Client Type
Go constants.Section
Java InfoOptions.Section
Node InfoOptions
Python InfoSection

Their members: all, clients, cluster, cluster_info (Valkey 9.1.0+), commandstats, cpu, default, errorstats, everything, keyspace, latencystats, memory, modules, persistence, replication, sentinel, server, stats.

Use Case

  • Discoverability: IDE completion and the generated docs would list the valid sections, with a doc comment for each, including which Valkey version added it (e.g. cluster_info).
  • Correctness: a typo such as "persistance" compiles, and the server quietly returns an empty reply for it. An enum variant can't be misspelled.
  • Consistency: Rust code would read the same way as the other GLIDE clients (InfoSection::Persistence, like Python's InfoSection.PERSISTENCE).

Proposed Solution

  • Add an InfoSection enum to rust/src/commands/options.rs, which mirrors Python's core_options. Include all 18 sections, in alphabetical order, with doc comments matching the other clients.
  • Implement ToValkeyArgs for it, as ExpireOption and the other option enums there do, writing the lowercase section name.
  • info_sections is already generic over ToValkeyArgs, so it would accept &[InfoSection::Persistence] with no signature change, and string callers keep working. Keeping strings also covers module-defined sections, which the enum can't list. Decide whether that's the intended API, or whether info_sections should accept only InfoSection, which would be a breaking change, acceptable while the crate is in 0.x preview.
  • Use the enum in the Rust tests (e.g. get_info and info_returns_expected_fields in rust/tests/).
  • Consider doing this together with (rust): Typed multi-node server commands fail on cluster clients #7362, which changes the return types of the typed INFO methods.

Other Information

Found while working on #7199 (#7364), which added cluster_info to the Go, Java, Node and Python section enums. Rust had nothing to add it to.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Client version used

valkey-glide (Rust) 0.9.0

Environment details (OS name and version, etc.)

⚪ Not applicable

Activity

  1. added
    Feature ✨Additional feature, big or small
    Rust ⚙️Pull requests that update rust code
    on Oct 16, 2026
  2. self-assigned this
    on Oct 16, 2026
  3. added a commit that references this issue on Oct 17, 2026
    a0ee981
  4. added theissue type on Oct 19, 2026
  5. added a commit that references this issue on Oct 24, 2026
    2b12cef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Feature ✨Additional feature, big or smallRust ⚙️Pull requests that update rust code

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions