Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > core-updates > by-pkgid > 564935689ab5527f955e5449ded02799 > files > 3204

rust-doc-1.19.0-1.mga6.armv7hl.rpm

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `From` trait in crate `std`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, From">

    <title>std::convert::From - Rust</title>

    <link rel="stylesheet" type="text/css" href="../../normalize.css">
    <link rel="stylesheet" type="text/css" href="../../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../../main.css">
    

    <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico">
    
</head>
<body class="rustdoc trait">
    <!--[if lte IE 8]>
    <div class="warning">
        This old browser is unsupported and will most likely display funky
        things.
    </div>
    <![endif]-->

    

    <nav class="sidebar">
        <a href='../../std/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='logo' width='100'></a>
        <p class='location'>Trait From</p><div class="block items"><ul><li><a href="#required-methods">Required Methods</a></li><li><a href="#implementors">Implementors</a></li></ul></div><p class='location'><a href='../index.html'>std</a>::<wbr><a href='index.html'>convert</a></p><script>window.sidebarCurrent = {name: 'From', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script>
    </nav>

    <nav class="sub">
        <form class="search-form js-only">
            <div class="search-container">
                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
                       type="search">
            </div>
        </form>
    </nav>

    <section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Trait <a href='../index.html'>std</a>::<wbr><a href='index.html'>convert</a>::<wbr><a class="trait" href=''>From</a></span><span class='out-of-band'><span class='since' title='Stable since Rust version 1.0.0'>1.0.0</span><span id='render-detail'>
                   <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
                       [<span class='inner'>&#x2212;</span>]
                   </a>
               </span><a class='srclink' href='../../src/core/convert.rs.html#310-314' title='goto source code'>[src]</a></span></h1>
<pre class='rust trait'>pub trait From&lt;T&gt; {
    fn <a href='#tymethod.from' class='fnname'>from</a>(T) -&gt; Self;
}</pre><div class='docblock'><p>Simple and safe type conversions in to <code>Self</code>. It is the reciprocal of
<code>Into</code>.</p>

<p>This trait is useful when performing error handling as described by
<a href="../../book/error-handling.html">the book</a> and is closely related to the <code>?</code> operator.</p>

<p>When constructing a function that is capable of failing the return type
will generally be of the form <code>Result&lt;T, E&gt;</code>.</p>

<p>The <code>From</code> trait allows for simplification of error handling by providing a
means of returning a single error type that encapsulates numerous possible
erroneous situations.</p>

<p>This trait is not limited to error handling, rather the general case for
this trait would be in any type conversions to have an explicit definition
of how they are performed.</p>

<p><strong>Note: this trait must not fail</strong>. If the conversion can fail, use
<a href="trait.TryFrom.html"><code>TryFrom</code></a> or a dedicated method which returns an <a href="../../std/option/enum.Option.html"><code>Option&lt;T&gt;</code></a> or a
<a href="../../std/result/enum.Result.html"><code>Result&lt;T, E&gt;</code></a>.</p>

<h1 id='generic-implementations' class='section-header'><a href='#generic-implementations'>Generic Implementations</a></h1>
<ul>
<li><code>From&lt;T&gt; for U</code> implies <a href="trait.Into.html"><code>Into&lt;U&gt;</code></a><code>for T</code></li>
<li><a href="trait.From.html#tymethod.from"><code>from</code></a> is reflexive, which means that <code>From&lt;T&gt; for T</code> is implemented</li>
</ul>

<h1 id='examples' class='section-header'><a href='#examples'>Examples</a></h1>
<p><a href="../../std/string/struct.String.html"><code>String</code></a> implements <code>From&lt;&amp;str&gt;</code>:</p>

<pre class="rust rust-example-rendered">
<span class="kw">let</span> <span class="ident">string</span> <span class="op">=</span> <span class="string">&quot;hello&quot;</span>.<span class="ident">to_string</span>();
<span class="kw">let</span> <span class="ident">other_string</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">from</span>(<span class="string">&quot;hello&quot;</span>);

<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">string</span>, <span class="ident">other_string</span>);<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=fn%20main()%20%7B%0Alet%20string%20%3D%20%22hello%22.to_string()%3B%0Alet%20other_string%20%3D%20String%3A%3Afrom(%22hello%22)%3B%0A%0Aassert_eq!(string%2C%20other_string)%3B%0A%7D">Run</a></pre>

<p>An example usage for error handling:</p>

<pre class="rust rust-example-rendered">
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>::{<span class="self">self</span>, <span class="ident">Read</span>};
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">num</span>;

<span class="kw">enum</span> <span class="ident">CliError</span> {
    <span class="ident">IoError</span>(<span class="ident">io</span>::<span class="ident">Error</span>),
    <span class="ident">ParseError</span>(<span class="ident">num</span>::<span class="ident">ParseIntError</span>),
}

<span class="kw">impl</span> <span class="ident">From</span><span class="op">&lt;</span><span class="ident">io</span>::<span class="ident">Error</span><span class="op">&gt;</span> <span class="kw">for</span> <span class="ident">CliError</span> {
    <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">error</span>: <span class="ident">io</span>::<span class="ident">Error</span>) <span class="op">-&gt;</span> <span class="self">Self</span> {
        <span class="ident">CliError</span>::<span class="ident">IoError</span>(<span class="ident">error</span>)
    }
}

<span class="kw">impl</span> <span class="ident">From</span><span class="op">&lt;</span><span class="ident">num</span>::<span class="ident">ParseIntError</span><span class="op">&gt;</span> <span class="kw">for</span> <span class="ident">CliError</span> {
    <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">error</span>: <span class="ident">num</span>::<span class="ident">ParseIntError</span>) <span class="op">-&gt;</span> <span class="self">Self</span> {
        <span class="ident">CliError</span>::<span class="ident">ParseError</span>(<span class="ident">error</span>)
    }
}

