<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>plarail_hangout</author_name>
  <author_url>https://blog.hatena.ne.jp/plarail_hangout/</author_url>
  <blog_title>Engineering Tech Dojo</blog_title>
  <blog_url>https://tech.fun-toy-life.com/</blog_url>
  <categories>
    <anon>Rust</anon>
  </categories>
  <description>RustのStringと&amp;strの違い：使い分けと変換方法まとめ はじめに Rustには文字列を扱う型が主に2つあります。String と &amp;str です。どちらも文字列ですが、所有権とメモリの扱いが異なります。最初はどちらを使えばいいか迷いやすいポイントなので、違いと使い分けをまとめます。 String と &amp;str の基本的な違い String &amp;str 所有権 あり（ヒープ上） なし（借用） 変更 可能 不可能 サイズ 実行時に変わる 固定 主な用途 文字列を所有・変更したい 文字列を参照するだけ let s1: String = String::from(&quot;hello&quot;); // ヒー…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftech.fun-toy-life.com%2Fentry%2F2026%2F06%2F03%2F103900&quot; title=&quot;RustのStringと&amp;amp;strの違い：使い分けと変換方法まとめ - Engineering Tech Dojo&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-06-03 10:39:00</published>
  <title>RustのStringと&amp;strの違い：使い分けと変換方法まとめ</title>
  <type>rich</type>
  <url>https://tech.fun-toy-life.com/entry/2026/06/03/103900</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
