<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>orhan.cn - Rust</title>
    <link rel="self" type="application/atom+xml" href="https://orhan.cn/tags/rust/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://orhan.cn"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-06-10T00:00:00+00:00</updated>
    <id>https://orhan.cn/tags/rust/atom.xml</id>
    <entry xml:lang="en">
        <title>Rust derive_builder crate：用宏生成 Builder 模式</title>
        <published>2026-06-10T00:00:00+00:00</published>
        <updated>2026-06-10T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              menzil
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://orhan.cn/posts/rust-derive-builder-crate/"/>
        <id>https://orhan.cn/posts/rust-derive-builder-crate/</id>
        
        <summary type="html">&lt;p&gt;如果你在找 &lt;code&gt;drive_builder&lt;&#x2F;code&gt;，crates.io 上目前没有这个 Rust crate。更常见、也更符合这个名字含义的 crate 是 &lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;derive_builder&quot;&gt;&lt;code&gt;derive_builder&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;：它通过 &lt;code&gt;#[derive(Builder)]&lt;&#x2F;code&gt; 为结构体自动生成 Builder 模式代码，减少大量重复 setter、默认值和校验逻辑。&lt;&#x2F;p&gt;</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>AIRE：面向交互式应用的实时音频引擎</title>
        <published>2026-05-26T00:00:00+00:00</published>
        <updated>2026-05-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              menzil
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://orhan.cn/posts/aire-realtime-audio-engine/"/>
        <id>https://orhan.cn/posts/aire-realtime-audio-engine/</id>
        
        <summary type="html">&lt;p&gt;最近看到一个很适合游戏开发者关注的小项目：&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Breijen&#x2F;aire&quot;&gt;AIRE&lt;&#x2F;a&gt;。它不是通用播放器，也不是 DAW 级音频工作站，而是一个更贴近游戏和交互式应用需求的实时音频引擎。&lt;&#x2F;p&gt;
&lt;p&gt;项目作者是在业余时间开发 2D 游戏时遇到问题：现有音频库要么太底层，要么只解决“把声音播出来”，但游戏里真正麻烦的是运行时控制、声音状态切换、低延迟混音、合成音效，以及后续的空间音频和环境声学。于是作者干脆自己做了 AIRE。&lt;&#x2F;p&gt;</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Scena 1.5.1：Rust 原生 3D 渲染器的新进展</title>
        <published>2026-05-26T00:00:00+00:00</published>
        <updated>2026-05-26T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              menzil
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://orhan.cn/posts/scena-1-5-1/"/>
        <id>https://orhan.cn/posts/scena-1-5-1/</id>
        
        <summary type="html">&lt;p&gt;最近 &lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;scena&quot;&gt;Scena&lt;&#x2F;a&gt; 发布了 1.5.1。它是一个 Rust 原生的 3D 渲染器，目标不是做一个完整游戏引擎，而是提供一层更聚焦的 3D 可视化能力：场景图、glTF&#x2F;GLB 加载、PBR 材质、相机、灯光、交互、浏览器渲染、本地渲染，以及无头图像生成。&lt;&#x2F;p&gt;
