<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0"><channel><title>流云卷雪</title><link>https://flwsno.com</link><atom:link href="https://flwsno.com/rss.xml" rel="self" type="application/rss+xml"/><description>流云终破雾，卷雪自生春</description><generator>Halo v2.24.2</generator><language>zh-cn</language><image><url>https://flwsno.com/upload/xue.svg</url><title>流云卷雪</title><link>https://flwsno.com</link></image><lastBuildDate>Thu, 14 May 2026 08:03:17 GMT</lastBuildDate><item><title><![CDATA[19. 不安全：unsafe]]></title><link>https://flwsno.com/archives/19.-bu-an-quan-unsafe</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=19.%20%E4%B8%8D%E5%AE%89%E5%85%A8%EF%BC%9Aunsafe&amp;url=/archives/19.-bu-an-quan-unsafe" width="1" height="1" alt="" style="opacity:0;">使用 unsafe 关键字将 Rust 安全代码和非安全代码建立边界。 unsafe block unsafe {} 用于指示编译器忽略一些严格的安全检查（但不忽略所有检查）, 主要使用场景: 读写裸指针（在安全代码中可以创建、转移、比较 裸指针，但是不能使用裸指针，如解引用和赋值）； 调用外部库函]]></description><guid isPermaLink="false">/archives/19.-bu-an-quan-unsafe</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 14 May 2026 03:19:19 GMT</pubDate></item><item><title><![CDATA[18. 测试：testing]]></title><link>https://flwsno.com/archives/18.-ce-shi-testing</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=18.%20%E6%B5%8B%E8%AF%95%EF%BC%9Atesting&amp;url=/archives/18.-ce-shi-testing" width="1" height="1" alt="" style="opacity:0;">Rust 提供了如下测试类型: 单元测试：Unit testing; 文档测试：Doc testing; 集成测试：Integration testing; Cargo.toml 为 testing/exampels 提供了单独的依赖配置: [dev-dependencies] pretty_ass]]></description><guid isPermaLink="false">/archives/18.-ce-shi-testing</guid><dc:creator>小钰大猪崽</dc:creator><pubDate>Thu, 14 May 2026 03:18:20 GMT</pubDate></item><item><title><![CDATA[17. 外部函数调用：FFI]]></title><link>https://flwsno.com/archives/17.-wai-bu-han-shu-diao-yong-ffi</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=17.%20%E5%A4%96%E9%83%A8%E5%87%BD%E6%95%B0%E8%B0%83%E7%94%A8%EF%BC%9AFFI&amp;url=/archives/17.-wai-bu-han-shu-diao-yong-ffi" width="1" height="1" alt="" style="opacity:0;">Rust 可以使用和链接其它语言开发的外部库中的函数和全局 item（如常量、变量、类型定义等），但在使用前必须在 extern block（ extern "ABI" {}） 中声明。 extern block 中只能声明 static 变量（对应 C 的全局变量或常量）和函数（只是函数签名），后]]></description><guid isPermaLink="false">/archives/17.-wai-bu-han-shu-diao-yong-ffi</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 14 May 2026 03:17:05 GMT</pubDate></item><item><title><![CDATA[16. 裸指针：raw pointer]]></title><link>https://flwsno.com/archives/16.-luo-zhi-zhen-raw-pointer</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=16.%20%E8%A3%B8%E6%8C%87%E9%92%88%EF%BC%9Araw%20pointer&amp;url=/archives/16.-luo-zhi-zhen-raw-pointer" width="1" height="1" alt="" style="opacity:0;">Rust 提供两种类型的裸指针类型：*mut T 和 *const T。 裸指针的主要使用场景是 FFI，如 Rust 调用的 C 函数包含指针类型参数时需要使用裸指针： // libc 的 malloc 和 free 使用裸指针来管理内存 #[allow(unused_extern_crates)]]></description><guid isPermaLink="false">/archives/16.-luo-zhi-zhen-raw-pointer</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 14 May 2026 03:15:43 GMT</pubDate></item><item><title><![CDATA[15. 宏：macro]]></title><link>https://flwsno.com/archives/15.-hong-macro</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=15.%20%E5%AE%8F%EF%BC%9Amacro&amp;url=/archives/15.-hong-macro" width="1" height="1" alt="" style="opacity:0;">macro 可以简化重复代码编写任务，实现 DSL，编译时生成代码等： 快速创建 Vec 的 vec![] ； 为数据结构添加各种 trait 支持的 derive macro: #[derive(Debug, Default, ...)] ； 单元测试宏：#[cfg(test)] macro 还可]]></description><guid isPermaLink="false">/archives/15.-hong-macro</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 14 May 2026 03:14:38 GMT</pubDate></item><item><title><![CDATA[14. 异步：async]]></title><link>https://flwsno.com/archives/14.-yi-bu-async</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=14.%20%E5%BC%82%E6%AD%A5%EF%BC%9Aasync&amp;url=/archives/14.-yi-bu-async" width="1" height="1" alt="" style="opacity:0;">线程（thread）的问题： 每个线程都有固定大小的栈内存占用，成千上万个线程会消耗大量的内存； 内核调度线程运行的上下文切换开销大； 线程在执行 read/write 系统调用时，尤其是网络通信时，会有大量的时间被 block 等待，此时该线程不能再执行其它事情，效率低； 异步（async）通过创]]></description><guid isPermaLink="false">/archives/14.-yi-bu-async</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 14 May 2026 03:13:31 GMT</pubDate></item><item><title><![CDATA[13. 包和模块：package/crate/module]]></title><link>https://flwsno.com/archives/13.-bao-he-mo-kuai-package-crate-module</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=13.%20%E5%8C%85%E5%92%8C%E6%A8%A1%E5%9D%97%EF%BC%9Apackage%2Fcrate%2Fmodule&amp;url=/archives/13.-bao-he-mo-kuai-package-crate-module" width="1" height="1" alt="" style="opacity:0;">crate 一个 package 包含一个或多个 crate, crate 分 3 种类型: binary、library、procedure_macro。 使用 cargo new my-project 命令创建 package，一个 package 至多包含一个 library crate（使用]]></description><guid isPermaLink="false">/archives/13.-bao-he-mo-kuai-package-crate-module</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 14 May 2026 03:11:42 GMT</pubDate></item><item><title><![CDATA[12. 迭代器：iterator]]></title><link>https://flwsno.com/archives/12.-die-dai-qi-iterator</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=12.%20%E8%BF%AD%E4%BB%A3%E5%99%A8%EF%BC%9Aiterator&amp;url=/archives/12.-die-dai-qi-iterator" width="1" height="1" alt="" style="opacity:0;">迭代器是实现 Iterator trait 的类型对象： pub trait Iterator { type Item; // Required method fn next(&amp;mut self) -&gt; Option&lt;Self::Item&gt;; // Provide]]></description><guid isPermaLink="false">/archives/12.-die-dai-qi-iterator</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 14 May 2026 03:10:39 GMT</pubDate></item><item><title><![CDATA[11. 类型协变：type coercion]]></title><link>https://flwsno.com/archives/11.-lei-xing-xie-bian-type-coercion</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=11.%20%E7%B1%BB%E5%9E%8B%E5%8D%8F%E5%8F%98%EF%BC%9Atype%20coercion&amp;url=/archives/11.-lei-xing-xie-bian-type-coercion" width="1" height="1" alt="" style="opacity:0;">子类型和变体 子类型（Subtyping）是隐式的自动转换 type coercion 支持的一个场景, 只用于表达 lifetime 之间的关系（Rust 类型之间 没有子类型语义），包含两种类型： 生命周期更长的 lifetime 是更短的子类型： 'b: 'a 表示 ‘b 的生命周期比 ‘a]]></description><guid isPermaLink="false">/archives/11.-lei-xing-xie-bian-type-coercion</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 14 May 2026 03:09:39 GMT</pubDate></item><item><title><![CDATA[10. 泛型和特性：generic/trait]]></title><link>https://flwsno.com/archives/10.-fan-xing-he-te-xing-generic-trait</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=10.%20%E6%B3%9B%E5%9E%8B%E5%92%8C%E7%89%B9%E6%80%A7%EF%BC%9Ageneric%2Ftrait&amp;url=/archives/10.-fan-xing-he-te-xing-generic-trait" width="1" height="1" alt="" style="opacity:0;">泛型 类型/函数/方法可以使用泛型参数 &lt;CamelCase, ...&gt;，泛型参数可以使用 lifetime 和 trait 进行限界： // 泛型参数类型：T 为泛型类型名称，名称位于类型名后的 &lt;..&gt; 中。 // T 没有任何限界，默认为 Sized。 struct Point&lt;T&gt; { x:]]></description><guid isPermaLink="false">/archives/10.-fan-xing-he-te-xing-generic-trait</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 14 May 2026 03:08:35 GMT</pubDate></item><item><title><![CDATA[9. 函数、方法和闭包：function/method/closure]]></title><link>https://flwsno.com/archives/9.-han-shu-fang-fa-he-bi-bao-function-method-closure</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=9.%20%E5%87%BD%E6%95%B0%E3%80%81%E6%96%B9%E6%B3%95%E5%92%8C%E9%97%AD%E5%8C%85%EF%BC%9Afunction%2Fmethod%2Fclosure&amp;url=/archives/9.-han-shu-fang-fa-he-bi-bao-function-method-closure" width="1" height="1" alt="" style="opacity:0;">函数用于执行一个任务或计算一个值。 函数使用 fn 声明, 使用 -&gt; 来指定返回值类型，没有指定返回值时默认为 unit type 类型和值 ()。 函数签名的每个参数都要标注类型，但 lifetime 可以使用 '_ 来让编译器自动推导（如根据 lifetime elision rule），如：]]></description><guid isPermaLink="false">/archives/9.-han-shu-fang-fa-he-bi-bao-function-method-closure</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Fri, 24 Apr 2026 09:58:19 GMT</pubDate></item><item><title><![CDATA[8. 模式匹配：match pattern]]></title><link>https://flwsno.com/archives/8.-mo-shi-pi-pei-match-pattern</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=8.%20%E6%A8%A1%E5%BC%8F%E5%8C%B9%E9%85%8D%EF%BC%9Amatch%20pattern&amp;url=/archives/8.-mo-shi-pi-pei-match-pattern" width="1" height="1" alt="" style="opacity:0;">模式匹配 match expression {} 是一个表达式，可用于变量赋值： expression 的结果可以是复杂类型, 如 struct、enum、tuple 等； 各 branch 是逗号分割的 pattern =&gt; {statements;},； 如果是单条语句，则可以省略大括号，如 p]]></description><guid isPermaLink="false">/archives/8.-mo-shi-pi-pei-match-pattern</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Fri, 24 Apr 2026 07:36:23 GMT</pubDate></item><item><title><![CDATA[7. 流程控制：flow control]]></title><link>https://flwsno.com/archives/7.-liu-cheng-kong-zhi-flow-control</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=7.%20%E6%B5%81%E7%A8%8B%E6%8E%A7%E5%88%B6%EF%BC%9Aflow%20control&amp;url=/archives/7.-liu-cheng-kong-zhi-flow-control" width="1" height="1" alt="" style="opacity:0;">Rust 是表达式语言，let、let-else、if-else，if-let，while-let，match，loop，block 等都是表达式，可以有返回值，可用于变量赋值。 // 语句没有返回值，所以下面代码编译时报错： let x = (let y = 5); Rust 控制流结构包括：i]]></description><guid isPermaLink="false">/archives/7.-liu-cheng-kong-zhi-flow-control</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Fri, 24 Apr 2026 07:34:51 GMT</pubDate></item><item><title><![CDATA[6. 生命周期：lifetime]]></title><link>https://flwsno.com/archives/6.-sheng-ming-zhou-qi-lifetime</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=6.%20%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F%EF%BC%9Alifetime&amp;url=/archives/6.-sheng-ming-zhou-qi-lifetime" width="1" height="1" alt="" style="opacity:0;">Rust 所有对象都具有 lifetime。 lifetime 是类型的注解参数, 不能在表达式中使用。只在编译时检查，运行时不感知： // 不支持在表达式中使用 lifetime 注解 // error: borrow expressions cannot be annotated with li]]></description><guid isPermaLink="false">/archives/6.-sheng-ming-zhou-qi-lifetime</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 23 Apr 2026 09:25:09 GMT</pubDate></item><item><title><![CDATA[5. 借用：refer/borrow]]></title><link>https://flwsno.com/archives/5.-jie-yong-refer-borrow</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=5.%20%E5%80%9F%E7%94%A8%EF%BC%9Arefer%2Fborrow&amp;url=/archives/5.-jie-yong-refer-borrow" width="1" height="1" alt="" style="opacity:0;">OBRM OBRM(Owner Base Resource Manage) 规则: 每一个 Rust 对象都有一个称为 Owner 的变量； 某个时刻，每个 Rust 对象只能有一个所有者（Owner）； 当对象不再使用时，Rust 会调用它的 Drop trait 实现来释放资源； 通过 OBRM]]></description><guid isPermaLink="false">/archives/5.-jie-yong-refer-borrow</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 23 Apr 2026 09:22:33 GMT</pubDate></item><item><title><![CDATA[4. 错误处理：panic/error/Option/Result]]></title><link>https://flwsno.com/archives/4.-cuo-wu-chu-li-panic-error-option-result</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=4.%20%E9%94%99%E8%AF%AF%E5%A4%84%E7%90%86%EF%BC%9Apanic%2Ferror%2FOption%2FResult&amp;url=/archives/4.-cuo-wu-chu-li-panic-error-option-result" width="1" height="1" alt="" style="opacity:0;">panic panic 是 Rust 提供的异常处理机制，打印 error message，然后开始回溯线程调用栈（unwinding stack），drop 所有对象： 如果是主线程 panic，则整个程序退出； 如果是子线程 panic，则终止该子线程，程序不退出； 默认只打印 error me]]></description><guid isPermaLink="false">/archives/4.-cuo-wu-chu-li-panic-error-option-result</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 23 Apr 2026 08:38:52 GMT</pubDate></item><item><title><![CDATA[3. 类型：type]]></title><link>https://flwsno.com/archives/3.-lei-xing-type</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=3.%20%E7%B1%BB%E5%9E%8B%EF%BC%9Atype&amp;url=/archives/3.-lei-xing-type" width="1" height="1" alt="" style="opacity:0;">类型 基础类型：Boolean, Numeric, Textual, Never; 序列类型：Tuple, Array, Slice; 自定义类型：Struct, Enum, Union; 函数类型：Functions, Closures; 指针类型：References, Raw pointers]]></description><guid isPermaLink="false">/archives/3.-lei-xing-type</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 23 Apr 2026 08:16:12 GMT</pubDate></item><item><title><![CDATA[2. 变量和常量：variable/const/static]]></title><link>https://flwsno.com/archives/2.-bian-liang-he-chang-liang-variable-const-static</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=2.%20%E5%8F%98%E9%87%8F%E5%92%8C%E5%B8%B8%E9%87%8F%EF%BC%9Avariable%2Fconst%2Fstatic&amp;url=/archives/2.-bian-liang-he-chang-liang-variable-const-static" width="1" height="1" alt="" style="opacity:0;">使用 let 声明变量, 默认不可变 (immutable)，使用 mut 声明可变变量： let _immutable_binding = 1; let mut mutable_binding = 1; println!("Before mutation: {}", mutable_bindin]]></description><guid isPermaLink="false">/archives/2.-bian-liang-he-chang-liang-variable-const-static</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 23 Apr 2026 08:04:07 GMT</pubDate></item><item><title><![CDATA[1. 标识符和注释：identify/comment]]></title><link>https://flwsno.com/archives/1.-biao-shi-fu-he-zhu-shi-identify-comment</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=1.%20%E6%A0%87%E8%AF%86%E7%AC%A6%E5%92%8C%E6%B3%A8%E9%87%8A%EF%BC%9Aidentify%2Fcomment&amp;url=/archives/1.-biao-shi-fu-he-zhu-shi-identify-comment" width="1" height="1" alt="" style="opacity:0;">标识符 不能以数字开头，不能使用关键字和保留字。 以 r# 开头的 raw indentify 可以使用关键字作为标识符。 foo _identifier r#true Москва 東京]]></description><guid isPermaLink="false">/archives/1.-biao-shi-fu-he-zhu-shi-identify-comment</guid><dc:creator>小钰大猪崽</dc:creator><category>Rust</category><pubDate>Thu, 23 Apr 2026 07:30:07 GMT</pubDate></item><item><title><![CDATA[使用Rustfs+Picgo实现自建S3存储图床上传]]></title><link>https://flwsno.com/archives/rustfs-picgo</link><description><![CDATA[<img src="https://flwsno.com/plugins/feed/assets/telemetry.gif?title=%E4%BD%BF%E7%94%A8Rustfs%2BPicgo%E5%AE%9E%E7%8E%B0%E8%87%AA%E5%BB%BAS3%E5%AD%98%E5%82%A8%E5%9B%BE%E5%BA%8A%E4%B8%8A%E4%BC%A0&amp;url=/archives/rustfs-picgo" width="1" height="1" alt="" style="opacity:0;">本文假设读者具有一定的服务器操作知识, 会基本的Docker和命令行操作, 文中仅给出最核心的操作 https以及域名访问部分需要有公网IP和自购域名, 如果只是内网访问, 可以不配置https/域名/cloudflare相关内容 有不清楚的地方可以AI搜索, 或者评论区讨论 rustfs部署 do]]></description><guid isPermaLink="false">/archives/rustfs-picgo</guid><dc:creator>小钰大猪崽</dc:creator><category>云存储</category><pubDate>Thu, 23 Apr 2026 05:59:32 GMT</pubDate></item></channel></rss>