<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"><channel><title>MagicLen</title><link>https://magiclen.org/cn/tag/once_cell/</link><description>多元化原创文章，内容包罗万象，有编程语言、网站应用、软件介绍、硬件介绍、操作系统、旅行游记、专题采访、益智问题、文学创作，以及作者们的知识分享和作品分享。</description><language>zh-CN</language><lastBuildDate>Sun, 22 Nov 2026 18:20:18 +0800</lastBuildDate><atom:link href="https://magiclen.org/cn/tag/once_cell/feed/" rel="self" type="application/rss+xml"/><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>8</sy:updateFrequency><sy:updateBase>1970-01-01T00:00+00:00</sy:updateBase><item><title>如何在 Rust 编程语言中使用全域静态变量？</title><link>https://magiclen.org/cn/static-lazy-static/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt>
在使用 C 或 C++ 编程语言的时候，我们有时会将变量声明在函数之外，使其可以在任何时间于整个程序的任何 scope 下使用。使用 Java 编程语言的时候，也有时会替类别加上「static」的类别（静态）字段变量，甚至还可以在「static」区块中，在类别初始化的时候顺便对类别字段进行初始化的动作。我们把这类声明在函数、方法之外，且独立于对象实体的变量称为「全域静态变量」（C/C++ 的全域变...]]></description><category>研究分享</category><category>Rust</category><category>C/C++</category><category>Rust</category><category>lazy_static</category><category>once_cell</category><guid>https://magiclen.org/cn/static-lazy-static</guid><pubDate>Tue, 23 Oct 2018 04:00:46 +0800</pubDate><dc:creator>Magic Len</dc:creator></item></channel></rss>