&lt;p&gt;如果你做的是 3D 模型查看器、产品展示、工业可视化、数字孪生前端或自动生成渲染图，Scena 这种定位会比较有意思。它把常见 3D 查看器流程封装成 Rust API：加载模型，实例化到场景，添加灯光和相机，准备渲染资源，然后输出画面。&lt;&#x2F;p&gt;</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Bolt FFI：让 Rust 成为跨平台业务逻辑的核心</title>
        <published>2026-05-12T00:00:00+00:00</published>
        <updated>2026-05-12T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              menzil
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://orhan.cn/posts/boltffi-intro/"/>
        <id>https://orhan.cn/posts/boltffi-intro/</id>
        
        <summary type="html">&lt;p&gt;最近关注到 &lt;a href=&quot;https:&#x2F;&#x2F;www.boltffi.dev&#x2F;&quot;&gt;Bolt FFI&lt;&#x2F;a&gt;，这是一个能把 Rust 库自动导出为多语言绑定的工具。它的定位很清晰：把业务逻辑集中在 Rust 中，一次编写，多端复用。&lt;&#x2F;p&gt;</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Rust 跨平台 UI 框架新动向：WaterUI、Blinc 与 Ply</title>
        <published>2026-05-12T00:00:00+00:00</published>
        <updated>2026-05-12T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              menzil
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://orhan.cn/posts/rust-ui-frameworks-2025/"/>
        <id>https://orhan.cn/posts/rust-ui-frameworks-2025/</id>
        
        <summary type="html">&lt;p&gt;Rust 的 GUI 生态一直是个热闹的话题。从早期的 egui、iced，到 Dioxus、Slint，各家在自绘、原生渲染、Web 技术栈之间走不同的路线。最近注意到三个较新的框架——&lt;a href=&quot;https:&#x2F;&#x2F;waterui.dev&#x2F;&quot;&gt;WaterUI&lt;&#x2F;a&gt;、&lt;a href=&quot;https:&#x2F;&#x2F;project-blinc.github.io&#x2F;Blinc&#x2F;introduction.html&quot;&gt;Blinc&lt;&#x2F;a&gt; 和 &lt;a href=&quot;https:&#x2F;&#x2F;plyx.iz.rs&#x2F;&quot;&gt;Ply&lt;&#x2F;a&gt;——它们都在尝试用 Rust 写一套代码，跑在移动端、桌面端甚至 Web 上。本文简单梳理它们的特点和差异。&lt;&#x2F;p&gt;</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Git 分支重置到之前的提交</title>
        <published>2026-03-06T00:00:00+00:00</published>
        <updated>2026-03-06T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              menzil
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://orhan.cn/posts/git-reset-branch-to-previous-commit/"/>
        <id>https://orhan.cn/posts/git-reset-branch-to-previous-commit/</id>
        
        <content type="html" xml:base="https://orhan.cn/posts/git-reset-branch-to-previous-commit/">&lt;h2 id=&quot;wen-ti-miao-shu&quot;&gt;问题描述&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#wen-ti-miao-shu&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;在运行 &lt;code&gt;cargo watch -x &#x27;run -p gateway&#x27;&lt;&#x2F;code&gt; 时遇到错误：&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;error: failed to load manifest for workspace member
