{"id":31195769,"url":"https://github.com/studyzy/gopher-learning-rust","last_synced_at":"2025-09-20T03:56:21.049Z","repository":{"id":314427026,"uuid":"1055403875","full_name":"studyzy/Gopher-Learning-Rust","owner":"studyzy","description":"Go程序员从入门到精通Rust","archived":false,"fork":false,"pushed_at":"2025-09-12T11:04:49.000Z","size":1119,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-12T12:25:44.963Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/studyzy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-12T08:07:54.000Z","updated_at":"2025-09-12T11:04:52.000Z","dependencies_parsed_at":"2025-09-12T12:25:46.577Z","dependency_job_id":"8fe0fe62-3b5f-4f7d-b94d-b394175b79ac","html_url":"https://github.com/studyzy/Gopher-Learning-Rust","commit_stats":null,"previous_names":["studyzy/gopher-learning-rust"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/studyzy/Gopher-Learning-Rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studyzy%2FGopher-Learning-Rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studyzy%2FGopher-Learning-Rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studyzy%2FGopher-Learning-Rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studyzy%2FGopher-Learning-Rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/studyzy","download_url":"https://codeload.github.com/studyzy/Gopher-Learning-Rust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studyzy%2FGopher-Learning-Rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276042132,"owners_count":25575000,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-20T03:56:20.006Z","updated_at":"2025-09-20T03:56:21.042Z","avatar_url":"https://github.com/studyzy.png","language":"JavaScript","readme":"# 《Go程序员的Rust从入门到精通》\n\n\u003e 📖 在线阅读：https://studyzy.github.io/Gopher-Learning-Rust/ | 📄 下载PDF：https://studyzy.github.io/Gopher-Learning-Rust/assets/gopher-learning-rust.pdf\n\n本书面向有多年 Go 经验、正在迁移或引入 Rust 的工程师，强调“思维迁移 + 工程落地 + 性能与可靠性”。大纲与章节安排与 SUMMARY 保持一致，便于对照学习与检索。\n\n---\n\n## 第一部分：语言思维转换\n1. 核心差异对比\n   - 内存管理：Go 的 GC vs Rust 的所有权/借用\n   - 并发模型：goroutine+channel vs async/await+Future+runtime\n   - 错误处理：error 接口 vs Result\u003cT, E\u003e + ?\n   - 包管理：Go Modules vs Cargo\n   - 类型系统：Go 接口的鸭子类型 vs Rust 的泛型 + trait bounds\n2. Rust 基础语法 vs Go\n   - 变量/可变性：let/mut vs var\n   - 控制流：if/match vs if/switch\n   - 集合：Vec/HashMap vs slice/map\n   - 闭包与函数：Fn/FnMut/FnOnce 对比 Go 匿名函数\n\n## 第二部分：所有权与生命周期\n3. 所有权核心规则\n   - Move/Copy 语义与借用（\u0026 / \u0026mut）\n   - 生命周期何时需要显式标注\n4. 集合与字符串\n   - Vec/slice 边界与借用\n   - String/str 与 UTF-8 注意事项\n5. 常见陷阱\n   - 悬垂引用、可变与不可变引用冲突\n   - 结构体/函数签名中的生命周期设计\n\n## 第三部分：类型系统与抽象\n6. 结构体、枚举与特征\n   - Enum + 模式匹配对比 Go 的常量 + switch\n   - Trait vs 接口；trait 对象（dyn Trait）与动态分发\n7. 泛型与约束\n   - 泛型与 where 子句\n   - 零成本抽象与单态化的取舍\n\n## 第四部分：Rust 后端必备技能\n8. 异步编程\n   - Future 状态机本质、.await、执行器\n   - Tokio 任务/定时器/IO\n   - Go channel 对照 tokio::sync::mpsc/oneshot\n9. 网络编程\n   - hyper 与 axum（对标 Go net/http 与 gin）\n   - JSON：serde vs encoding/json\n   - gRPC：tonic vs Go gRPC\n10. 数据库与 ORM\n   - SQLx、SeaORM、Diesel\n   - 连接池、迁移、事务实践\n\n## 第五部分：并发与多线程\n11. 并发模型\n   - std::thread vs goroutine\n   - tokio::spawn vs Go routine\n   - Mutex/RwLock vs sync.Mutex/RWMutex\n   - Channel 对照（std 与 tokio）\n12. Actor 模型\n   - actix 与消息驱动\n   - 与 Go 中基于 channel 的 CSP 对比\n\n## 第六部分：工程化与实践\n13. 项目管理\n   - Cargo 工作区、feature flag、CI/CD\n   - 测试/基准：cargo test/bench vs go test/bench\n14. 日志与配置\n   - tracing、结构化日志、OpenTelemetry\n   - 配置合并与环境覆盖（config/serde）\n15. 微服务与分布式\n   - gRPC/HTTP 微服务\n   - 中间件（认证、指标、日志）\n   - 容器化与部署对比（Kubernetes/Docker）\n\n## 第七部分：实战项目\n16. 从零搭建后端\n   - axum + tokio + sqlx + redis 构建 RESTful\n   - JWT 鉴权、gRPC 接入、Prometheus + OTel 监控\n   - Docker/K8s 部署\n17. 高级主题\n   - Unsafe Rust（与 Go unsafe 对照）\n   - FFI（与 C/Go 互操作）\n   - WASM、边缘计算、性能调优与 Profiling\n\n## 第八部分：从 Go 到 Rust 的思维升级\n18. 生产环境中的 Rust\n   - 何时选择 Rust，如何与 Go 共存\n   - SLO/延迟尾部、内存曲线、可观测性\n   - 迁移策略与渐进式替换\n\n## 附：Go 程序员学习 Rust 常见问题\n- 常见问题总览与对照实践指南：src/faq.md\n\n---\n\n👉 学完本书，你将能够：\n- 理解 Rust 与 Go 的核心差异并完成思维迁移；\n- 使用 Rust 构建可上线的后端服务与微服务组件；\n- 在 Go 系统中用 Rust 重写性能热点或以 FFI/IPC 集成；\n- 建立工程化能力：测试、观测、构建与跨平台发布；\n- 针对生产环境做出正确的语言/架构技术决策。","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudyzy%2Fgopher-learning-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstudyzy%2Fgopher-learning-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudyzy%2Fgopher-learning-rust/lists"}