{"id":15031666,"url":"https://github.com/bradyjoestar/rustnotes","last_synced_at":"2025-04-09T20:41:06.334Z","repository":{"id":109008451,"uuid":"195336081","full_name":"bradyjoestar/rustnotes","owner":"bradyjoestar","description":null,"archived":false,"fork":false,"pushed_at":"2020-06-06T09:03:46.000Z","size":6267,"stargazers_count":29,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T22:37:11.750Z","etag":null,"topics":["rust","rustlang"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bradyjoestar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2019-07-05T03:59:16.000Z","updated_at":"2023-08-15T11:41:05.000Z","dependencies_parsed_at":"2023-04-17T22:17:36.283Z","dependency_job_id":null,"html_url":"https://github.com/bradyjoestar/rustnotes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradyjoestar%2Frustnotes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradyjoestar%2Frustnotes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradyjoestar%2Frustnotes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradyjoestar%2Frustnotes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradyjoestar","download_url":"https://codeload.github.com/bradyjoestar/rustnotes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248109700,"owners_count":21049362,"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","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":["rust","rustlang"],"created_at":"2024-09-24T20:16:17.640Z","updated_at":"2025-04-09T20:41:06.323Z","avatar_url":"https://github.com/bradyjoestar.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# rustnotes\n\n## 序\n这份学习笔记是在学习Rust的过程中的记录，主要基于《Rust程序设计语言-简体中文版》和《RustPrimer》两份开源书籍。\n\n上面两本书籍相对全面，但对部分初学者可能更为深奥一些，尤其是之前没有接触过C/C++ 和Rust语言的读者。在学习过程中我对二份开源书籍进行了适合的整理，又加入了一些自己学习过程中新添加的内容，于是就有了这份学习笔记。这份学习笔记的主要贡献在于涵盖了所有工程上基于Rust进行开发需要掌握的基础知识，并且重新调整了目录结构。\n\n我个人对Rust语言设计的看法主要是：重大创新，却又博采众长。\n\nRust为了解决内存安全问题重新设计了类型系统，提出了所有权的概念，同时为了能够解决当前大多数语言无法检测到的运行时错误，rust创造性地设计了无畏并发。Rust借鉴了很多优秀语言的设计理念，以及快速迭代的社区，而这些都是Rust受到赞赏的重要因素。\n\nRust 是一门系统级编程语言，被设计为保证内存和线程安全，并防止段错误。作为系统级编程语言，它的基本理念是 “零开销抽象”。理论上来说，它的速度与 C / C++ 同级。\n\nRust 可以被归为通用的、多范式、编译型的编程语言，类似 C 或者 C++。与这两门编程语言不同的是，Rust 是线程安全的！\n\nRust 编程语言的目标是，创建一个高度安全和并发的软件系统。它强调安全性、并发和内存控制。尽管 Rust 借用了 C 和 C++ 的语法，它不允许空指针和悬挂指针，二者是 C 和 C++ 中系统崩溃、内存泄露和不安全代码的根源。\n\nRust 中有诸如 if else 和循环语句 for 和 while 的通用控制结构。和 C 和 C++ 风格的编程语言一样，代码段放在花括号中。\n\nRust 使用实现（implementation）、特征（trait）和结构化类型（structured type）而不是类（class）。这点，与基于继承的OO语言 C++, Java 有相当大的差异。而跟 Ocaml, Haskell 这类函数式语言更加接近。\n\nRust 做到了内存安全而无需 .NET 和 Java 编程语言中实现自动垃圾收集器的开销，这是通过所有权/借用机制、生命周期、以及类型系统来达到的。\n\nRust 程序设计语言的本质在于赋能（empowerment）：无论你现在编写的是何种代码，Rust 能让你在更为广泛的编程领域走得更远，写出自信。\n比如，“系统层面”（“systems-level”）的工作，涉及内存管理、数据表示和并发等底层细节。从传统角度来看，这是一个神秘的编程领域，只为浸淫多年的极少数人所触及，也只有他们能避开那些臭名昭著的陷阱。即使谨慎的实践者，亦唯恐代码出现漏洞、崩溃或损坏。\n\nRust 破除了这些障碍，其消除了旧的陷阱并提供了伴你一路同行的友好、精良的工具。想要 “深入” 底层控制的程序员可以使用 Rust，无需冒着常见的崩溃或安全漏洞的风险，也无需学习时常改变的工具链的最新知识。其语言本身更是被设计为自然而然的引导你编写出在运行速度和内存使用上都十分高效的可靠代码。\n\n参考：\n- https://rustcc.gitbooks.io/rustprimer/content/   《RustPrimer》\n- https://kaisery.github.io/trpl-zh-cn/   《Rust程序设计语言-简体中文版》\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradyjoestar%2Frustnotes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradyjoestar%2Frustnotes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradyjoestar%2Frustnotes/lists"}