&lt;&#x2F;span&gt;&lt;span&gt;referenced by workspace at `&#x2F;path&#x2F;to&#x2F;Cargo.toml`
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;Caused by:
&lt;&#x2F;span&gt;&lt;span&gt;  failed to load manifest for dependency `module-store`
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;Caused by:
&lt;&#x2F;span&gt;&lt;span&gt;  failed to read `&#x2F;path&#x2F;to&#x2F;modules&#x2F;store&#x2F;Cargo.toml`
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;Caused by:
&lt;&#x2F;span&gt;&lt;span&gt;  No such file or directory (os error 2)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;原因是 &lt;code&gt;Cargo.toml&lt;&#x2F;code&gt; 中的 workspace members 列表包含了 &lt;code&gt;modules&#x2F;store&lt;&#x2F;code&gt; 和 &lt;code&gt;modules&#x2F;merchant&lt;&#x2F;code&gt;，但这些目录实际上不存在。这是由于之前的错误提交导致的。&lt;&#x2F;p&gt;
&lt;h2 id=&quot;jie-jue-fang-an&quot;&gt;解决方案&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#jie-jue-fang-an&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;1-que-ren-zheng-que-de-ti-jiao&quot;&gt;1. 确认正确的提交&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#1-que-ren-zheng-que-de-ti-jiao&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;首先查看提交历史，找到最后一个正常工作的提交：&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; log&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --oneline
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;确认目标提交是 &lt;code&gt;14b6cf9&lt;&#x2F;code&gt; (use orm fixed n+1)。&lt;&#x2F;p&gt;
&lt;h3 id=&quot;2-zhong-zhi-fen-zhi&quot;&gt;2. 重置分支&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#2-zhong-zhi-fen-zhi&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;如果当前在 detached HEAD 状态，可以使用以下方法：&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# 方法一：强制将 main 分支指向当前 HEAD，然后切换到 main
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; branch&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; -f&lt;&#x2F;span&gt;&lt;span&gt; main HEAD &amp;amp;&amp;amp; &lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; checkout main
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# 方法二：切换回 main 分支，然后重置到目标提交
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; checkout main
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; reset&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --hard&lt;&#x2F;span&gt;&lt;span&gt; 14b6cf9
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;如果已经在 main 分支上：&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# 直接重置
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; reset&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --hard&lt;&#x2F;span&gt;&lt;span&gt; 14b6cf9
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;3-tui-song-dao-yuan-cheng-ke-xuan&quot;&gt;3. 推送到远程（可选）&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#3-tui-song-dao-yuan-cheng-ke-xuan&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;如果需要更新远程仓库，使用 force push：&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; push origin main&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --force
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;⚠️ 注意&lt;&#x2F;strong&gt;：&lt;code&gt;--force&lt;&#x2F;code&gt; 会覆盖远程历史记录，如果团队中有其他人在使用该分支，请先沟通确认。&lt;&#x2F;p&gt;
&lt;h3 id=&quot;4-yan-zheng&quot;&gt;4. 验证&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#4-yan-zheng&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# 查看当前分支和状态
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; branch&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --show-current
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; status
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# 查看最近的提交
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; log&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --oneline -5
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;xiang-guan-zhi-shi&quot;&gt;相关知识&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#xiang-guan-zhi-shi&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;git-reset-hard-de-zuo-yong&quot;&gt;git reset --hard 的作用&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#git-reset-hard-de-zuo-yong&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;移动 HEAD 指针到指定提交&lt;&#x2F;li&gt;
&lt;li&gt;重置暂存区（staging area）&lt;&#x2F;li&gt;
&lt;li&gt;重置工作目录（working directory）&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;会丢失所有未提交的更改&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;detached-head-zhuang-tai&quot;&gt;Detached HEAD 状态&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#detached-head-zhuang-tai&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;当你直接 checkout 到某个提交（而不是分支）时，会进入 detached HEAD 状态。此时的修改不属于任何分支，需要创建新分支或切换回已有分支。&lt;&#x2F;p&gt;
&lt;h3 id=&quot;geng-an-quan-de-ti-dai-fang-an&quot;&gt;更安全的替代方案&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#geng-an-quan-de-ti-dai-fang-an&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;p&gt;如果不想使用 &lt;code&gt;--hard&lt;&#x2F;code&gt;，可以考虑：&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# 创建备份分支
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; branch backup-branch
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# 使用 revert 撤销提交（保留历史）
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; revert &amp;lt;commit-hash&amp;gt;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#65737e;&quot;&gt;# 或使用 reset --soft（保留更改在暂存区）
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span&gt; reset&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt; --soft &lt;&#x2F;span&gt;&lt;span&gt;&amp;lt;commit-hash&amp;gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h2 id=&quot;zong-jie&quot;&gt;总结&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#zong-jie&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;p&gt;遇到 Cargo workspace 成员缺失的问题时，首先检查 &lt;code&gt;Cargo.toml&lt;&#x2F;code&gt; 中的 members 列表是否与实际目录结构匹配。如果是由错误提交导致的，可以使用 &lt;code&gt;git reset --hard&lt;&#x2F;code&gt; 快速回退到正确的状态。&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>psql: error: connection to server on socket &#x2F;tmp&#x2F;.s.PGSQL.5432 原因及修复方法</title>
        <published>2025-10-27T00:00:00+00:00</published>
        <updated>2025-10-27T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              menzil
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://orhan.cn/posts/psql-error-connection-to-server-on-socket/"/>
        <id>https://orhan.cn/posts/psql-error-connection-to-server-on-socket/</id>
        
        <content type="html" xml:base="https://orhan.cn/posts/psql-error-connection-to-server-on-socket/">&lt;p&gt;MacOS 上brew安装的PostgreSQL有时候就报&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;psql:&lt;&#x2F;span&gt;&lt;span&gt; error: connection to server on socket &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color:#a3be8c;&quot;&gt;&#x2F;tmp&#x2F;.s.PGSQL.5432&lt;&#x2F;span&gt;&lt;span&gt;&amp;quot; failed: No such file or directory 	Is the server running locally and accepting connections on that socket?
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;重启也没能解决，后来找了以后，找到原因了。&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;postmaster.pid&lt;&#x2F;span&gt;&lt;span&gt; already exists
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;上一次异常退出，pid 文件没清。
清理办法：&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;rm -f&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;opt&#x2F;homebrew&#x2F;var&#x2F;postgresql@17&#x2F;postmaster.pid
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;后面启动就行&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;sh&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-sh &quot;&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;brew&lt;&#x2F;span&gt;&lt;span&gt; services restart postgresql@17
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;就是一次问题的记录，希望对你有帮助！&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Rust Best Crates</title>
        <published>2025-09-23T00:00:00+00:00</published>
        <updated>2025-09-23T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              menzil
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://orhan.cn/posts/best-crates/"/>
        <id>https://orhan.cn/posts/best-crates/</id>
        
        <content type="html" xml:base="https://orhan.cn/posts/best-crates/">&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;pgrx&quot;&gt;Build Postgres Extensions with Rust!&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;mry&quot;&gt;Mry A simple but powerful mocking library for structs, traits, and function.&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;rumqttc&quot;&gt;rumqttc&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;postgrest&quot;&gt;postgrest&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>IOS正式打包证书创建</title>
        <published>2025-09-16T00:00:00+00:00</published>
        <updated>2025-09-16T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              menzil
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://orhan.cn/posts/ios-develop/"/>
        <id>https://orhan.cn/posts/ios-develop/</id>
        
        <content type="html" xml:base="https://orhan.cn/posts/ios-develop/">&lt;h2 id=&quot;ru-he-jiang-ios-sheng-chan-zheng-shu-cer-zhuan-huan-wei-p12-wen-jian-bing-chuang-jian-miao-shu-wen-jian&quot;&gt;如何将 iOS 生产证书（.cer）转换为 .p12 文件并创建描述文件&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#ru-he-jiang-ios-sheng-chan-zheng-shu-cer-zhuan-huan-wei-p12-wen-jian-bing-chuang-jian-miao-shu-wen-jian&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;1-zhuan-huan-cer-wen-jian-wei-p12-wen-jian&quot;&gt;1. 转换 &lt;code&gt;.cer&lt;&#x2F;code&gt; 文件为 &lt;code&gt;.p12&lt;&#x2F;code&gt; 文件&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#1-zhuan-huan-cer-wen-jian-wei-p12-wen-jian&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;打开钥匙串访问&lt;&#x2F;strong&gt;
