<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Initialization on Nalar</title>
    <link>https://nalar.dev/tags/initialization/</link>
    <description>Recent content in Initialization on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 07 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/initialization/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Initialize Shared Rust State Once with OnceLock</title>
      <link>https://nalar.dev/initialize-shared-rust-state-once-with-oncelock/</link>
      <pubDate>Mon, 07 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/initialize-shared-rust-state-once-with-oncelock/</guid>
      <description>&lt;p&gt;Applications often need one shared value that is expensive or awkward to construct but should not change after initialization. Examples include parsed configuration, a lookup table, a compiled matcher, or metadata discovered during startup.&lt;/p&gt;&#xA;&lt;p&gt;A plain &lt;code&gt;static&lt;/code&gt; works only when the value can be created as a constant. A &lt;code&gt;Mutex&amp;lt;Option&amp;lt;T&amp;gt;&amp;gt;&lt;/code&gt; can represent &amp;ldquo;not initialized yet,&amp;rdquo; but it also introduces a lock and a mutable state model that the program may not need after setup.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