<span class="kw">fn</span> <span class="ident">open_and_parse_file</span>(<span class="ident">file_name</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">i32</span>, <span class="ident">CliError</span><span class="op">&gt;</span> {
    <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">file</span> <span class="op">=</span> <span class="ident">std</span>::<span class="ident">fs</span>::<span class="ident">File</span>::<span class="ident">open</span>(<span class="string">&quot;test&quot;</span>)<span class="question-mark">?</span>;
    <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">contents</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">new</span>();
    <span class="ident">file</span>.<span class="ident">read_to_string</span>(<span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">contents</span>)<span class="question-mark">?</span>;
    <span class="kw">let</span> <span class="ident">num</span>: <span class="ident">i32</span> <span class="op">=</span> <span class="ident">contents</span>.<span class="ident">trim</span>().<span class="ident">parse</span>()<span class="question-mark">?</span>;
    <span class="prelude-val">Ok</span>(<span class="ident">num</span>)
}<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=fn%20main()%20%7B%0Ause%20std%3A%3Aio%3A%3A%7Bself%2C%20Read%7D%3B%0Ause%20std%3A%3Anum%3B%0A%0Aenum%20CliError%20%7B%0A%20%20%20%20IoError(io%3A%3AError)%2C%0A%20%20%20%20ParseError(num%3A%3AParseIntError)%2C%0A%7D%0A%0Aimpl%20From%3Cio%3A%3AError%3E%20for%20CliError%20%7B%0A%20%20%20%20fn%20from(error%3A%20io%3A%3AError)%20-%3E%20Self%20%7B%0A%20%20%20%20%20%20%20%20CliError%3A%3AIoError(error)%0A%20%20%20%20%7D%0A%7D%0A%0Aimpl%20From%3Cnum%3A%3AParseIntError%3E%20for%20CliError%20%7B%0A%20%20%20%20fn%20from(error%3A%20num%3A%3AParseIntError)%20-%3E%20Self%20%7B%0A%20%20%20%20%20%20%20%20CliError%3A%3AParseError(error)%0A%20%20%20%20%7D%0A%7D%0A%0Afn%20open_and_parse_file(file_name%3A%20%26str)%20-%3E%20Result%3Ci32%2C%20CliError%3E%20%7B%0A%20%20%20%20let%20mut%20file%20%3D%20std%3A%3Afs%3A%3AFile%3A%3Aopen(%22test%22)%3F%3B%0A%20%20%20%20let%20mut%20contents%20%3D%20String%3A%3Anew()%3B%0A%20%20%20%20file.read_to_string(%26mut%20contents)%3F%3B%0A%20%20%20%20let%20num%3A%20i32%20%3D%20contents.trim().parse()%3F%3B%0A%20%20%20%20Ok(num)%0A%7D%0A%7D">Run</a></pre>
</div>
            <h2 id='required-methods'>Required Methods</h2>
            <div class='methods'>
        <h3 id='tymethod.from' class='method'><span id='from.v' class='invisible'><code>fn <a href='#tymethod.from' class='fnname'>from</a>(T) -&gt; Self</code></span></h3><div class='docblock'><p>Performs the conversion.</p>
</div></div>
        <h2 id='implementors'>Implementors</h2>
        <ul class='item-list' id='implementors-list'>
    <li><code>impl&lt;'a, T&gt; From&lt;<a class="primitive" href="../primitive.slice.html">&amp;'a [T]</a>&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/marker/trait.Copy.html" title="trait std::marker::Copy">Copy</a>,&nbsp;</span></code></li>
<li><code>impl&lt;T&gt; From&lt;T&gt; for <a class="struct" href="../../std/sync/struct.Arc.html" title="struct std::sync::Arc">Arc</a>&lt;T&gt;</code></li>
<li><code>impl&lt;T&gt; From&lt;T&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;T&gt;</code></li>
<li><code>impl&lt;'a&gt; From&lt;&amp;'a <a class="primitive" href="../primitive.str.html">str</a>&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="primitive" href="../primitive.str.html">str</a>&gt;</code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="primitive" href="../primitive.str.html">str</a>&gt;&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="primitive" href="../primitive.slice.html">[</a><a class="primitive" href="../primitive.u8.html">u8</a><a class="primitive" href="../primitive.slice.html">]</a>&gt;</code></li>
<li><code>impl&lt;T&gt; From&lt;T&gt; for <a class="struct" href="../../std/rc/struct.Rc.html" title="struct std::rc::Rc">Rc</a>&lt;T&gt;</code></li>
<li><code>impl&lt;'a, T&gt; From&lt;<a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a>&gt;&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a>: <a class="trait" href="../../std/borrow/trait.ToOwned.html" title="trait std::borrow::ToOwned">ToOwned</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;<a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a> as <a class="trait" href="../../std/borrow/trait.ToOwned.html" title="trait std::borrow::ToOwned">ToOwned</a>&gt;::<a class="trait" href="../../std/borrow/trait.ToOwned.html" title="trait std::borrow::ToOwned">Owned</a> == <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt;,&nbsp;</span></code></li>
<li><code>impl&lt;'a, T&gt; From&lt;<a class="primitive" href="../primitive.slice.html">&amp;'a [T]</a>&gt; for <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a>,&nbsp;</span></code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="primitive" href="../primitive.str.html">str</a>&gt;&gt; for <a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a></code></li>
<li><code>impl&lt;'a, T&gt; From&lt;<a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt;&gt; for <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a>,&nbsp;</span></code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a>&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt;</code></li>
<li><code>impl&lt;'a&gt; From&lt;&amp;'a <a class="primitive" href="../primitive.str.html">str</a>&gt; for <a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a></code></li>
<li><code>impl&lt;T&gt; From&lt;<a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt;&gt; for <a class="struct" href="../../std/collections/binary_heap/struct.BinaryHeap.html" title="struct std::collections::binary_heap::BinaryHeap">BinaryHeap</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/cmp/trait.Ord.html" title="trait std::cmp::Ord">Ord</a>,&nbsp;</span></code></li>
<li><code>impl&lt;'a, T&gt; From&lt;<a class="primitive" href="../primitive.slice.html">&amp;'a [T]</a>&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a>,&nbsp;</span></code></li>
<li><code>impl&lt;'a, T&gt; From&lt;<a class="primitive" href="../primitive.slice.html">&amp;'a mut [T]</a>&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../std/clone/trait.Clone.html" title="trait std::clone::Clone">Clone</a>,&nbsp;</span></code></li>
<li><code>impl&lt;T&gt; From&lt;<a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt;&gt; for <a class="struct" href="../../std/collections/vec_deque/struct.VecDeque.html" title="struct std::collections::vec_deque::VecDeque">VecDeque</a>&lt;T&gt;</code></li>
<li><code>impl&lt;'a&gt; From&lt;<a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a>&gt; for <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="primitive" href="../primitive.str.html">str</a>&gt;</code></li>
<li><code>impl&lt;T&gt; From&lt;<a class="struct" href="../../std/collections/binary_heap/struct.BinaryHeap.html" title="struct std::collections::binary_heap::BinaryHeap">BinaryHeap</a>&lt;T&gt;&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt;</code></li>
<li><code>impl&lt;'a&gt; From&lt;&amp;'a <a class="primitive" href="../primitive.str.html">str</a>&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt;</code></li>
<li><code>impl&lt;T&gt; From&lt;<a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="primitive" href="../primitive.slice.html">[</a>T<a class="primitive" href="../primitive.slice.html">]</a>&gt;&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt;</code></li>
<li><code>impl&lt;'a&gt; From&lt;&amp;'a <a class="primitive" href="../primitive.str.html">str</a>&gt; for <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="primitive" href="../primitive.str.html">str</a>&gt;</code></li>
<li><code>impl&lt;T&gt; From&lt;<a class="struct" href="../../std/collections/vec_deque/struct.VecDeque.html" title="struct std::collections::vec_deque::VecDeque">VecDeque</a>&lt;T&gt;&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;T&gt;</code></li>
<li><code>impl&lt;'a&gt; From&lt;<a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="primitive" href="../primitive.str.html">str</a>&gt;&gt; for <a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i8.html">i8</a>&gt; for <a class="primitive" href="../primitive.i64.html">i64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u32.html">u32</a>&gt; for <a class="primitive" href="../primitive.f64.html">f64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i64.html">i64</a>&gt; for <a class="primitive" href="../primitive.i128.html">i128</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i16.html">i16</a>&gt; for <a class="primitive" href="../primitive.i32.html">i32</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u16.html">u16</a>&gt; for <a class="primitive" href="../primitive.i64.html">i64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt; for <a class="primitive" href="../primitive.i16.html">i16</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt; for <a class="primitive" href="../primitive.f64.html">f64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i8.html">i8</a>&gt; for <a class="primitive" href="../primitive.isize.html">isize</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i8.html">i8</a>&gt; for <a class="primitive" href="../primitive.i32.html">i32</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i16.html">i16</a>&gt; for <a class="primitive" href="../primitive.f64.html">f64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u16.html">u16</a>&gt; for <a class="primitive" href="../primitive.i128.html">i128</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i8.html">i8</a>&gt; for <a class="primitive" href="../primitive.f32.html">f32</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.f32.html">f32</a>&gt; for <a class="primitive" href="../primitive.f64.html">f64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt; for <a class="primitive" href="../primitive.i128.html">i128</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u16.html">u16</a>&gt; for <a class="primitive" href="../primitive.u128.html">u128</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt; for <a class="primitive" href="../primitive.u32.html">u32</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.char.html">char</a>&gt; for <a class="primitive" href="../primitive.u32.html">u32</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i8.html">i8</a>&gt; for <a class="primitive" href="../primitive.i16.html">i16</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt; for <a class="primitive" href="../primitive.usize.html">usize</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i16.html">i16</a>&gt; for <a class="primitive" href="../primitive.i128.html">i128</a></code></li>
<li><code>impl&lt;T&gt; From&lt;T&gt; for <a class="enum" href="../../std/option/enum.Option.html" title="enum std::option::Option">Option</a>&lt;T&gt;</code></li>
<li><code>impl&lt;T&gt; From&lt;T&gt; for <a class="struct" href="../../std/cell/struct.UnsafeCell.html" title="struct std::cell::UnsafeCell">UnsafeCell</a>&lt;T&gt;</code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u32.html">u32</a>&gt; for <a class="primitive" href="../primitive.i128.html">i128</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u16.html">u16</a>&gt; for <a class="primitive" href="../primitive.f32.html">f32</a></code></li>
<li><code>impl&lt;T&gt; From&lt;T&gt; for <a class="struct" href="../../std/cell/struct.Cell.html" title="struct std::cell::Cell">Cell</a>&lt;T&gt;</code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt; for <a class="primitive" href="../primitive.u16.html">u16</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i8.html">i8</a>&gt; for <a class="primitive" href="../primitive.i128.html">i128</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u64.html">u64</a>&gt; for <a class="primitive" href="../primitive.i128.html">i128</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i32.html">i32</a>&gt; for <a class="primitive" href="../primitive.f64.html">f64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u16.html">u16</a>&gt; for <a class="primitive" href="../primitive.i32.html">i32</a></code></li>
<li><code>impl&lt;T&gt; From&lt;T&gt; for <a class="struct" href="../../std/cell/struct.RefCell.html" title="struct std::cell::RefCell">RefCell</a>&lt;T&gt;</code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u16.html">u16</a>&gt; for <a class="primitive" href="../primitive.u32.html">u32</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt; for <a class="primitive" href="../primitive.char.html">char</a></code></li>
<li><code>impl&lt;T&gt; From&lt;T&gt; for T</code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt; for <a class="primitive" href="../primitive.f32.html">f32</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u32.html">u32</a>&gt; for <a class="primitive" href="../primitive.u64.html">u64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i8.html">i8</a>&gt; for <a class="primitive" href="../primitive.f64.html">f64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u16.html">u16</a>&gt; for <a class="primitive" href="../primitive.u64.html">u64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u32.html">u32</a>&gt; for <a class="primitive" href="../primitive.i64.html">i64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u16.html">u16</a>&gt; for <a class="primitive" href="../primitive.f64.html">f64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt; for <a class="primitive" href="../primitive.i32.html">i32</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt; for <a class="primitive" href="../primitive.u64.html">u64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i16.html">i16</a>&gt; for <a class="primitive" href="../primitive.f32.html">f32</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u64.html">u64</a>&gt; for <a class="primitive" href="../primitive.u128.html">u128</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt; for <a class="primitive" href="../primitive.u128.html">u128</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u32.html">u32</a>&gt; for <a class="primitive" href="../primitive.u128.html">u128</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt; for <a class="primitive" href="../primitive.i64.html">i64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i16.html">i16</a>&gt; for <a class="primitive" href="../primitive.i64.html">i64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i32.html">i32</a>&gt; for <a class="primitive" href="../primitive.i64.html">i64</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.i32.html">i32</a>&gt; for <a class="primitive" href="../primitive.i128.html">i128</a></code></li>
<li><code>impl&lt;'a, E:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'a&gt; From&lt;E&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'a&gt;</code></li>
<li><code>impl&lt;'a, E:&nbsp;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + <a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> + <a class="trait" href="../../std/marker/trait.Sync.html" title="trait std::marker::Sync">Sync</a> + 'a&gt; From&lt;E&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + <a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> + <a class="trait" href="../../std/marker/trait.Sync.html" title="trait std::marker::Sync">Sync</a> + 'a&gt;</code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a>&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + <a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> + <a class="trait" href="../../std/marker/trait.Sync.html" title="trait std::marker::Sync">Sync</a>&gt;</code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a>&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a>&gt;</code></li>
<li><code>impl&lt;'a, 'b&gt; From&lt;&amp;'b <a class="primitive" href="../primitive.str.html">str</a>&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a> + <a class="trait" href="../../std/marker/trait.Send.html" title="trait std::marker::Send">Send</a> + <a class="trait" href="../../std/marker/trait.Sync.html" title="trait std::marker::Sync">Sync</a> + 'a&gt;</code></li>
<li><code>impl&lt;'a&gt; From&lt;&amp;'a <a class="primitive" href="../primitive.str.html">str</a>&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="trait" href="../../std/error/trait.Error.html" title="trait std::error::Error">Error</a>&gt;</code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/ffi/struct.CString.html" title="struct std::ffi::CString">CString</a>&gt; for <a class="struct" href="../../std/vec/struct.Vec.html" title="struct std::vec::Vec">Vec</a>&lt;<a class="primitive" href="../primitive.u8.html">u8</a>&gt;</code></li>
<li><code>impl&lt;'a&gt; From&lt;&amp;'a <a class="struct" href="../../std/ffi/struct.CStr.html" title="struct std::ffi::CStr">CStr</a>&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="struct" href="../../std/ffi/struct.CStr.html" title="struct std::ffi::CStr">CStr</a>&gt;</code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="struct" href="../../std/ffi/struct.CStr.html" title="struct std::ffi::CStr">CStr</a>&gt;&gt; for <a class="struct" href="../../std/ffi/struct.CString.html" title="struct std::ffi::CString">CString</a></code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/ffi/struct.NulError.html" title="struct std::ffi::NulError">NulError</a>&gt; for <a class="struct" href="../../std/io/struct.Error.html" title="struct std::io::Error">Error</a></code></li>
<li><code>impl&lt;'a&gt; From&lt;&amp;'a <a class="struct" href="../../std/ffi/struct.CStr.html" title="struct std::ffi::CStr">CStr</a>&gt; for <a class="struct" href="../../std/ffi/struct.CString.html" title="struct std::ffi::CString">CString</a></code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a>&gt; for <a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a></code></li>
<li><code>impl&lt;'a, T:&nbsp;?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a> + <a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;&gt; From&lt;&amp;'a T&gt; for <a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a></code></li>
<li><code>impl&lt;'a&gt; From&lt;&amp;'a <a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;</code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;&gt; for <a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a></code></li>
<li><code>impl&lt;W&gt; From&lt;<a class="struct" href="../../std/io/struct.IntoInnerError.html" title="struct std::io::IntoInnerError">IntoInnerError</a>&lt;W&gt;&gt; for <a class="struct" href="../../std/io/struct.Error.html" title="struct std::io::Error">Error</a></code></li>
<li><code>impl From&lt;<a class="enum" href="../../std/io/enum.ErrorKind.html" title="enum std::io::ErrorKind">ErrorKind</a>&gt; for <a class="struct" href="../../std/io/struct.Error.html" title="struct std::io::Error">Error</a></code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/net/struct.Ipv4Addr.html" title="struct std::net::Ipv4Addr">Ipv4Addr</a>&gt; for <a class="enum" href="../../std/net/enum.IpAddr.html" title="enum std::net::IpAddr">IpAddr</a></code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/net/struct.Ipv6Addr.html" title="struct std::net::Ipv6Addr">Ipv6Addr</a>&gt; for <a class="enum" href="../../std/net/enum.IpAddr.html" title="enum std::net::IpAddr">IpAddr</a></code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/net/struct.Ipv4Addr.html" title="struct std::net::Ipv4Addr">Ipv4Addr</a>&gt; for <a class="primitive" href="../primitive.u32.html">u32</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u32.html">u32</a>&gt; for <a class="struct" href="../../std/net/struct.Ipv4Addr.html" title="struct std::net::Ipv4Addr">Ipv4Addr</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.array.html">[</a><a class="primitive" href="../primitive.u8.html">u8</a><a class="primitive" href="../primitive.array.html">; 4]</a>&gt; for <a class="struct" href="../../std/net/struct.Ipv4Addr.html" title="struct std::net::Ipv4Addr">Ipv4Addr</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.array.html">[</a><a class="primitive" href="../primitive.u8.html">u8</a><a class="primitive" href="../primitive.array.html">; 4]</a>&gt; for <a class="enum" href="../../std/net/enum.IpAddr.html" title="enum std::net::IpAddr">IpAddr</a></code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/net/struct.Ipv6Addr.html" title="struct std::net::Ipv6Addr">Ipv6Addr</a>&gt; for <a class="primitive" href="../primitive.u128.html">u128</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.u128.html">u128</a>&gt; for <a class="struct" href="../../std/net/struct.Ipv6Addr.html" title="struct std::net::Ipv6Addr">Ipv6Addr</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.array.html">[</a><a class="primitive" href="../primitive.u8.html">u8</a><a class="primitive" href="../primitive.array.html">; 16]</a>&gt; for <a class="struct" href="../../std/net/struct.Ipv6Addr.html" title="struct std::net::Ipv6Addr">Ipv6Addr</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.array.html">[</a><a class="primitive" href="../primitive.u16.html">u16</a><a class="primitive" href="../primitive.array.html">; 8]</a>&gt; for <a class="struct" href="../../std/net/struct.Ipv6Addr.html" title="struct std::net::Ipv6Addr">Ipv6Addr</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.array.html">[</a><a class="primitive" href="../primitive.u8.html">u8</a><a class="primitive" href="../primitive.array.html">; 16]</a>&gt; for <a class="enum" href="../../std/net/enum.IpAddr.html" title="enum std::net::IpAddr">IpAddr</a></code></li>
<li><code>impl From&lt;<a class="primitive" href="../primitive.array.html">[</a><a class="primitive" href="../primitive.u16.html">u16</a><a class="primitive" href="../primitive.array.html">; 8]</a>&gt; for <a class="enum" href="../../std/net/enum.IpAddr.html" title="enum std::net::IpAddr">IpAddr</a></code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/net/struct.SocketAddrV4.html" title="struct std::net::SocketAddrV4">SocketAddrV4</a>&gt; for <a class="enum" href="../../std/net/enum.SocketAddr.html" title="enum std::net::SocketAddr">SocketAddr</a></code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/net/struct.SocketAddrV6.html" title="struct std::net::SocketAddrV6">SocketAddrV6</a>&gt; for <a class="enum" href="../../std/net/enum.SocketAddr.html" title="enum std::net::SocketAddr">SocketAddr</a></code></li>
<li><code>impl&lt;I:&nbsp;<a class="trait" href="../../std/convert/trait.Into.html" title="trait std::convert::Into">Into</a>&lt;<a class="enum" href="../../std/net/enum.IpAddr.html" title="enum std::net::IpAddr">IpAddr</a>&gt;&gt; From&lt;<a class="primitive" href="../primitive.tuple.html">(</a>I, <a class="primitive" href="../primitive.u16.html">u16</a><a class="primitive" href="../primitive.tuple.html">)</a>&gt; for <a class="enum" href="../../std/net/enum.SocketAddr.html" title="enum std::net::SocketAddr">SocketAddr</a></code></li>
<li><code>impl&lt;'a&gt; From&lt;&amp;'a <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt; for <a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/boxed/struct.Box.html" title="struct std::boxed::Box">Box</a>&lt;<a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code></li>
<li><code>impl&lt;'a, T:&nbsp;?<a class="trait" href="../../std/marker/trait.Sized.html" title="trait std::marker::Sized">Sized</a> + <a class="trait" href="../../std/convert/trait.AsRef.html" title="trait std::convert::AsRef">AsRef</a>&lt;<a class="struct" href="../../std/ffi/struct.OsStr.html" title="struct std::ffi::OsStr">OsStr</a>&gt;&gt; From&lt;&amp;'a T&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="struct" href="../../std/ffi/struct.OsString.html" title="struct std::ffi::OsString">OsString</a></code></li>
<li><code>impl From&lt;<a class="struct" href="../../std/string/struct.String.html" title="struct std::string::String">String</a>&gt; for <a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a></code></li>
<li><code>impl&lt;'a&gt; From&lt;&amp;'a <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt; for <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code></li>
<li><code>impl&lt;'a&gt; From&lt;<a class="struct" href="../../std/path/struct.PathBuf.html" title="struct std::path::PathBuf">PathBuf</a>&gt; for <a class="enum" href="../../std/borrow/enum.Cow.html" title="enum std::borrow::Cow">Cow</a>&lt;'a, <a class="struct" href="../../std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</code></li>
<li><code>impl&lt;T&gt; From&lt;<a class="struct" href="../../std/sync/struct.PoisonError.html" title="struct std::sync::PoisonError">PoisonError</a>&lt;T&gt;&gt; for <a class="enum" href="../../std/sync/enum.TryLockError.html" title="enum std::sync::TryLockError">TryLockError</a>&lt;T&gt;</code></li>
</ul><script type="text/javascript" async
                         src="../../implementors/core/convert/trait.From.js">
                 </script></section>
    <section id='search' class="content hidden"></section>

    <section class="footer"></section>

    <aside id="help" class="hidden">
        <div>
            <h1 class="hidden">Help</h1>

            <div class="shortcuts">
                <h2>Keyboard Shortcuts</h2>

                <dl>
                    <dt>?</dt>
                    <dd>Show this help dialog</dd>
                    <dt>S</dt>
                    <dd>Focus the search field</dd>
                    <dt>&larrb;</dt>
                    <dd>Move up in search results</dd>
                    <dt>&rarrb;</dt>
                    <dd>Move down in search results</dd>
                    <dt>&#9166;</dt>
                    <dd>Go to active search result</dd>
                    <dt>+</dt>
                    <dd>Collapse/expand all sections</dd>
                </dl>
            </div>

            <div class="infos">
                <h2>Search Tricks</h2>

                <p>
                    Prefix searches with a type followed by a colon (e.g.
                    <code>fn:</code>) to restrict the search to a given type.
                </p>

                <p>
                    Accepted types are: <code>fn</code>, <code>mod</code>,
                    <code>struct</code>, <code>enum</code>,
                    <code>trait</code>, <code>type</code>, <code>macro</code>,
                    and <code>const</code>.
                </p>

                <p>
                    Search functions by type signature (e.g.
                    <code>vec -> usize</code> or <code>* -> vec</code>)
                </p>
            </div>
        </div>
    </aside>

    

    <script>
        window.rootPath = "../../";
        window.currentCrate = "std";
    </script>
    <script src="../../main.js"></script>
    <script defer src="../../search-index.js"></script>
</body>
</html>