在 Mac 电脑上，通过 “聚焦搜索”（通常是按下 &lt;code&gt;Command + 空格&lt;&#x2F;code&gt;）输入 “钥匙串访问”，然后打开该应用程序。&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;导入 &lt;code&gt;.cer&lt;&#x2F;code&gt; 证书&lt;&#x2F;strong&gt;
双击下载好的 &lt;code&gt;ios_distribution.cer&lt;&#x2F;code&gt; 文件，系统会自动将其导入到钥匙串访问中。
你可以在钥匙串访问的 &lt;strong&gt;证书&lt;&#x2F;strong&gt; 类别中找到它，证书名称通常类似于 &lt;code&gt;iPhone Distribution&lt;&#x2F;code&gt;。&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;导出为 &lt;code&gt;.p12&lt;&#x2F;code&gt; 文件&lt;&#x2F;strong&gt;
在钥匙串访问中，找到刚才导入的 &lt;code&gt;iPhone Distribution&lt;&#x2F;code&gt; 证书。
右键点击该证书，选择 &lt;strong&gt;“导出”&lt;&#x2F;strong&gt; 选项。
在弹出的保存对话框中，选择 &lt;strong&gt;个人信息交换（.p12）&lt;&#x2F;strong&gt; 作为文件格式。
选择一个合适的保存位置，并设置一个密码来保护这个 &lt;code&gt;.p12&lt;&#x2F;code&gt; 文件。
请务必记住这个密码，因为在后续打包过程中会用到。&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;2-chuang-jian-miao-shu-wen-jian-provisioning-profile&quot;&gt;2. 创建描述文件（Provisioning Profile）&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#2-chuang-jian-miao-shu-wen-jian-provisioning-profile&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;登录苹果开发者官网&lt;&#x2F;strong&gt;
进入 &lt;a href=&quot;https:&#x2F;&#x2F;developer.apple.com&quot;&gt;Apple Developer&lt;&#x2F;a&gt; 官网。&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;创建新的描述文件&lt;&#x2F;strong&gt;
进入 &lt;strong&gt;Certificates, Identifiers &amp;amp; Profiles&lt;&#x2F;strong&gt; 页面。
在左侧导航栏中选择 &lt;strong&gt;Profiles&lt;&#x2F;strong&gt;，然后点击右上角的 &lt;strong&gt;+&lt;&#x2F;strong&gt; 号创建一个新的描述文件。&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;选择 Distribution 类型&lt;&#x2F;strong&gt;
在新建描述文件页面，选择 &lt;strong&gt;Distribution&lt;&#x2F;strong&gt; 类型，例如 &lt;strong&gt;App Store Connect&lt;&#x2F;strong&gt;，然后点击 &lt;strong&gt;继续&lt;&#x2F;strong&gt;。&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;选择 App ID&lt;&#x2F;strong&gt;
选择之前创建好的 &lt;strong&gt;App ID&lt;&#x2F;strong&gt;，然后点击 &lt;strong&gt;下一步&lt;&#x2F;strong&gt;。&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;完成描述文件创建&lt;&#x2F;strong&gt;
根据提示完成描述文件的创建，并下载该描述文件（文件扩展名为 &lt;code&gt;.mobileprovision&lt;&#x2F;code&gt;）。&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;3-pei-zhi-hbuilder-jin-xing-da-bao&quot;&gt;3. 配置 HBuilder 进行打包&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#3-pei-zhi-hbuilder-jin-xing-da-bao&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;打开 &lt;strong&gt;HBuilderX&lt;&#x2F;strong&gt; 项目，进入 &lt;strong&gt;发行 → 原生 App - 云打包&lt;&#x2F;strong&gt;。&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;在 &lt;strong&gt;iOS 打包设置&lt;&#x2F;strong&gt; 中：&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;证书类型选择 &lt;strong&gt;生产证书&lt;&#x2F;strong&gt;。&lt;&#x2F;li&gt;
&lt;li&gt;上传刚申请的 &lt;code&gt;.p12&lt;&#x2F;code&gt; 证书文件以及密码。&lt;&#x2F;li&gt;
&lt;li&gt;选择对应的 &lt;strong&gt;生产环境描述文件（.mobileprovision）&lt;&#x2F;strong&gt;。&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;确认其他配置（如 App ID、版本号等）正确后，开始打包。&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;4-zhu-yi-shi-xiang&quot;&gt;4. 注意事项&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#4-zhu-yi-shi-xiang&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;开发证书&lt;&#x2F;strong&gt;（iPhone Developer）仅用于测试，只能安装到添加了 UDID 的测试设备。&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;生产证书&lt;&#x2F;strong&gt;（iPhone Distribution）用于 App Store 上架，打包后生成的 ipa 文件可通过 Transporter 提交审核。&lt;&#x2F;li&gt;
&lt;li&gt;确保证书和描述文件未过期，且与你的 App ID 匹配。&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;完成以上步骤后，你就可以生成并提交 ipa 文件到 App Store 进行审核。&lt;&#x2F;p&gt;
&lt;p&gt;https:&#x2F;&#x2F;www.bilibili.com&#x2F;video&#x2F;BV1jk4y1S7HZ&#x2F;?spm_id_from=333.1387.favlist.content.click&amp;amp;vd_source=0308c0d7b24cc0f488bdf0157f88f36a
苹果开发者证书如何导出的？后面还需要导出描述文件，证书和描述文件是对应的。选择可靠的证书签名可以实现很多功能。&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>项目架构</title>
        <published>2025-08-25T00:00:00+00:00</published>
        <updated>2025-08-25T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              menzil
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://orhan.cn/posts/project-structure/"/>
        <id>https://orhan.cn/posts/project-structure/</id>
        
        <content type="html" xml:base="https://orhan.cn/posts/project-structure/">&lt;ol&gt;
