Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

public API naming and shape decisions drift without a referenced style guide

Abierto Apto para principiantes
#1,155 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
86/100
Tipo de issue
Documentación
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
rust

Línea de trabajo

Abre CONTRIBUTING.md y confirma que solo se refiere al estilo de código y a los patrones existentes del repositorio. Añade una referencia a las Rust API Guidelines oficiales como base para los nombres y la forma de los tipos de la API pública, sin cambiar las APIs existentes. Se considera terminado cuando la documentación para contribuidores enlaza explícitamente la guía y sus checklists relevantes, mientras que la alineación de la API sigue fuera del alcance.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

P3 question T-documentation T-enhancement

Description

While looking through the crate's public API, I noticed a few inconsistencies that suggest there's no referenced style-guide baseline behind naming/type-shape decisions:

  • Some plain accessors use a get_ prefix while neighboring accessors in the same files don't, which reads as inconsistent with the Rust API Guidelines' C-GETTER convention.
  • Identifier fields (session/task/tool-use/client id) are represented as bare String/Arc<str> rather than distinct types, so nothing stops one id kind being passed where another is expected.

No repo doc references a style guide, so it's unclear whether this is intentional or just drift. Simplest fix: state explicitly in contributor docs that code should be idiomatic and follow the official Rust API Guidelines (https://rust-lang.github.io/api-guidelines/) - its naming (C-*) and type-safety (C-NEWTYPE) checklists already cover both examples above, so this is a documentation change, not a new process to design. Bringing existing API (like the two examples above) in line with the referenced guide is a separate, breaking-change follow-up - worth tracking on its own once the guide itself is adopted, not part of this issue.

Reproduction Steps

  1. rg -n "pub fn get_[a-z_]+\(" crates/rmcp/src - 8 matches, all plain field/derived-value accessors inconsistent with sibling accessors in the same files.
  2. Compare SessionId/EventId/StreamId/task_id/tool_use_id/client_id field types across model.rs, task_manager.rs, transport/auth.rs - all bare String/Arc<str>/type aliases, no newtype.
  3. Checked CONTRIBUTING.md and the repo for any reference to language-specific style guide - none found. CONTRIBUTING.md only says "follow existing code style" / "follow the repository's established patterns," with no concrete convention to check against.

Expected Behavior

Contributor docs cite an explicit style-guide baseline for public API naming/shape.

Actual Behavior

No such reference exists, so it's unclear whether naming inconsistencies like the above are intentional.

Logs / Evidence

Lenguaje dominante
Rust
Estrellas
3.9k
Forks
645
Merge medio
4 d 22 h
PR fusionados (30 d)
37

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de modelcontextprotocol/rust-sdk

Todos los issues de modelcontextprotocol/rust-sdk

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.