| <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="`str` methods producing `SmolStr`s."><title>StrExt in smol_str - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="smol_str" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">StrExt</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../smol_str/index.html">smol_<wbr>str</a><span class="version">0.3.4</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">StrExt</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.replace_smolstr" title="replace_smolstr">replace_smolstr</a></li><li><a href="#tymethod.replacen_smolstr" title="replacen_smolstr">replacen_smolstr</a></li><li><a href="#tymethod.to_ascii_lowercase_smolstr" title="to_ascii_lowercase_smolstr">to_ascii_lowercase_smolstr</a></li><li><a href="#tymethod.to_ascii_uppercase_smolstr" title="to_ascii_uppercase_smolstr">to_ascii_uppercase_smolstr</a></li><li><a href="#tymethod.to_lowercase_smolstr" title="to_lowercase_smolstr">to_lowercase_smolstr</a></li><li><a href="#tymethod.to_uppercase_smolstr" title="to_uppercase_smolstr">to_uppercase_smolstr</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-StrExt-for-str" title="str">str</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate smol_<wbr>str</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">smol_str</a></div><h1>Trait <span class="trait">StrExt</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/smol_str/lib.rs.html#585-627">Source</a> </span></div><pre class="rust item-decl"><code>pub trait StrExt: Sealed { |
| // Required methods |
| fn <a href="#tymethod.to_lowercase_smolstr" class="fn">to_lowercase_smolstr</a>(&self) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a>; |
| <span class="item-spacer"></span> fn <a href="#tymethod.to_uppercase_smolstr" class="fn">to_uppercase_smolstr</a>(&self) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a>; |
| <span class="item-spacer"></span> fn <a href="#tymethod.to_ascii_lowercase_smolstr" class="fn">to_ascii_lowercase_smolstr</a>(&self) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a>; |
| <span class="item-spacer"></span> fn <a href="#tymethod.to_ascii_uppercase_smolstr" class="fn">to_ascii_uppercase_smolstr</a>(&self) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a>; |
| <span class="item-spacer"></span> fn <a href="#tymethod.replace_smolstr" class="fn">replace_smolstr</a>(&self, from: &<a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html">str</a>, to: &<a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html">str</a>) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a>; |
| <span class="item-spacer"></span> fn <a href="#tymethod.replacen_smolstr" class="fn">replacen_smolstr</a>(&self, from: &<a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html">str</a>, to: &<a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html">str</a>, count: <a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.usize.html">usize</a>) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a>; |
| }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><a href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html" title="primitive str"><code>str</code></a> methods producing <a href="struct.SmolStr.html" title="struct smol_str::SmolStr"><code>SmolStr</code></a>s.</p> |
| </div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.to_lowercase_smolstr" class="method"><a class="src rightside" href="../src/smol_str/lib.rs.html#591">Source</a><h4 class="code-header">fn <a href="#tymethod.to_lowercase_smolstr" class="fn">to_lowercase_smolstr</a>(&self) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a></h4></section></summary><div class="docblock"><p>Returns the lowercase equivalent of this string slice as a new <a href="struct.SmolStr.html" title="struct smol_str::SmolStr"><code>SmolStr</code></a>, |
| potentially without allocating.</p> |
| <p>See <a href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html#method.to_lowercase" title="method str::to_lowercase"><code>str::to_lowercase</code></a>.</p> |
| </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.to_uppercase_smolstr" class="method"><a class="src rightside" href="../src/smol_str/lib.rs.html#598">Source</a><h4 class="code-header">fn <a href="#tymethod.to_uppercase_smolstr" class="fn">to_uppercase_smolstr</a>(&self) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a></h4></section></summary><div class="docblock"><p>Returns the uppercase equivalent of this string slice as a new <a href="struct.SmolStr.html" title="struct smol_str::SmolStr"><code>SmolStr</code></a>, |
| potentially without allocating.</p> |
| <p>See <a href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html#method.to_uppercase" title="method str::to_uppercase"><code>str::to_uppercase</code></a>.</p> |
| </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.to_ascii_lowercase_smolstr" class="method"><a class="src rightside" href="../src/smol_str/lib.rs.html#605">Source</a><h4 class="code-header">fn <a href="#tymethod.to_ascii_lowercase_smolstr" class="fn">to_ascii_lowercase_smolstr</a>(&self) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a></h4></section></summary><div class="docblock"><p>Returns the ASCII lowercase equivalent of this string slice as a new <a href="struct.SmolStr.html" title="struct smol_str::SmolStr"><code>SmolStr</code></a>, |
| potentially without allocating.</p> |
| <p>See <a href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html#method.to_ascii_lowercase" title="method str::to_ascii_lowercase"><code>str::to_ascii_lowercase</code></a>.</p> |
| </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.to_ascii_uppercase_smolstr" class="method"><a class="src rightside" href="../src/smol_str/lib.rs.html#612">Source</a><h4 class="code-header">fn <a href="#tymethod.to_ascii_uppercase_smolstr" class="fn">to_ascii_uppercase_smolstr</a>(&self) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a></h4></section></summary><div class="docblock"><p>Returns the ASCII uppercase equivalent of this string slice as a new <a href="struct.SmolStr.html" title="struct smol_str::SmolStr"><code>SmolStr</code></a>, |
| potentially without allocating.</p> |
| <p>See <a href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html#method.to_ascii_uppercase" title="method str::to_ascii_uppercase"><code>str::to_ascii_uppercase</code></a>.</p> |
| </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.replace_smolstr" class="method"><a class="src rightside" href="../src/smol_str/lib.rs.html#619">Source</a><h4 class="code-header">fn <a href="#tymethod.replace_smolstr" class="fn">replace_smolstr</a>(&self, from: &<a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html">str</a>, to: &<a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html">str</a>) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a></h4></section></summary><div class="docblock"><p>Replaces all matches of a &str with another &str returning a new <a href="struct.SmolStr.html" title="struct smol_str::SmolStr"><code>SmolStr</code></a>, |
| potentially without allocating.</p> |
| <p>See <a href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html#method.replace" title="method str::replace"><code>str::replace</code></a>.</p> |
| </div></details><details class="toggle method-toggle" open><summary><section id="tymethod.replacen_smolstr" class="method"><a class="src rightside" href="../src/smol_str/lib.rs.html#626">Source</a><h4 class="code-header">fn <a href="#tymethod.replacen_smolstr" class="fn">replacen_smolstr</a>(&self, from: &<a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html">str</a>, to: &<a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html">str</a>, count: <a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.usize.html">usize</a>) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a></h4></section></summary><div class="docblock"><p>Replaces first N matches of a &str with another &str returning a new <a href="struct.SmolStr.html" title="struct smol_str::SmolStr"><code>SmolStr</code></a>, |
| potentially without allocating.</p> |
| <p>See <a href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html#method.replacen" title="method str::replacen"><code>str::replacen</code></a>.</p> |
| </div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-StrExt-for-str" class="impl"><a class="src rightside" href="../src/smol_str/lib.rs.html#629-728">Source</a><a href="#impl-StrExt-for-str" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.StrExt.html" title="trait smol_str::StrExt">StrExt</a> for <a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html">str</a></h3></section></summary><div class="impl-items"><section id="method.to_lowercase_smolstr" class="method trait-impl"><a class="src rightside" href="../src/smol_str/lib.rs.html#631-639">Source</a><a href="#method.to_lowercase_smolstr" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.to_lowercase_smolstr" class="fn">to_lowercase_smolstr</a>(&self) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a></h4></section><section id="method.to_uppercase_smolstr" class="method trait-impl"><a class="src rightside" href="../src/smol_str/lib.rs.html#642-650">Source</a><a href="#method.to_uppercase_smolstr" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.to_uppercase_smolstr" class="fn">to_uppercase_smolstr</a>(&self) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a></h4></section><section id="method.to_ascii_lowercase_smolstr" class="method trait-impl"><a class="src rightside" href="../src/smol_str/lib.rs.html#653-667">Source</a><a href="#method.to_ascii_lowercase_smolstr" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.to_ascii_lowercase_smolstr" class="fn">to_ascii_lowercase_smolstr</a>(&self) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a></h4></section><section id="method.to_ascii_uppercase_smolstr" class="method trait-impl"><a class="src rightside" href="../src/smol_str/lib.rs.html#670-684">Source</a><a href="#method.to_ascii_uppercase_smolstr" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.to_ascii_uppercase_smolstr" class="fn">to_ascii_uppercase_smolstr</a>(&self) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a></h4></section><section id="method.replace_smolstr" class="method trait-impl"><a class="src rightside" href="../src/smol_str/lib.rs.html#687-689">Source</a><a href="#method.replace_smolstr" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.replace_smolstr" class="fn">replace_smolstr</a>(&self, from: &<a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html">str</a>, to: &<a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html">str</a>) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a></h4></section><section id="method.replacen_smolstr" class="method trait-impl"><a class="src rightside" href="../src/smol_str/lib.rs.html#692-727">Source</a><a href="#method.replacen_smolstr" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.replacen_smolstr" class="fn">replacen_smolstr</a>(&self, from: &<a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html">str</a>, to: &<a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.str.html">str</a>, count: <a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.usize.html">usize</a>) -> <a class="struct" href="struct.SmolStr.html" title="struct smol_str::SmolStr">SmolStr</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../trait.impl/smol_str/trait.StrExt.js" data-ignore-extern-crates="std" async></script></section></div></main></body></html> |