public API naming and shape decisions drift without a referenced style guide
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 86/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- rust
调研方向
打开 CONTRIBUTING.md,并确认它只涉及现有的代码风格和仓库模式。添加对官方 Rust API Guidelines 的引用,将其作为公共 API 命名和类型形状的基准,但不要更改现有 API。完成的标准是,贡献者文档明确链接到该指南及其相关检查清单,同时 API 对齐仍不在范围内。
由索引模型根据 Issue 内容生成。
描述
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
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.- Compare
SessionId/EventId/StreamId/task_id/tool_use_id/client_idfield types acrossmodel.rs,task_manager.rs,transport/auth.rs- all bareString/Arc<str>/type aliases, no newtype. - 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
- 主要语言
- Rust
- 星标
- 4k
- 派生
- 662
- 平均合并
- 3 天 23 小时
- 30 天内合并 PR
- 34
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/rust-sdk 的其他 Issue
-
Streamable HTTP client: a 401 or 403 with a JSON-RPC error body and no WWW-Authenticate loses its HTTP status可能已有人在做 @aton-of-data 于 4 天前认领。 未关闭bug P2 ready for work T-security T-transport
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/rust-sdk#1339 ·
维护者通常 3 天内回复
-
auth: refresh_token() requests offline_access that was never granted, so refreshes fail with invalid_scope可能已有人在做 @jstar0 于 6 天前认领。 未关闭bug P1 ready for work T-security T-transport
难度 2/5 1-3 小时 新手友好度 65/100
modelcontextprotocol/rust-sdk#1330 ·
维护者通常 3 天内回复
-
Two rmcp tests fail on Windows: connection-refused text check and `npm` spawn in test_with_js可能已有人在做 @bolinfest 今天认领。 未关闭bug P2 ready for work T-test
modelcontextprotocol/rust-sdk#1364 · 1 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
-
Client never answers a server `ping` sent during the `initialize` handshake可能已有人在做 @bolinfest 今天认领。 未关闭bug P1 ready for work T-service
modelcontextprotocol/rust-sdk#1362 · 3 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
-
streamable-http client: an error response to `initialize` is lost or ignored (SSE, session re-init)可能已有人在做 @bolinfest 于 1 天前认领。 未关闭bug P1 ready for work T-transport
modelcontextprotocol/rust-sdk#1360 · 1 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
查看 modelcontextprotocol/rust-sdk 的全部 Issue
相似的 Issue
-
Four problem loader browser tests fail on Windows可能已有人在做 @Patriciaath999 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
starkware-libs/sequencer#15229 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 66/100
ActivityWatch/aw-notify-rs#47 · 1 条评论 ·