<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="A formatted representation of a span’s fields stored in its extensions."><title>FormattedFields in tracing_subscriber::fmt - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><linkrel="stylesheet"href="../../static.files/normalize-76eba96aa4d2e634.css"><linkrel="stylesheet"href="../../static.files/rustdoc-ac92e1bbe349e143.css"><metaname="rustdoc-vars"data-root-path="../../"data-static-root-path="../../static.files/"data-current-crate="tracing_subscriber"data-themes=""data-resource-suffix=""data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)"data-channel="1.76.0"data-search-js="search-2b6ce74ff89ae146.js"data-settings-js="settings-4313503d2e1961c2.js"><scriptsrc="../../static.files/storage-f2adc0d6ca4d09fb.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../../static.files/main-305769736d49e732.js"></script><noscript><linkrel="stylesheet"href="../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><linkrel="alternate icon"type="image/png"href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><linkrel="alternate icon"type="image/png"href="../../static.files/favicon-32x32-422f7d1d52889060.png"><linkrel="icon"type="image/svg+xml"href="../../static.files/favicon-2c020d218678b618.svg"></head><bodyclass="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle">☰</button><aclass="logo-container"href="../../tracing_subscriber/index.html"><imgsrc="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png"alt=""></a></nav><navclass="sidebar"><divclass="sidebar-crate"><aclass="logo-container"href="../../tracing_subscriber/index.html"><imgsrc="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png"alt="logo"></a><h2><ahref="../../tracing_subscriber/index.html">tracing_subscriber</a><spanclass="version">0.3.18</span></h2></div><h2class="location"><ahref="#">FormattedFields</a></h2><divclass="sidebar-elems"><section><h3><ahref="#fields">Fields</a></h3><ulclass="block structfield"><li><ahref="#structfield.fields">fields</a></li></ul><h3><ahref="#implementations">Methods</a></h3><ulclass="block method"><li><ahref="#method.as_writer">as_writer</a></li><li><ahref="#method.new">new</a></li></ul><h3><ahref="#deref-methods-String">Methods from Deref<Target=String></a></h3><ulclass="block deref-methods"><li><ahref="#method.as_bytes">as_bytes</a></li><li><ahref="#method.as_str">as_str</a></li><li><ahref="#method.capacity">capacity</a></li><li><ahref="#method.is_empty">is_empty</a></li><li><ahref="#method.len">len</a></li></ul><h3><ahref="#deref-methods-str">Methods from Deref<Target=str></a></h3><ulclass="block deref-methods"><li><ahref="#method.as_ascii">as_ascii</a></li><li><ahref="#method.as_bytes-1">as_bytes</a></li><li><ahref="#method.as_bytes_mut">as_bytes_mut</a></li><li><ahref="#method.as_mut_ptr">as_mut_ptr</a></li><li><ahref="#method.as_ptr">as_ptr</a></li><li><ahref="#method.bytes">bytes</a></li><li><ahref="#method.ceil_char_boundary">ceil_char_boundary</a></li><li><ahref="#method.char_indices">char_indice
<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../../tracing_subscriber/all.html"title="show sidebar"></a></div><inputclass="search-input"name="search"aria-label="Run search in the documentation"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><divid="help-button"tabindex="-1"><ahref="../../help.html"title="help">?</a></div><divid="settings-menu"tabindex="-1"><ahref="../../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><sectionid="main-content"class="content"><divclass="main-heading"><h1>Struct <ahref="../index.html">tracing_subscriber</a>::<wbr><ahref="index.html">fmt</a>::<wbr><aclass="struct"href="#">FormattedFields</a><buttonid="copy-path"title="Copy item path to clipboard"><imgsrc="../../static.files/clipboard-7571035ce49a181d.svg"width="19"height="18"alt="Copy item path"></button></h1><spanclass="out-of-band"><aclass="src"href="../../src/tracing_subscriber/fmt/fmt_layer.rs.html#737-742">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><preclass="rust item-decl"><code>pub struct FormattedFields<E: ?<aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>> {
}</code></pre><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>A formatted representation of a span’s fields stored in its <ahref="../registry/struct.Extensions.html"title="struct tracing_subscriber::registry::Extensions">extensions</a>.</p>
<p>Because <code>FormattedFields</code> is generic over the type of the formatter that
produced it, multiple versions of a span’s formatted fields can be stored in
the <ahref="../registry/struct.Extensions.html"title="struct tracing_subscriber::registry::Extensions"><code>Extensions</code></a> type-map. This means that when multiple
formatters are in use, each can store its own formatted representation
without conflicting.</p>
</div></details><h2id="fields"class="fields section-header">Fields<ahref="#fields"class="anchor">§</a></h2><spanid="structfield.fields"class="structfield section-header"><ahref="#structfield.fields"class="anchor field">§</a><code>fields: <aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></code></span><divclass="docblock"><p>The formatted fields of a span.</p>
</div><h2id="implementations"class="section-header">Implementations<ahref="#implementations"class="anchor">§</a></h2><divid="implementations-list"><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-FormattedFields%3CE%3E"class="impl"><aclass="src rightside"href="../../src/tracing_subscriber/fmt/fmt_layer.rs.html#744-761">source</a><ahref="#impl-FormattedFields%3CE%3E"class="anchor">§</a><h3class="code-header">impl<E: ?<aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>><aclass="struct"href="struct.FormattedFields.html"title="struct tracing_subscriber::fmt::FormattedFields">FormattedFields</a><E></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.new"class="method"><aclass="src rightside"href="../../src/tracing_subscriber/fmt/fmt_layer.rs.html#746-752">source</a><h4class="code-header">pub fn <ahref="#method.new"class="fn">new</a>(fields: <aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>) -> Self</h4></section></summary><divclass="docblock"><p>Returns a new <code>FormattedFields</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_writer"class="method"><aclass="src rightside"href="../../src/tracing_subscriber/fmt/fmt_layer.rs.html#758-760">source</a><h4class="code-header">pub fn <ahref="#method.as_writer"class="fn">as_writer</a>(&mut self) -><aclass="struct"href="format/struct.Writer.html"title="struct tracing_subscriber::fmt::format::Writer">Writer</a><'_></h4></section></summary><divclass="docblock"><p>Returns a new <ahref="format/struct.Writer.html"title="struct tracing_subscriber::fmt::format::Writer"><code>format::Writer</code></a> for writing to this <code>FormattedFields</code>.</p>
<p>The returned <ahref="format/struct.Writer.html"title="struct tracing_subscriber::fmt::format::Writer"><code>format::Writer</code></a> can be used with the
</div></details></div></details></div><h2id="deref-methods-String"class="section-header"><span>Methods from <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/ops/deref/trait.Deref.html"title="trait core::ops::deref::Deref">Deref</a><Target = <aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>></span><ahref="#deref-methods-String"class="anchor">§</a></h2><divid="deref-methods-String-1"class="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_str"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.7.0">1.7.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/string.rs.html#1015">source</a></span><h4class="code-header">pub fn <ahref="#method.as_str"class="fn">as_str</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section></summary><divclass="docblock"><p>Extracts a string slice containing the entire <code>String</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.capacity"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/string.rs.html#1104">source</a></span><h4class="code-header">pub fn <ahref="#method.capacity"class="fn">capacity</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Returns this <code>String</code>’s capacity, in bytes.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_bytes"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/string.rs.html#1367">source</a></span><h4class="code-header">pub fn <ahref="#method.as_bytes"class="fn">as_bytes</a>(&self) ->&[<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>] <ahref="#"class="tooltip"data-notable-ty="&[u8]">ⓘ</a></h4></section></summary><divclass="docblock"><p>Returns a byte slice of this <code>String</code>’s contents.</p>
<p>The inverse of this method is <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html#method.from_utf8"title="associated function alloc::string::String::from_utf8"><code>from_utf8</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.len"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/string.rs.html#1741">source</a></span><h4class="code-header">pub fn <ahref="#method.len"class="fn">len</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Returns the length of this <code>String</code>, in bytes, not <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s or
graphemes. In other words, it might not be what a human considers the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_empty"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/string.rs.html#1759">source</a></span><h4class="code-header">pub fn <ahref="#method.is_empty"class="fn">is_empty</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if this <code>String</code> has a length of zero, and <code>false</code> otherwise.</p>
</div></details></div><h2id="deref-methods-str"class="section-header"><span>Methods from <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/ops/deref/trait.Deref.html"title="trait core::ops::deref::Deref">Deref</a><Target = <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>></span><ahref="#deref-methods-str"class="anchor">§</a></h2><divid="deref-methods-str-1"class="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.len-1"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#164">source</a></span><h4class="code-header">pub fn <ahref="#method.len-1"class="fn">len</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Returns the length of <code>self</code>.</p>
<p>This length is in bytes, not <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s or graphemes. In other words,
it might not be what a human considers the length of the string.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_empty-1"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#183">source</a></span><h4class="code-header">pub fn <ahref="#method.is_empty-1"class="fn">is_empty</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if <code>self</code> has a length of zero bytes.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_char_boundary"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.9.0">1.9.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#213">source</a></span><h4class="code-header">pub fn <ahref="#method.is_char_boundary"class="fn">is_char_boundary</a>(&self, index: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Checks that <code>index</code>-th byte is the first byte in a UTF-8 code point
sequence or the end of the string.</p>
<p>The start and end of the string (when <code>index == self.len()</code>) are
considered to be boundaries.</p>
<p>Returns <code>false</code> if <code>index</code> is greater than <code>self.len()</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.floor_char_boundary"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#260">source</a><h4class="code-header">pub fn <ahref="#method.floor_char_boundary"class="fn">floor_char_boundary</a>(&self, index: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>round_char_boundary</code> <ahref="https://github.com/tokio-rs/tracing/issues/93743">#93743</a>)</span></div></span></summary><divclass="docblock"><p>Finds the closest <code>x</code> not exceeding <code>index</code> where <code>is_char_boundary(x)</code> is <code>true</code>.</p>
<p>This method can help you truncate a string so that it’s still valid UTF-8, but doesn’t
exceed a given number of bytes. Note that this is done purely at the character level
and can still visually split graphemes, even though the underlying characters aren’t
split. For example, the emoji 🧑🔬 (scientist) could be split so that the string only
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ceil_char_boundary"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#298">source</a><h4class="code-header">pub fn <ahref="#method.ceil_char_boundary"class="fn">ceil_char_boundary</a>(&self, index: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>round_char_boundary</code> <ahref="https://github.com/tokio-rs/tracing/issues/93743">#93743</a>)</span></div></span></summary><divclass="docblock"><p>Finds the closest <code>x</code> not below <code>index</code> where <code>is_char_boundary(x)</code> is <code>true</code>.</p>
<p>If <code>index</code> is greater than the length of the string, this returns the length of the string.</p>
<p>This method is the natural complement to <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.floor_char_boundary"title="method str::floor_char_boundary"><code>floor_char_boundary</code></a>. See that method
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_bytes-1"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#324">source</a></span><h4class="code-header">pub fn <ahref="#method.as_bytes-1"class="fn">as_bytes</a>(&self) ->&[<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>] <ahref="#"class="tooltip"data-notable-ty="&[u8]">ⓘ</a></h4></section></summary><divclass="docblock"><p>Converts a string slice to a byte slice. To convert the byte slice back
into a string slice, use the <ahref="https://doc.rust-lang.org/1.76.0/core/str/converts/fn.from_utf8.html"title="fn core::str::converts::from_utf8"><code>from_utf8</code></a> function.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_bytes_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.20.0">1.20.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#368">source</a></span><h4class="code-header">pub unsafe fn <ahref="#method.as_bytes_mut"class="fn">as_bytes_mut</a>(&mut self) ->&mut [<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a>] <ahref="#"class="tooltip"data-notable-ty="&mut [u8]">ⓘ</a></h4></section></summary><divclass="docblock"><p>Converts a mutable string slice to a mutable byte slice.</p>
<h5id="safety"><ahref="#safety">Safety</a></h5>
<p>The caller must ensure that the content of the slice is valid UTF-8
before the borrow ends and the underlying <code>str</code> is used.</p>
<p>Use of a <code>str</code> whose contents are not valid UTF-8 is undefined behavior.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ptr"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#398">source</a></span><h4class="code-header">pub fn <ahref="#method.as_ptr"class="fn">as_ptr</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.pointer.html">*const </a><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a></h4></section></summary><divclass="docblock"><p>Converts a string slice to a raw pointer.</p>
<p>As string slices are a slice of bytes, the raw pointer points to a
<ahref="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html"title="primitive u8"><code>u8</code></a>. This pointer will be pointing to the first byte of the string
slice.</p>
<p>The caller must ensure that the returned pointer is never written to.
If you need to mutate the contents of the string slice, use <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.as_mut_ptr"title="method str::as_mut_ptr"><code>as_mut_ptr</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_mut_ptr"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.36.0">1.36.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#414">source</a></span><h4class="code-header">pub fn <ahref="#method.as_mut_ptr"class="fn">as_mut_ptr</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.pointer.html">*mut </a><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html">u8</a></h4></section></summary><divclass="docblock"><p>Converts a mutable string slice to a raw pointer.</p>
<p>As string slices are a slice of bytes, the raw pointer points to a
<ahref="https://doc.rust-lang.org/1.76.0/std/primitive.u8.html"title="primitive u8"><code>u8</code></a>. This pointer will be pointing to the first byte of the string
slice.</p>
<p>It is your responsibility to make sure that the string slice only gets
modified in a way that it remains valid UTF-8.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.20.0">1.20.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#439">source</a></span><h4class="code-header">pub fn <ahref="#method.get"class="fn">get</a><I>(&self, i: I) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<I as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html#associatedtype.Output"title="type core::slice::index::SliceIndex::Output">Output</a>><divclass="where">where
I: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>>,</div></h4></section></summary><divclass="docblock"><p>Returns a subslice of <code>str</code>.</p>
<p>This is the non-panicking alternative to indexing the <code>str</code>. Returns
<ahref="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html#variant.None"title="variant core::option::Option::None"><code>None</code></a> whenever equivalent indexing operation would panic.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.20.0">1.20.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#471">source</a></span><h4class="code-header">pub fn <ahref="#method.get_mut"class="fn">get_mut</a><I>(
&mut self,
i: I
) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&mut <I as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html#associatedtype.Output"title="type core::slice::index::SliceIndex::Output">Output</a>><divclass="where">where
I: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>>,</div></h4></section></summary><divclass="docblock"><p>Returns a mutable subslice of <code>str</code>.</p>
<p>This is the non-panicking alternative to indexing the <code>str</code>. Returns
<ahref="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html#variant.None"title="variant core::option::Option::None"><code>None</code></a> whenever equivalent indexing operation would panic.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_unchecked"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.20.0">1.20.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#503">source</a></span><h4class="code-header">pub unsafe fn <ahref="#method.get_unchecked"class="fn">get_unchecked</a><I>(&self, i: I) ->&<I as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html#associatedtype.Output"title="type core::slice::index::SliceIndex::Output">Output</a><divclass="where">where
I: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>>,</div></h4></section></summary><divclass="docblock"><p>Returns an unchecked subslice of <code>str</code>.</p>
<p>This is the unchecked alternative to indexing the <code>str</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_unchecked_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.20.0">1.20.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#538">source</a></span><h4class="code-header">pub unsafe fn <ahref="#method.get_unchecked_mut"class="fn">get_unchecked_mut</a><I>(
&mut self,
i: I
) ->&mut <I as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html#associatedtype.Output"title="type core::slice::index::SliceIndex::Output">Output</a><divclass="where">where
I: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/slice/index/trait.SliceIndex.html"title="trait core::slice::index::SliceIndex">SliceIndex</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>>,</div></h4></section></summary><divclass="docblock"><p>Returns a mutable, unchecked subslice of <code>str</code>.</p>
<p>This is the unchecked alternative to indexing the <code>str</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.slice_unchecked"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#589">source</a></span><h4class="code-header">pub unsafe fn <ahref="#method.slice_unchecked"class="fn">slice_unchecked</a>(&self, begin: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>, end: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 1.29.0: use <code>get_unchecked(begin..end)</code> instead</span></div></span></summary><divclass="docblock"><p>Creates a string slice from another string slice, bypassing safety
checks.</p>
<p>This is generally not recommended, use with caution! For a safe
alternative see <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html"title="primitive str"><code>str</code></a> and <ahref="https://doc.rust-lang.org/1.76.0/core/ops/index/trait.Index.html"title="trait core::ops::index::Index"><code>Index</code></a>.</p>
<p>This new slice goes from <code>begin</code> to <code>end</code>, including <code>begin</code> but
) ->&mut <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 1.29.0: use <code>get_unchecked_mut(begin..end)</code> instead</span></div></span></summary><divclass="docblock"><p>Creates a string slice from another string slice, bypassing safety
checks.
This is generally not recommended, use with caution! For a safe
alternative see <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html"title="primitive str"><code>str</code></a> and <ahref="https://doc.rust-lang.org/1.76.0/core/ops/index/trait.IndexMut.html"title="trait core::ops::index::IndexMut"><code>IndexMut</code></a>.</p>
<p>This new slice goes from <code>begin</code> to <code>end</code>, including <code>begin</code> but
excluding <code>end</code>.</p>
<p>To get an immutable string slice instead, see the
<p>Callers of this function are responsible that three preconditions are
satisfied:</p>
<ul>
<li><code>begin</code> must not exceed <code>end</code>.</li>
<li><code>begin</code> and <code>end</code> must be byte positions within the string slice.</li>
<li><code>begin</code> and <code>end</code> must lie on UTF-8 sequence boundaries.</li>
</ul>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_at"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.4.0">1.4.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#660">source</a></span><h4class="code-header">pub fn <ahref="#method.split_at"class="fn">split_at</a>(&self, mid: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -> (&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>, &<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>)</h4></section></summary><divclass="docblock"><p>Divide one string slice into two at an index.</p>
<p>The argument, <code>mid</code>, should be a byte offset from the start of the
string. It must also be on the boundary of a UTF-8 code point.</p>
<p>The two slices returned go from the start of the string slice to <code>mid</code>,
and from <code>mid</code> to the end of the string slice.</p>
<p>To get mutable string slices instead, see the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.split_at_mut"title="method str::split_at_mut"><code>split_at_mut</code></a>
method.</p>
<h5id="panics"><ahref="#panics">Panics</a></h5>
<p>Panics if <code>mid</code> is not on a UTF-8 code point boundary, or if it is
past the end of the last code point of the string slice.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_at_mut"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.4.0">1.4.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#702">source</a></span><h4class="code-header">pub fn <ahref="#method.split_at_mut"class="fn">split_at_mut</a>(&mut self, mid: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -> (&mut <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>, &mut <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>)</h4></section></summary><divclass="docblock"><p>Divide one mutable string slice into two at an index.</p>
<p>The argument, <code>mid</code>, should be a byte offset from the start of the
string. It must also be on the boundary of a UTF-8 code point.</p>
<p>The two slices returned go from the start of the string slice to <code>mid</code>,
and from <code>mid</code> to the end of the string slice.</p>
<p>To get immutable string slices instead, see the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.split_at"title="method str::split_at"><code>split_at</code></a> method.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.chars"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#768">source</a></span><h4class="code-header">pub fn <ahref="#method.chars"class="fn">chars</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.Chars.html"title="struct core::str::iter::Chars">Chars</a><'_></h4></section></summary><divclass="docblock"><p>Returns an iterator over the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s of a string slice.</p>
<p>As a string slice consists of valid UTF-8, we can iterate through a
string slice by <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>. This method returns such an iterator.</p>
<p>It’s important to remember that <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a> represents a Unicode Scalar
Value, and might not match your idea of what a ‘character’ is. Iteration
over grapheme clusters may be what you actually want. This functionality
is not provided by Rust’s standard library, check crates.io instead.</p>
<p>Remember, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s might not match your intuition about characters:</p>
<spanclass="macro">assert_eq!</span>(<spanclass="prelude-val">Some</span>(<spanclass="string">'y'</span>), chars.next()); <spanclass="comment">// not 'y̆'
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.char_indices"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#825">source</a></span><h4class="code-header">pub fn <ahref="#method.char_indices"class="fn">char_indices</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.CharIndices.html"title="struct core::str::iter::CharIndices">CharIndices</a><'_></h4></section></summary><divclass="docblock"><p>Returns an iterator over the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s of a string slice, and their
positions.</p>
<p>As a string slice consists of valid UTF-8, we can iterate through a
string slice by <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>. This method returns an iterator of both
these <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, as well as their byte positions.</p>
<p>The iterator yields tuples. The position is first, the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a> is
<p>Remember, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s might not match your intuition about characters:</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.bytes"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#848">source</a></span><h4class="code-header">pub fn <ahref="#method.bytes"class="fn">bytes</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.Bytes.html"title="struct core::str::iter::Bytes">Bytes</a><'_></h4></section></summary><divclass="docblock"><p>An iterator over the bytes of a string slice.</p>
<p>As a string slice consists of a sequence of bytes, we can iterate
through a string slice by byte. This method returns such an iterator.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_whitespace"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.1.0">1.1.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#900">source</a></span><h4class="code-header">pub fn <ahref="#method.split_whitespace"class="fn">split_whitespace</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.SplitWhitespace.html"title="struct core::str::iter::SplitWhitespace">SplitWhitespace</a><'_></h4></section></summary><divclass="docblock"><p>Splits a string slice by whitespace.</p>
<p>The iterator returned will return string slices that are sub-slices of
the original string slice, separated by any amount of whitespace.</p>
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
Core Property <code>White_Space</code>. If you only want to split on ASCII whitespace
instead, use <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.split_ascii_whitespace"title="method str::split_ascii_whitespace"><code>split_ascii_whitespace</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_ascii_whitespace"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.34.0">1.34.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#949">source</a></span><h4class="code-header">pub fn <ahref="#method.split_ascii_whitespace"class="fn">split_ascii_whitespace</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.SplitAsciiWhitespace.html"title="struct core::str::iter::SplitAsciiWhitespace">SplitAsciiWhitespace</a><'_></h4></section></summary><divclass="docblock"><p>Splits a string slice by ASCII whitespace.</p>
<p>The iterator returned will return string slices that are sub-slices of
the original string slice, separated by any amount of ASCII whitespace.</p>
<p>To split by Unicode <code>Whitespace</code> instead, use <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.split_whitespace"title="method str::split_whitespace"><code>split_whitespace</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.lines"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1002">source</a></span><h4class="code-header">pub fn <ahref="#method.lines"class="fn">lines</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.Lines.html"title="struct core::str::iter::Lines">Lines</a><'_></h4></section></summary><divclass="docblock"><p>An iterator over the lines of a string, as string slices.</p>
<p>Lines are split at line endings that are either newlines (<code>\n</code>) or
sequences of a carriage return followed by a line feed (<code>\r\n</code>).</p>
<p>Line terminators are not included in the lines returned by the iterator.</p>
<p>Note that any carriage return (<code>\r</code>) not immediately followed by a
line feed (<code>\n</code>) does not split a line. These carriage returns are
thereby included in the produced lines.</p>
<p>The final line ending is optional. A string that ends with a final line
ending will return the same lines as an otherwise identical string
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.lines_any"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1011">source</a></span><h4class="code-header">pub fn <ahref="#method.lines_any"class="fn">lines_any</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.LinesAny.html"title="struct core::str::iter::LinesAny">LinesAny</a><'_></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 1.4.0: use lines() instead now</span></div></span></summary><divclass="docblock"><p>An iterator over the lines of a string.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.encode_utf16"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.8.0">1.8.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1030">source</a></span><h4class="code-header">pub fn <ahref="#method.encode_utf16"class="fn">encode_utf16</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.EncodeUtf16.html"title="struct core::str::iter::EncodeUtf16">EncodeUtf16</a><'_></h4></section></summary><divclass="docblock"><p>Returns an iterator of <code>u16</code> over the string encoded as UTF-16.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.contains"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1055">source</a></span><h4class="code-header">pub fn <ahref="#method.contains"class="fn">contains</a><'a, P>(&'a self, pat: P) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if the given pattern matches a sub-slice of
this string slice.</p>
<p>Returns <code>false</code> if it does not.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.starts_with"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1079">source</a></span><h4class="code-header">pub fn <ahref="#method.starts_with"class="fn">starts_with</a><'a, P>(&'a self, pat: P) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if the given pattern matches a prefix of this
string slice.</p>
<p>Returns <code>false</code> if it does not.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if the given pattern matches a suffix of this
string slice.</p>
<p>Returns <code>false</code> if it does not.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.find"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1154">source</a></span><h4class="code-header">pub fn <ahref="#method.find"class="fn">find</a><'a, P>(&'a self, pat: P) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Returns the byte index of the first character of this string slice that
matches the pattern.</p>
<p>Returns <ahref="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html#variant.None"title="variant core::option::Option::None"><code>None</code></a> if the pattern doesn’t match.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Returns the byte index for the first character of the last match of the pattern in
this string slice.</p>
<p>Returns <ahref="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html#variant.None"title="variant core::option::Option::None"><code>None</code></a> if the pattern doesn’t match.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1322">source</a></span><h4class="code-header">pub fn <ahref="#method.split"class="fn">split</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.Split.html"title="struct core::str::iter::Split">Split</a><'a, P><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>An iterator over substrings of this string slice, separated by
characters matched by a pattern.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator will be a <ahref="https://doc.rust-lang.org/1.76.0/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="trait core::iter::traits::double_ended::DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if the pattern
allows a reverse search and forward/reverse search yields the same
elements. This is true for, e.g., <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, but not for <code>&str</code>.</p>
<p>If the pattern allows a reverse search but its results might differ
from a forward search, the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.rsplit"title="method str::rsplit"><code>rsplit</code></a> method can be used.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>v: Vec<<spanclass="kw-2">&</span>str> = <spanclass="string">"Mary had a little lamb"</span>.split(<spanclass="string">' '</span>).collect();
<divclass="example-wrap ignore"><ahref="#"class="tooltip"title="This example is not tested">ⓘ</a><preclass="rust rust-example-rendered"><code><spanclass="macro">assert_eq!</span>(d, <spanclass="kw-2">&</span>[<spanclass="string">"a"</span>, <spanclass="string">"b"</span>, <spanclass="string">"c"</span>]);</code></pre></div>
<p>Use <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.split_whitespace"title="method str::split_whitespace"><code>split_whitespace</code></a> for this behavior.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_inclusive"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.51.0">1.51.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1362">source</a></span><h4class="code-header">pub fn <ahref="#method.split_inclusive"class="fn">split_inclusive</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.SplitInclusive.html"title="struct core::str::iter::SplitInclusive">SplitInclusive</a><'a, P><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>An iterator over substrings of this string slice, separated by
characters matched by a pattern. Differs from the iterator produced by
<code>split</code> in that <code>split_inclusive</code> leaves the matched part as the
terminator of the substring.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>v: Vec<<spanclass="kw-2">&</span>str> = <spanclass="string">"Mary had a little lamb\nlittle lamb\nlittle lamb."
<spanclass="macro">assert_eq!</span>(v, [<spanclass="string">"Mary had a little lamb\n"</span>, <spanclass="string">"little lamb\n"</span>, <spanclass="string">"little lamb."</span>]);</code></pre></div>
<p>If the last element of the string is matched,
that element will be considered the terminator of the preceding substring.
That substring will be the last item returned by the iterator.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>v: Vec<<spanclass="kw-2">&</span>str> = <spanclass="string">"Mary had a little lamb\nlittle lamb\nlittle lamb.\n"
<spanclass="macro">assert_eq!</span>(v, [<spanclass="string">"Mary had a little lamb\n"</span>, <spanclass="string">"little lamb\n"</span>, <spanclass="string">"little lamb.\n"</span>]);</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rsplit"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1417-1419">source</a></span><h4class="code-header">pub fn <ahref="#method.rsplit"class="fn">rsplit</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.RSplit.html"title="struct core::str::iter::RSplit">RSplit</a><'a, P><divclass="where">where
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><divclass="docblock"><p>An iterator over substrings of the given string slice, separated by
characters matched by a pattern and yielded in reverse order.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator requires that the pattern supports a reverse
search, and it will be a <ahref="https://doc.rust-lang.org/1.76.0/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="trait core::iter::traits::double_ended::DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if a forward/reverse
search yields the same elements.</p>
<p>For iterating from the front, the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.split"title="method str::split"><code>split</code></a> method can be used.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>v: Vec<<spanclass="kw-2">&</span>str> = <spanclass="string">"Mary had a little lamb"</span>.rsplit(<spanclass="string">' '</span>).collect();
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_terminator"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1466">source</a></span><h4class="code-header">pub fn <ahref="#method.split_terminator"class="fn">split_terminator</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.SplitTerminator.html"title="struct core::str::iter::SplitTerminator">SplitTerminator</a><'a, P><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>An iterator over substrings of the given string slice, separated by
characters matched by a pattern.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>Equivalent to <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.split"title="method str::split"><code>split</code></a>, except that the trailing substring
is skipped if empty.</p>
<p>This method can be used for string data that is <em>terminated</em>,
<p>The returned iterator will be a <ahref="https://doc.rust-lang.org/1.76.0/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="trait core::iter::traits::double_ended::DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if the pattern
allows a reverse search and forward/reverse search yields the same
elements. This is true for, e.g., <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, but not for <code>&str</code>.</p>
<p>If the pattern allows a reverse search but its results might differ
from a forward search, the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.rsplit_terminator"title="method str::rsplit_terminator"><code>rsplit_terminator</code></a> method can be used.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><divclass="docblock"><p>An iterator over substrings of <code>self</code>, separated by characters
matched by a pattern and yielded in reverse order.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>Equivalent to <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.split"title="method str::split"><code>split</code></a>, except that the trailing substring is
skipped if empty.</p>
<p>This method can be used for string data that is <em>terminated</em>,
<p>The returned iterator requires that the pattern supports a
reverse search, and it will be double ended if a forward/reverse
search yields the same elements.</p>
<p>For iterating from the front, the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.split_terminator"title="method str::split_terminator"><code>split_terminator</code></a> method can be
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.splitn"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1567">source</a></span><h4class="code-header">pub fn <ahref="#method.splitn"class="fn">splitn</a><'a, P>(&'a self, n: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.SplitN.html"title="struct core::str::iter::SplitN">SplitN</a><'a, P><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>An iterator over substrings of the given string slice, separated by a
pattern, restricted to returning at most <code>n</code> items.</p>
<p>If <code>n</code> substrings are returned, the last substring (the <code>n</code>th substring)
will contain the remainder of the string.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator will not be double ended, because it is
not efficient to support.</p>
<p>If the pattern allows a reverse search, the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.rsplitn"title="method str::rsplitn"><code>rsplitn</code></a> method can be
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>v: Vec<<spanclass="kw-2">&</span>str> = <spanclass="string">"Mary had a little lambda"</span>.splitn(<spanclass="number">3</span>, <spanclass="string">' '</span>).collect();
<spanclass="macro">assert_eq!</span>(v, [<spanclass="string">"Mary"</span>, <spanclass="string">"had"</span>, <spanclass="string">"a little lambda"</span>]);
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><divclass="docblock"><p>An iterator over substrings of this string slice, separated by a
pattern, starting from the end of the string, restricted to returning
at most <code>n</code> items.</p>
<p>If <code>n</code> substrings are returned, the last substring (the <code>n</code>th substring)
will contain the remainder of the string.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator will not be double ended, because it is not
efficient to support.</p>
<p>For splitting from the front, the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.splitn"title="method str::splitn"><code>splitn</code></a> method can be used.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>v: Vec<<spanclass="kw-2">&</span>str> = <spanclass="string">"Mary had a little lamb"</span>.rsplitn(<spanclass="number">3</span>, <spanclass="string">' '</span>).collect();
<spanclass="macro">assert_eq!</span>(v, [<spanclass="string">"lamb"</span>, <spanclass="string">"little"</span>, <spanclass="string">"Mary had a"</span>]);
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.split_once"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.52.0">1.52.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1636">source</a></span><h4class="code-header">pub fn <ahref="#method.split_once"class="fn">split_once</a><'a, P>(&'a self, delimiter: P) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(&'a <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>, &'a <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>)><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Splits the string on the first occurrence of the specified delimiter and
returns prefix before delimiter and suffix after delimiter.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Splits the string on the last occurrence of the specified delimiter and
returns prefix before delimiter and suffix after delimiter.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.matches"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.2.0">1.2.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1694">source</a></span><h4class="code-header">pub fn <ahref="#method.matches"class="fn">matches</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.Matches.html"title="struct core::str::iter::Matches">Matches</a><'a, P><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>An iterator over the disjoint matches of a pattern within the given string
slice.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator will be a <ahref="https://doc.rust-lang.org/1.76.0/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="trait core::iter::traits::double_ended::DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if the pattern
allows a reverse search and forward/reverse search yields the same
elements. This is true for, e.g., <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, but not for <code>&str</code>.</p>
<p>If the pattern allows a reverse search but its results might differ
from a forward search, the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.rmatches"title="method str::rmatches"><code>rmatches</code></a> method can be used.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><divclass="docblock"><p>An iterator over the disjoint matches of a pattern within this string slice,
yielded in reverse order.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator requires that the pattern supports a reverse
search, and it will be a <ahref="https://doc.rust-lang.org/1.76.0/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="trait core::iter::traits::double_ended::DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if a forward/reverse
search yields the same elements.</p>
<p>For iterating from the front, the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.matches"title="method str::matches"><code>matches</code></a> method can be used.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.match_indices"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.5.0">1.5.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1772">source</a></span><h4class="code-header">pub fn <ahref="#method.match_indices"class="fn">match_indices</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.MatchIndices.html"title="struct core::str::iter::MatchIndices">MatchIndices</a><'a, P><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>An iterator over the disjoint matches of a pattern within this string
slice as well as the index that the match starts at.</p>
<p>For matches of <code>pat</code> within <code>self</code> that overlap, only the indices
corresponding to the first match are returned.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator will be a <ahref="https://doc.rust-lang.org/1.76.0/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="trait core::iter::traits::double_ended::DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if the pattern
allows a reverse search and forward/reverse search yields the same
elements. This is true for, e.g., <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, but not for <code>&str</code>.</p>
<p>If the pattern allows a reverse search but its results might differ
from a forward search, the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.rmatch_indices"title="method str::rmatch_indices"><code>rmatch_indices</code></a> method can be used.</p>
<spanclass="macro">assert_eq!</span>(v, [(<spanclass="number">0</span>, <spanclass="string">"aba"</span>)]); <spanclass="comment">// only the first `aba`</span></code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.rmatch_indices"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.5.0">1.5.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1812-1814">source</a></span><h4class="code-header">pub fn <ahref="#method.rmatch_indices"class="fn">rmatch_indices</a><'a, P>(&'a self, pat: P) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.RMatchIndices.html"title="struct core::str::iter::RMatchIndices">RMatchIndices</a><'a, P><divclass="where">where
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><divclass="docblock"><p>An iterator over the disjoint matches of a pattern within <code>self</code>,
yielded in reverse order along with the index of the match.</p>
<p>For matches of <code>pat</code> within <code>self</code> that overlap, only the indices
corresponding to the last match are returned.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<p>The returned iterator requires that the pattern supports a reverse
search, and it will be a <ahref="https://doc.rust-lang.org/1.76.0/core/iter/traits/double_ended/trait.DoubleEndedIterator.html"title="trait core::iter::traits::double_ended::DoubleEndedIterator"><code>DoubleEndedIterator</code></a> if a forward/reverse
search yields the same elements.</p>
<p>For iterating from the front, the <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.match_indices"title="method str::match_indices"><code>match_indices</code></a> method can be used.</p>
<spanclass="macro">assert_eq!</span>(v, [(<spanclass="number">2</span>, <spanclass="string">"aba"</span>)]); <spanclass="comment">// only the last `aba`</span></code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1836">source</a></span><h4class="code-header">pub fn <ahref="#method.trim"class="fn">trim</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section></summary><divclass="docblock"><p>Returns a string slice with leading and trailing whitespace removed.</p>
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
Core Property <code>White_Space</code>, which includes newlines.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_start"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.30.0">1.30.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1875">source</a></span><h4class="code-header">pub fn <ahref="#method.trim_start"class="fn">trim_start</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section></summary><divclass="docblock"><p>Returns a string slice with leading whitespace removed.</p>
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
Core Property <code>White_Space</code>, which includes newlines.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_end"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.30.0">1.30.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1914">source</a></span><h4class="code-header">pub fn <ahref="#method.trim_end"class="fn">trim_end</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section></summary><divclass="docblock"><p>Returns a string slice with trailing whitespace removed.</p>
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
Core Property <code>White_Space</code>, which includes newlines.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_left"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1954">source</a></span><h4class="code-header">pub fn <ahref="#method.trim_left"class="fn">trim_left</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 1.33.0: superseded by <code>trim_start</code></span></div></span></summary><divclass="docblock"><p>Returns a string slice with leading whitespace removed.</p>
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_right"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#1994">source</a></span><h4class="code-header">pub fn <ahref="#method.trim_right"class="fn">trim_right</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 1.33.0: superseded by <code>trim_end</code></span></div></span></summary><divclass="docblock"><p>Returns a string slice with trailing whitespace removed.</p>
<p>‘Whitespace’ is defined according to the terms of the Unicode Derived
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.DoubleEndedSearcher.html"title="trait core::str::pattern::DoubleEndedSearcher">DoubleEndedSearcher</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Returns a string slice with all prefixes and suffixes that match a
pattern repeatedly removed.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a function
or closure that determines if a character matches.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="macro">assert_eq!</span>(<spanclass="string">"1foo1barXX"</span>.trim_matches(|c| c == <spanclass="string">'1' </span>|| c == <spanclass="string">'X'</span>), <spanclass="string">"foo1bar"</span>);</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_start_matches"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.30.0">1.30.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2074">source</a></span><h4class="code-header">pub fn <ahref="#method.trim_start_matches"class="fn">trim_start_matches</a><'a, P>(&'a self, pat: P) ->&'a <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Returns a string slice with all prefixes that match a pattern
repeatedly removed.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.strip_prefix"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.45.0">1.45.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2107">source</a></span><h4class="code-header">pub fn <ahref="#method.strip_prefix"class="fn">strip_prefix</a><'a, P>(&'a self, prefix: P) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&'a <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Returns a string slice with the prefix removed.</p>
<p>If the string starts with the pattern <code>prefix</code>, returns substring after the prefix, wrapped
in <code>Some</code>. Unlike <code>trim_start_matches</code>, this method removes the prefix exactly once.</p>
<p>If the string does not start with <code>prefix</code>, returns <code>None</code>.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Returns a string slice with the suffix removed.</p>
<p>If the string ends with the pattern <code>suffix</code>, returns the substring before the suffix,
wrapped in <code>Some</code>. Unlike <code>trim_end_matches</code>, this method removes the suffix exactly once.</p>
<p>If the string does not end with <code>suffix</code>, returns <code>None</code>.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Returns a string slice with all suffixes that match a pattern
repeatedly removed.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="macro">assert_eq!</span>(<spanclass="string">"1fooX"</span>.trim_end_matches(|c| c == <spanclass="string">'1' </span>|| c == <spanclass="string">'X'</span>), <spanclass="string">"1foo"</span>);</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_left_matches"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2222">source</a></span><h4class="code-header">pub fn <ahref="#method.trim_left_matches"class="fn">trim_left_matches</a><'a, P>(&'a self, pat: P) ->&'a <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 1.33.0: superseded by <code>trim_start_matches</code></span></div></span></summary><divclass="docblock"><p>Returns a string slice with all prefixes that match a pattern
repeatedly removed.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<P as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html#associatedtype.Searcher"title="type core::str::pattern::Pattern::Searcher">Searcher</a>: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.ReverseSearcher.html"title="trait core::str::pattern::ReverseSearcher">ReverseSearcher</a><'a>,</div></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 1.33.0: superseded by <code>trim_end_matches</code></span></div></span></summary><divclass="docblock"><p>Returns a string slice with all suffixes that match a pattern
repeatedly removed.</p>
<p>The <ahref="https://doc.rust-lang.org/1.76.0/core/str/pattern/index.html"title="mod core::str::pattern">pattern</a> can be a <code>&str</code>, <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>, a slice of <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html"title="primitive char"><code>char</code></a>s, or a
function or closure that determines if a character matches.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="macro">assert_eq!</span>(<spanclass="string">"1fooX"</span>.trim_right_matches(|c| c == <spanclass="string">'1' </span>|| c == <spanclass="string">'X'</span>), <spanclass="string">"1foo"</span>);</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.parse"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2317">source</a></span><h4class="code-header">pub fn <ahref="#method.parse"class="fn">parse</a><F>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><F, <F as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/traits/trait.FromStr.html"title="trait core::str::traits::FromStr">FromStr</a>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/str/traits/trait.FromStr.html#associatedtype.Err"title="type core::str::traits::FromStr::Err">Err</a>><divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/traits/trait.FromStr.html"title="trait core::str::traits::FromStr">FromStr</a>,</div></h4></section></summary><divclass="docblock"><p>Parses this string slice into another type.</p>
<p>Because <code>parse</code> is so general, it can cause problems with type
inference. As such, <code>parse</code> is one of the few times you’ll see
the syntax affectionately known as the ‘turbofish’: <code>::<></code>. This
helps the inference algorithm understand specifically which type
you’re trying to parse into.</p>
<p><code>parse</code> can parse into any type that implements the <ahref="https://doc.rust-lang.org/1.76.0/core/str/traits/trait.FromStr.html"title="trait core::str::traits::FromStr"><code>FromStr</code></a> trait.</p>
<h5id="errors"><ahref="#errors">Errors</a></h5>
<p>Will return <ahref="https://doc.rust-lang.org/1.76.0/core/str/traits/trait.FromStr.html#associatedtype.Err"title="associated type core::str::traits::FromStr::Err"><code>Err</code></a> if it’s not possible to parse this string slice into
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_ascii"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2336">source</a></span><h4class="code-header">pub fn <ahref="#method.is_ascii"class="fn">is_ascii</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Checks if all characters in this string are within the ASCII range.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.as_ascii"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2348">source</a><h4class="code-header">pub fn <ahref="#method.as_ascii"class="fn">as_ascii</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&[<aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/ascii/ascii_char/enum.AsciiChar.html"title="enum core::ascii::ascii_char::AsciiChar">AsciiChar</a>]></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>ascii_char</code> <ahref="https://github.com/tokio-rs/tracing/issues/110998">#110998</a>)</span></div></span></summary><divclass="docblock"><p>If this string slice <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.is_ascii"title="method str::is_ascii"><code>is_ascii</code></a>, returns it as a slice
of <ahref="https://doc.rust-lang.org/1.76.0/core/ascii/ascii_char/enum.AsciiChar.html"title="enum core::ascii::ascii_char::AsciiChar">ASCII characters</a>, otherwise returns <code>None</code>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.eq_ignore_ascii_case"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2368">source</a></span><h4class="code-header">pub fn <ahref="#method.eq_ignore_ascii_case"class="fn">eq_ignore_ascii_case</a>(&self, other: &<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Checks that two strings are an ASCII case-insensitive match.</p>
<p>Same as <code>to_ascii_lowercase(a) == to_ascii_lowercase(b)</code>,
but without allocating and copying temporaries.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.make_ascii_uppercase"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2393">source</a></span><h4class="code-header">pub fn <ahref="#method.make_ascii_uppercase"class="fn">make_ascii_uppercase</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Converts this string to its ASCII upper case equivalent in-place.</p>
<p>ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’,
but non-ASCII letters are unchanged.</p>
<p>To return a new uppercased value without modifying the existing one, use
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span><spanclass="kw-2">mut </span>s = String::from(<spanclass="string">"Grüße, Jürgen ❤"</span>);
s.make_ascii_uppercase();
<spanclass="macro">assert_eq!</span>(<spanclass="string">"GRüßE, JüRGEN ❤"</span>, s);</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.make_ascii_lowercase"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2420">source</a></span><h4class="code-header">pub fn <ahref="#method.make_ascii_lowercase"class="fn">make_ascii_lowercase</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Converts this string to its ASCII lower case equivalent in-place.</p>
<p>ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’,
but non-ASCII letters are unchanged.</p>
<p>To return a new lowercased value without modifying the existing one, use
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span><spanclass="kw-2">mut </span>s = String::from(<spanclass="string">"GRÜßE, JÜRGEN ❤"</span>);
s.make_ascii_lowercase();
<spanclass="macro">assert_eq!</span>(<spanclass="string">"grÜße, jÜrgen ❤"</span>, s);</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_ascii_start"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2446">source</a><h4class="code-header">pub fn <ahref="#method.trim_ascii_start"class="fn">trim_ascii_start</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>byte_slice_trim_ascii</code> <ahref="https://github.com/tokio-rs/tracing/issues/94035">#94035</a>)</span></div></span></summary><divclass="docblock"><p>Returns a string slice with leading ASCII whitespace removed.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.trim_ascii"class="method"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2499">source</a><h4class="code-header">pub fn <ahref="#method.trim_ascii"class="fn">trim_ascii</a>(&self) ->&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a></h4></section><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>byte_slice_trim_ascii</code> <ahref="https://github.com/tokio-rs/tracing/issues/94035">#94035</a>)</span></div></span></summary><divclass="docblock"><p>Returns a string slice with leading and trailing ASCII whitespace
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.escape_debug"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.34.0">1.34.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2542">source</a></span><h4class="code-header">pub fn <ahref="#method.escape_debug"class="fn">escape_debug</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.EscapeDebug.html"title="struct core::str::iter::EscapeDebug">EscapeDebug</a><'_></h4></section></summary><divclass="docblock"><p>Return an iterator that escapes each char in <code>self</code> with <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html#method.escape_debug"title="method char::escape_debug"><code>char::escape_debug</code></a>.</p>
<p>Note: only extended grapheme codepoints that begin the string will be
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.escape_default"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.34.0">1.34.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2588">source</a></span><h4class="code-header">pub fn <ahref="#method.escape_default"class="fn">escape_default</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.EscapeDefault.html"title="struct core::str::iter::EscapeDefault">EscapeDefault</a><'_></h4></section></summary><divclass="docblock"><p>Return an iterator that escapes each char in <code>self</code> with <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html#method.escape_default"title="method char::escape_default"><code>char::escape_default</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.escape_unicode"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.34.0">1.34.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/core/str/mod.rs.html#2626">source</a></span><h4class="code-header">pub fn <ahref="#method.escape_unicode"class="fn">escape_unicode</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/str/iter/struct.EscapeUnicode.html"title="struct core::str::iter::EscapeUnicode">EscapeUnicode</a><'_></h4></section></summary><divclass="docblock"><p>Return an iterator that escapes each char in <code>self</code> with <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.char.html#method.escape_unicode"title="method char::escape_unicode"><code>char::escape_unicode</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.replace"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/str.rs.html#269">source</a></span><h4class="code-header">pub fn <ahref="#method.replace"class="fn">replace</a><'a, P>(&'a self, from: P, to: &<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Replaces all matches of a pattern with another string.</p>
<p><code>replace</code> creates a new <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String"><code>String</code></a>, and copies the data from this string slice into it.
While doing so, it attempts to find matches of a pattern. If it finds any, it
replaces them with the replacement string slice.</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>s = <spanclass="string">"this is old"</span>;
<spanclass="macro">assert_eq!</span>(<spanclass="string">"this is new"</span>, s.replace(<spanclass="string">"old"</span>, <spanclass="string">"new"</span>));
<spanclass="macro">assert_eq!</span>(<spanclass="string">"than an old"</span>, s.replace(<spanclass="string">"is"</span>, <spanclass="string">"an"</span>));</code></pre></div>
<p>When the pattern doesn’t match, it returns this string slice as <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String"><code>String</code></a>:</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>s = <spanclass="string">"this is old"</span>;
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.replacen"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.16.0">1.16.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/str.rs.html#309">source</a></span><h4class="code-header">pub fn <ahref="#method.replacen"class="fn">replacen</a><'a, P>(&'a self, pat: P, to: &<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.str.html">str</a>, count: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a><divclass="where">where
P: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/str/pattern/trait.Pattern.html"title="trait core::str::pattern::Pattern">Pattern</a><'a>,</div></h4></section></summary><divclass="docblock"><p>Replaces first N matches of a pattern with another string.</p>
<p><code>replacen</code> creates a new <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String"><code>String</code></a>, and copies the data from this string slice into it.
While doing so, it attempts to find matches of a pattern. If it finds any, it
replaces them with the replacement string slice at most <code>count</code> times.</p>
<p>When the pattern doesn’t match, it returns this string slice as <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String"><code>String</code></a>:</p>
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>s = <spanclass="string">"this is old"</span>;
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_lowercase"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.2.0">1.2.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/str.rs.html#366">source</a></span><h4class="code-header">pub fn <ahref="#method.to_lowercase"class="fn">to_lowercase</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></h4></section></summary><divclass="docblock"><p>Returns the lowercase equivalent of this string slice, as a new <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String"><code>String</code></a>.</p>
<p>‘Lowercase’ is defined according to the terms of the Unicode Derived Core Property
<code>Lowercase</code>.</p>
<p>Since some characters can expand into multiple characters when changing
the case, this function returns a <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String"><code>String</code></a> instead of modifying the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_uppercase"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.2.0">1.2.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/str.rs.html#457">source</a></span><h4class="code-header">pub fn <ahref="#method.to_uppercase"class="fn">to_uppercase</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></h4></section></summary><divclass="docblock"><p>Returns the uppercase equivalent of this string slice, as a new <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String"><code>String</code></a>.</p>
<p>‘Uppercase’ is defined according to the terms of the Unicode Derived Core Property
<code>Uppercase</code>.</p>
<p>Since some characters can expand into multiple characters when changing
the case, this function returns a <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String"><code>String</code></a> instead of modifying the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.repeat"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.16.0">1.16.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/str.rs.html#527">source</a></span><h4class="code-header">pub fn <ahref="#method.repeat"class="fn">repeat</a>(&self, n: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></h4></section></summary><divclass="docblock"><p>Creates a new <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String"><code>String</code></a> by repeating a string <code>n</code> times.</p>
<divclass="example-wrap should_panic"><ahref="#"class="tooltip"title="This example panics">ⓘ</a><preclass="rust rust-example-rendered"><code><spanclass="comment">// this will panic at runtime
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_ascii_uppercase"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/str.rs.html#557">source</a></span><h4class="code-header">pub fn <ahref="#method.to_ascii_uppercase"class="fn">to_ascii_uppercase</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></h4></section></summary><divclass="docblock"><p>Returns a copy of this string where each character is mapped to its
ASCII upper case equivalent.</p>
<p>ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’,
but non-ASCII letters are unchanged.</p>
<p>To uppercase the value in-place, use <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.make_ascii_uppercase"title="method str::make_ascii_uppercase"><code>make_ascii_uppercase</code></a>.</p>
<p>To uppercase ASCII characters in addition to non-ASCII characters, use
<divclass="example-wrap"><preclass="rust rust-example-rendered"><code><spanclass="kw">let </span>s = <spanclass="string">"Grüße, Jürgen ❤"</span>;
<spanclass="macro">assert_eq!</span>(<spanclass="string">"GRüßE, JüRGEN ❤"</span>, s.to_ascii_uppercase());</code></pre></div>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_ascii_lowercase"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.23.0">1.23.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.76.0/src/alloc/str.rs.html#589">source</a></span><h4class="code-header">pub fn <ahref="#method.to_ascii_lowercase"class="fn">to_ascii_lowercase</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></h4></section></summary><divclass="docblock"><p>Returns a copy of this string where each character is mapped to its
ASCII lower case equivalent.</p>
<p>ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’,
but non-ASCII letters are unchanged.</p>
<p>To lowercase the value in-place, use <ahref="https://doc.rust-lang.org/1.76.0/std/primitive.str.html#method.make_ascii_lowercase"title="method str::make_ascii_lowercase"><code>make_ascii_lowercase</code></a>.</p>
<p>To lowercase ASCII characters in addition to non-ASCII characters, use
T: 'static + ?<aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.type_id"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/any.rs.html#141">source</a><ahref="#method.type_id"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/any/trait.Any.html#tymethod.type_id"class="fn">type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/any/struct.TypeId.html"title="struct core::any::TypeId">TypeId</a></h4></section></summary><divclass='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <ahref="https://doc.rust-lang.org/1.76.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Borrow%3CT%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/borrow.rs.html#208">source</a><ahref="#impl-Borrow%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/borrow/trait.Borrow.html"title="trait core::borrow::Borrow">Borrow</a><T> for T<divclass="where">where
T: ?<aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.borrow"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/borrow.rs.html#210">source</a><ahref="#method.borrow"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/borrow/trait.Borrow.html#tymethod.borrow"class="fn">borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&T</a></h4></section></summary><divclass='docblock'>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.76.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-BorrowMut%3CT%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/borrow.rs.html#216">source</a><ahref="#impl-BorrowMut%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/borrow/trait.BorrowMut.html"title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<divclass="where">where
T: ?<aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.borrow_mut"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/borrow.rs.html#217">source</a><ahref="#method.borrow_mut"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut"class="fn">borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&mut T</a></h4></section></summary><divclass='docblock'>Mutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.76.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-From%3CT%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#763">source</a><ahref="#impl-From%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for T</h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.from"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#766">source</a><ahref="#method.from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.From.html#tymethod.from"class="fn">from</a>(t: T) -> T</h4></section></summary><divclass="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Instrument-for-T"class="impl"><aclass="src rightside"href="../../src/tracing/instrument.rs.html#325">source</a><ahref="#impl-Instrument-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="../../tracing/instrument/trait.Instrument.html"title="trait tracing::instrument::Instrument">Instrument</a> for T</h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.instrument"class="method trait-impl"><aclass="src rightside"href="../../src/tracing/instrument.rs.html#86">source</a><ahref="#method.instrument"class="anchor">§</a><h4class="code-header">fn <ahref="../../tracing/instrument/trait.Instrument.html#method.instrument"class="fn">instrument</a>(self, span: <aclass="struct"href="../../tracing/span/struct.Span.html"title="struct tracing::span::Span">Span</a>) -><aclass="struct"href="../../tracing/instrument/struct.Instrumented.html"title="struct tracing::instrument::Instrumented">Instrumented</a><Self></h4></section></summary><divclass='docblock'>Instruments this type with the provided <ahref="../../tracing/span/struct.Span.html"title="struct tracing::span::Span"><code>Span</code></a>, returning an
<code>Instrumented</code> wrapper. <ahref="../../tracing/instrument/trait.Instrument.html#method.instrument">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.in_current_span"class="method trait-impl"><aclass="src rightside"href="../../src/tracing/instrument.rs.html#128">source</a><ahref="#method.in_current_span"class="anchor">§</a><h4class="code-header">fn <ahref="../../tracing/instrument/trait.Instrument.html#method.in_current_span"class="fn">in_current_span</a>(self) -><aclass="struct"href="../../tracing/instrument/struct.Instrumented.html"title="struct tracing::instrument::Instrumented">Instrumented</a><Self></h4></section></summary><divclass='docblock'>Instruments this type with the <ahref="../../tracing/span/struct.Span.html#method.current"title="associated function tracing::span::Span::current">current</a><ahref="../../tracing/span/struct.Span.html"title="struct tracing::span::Span"><code>Span</code></a>, returning an
<code>Instrumented</code> wrapper. <ahref="../../tracing/instrument/trait.Instrument.html#method.in_current_span">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Into%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#747-749">source</a><ahref="#impl-Into%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><U> for T<divclass="where">where
<p>That is, this conversion is whatever the implementation of
<code><ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-ToString-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/alloc/string.rs.html#2600">source</a><ahref="#impl-ToString-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.76.0/alloc/string/trait.ToString.html"title="trait alloc::string::ToString">ToString</a> for T<divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Display.html"title="trait core::fmt::Display">Display</a> + ?<aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_string"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/alloc/string.rs.html#2606">source</a><ahref="#method.to_string"class="anchor">§</a><h4class="code-header">default fn <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/trait.ToString.html#tymethod.to_string"class="fn">to_string</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></h4></section></summary><divclass='docblock'>Converts the given value to a <code>String</code>. <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryFrom%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#803-805">source</a><ahref="#impl-TryFrom%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T<divclass="where">where
U: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error"class="associatedtype trait-impl"><ahref="#associatedtype.Error"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_from"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#810">source</a><ahref="#method.try_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#tymethod.try_from"class="fn">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryInto%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#788-790">source</a><ahref="#impl-TryInto%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T<divclass="where">where
U: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error-1"class="associatedtype trait-impl"><ahref="#associatedtype.Error-1"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_into"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#795">source</a><ahref="#method.try_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryInto.html#tymethod.try_into"class="fn">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-WithSubscriber-for-T"class="impl"><aclass="src rightside"href="../../src/tracing/instrument.rs.html#393">source</a><ahref="#impl-WithSubscriber-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="../../tracing/instrument/trait.WithSubscriber.html"title="trait tracing::instrument::WithSubscriber">WithSubscriber</a> for T</h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.with_subscriber"class="method trait-impl"><aclass="src rightside"href="../../src/tracing/instrument.rs.html#176-178">source</a><ahref="#method.with_subscriber"class="anchor">§</a><h4class="code-header">fn <ahref="../../tracing/instrument/trait.WithSubscriber.html#method.with_subscriber"class="fn">with_subscriber</a><S>(self, subscriber: S) -><aclass="struct"href="../../tracing/instrument/struct.WithDispatch.html"title="struct tracing::instrument::WithDispatch">WithDispatch</a><Self><divclass="where">where
S: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="../../tracing_core/dispatcher/struct.Dispatch.html"title="struct tracing_core::dispatcher::Dispatch">Dispatch</a>>,</div></h4></section></summary><divclass='docblock'>Attaches the provided <ahref="../../tracing_core/subscriber/trait.Subscriber.html"title="trait tracing_core::subscriber::Subscriber"><code>Subscriber</code></a> to this type, returning a
<ahref="../../tracing/instrument/struct.WithDispatch.html"title="struct tracing::instrument::WithDispatch"><code>WithDispatch</code></a> wrapper. <ahref="../../tracing/instrument/trait.WithSubscriber.html#method.with_subscriber">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.with_current_subscriber"class="method trait-impl"><aclass="src rightside"href="../../src/tracing/instrument.rs.html#228">source</a><ahref="#method.with_current_subscriber"class="anchor">§</a><h4class="code-header">fn <ahref="../../tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber"class="fn">with_current_subscriber</a>(self) -><aclass="struct"href="../../tracing/instrument/struct.WithDispatch.html"title="struct tracing::instrument::WithDispatch">WithDispatch</a><Self></h4></section></summary><divclass='docblock'>Attaches the current <ahref="../../tracing/dispatcher/index.html#setting-the-default-subscriber"title="mod tracing::dispatcher">default</a><ahref="../../tracing_core/subscriber/trait.Subscriber.html"title="trait tracing_core::subscriber::Subscriber"><code>Subscriber</code></a> to this type, returning a
<ahref="../../tracing/instrument/struct.WithDispatch.html"title="struct tracing::instrument::WithDispatch"><code>WithDispatch</code></a> wrapper. <ahref="../../tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber">Read more</a></div></details></div></details></div><scripttype="text/json"id="notable-traits-data">{"&[u8]":"<h3>Notable traits for <code>&[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.76.0/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.76.0/std/primitive.u8.html\">u8</a>]</div>","&mut [u8]":"<h3>Notable traits for <code>&mut [<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.76.0/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a> for &mut [<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.76.0/std/primitive.u8.html\">u8</a>]</div>"}</script></section></div></main></body></html>