&lt;li&gt;代码规范（命名规范, 代码风格，命名风格规定好。驼峰，snake等）&lt;&#x2F;li&gt;
&lt;li&gt;框架规范 （使用那些技术，那些框架，crate 或者node module）&lt;&#x2F;li&gt;
&lt;li&gt;先实现基础框架，然后叠加扩展&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;ji-chu-kuang-jia-da-jian&quot;&gt;基础框架搭建：&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#ji-chu-kuang-jia-da-jian&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;pre style=&quot;background-color:#2b303b;color:#c0c5ce;&quot;&gt;&lt;code&gt;&lt;span&gt;我们首先把基础框架搭好，然后横向扩展，健壮稳步前进，再大的项目也先拆分好小的模块，然后一步步实现就行
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;公共模块实现：
&lt;&#x2F;span&gt;&lt;span&gt;    1. 分类
&lt;&#x2F;span&gt;&lt;span&gt;    2. 标签
&lt;&#x2F;span&gt;&lt;span&gt;    3. 文章
&lt;&#x2F;span&gt;&lt;span&gt;    4. 消息通知（短信，小程序，公众号，邮件，app内等）
&lt;&#x2F;span&gt;&lt;span&gt;    5. 付款：微信支付，公众号，app支付，支付宝支付。退款，分账，提现
&lt;&#x2F;span&gt;&lt;span&gt;    6. 物流查询
&lt;&#x2F;span&gt;&lt;span&gt;    7. 订单管理
&lt;&#x2F;span&gt;&lt;span&gt;    8. 海报生成
&lt;&#x2F;span&gt;&lt;span&gt;    9. 推广方案
&lt;&#x2F;span&gt;&lt;span&gt;    10. 客服
&lt;&#x2F;span&gt;&lt;span&gt;    11. 用户行为
&lt;&#x2F;span&gt;&lt;span&gt;    12. 统计
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;api-xiang-mu&quot;&gt;api 项目：&lt;a class=&quot;anchor&quot; aria-hidden=&quot;true&quot; href=&quot;#api-xiang-mu&quot; hidden=&quot;&quot;&gt;#&lt;&#x2F;a&gt;
&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;资源访问类型：管理员，公开，自己，带token公开查看&lt;&#x2F;li&gt;
&lt;li&gt;返回类型，请求类型统一化&lt;&#x2F;li&gt;
&lt;li&gt;先计划，再实现&lt;&#x2F;li&gt;
&lt;li&gt;即使提交代码到git仓库，完整留痕&lt;&#x2F;li&gt;
&lt;li&gt;每加一个模块即使写API文档+代码测试&lt;&#x2F;li&gt;
&lt;li&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>巩固rust</title>
        <published>2024-11-25T00:00:00+00:00</published>
        <updated>2024-11-25T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              menzil
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://orhan.cn/posts/rust-01/"/>
        <id>https://orhan.cn/posts/rust-01/</id>
        
        <content type="html" xml:base="https://orhan.cn/posts/rust-01/">&lt;p&gt;rust&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
