<!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 synchronization primitive which can be used to run a one-time global initialization. Useful for one-time initialization for FFI or related functionality. This type can only be constructed with `Once::new()`."><title>Once in tracing_core - 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-5bc39a1768837dd0.css"><metaname="rustdoc-vars"data-root-path="../"data-static-root-path="../static.files/"data-current-crate="tracing_core"data-themes=""data-resource-suffix=""data-rustdoc-version="1.77.1 (7cf61ebde 2024-03-27)"data-channel="1.77.1"data-search-js="search-dd67cee4cfa65049.js"data-settings-js="settings-4313503d2e1961c2.js"><scriptsrc="../static.files/storage-4c98445ec4002617.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../static.files/main-48f368f3872407c8.js"></script><noscript><linkrel="stylesheet"href="../static.files/noscript-04d5337699b92874.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"title="show sidebar"></button><aclass="logo-container"href="../tracing_core/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_core/index.html"><imgsrc="https://raw.githubusercontent.com/tokio-rs/tracing/master/assets/logo-type.png"alt="logo"></a><h2><ahref="../tracing_core/index.html">tracing_core</a><spanclass="version">0.1.32</span></h2></div><h2class="location"><ahref="#">Once</a></h2><divclass="sidebar-elems"><section><h3><ahref="#implementations">Methods</a></h3><ulclass="block method"><li><ahref="#method.call_once">call_once</a></li><li><ahref="#method.call_once_force">call_once_force</a></li><li><ahref="#method.is_completed">is_completed</a></li><li><ahref="#method.new">new</a></li></ul><h3><ahref="#trait-implementations">Trait Implementations</a></h3><ulclass="block trait-implementation"><li><ahref="#impl-Debug-for-Once">Debug</a></li><li><ahref="#impl-RefUnwindSafe-for-Once">RefUnwindSafe</a></li><li><ahref="#impl-UnwindSafe-for-Once">UnwindSafe</a></li></ul><h3><ahref="#synthetic-implementations">Auto Trait Implementations</a></h3><ulclass="block synthetic-implementation"><li><ahref="#impl-Send-for-Once">Send</a></li><li><ahref="#impl-Sync-for-Once">Sync</a></li><li><ahref="#impl-Unpin-for-Once">Unpin</a></li></ul><h3><ahref="#blanket-implementations">Blanket Implementations</a></h3><ulclass="block blanket-implementation"><li><ahref="#impl-Any-for-T">Any</a></li><li><ahref="#impl-Borrow%3CT%3E-for-T">Borrow<T></a></li><li><ahref="#impl-BorrowMut%3CT%3E-for-T">BorrowMut<T></a
<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../tracing_core/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_core</a>::<wbr><aclass="struct"href="#">Once</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"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.1/src/std/sync/once.rs.html#29">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><preclass="rust item-decl"><code>pub struct Once { <spanclass="comment">/* private fields */</span> }</code></pre><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>A synchronization primitive which can be used to run a one-time global
initialization. Useful for one-time initialization for FFI or related
functionality. This type can only be constructed with <ahref="struct.Once.html#method.new"title="associated function tracing_core::Once::new"><code>Once::new()</code></a>.</p>
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/ops/function/trait.FnOnce.html"title="trait core::ops::function::FnOnce">FnOnce</a>(),</div></h4></section></summary><divclass="docblock"><p>Performs an initialization routine once and only once. The given closure
will be executed if this is the first time <code>call_once</code> has been called,
and otherwise the routine will <em>not</em> be invoked.</p>
<p>This method will block the calling thread if another initialization
routine is currently running.</p>
<p>When this function returns, it is guaranteed that some initialization
has run and completed (it might not be the closure specified). It is also
guaranteed that any memory writes performed by the executed closure can
be reliably observed by other threads at this point (there is a
happens-before relation between the closure and code executing after the
return).</p>
<p>If the given closure recursively invokes <code>call_once</code> on the same <ahref="struct.Once.html"title="struct tracing_core::Once"><code>Once</code></a>
instance, the exact behavior is not specified: allowed outcomes are
<p>The closure <code>f</code> will only be executed once even if this is called
concurrently amongst many threads. If that closure panics, however, then
it will <em>poison</em> this <ahref="struct.Once.html"title="struct tracing_core::Once"><code>Once</code></a> instance, causing all future invocations of
<code>call_once</code> to also panic.</p>
<p>This is similar to <ahref="struct.Mutex.html#poisoning">poisoning with mutexes</a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.call_once_force"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.77.1/src/std/sync/once.rs.html#198-200">source</a></span><h4class="code-header">pub fn <ahref="#method.call_once_force"class="fn">call_once_force</a><F>(&self, f: F)<divclass="where">where
F: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/ops/function/trait.FnOnce.html"title="trait core::ops::function::FnOnce">FnOnce</a>(&<aclass="struct"href="https://doc.rust-lang.org/1.77.1/std/sync/once/struct.OnceState.html"title="struct std::sync::once::OnceState">OnceState</a>),</div></h4></section></summary><divclass="docblock"><p>Performs the same function as <ahref="struct.Once.html#method.call_once"title="method tracing_core::Once::call_once"><code>call_once()</code></a> except ignores poisoning.</p>
<p>Unlike <ahref="struct.Once.html#method.call_once"title="method tracing_core::Once::call_once"><code>call_once()</code></a>, if this <ahref="struct.Once.html"title="struct tracing_core::Once"><code>Once</code></a> has been poisoned (i.e., a previous
call to <ahref="struct.Once.html#method.call_once"title="method tracing_core::Once::call_once"><code>call_once()</code></a> or <ahref="struct.Once.html#method.call_once_force"title="method tracing_core::Once::call_once_force"><code>call_once_force()</code></a> caused a panic), calling
<ahref="struct.Once.html#method.call_once_force"title="method tracing_core::Once::call_once_force"><code>call_once_force()</code></a> will still invoke the closure <code>f</code> and will <em>not</em>
result in an immediate panic. If <code>f</code> panics, the <ahref="struct.Once.html"title="struct tracing_core::Once"><code>Once</code></a> will remain
in a poison state. If <code>f</code> does <em>not</em> panic, the <ahref="struct.Once.html"title="struct tracing_core::Once"><code>Once</code></a> will no
longer be in a poison state and all future calls to <ahref="struct.Once.html#method.call_once"title="method tracing_core::Once::call_once"><code>call_once()</code></a> or
<ahref="struct.Once.html#method.call_once_force"title="method tracing_core::Once::call_once_force"><code>call_once_force()</code></a> will be no-ops.</p>
<p>The closure <code>f</code> is yielded a <ahref="https://doc.rust-lang.org/1.77.1/std/sync/once/struct.OnceState.html"title="struct std::sync::once::OnceState"><code>OnceState</code></a> structure which can be used
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_completed"class="method"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.43.0">1.43.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.1/src/std/sync/once.rs.html#254">source</a></span><h4class="code-header">pub fn <ahref="#method.is_completed"class="fn">is_completed</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Returns <code>true</code> if some <ahref="struct.Once.html#method.call_once"title="method tracing_core::Once::call_once"><code>call_once()</code></a> call has completed
successfully. Specifically, <code>is_completed</code> will return false in
the following situations:</p>
<ul>
<li><ahref="struct.Once.html#method.call_once"title="method tracing_core::Once::call_once"><code>call_once()</code></a> was not called at all,</li>
<li><ahref="struct.Once.html#method.call_once"title="method tracing_core::Once::call_once"><code>call_once()</code></a> was called, but has not yet completed,</li>
<li>the <ahref="struct.Once.html"title="struct tracing_core::Once"><code>Once</code></a> instance is poisoned</li>
</ul>
<p>This function returning <code>false</code> does not mean that <ahref="struct.Once.html"title="struct tracing_core::Once"><code>Once</code></a> has not been
executed. For example, it may have been executed in the time between
when <code>is_completed</code> starts executing and when it returns, in which case
the <code>false</code> return value would be stale (but still permissible).</p>
</div></details></div></details></div><h2id="trait-implementations"class="section-header">Trait Implementations<ahref="#trait-implementations"class="anchor">§</a></h2><divid="trait-implementations-list"><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Debug-for-Once"class="impl"><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.77.1/src/std/sync/once.rs.html#270">source</a></span><ahref="#impl-Debug-for-Once"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a> for <aclass="struct"href="struct.Once.html"title="struct tracing_core::Once">Once</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.fmt"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.1/src/std/sync/once.rs.html#271">source</a><ahref="#method.fmt"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/fmt/trait.Debug.html#tymethod.fmt"class="fn">fmt</a>(&self, f: &mut <aclass="struct"href="https://doc.rust-lang.org/1.77.1/core/fmt/struct.Formatter.html"title="struct core::fmt::Formatter">Formatter</a><'_>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.unit.html">()</a>, <aclass="struct"href="https://doc.rust-lang.org/1.77.1/core/fmt/struct.Error.html"title="struct core::fmt::Error">Error</a>></h4></section></summary><divclass='docblock'>Formats the value using the given formatter. <ahref="https://doc.rust-lang.org/1.77.1/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><sectionid="impl-RefUnwindSafe-for-Once"class="impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.59.0">1.59.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.1/src/std/sync/once.rs.html#37">source</a></span><ahref="#impl-RefUnwindSafe-for-Once"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/panic/unwind_safe/trait.RefUnwindSafe.html"title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <aclass="struct"href="struct.Once.html"title="struct tracing_core::Once">Once</a></h3></section><sectionid="impl-UnwindSafe-for-Once"class="impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.59.0">1.59.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.77.1/src/std/sync/once.rs.html#34">source</a></span><ahref="#impl-UnwindSafe-for-Once"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/panic/unwind_safe/trait.UnwindSafe.html"title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <aclass="struct"href="struct.Once.html"title="struct tracing_core::Once">Once</a></h3></section></div><h2id="synthetic-implementations"class="section-header">Auto Trait Implementations<ahref="#synthetic-implementations"class="anchor">§</a></h2><divid="synthetic-implementations-list"><sectionid="impl-Send-for-Once"class="impl"><ahref="#impl-Send-for-Once"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/marker/trait.Send.html"title="trait core::marker::Send">Send</a> for <aclass="struct"href="struct.Once.html"title="struct tracing_core::Once">Once</a></h3></section><sectionid="impl-Sync-for-Once"class="impl"><ahref="#impl-Sync-for-Once"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/marker/trait.Sync.html"title="trait core::marker::Sync">Sync</a> for <aclass="struct"href="struct.Once.html"title="struct
T: 'static + ?<aclass="trait"href="https://doc.rust-lang.org/1.77.1/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.77.1/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.77.1/core/any/trait.Any.html#tymethod.type_id"class="fn">type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.1/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.77.1/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.77.1/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.77.1/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.77.1/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.77.1/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.77.1/core/borrow/trait.Borrow.html#tymethod.borrow"class="fn">borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.reference.html">&T</a></h4></section></summary><divclass='docblock'>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.77.1/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.77.1/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.77.1/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.77.1/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.77.1/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.77.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut"class="fn">borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/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.77.1/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.77.1/src/core/convert/mod.rs.html#764">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.77.1/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.77.1/src/core/convert/mod.rs.html#767">source</a><ahref="#method.from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/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-Into%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.1/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.77.1/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><U> for T<divclass="where">where
<code><ahref="https://doc.rust-lang.org/1.77.1/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-TryFrom%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.1/src/core/convert/mod.rs.html#804-806">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.77.1/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.77.1/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-1"class="associatedtype trait-impl"><ahref="#associatedtype.Error-1"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.77.1/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.77.1/src/core/convert/mod.rs.html#811">source</a><ahref="#method.try_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html#tymethod.try_from"class="fn">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.1/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.77.1/src/core/convert/mod.rs.html#789-791">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.77.1/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.77.1/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"class="associatedtype trait-impl"><ahref="#associatedtype.Error"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.1/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.77.1/src/core/convert/mod.rs.html#796">source</a><ahref="#method.try_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryInto.html#tymethod.try_into"class="fn">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.1/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></div></section></div></main></body></html>