blob: d5ca17e4e2a1f9670d9703e163aaa2e406b09744 [file] [log] [blame]
<!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="A generic trait for converting a number to a value."><meta name="keywords" content="rust, rustlang, rust-lang, FromPrimitive"><title>FromPrimitive in num_traits::cast - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../num_traits/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../num_traits/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">FromPrimitive</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.from_i64">from_i64</a></li><li><a href="#tymethod.from_u64">from_u64</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.from_f32">from_f32</a></li><li><a href="#method.from_f64">from_f64</a></li><li><a href="#method.from_i16">from_i16</a></li><li><a href="#method.from_i32">from_i32</a></li><li><a href="#method.from_i8">from_i8</a></li><li><a href="#method.from_isize">from_isize</a></li><li><a href="#method.from_u16">from_u16</a></li><li><a href="#method.from_u32">from_u32</a></li><li><a href="#method.from_u8">from_u8</a></li><li><a href="#method.from_usize">from_usize</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-FromPrimitive-for-Wrapping%3CT%3E">Wrapping&lt;T&gt;</a></li><li><a href="#impl-FromPrimitive-for-f32">f32</a></li><li><a href="#impl-FromPrimitive-for-f64">f64</a></li><li><a href="#impl-FromPrimitive-for-i16">i16</a></li><li><a href="#impl-FromPrimitive-for-i32">i32</a></li><li><a href="#impl-FromPrimitive-for-i64">i64</a></li><li><a href="#impl-FromPrimitive-for-i8">i8</a></li><li><a href="#impl-FromPrimitive-for-isize">isize</a></li><li><a href="#impl-FromPrimitive-for-u16">u16</a></li><li><a href="#impl-FromPrimitive-for-u32">u32</a></li><li><a href="#impl-FromPrimitive-for-u64">u64</a></li><li><a href="#impl-FromPrimitive-for-u8">u8</a></li><li><a href="#impl-FromPrimitive-for-usize">usize</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In num_traits::cast</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Trait <a href="../index.html">num_traits</a>::<wbr><a href="index.html">cast</a>::<wbr><a class="trait" href="#">FromPrimitive</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/num_traits/cast.rs.html#411-522">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust trait"><code>pub trait FromPrimitive: Sized {
fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;Self&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;Self&gt;;
fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;Self&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;Self&gt; { ... }
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A generic trait for converting a number to a value.</p>
<p>A value can be represented by the target type when it lies within
the range of scalars supported by the target type.
For example, a negative integer cannot be represented by an unsigned
integer type, and an <code>i64</code> with a very high magnitude might not be
convertible to an <code>i32</code>.
On the other hand, conversions with possible precision loss or truncation
are admitted, like an <code>f32</code> with a decimal part to an integer type, or
even a large <code>f64</code> saturating to <code>f32</code> infinity.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required Methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.from_i64" class="method has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#442">source</a><h4 class="code-header">fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Converts an <code>i64</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.from_u64" class="method has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#487">source</a><h4 class="code-header">fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Converts an <code>u64</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned.</p>
</div></details></div><h2 id="provided-methods" class="small-section-header">Provided Methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_isize" class="method has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#415-417">source</a><h4 class="code-header">fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Converts an <code>isize</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_i8" class="method has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#422-424">source</a><h4 class="code-header">fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Converts an <code>i8</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_i16" class="method has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#429-431">source</a><h4 class="code-header">fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Converts an <code>i16</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_i32" class="method has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#436-438">source</a><h4 class="code-header">fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Converts an <code>i32</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_usize" class="method has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#460-462">source</a><h4 class="code-header">fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Converts a <code>usize</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_u8" class="method has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#467-469">source</a><h4 class="code-header">fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Converts an <code>u8</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_u16" class="method has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#474-476">source</a><h4 class="code-header">fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Converts an <code>u16</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_u32" class="method has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#481-483">source</a><h4 class="code-header">fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Converts an <code>u32</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_f32" class="method has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#505-507">source</a><h4 class="code-header">fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Converts a <code>f32</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_f64" class="method has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#516-521">source</a><h4 class="code-header">fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;Self&gt;</h4></section></summary><div class="docblock"><p>Converts a <code>f64</code> to return an optional value of this type. If the
value cannot be represented by this type, then <code>None</code> is returned.</p>
<p>The default implementation tries to convert through <code>from_i64()</code>, and
failing that through <code>from_u64()</code>. Types implementing this trait should
override this method if they can represent a greater range.</p>
</div></details></div><h2 id="foreign-impls" class="small-section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-FromPrimitive-for-isize" class="impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#592">source</a><a href="#impl-FromPrimitive-for-isize" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a> for isize</h3></section></summary><div class="impl-items"><section id="method.from_isize-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#592">source</a><a href="#method.from_isize-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;isize&gt;</h4></section><section id="method.from_i8-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#592">source</a><a href="#method.from_i8-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;isize&gt;</h4></section><section id="method.from_i16-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#592">source</a><a href="#method.from_i16-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;isize&gt;</h4></section><section id="method.from_i32-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#592">source</a><a href="#method.from_i32-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;isize&gt;</h4></section><section id="method.from_i64" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#592">source</a><a href="#method.from_i64" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;isize&gt;</h4></section><section id="method.from_usize-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#592">source</a><a href="#method.from_usize-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;isize&gt;</h4></section><section id="method.from_u8-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#592">source</a><a href="#method.from_u8-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;isize&gt;</h4></section><section id="method.from_u16-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#592">source</a><a href="#method.from_u16-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;isize&gt;</h4></section><section id="method.from_u32-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#592">source</a><a href="#method.from_u32-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;isize&gt;</h4></section><section id="method.from_u64" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#592">source</a><a href="#method.from_u64" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;isize&gt;</h4></section><section id="method.from_f32-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#592">source</a><a href="#method.from_f32-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;isize&gt;</h4></section><section id="method.from_f64-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#592">source</a><a href="#method.from_f64-1" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;isize&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-FromPrimitive-for-i8" class="impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#593">source</a><a href="#impl-FromPrimitive-for-i8" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a> for i8</h3></section></summary><div class="impl-items"><section id="method.from_isize-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#593">source</a><a href="#method.from_isize-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;i8&gt;</h4></section><section id="method.from_i8-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#593">source</a><a href="#method.from_i8-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;i8&gt;</h4></section><section id="method.from_i16-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#593">source</a><a href="#method.from_i16-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;i8&gt;</h4></section><section id="method.from_i32-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#593">source</a><a href="#method.from_i32-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;i8&gt;</h4></section><section id="method.from_i64-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#593">source</a><a href="#method.from_i64-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;i8&gt;</h4></section><section id="method.from_usize-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#593">source</a><a href="#method.from_usize-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;i8&gt;</h4></section><section id="method.from_u8-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#593">source</a><a href="#method.from_u8-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;i8&gt;</h4></section><section id="method.from_u16-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#593">source</a><a href="#method.from_u16-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;i8&gt;</h4></section><section id="method.from_u32-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#593">source</a><a href="#method.from_u32-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;i8&gt;</h4></section><section id="method.from_u64-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#593">source</a><a href="#method.from_u64-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;i8&gt;</h4></section><section id="method.from_f32-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#593">source</a><a href="#method.from_f32-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;i8&gt;</h4></section><section id="method.from_f64-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#593">source</a><a href="#method.from_f64-2" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;i8&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-FromPrimitive-for-i16" class="impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#594">source</a><a href="#impl-FromPrimitive-for-i16" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a> for i16</h3></section></summary><div class="impl-items"><section id="method.from_isize-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#594">source</a><a href="#method.from_isize-3" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;i16&gt;</h4></section><section id="method.from_i8-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#594">source</a><a href="#method.from_i8-3" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;i16&gt;</h4></section><section id="method.from_i16-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#594">source</a><a href="#method.from_i16-3" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;i16&gt;</h4></section><section id="method.from_i32-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#594">source</a><a href="#method.from_i32-3" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;i16&gt;</h4></section><section id="method.from_i64-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#594">source</a><a href="#method.from_i64-2" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;i16&gt;</h4></section><section id="method.from_usize-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#594">source</a><a href="#method.from_usize-3" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;i16&gt;</h4></section><section id="method.from_u8-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#594">source</a><a href="#method.from_u8-3" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;i16&gt;</h4></section><section id="method.from_u16-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#594">source</a><a href="#method.from_u16-3" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;i16&gt;</h4></section><section id="method.from_u32-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#594">source</a><a href="#method.from_u32-3" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;i16&gt;</h4></section><section id="method.from_u64-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#594">source</a><a href="#method.from_u64-2" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;i16&gt;</h4></section><section id="method.from_f32-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#594">source</a><a href="#method.from_f32-3" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;i16&gt;</h4></section><section id="method.from_f64-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#594">source</a><a href="#method.from_f64-3" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;i16&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-FromPrimitive-for-i32" class="impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#595">source</a><a href="#impl-FromPrimitive-for-i32" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a> for i32</h3></section></summary><div class="impl-items"><section id="method.from_isize-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#595">source</a><a href="#method.from_isize-4" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;i32&gt;</h4></section><section id="method.from_i8-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#595">source</a><a href="#method.from_i8-4" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;i32&gt;</h4></section><section id="method.from_i16-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#595">source</a><a href="#method.from_i16-4" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;i32&gt;</h4></section><section id="method.from_i32-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#595">source</a><a href="#method.from_i32-4" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;i32&gt;</h4></section><section id="method.from_i64-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#595">source</a><a href="#method.from_i64-3" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;i32&gt;</h4></section><section id="method.from_usize-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#595">source</a><a href="#method.from_usize-4" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;i32&gt;</h4></section><section id="method.from_u8-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#595">source</a><a href="#method.from_u8-4" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;i32&gt;</h4></section><section id="method.from_u16-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#595">source</a><a href="#method.from_u16-4" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;i32&gt;</h4></section><section id="method.from_u32-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#595">source</a><a href="#method.from_u32-4" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;i32&gt;</h4></section><section id="method.from_u64-3" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#595">source</a><a href="#method.from_u64-3" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;i32&gt;</h4></section><section id="method.from_f32-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#595">source</a><a href="#method.from_f32-4" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;i32&gt;</h4></section><section id="method.from_f64-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#595">source</a><a href="#method.from_f64-4" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;i32&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-FromPrimitive-for-i64" class="impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#596">source</a><a href="#impl-FromPrimitive-for-i64" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a> for i64</h3></section></summary><div class="impl-items"><section id="method.from_isize-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#596">source</a><a href="#method.from_isize-5" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;i64&gt;</h4></section><section id="method.from_i8-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#596">source</a><a href="#method.from_i8-5" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;i64&gt;</h4></section><section id="method.from_i16-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#596">source</a><a href="#method.from_i16-5" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;i64&gt;</h4></section><section id="method.from_i32-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#596">source</a><a href="#method.from_i32-5" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;i64&gt;</h4></section><section id="method.from_i64-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#596">source</a><a href="#method.from_i64-4" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;i64&gt;</h4></section><section id="method.from_usize-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#596">source</a><a href="#method.from_usize-5" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;i64&gt;</h4></section><section id="method.from_u8-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#596">source</a><a href="#method.from_u8-5" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;i64&gt;</h4></section><section id="method.from_u16-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#596">source</a><a href="#method.from_u16-5" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;i64&gt;</h4></section><section id="method.from_u32-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#596">source</a><a href="#method.from_u32-5" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;i64&gt;</h4></section><section id="method.from_u64-4" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#596">source</a><a href="#method.from_u64-4" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;i64&gt;</h4></section><section id="method.from_f32-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#596">source</a><a href="#method.from_f32-5" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;i64&gt;</h4></section><section id="method.from_f64-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#596">source</a><a href="#method.from_f64-5" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;i64&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-FromPrimitive-for-usize" class="impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#599">source</a><a href="#impl-FromPrimitive-for-usize" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a> for usize</h3></section></summary><div class="impl-items"><section id="method.from_isize-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#599">source</a><a href="#method.from_isize-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;usize&gt;</h4></section><section id="method.from_i8-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#599">source</a><a href="#method.from_i8-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;usize&gt;</h4></section><section id="method.from_i16-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#599">source</a><a href="#method.from_i16-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;usize&gt;</h4></section><section id="method.from_i32-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#599">source</a><a href="#method.from_i32-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;usize&gt;</h4></section><section id="method.from_i64-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#599">source</a><a href="#method.from_i64-5" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;usize&gt;</h4></section><section id="method.from_usize-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#599">source</a><a href="#method.from_usize-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;usize&gt;</h4></section><section id="method.from_u8-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#599">source</a><a href="#method.from_u8-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;usize&gt;</h4></section><section id="method.from_u16-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#599">source</a><a href="#method.from_u16-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;usize&gt;</h4></section><section id="method.from_u32-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#599">source</a><a href="#method.from_u32-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;usize&gt;</h4></section><section id="method.from_u64-5" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#599">source</a><a href="#method.from_u64-5" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;usize&gt;</h4></section><section id="method.from_f32-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#599">source</a><a href="#method.from_f32-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;usize&gt;</h4></section><section id="method.from_f64-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#599">source</a><a href="#method.from_f64-6" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;usize&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-FromPrimitive-for-u8" class="impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#600">source</a><a href="#impl-FromPrimitive-for-u8" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a> for u8</h3></section></summary><div class="impl-items"><section id="method.from_isize-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#600">source</a><a href="#method.from_isize-7" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;u8&gt;</h4></section><section id="method.from_i8-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#600">source</a><a href="#method.from_i8-7" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;u8&gt;</h4></section><section id="method.from_i16-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#600">source</a><a href="#method.from_i16-7" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;u8&gt;</h4></section><section id="method.from_i32-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#600">source</a><a href="#method.from_i32-7" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;u8&gt;</h4></section><section id="method.from_i64-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#600">source</a><a href="#method.from_i64-6" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;u8&gt;</h4></section><section id="method.from_usize-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#600">source</a><a href="#method.from_usize-7" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;u8&gt;</h4></section><section id="method.from_u8-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#600">source</a><a href="#method.from_u8-7" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;u8&gt;</h4></section><section id="method.from_u16-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#600">source</a><a href="#method.from_u16-7" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;u8&gt;</h4></section><section id="method.from_u32-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#600">source</a><a href="#method.from_u32-7" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;u8&gt;</h4></section><section id="method.from_u64-6" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#600">source</a><a href="#method.from_u64-6" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;u8&gt;</h4></section><section id="method.from_f32-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#600">source</a><a href="#method.from_f32-7" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;u8&gt;</h4></section><section id="method.from_f64-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#600">source</a><a href="#method.from_f64-7" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;u8&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-FromPrimitive-for-u16" class="impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#601">source</a><a href="#impl-FromPrimitive-for-u16" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a> for u16</h3></section></summary><div class="impl-items"><section id="method.from_isize-8" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#601">source</a><a href="#method.from_isize-8" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;u16&gt;</h4></section><section id="method.from_i8-8" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#601">source</a><a href="#method.from_i8-8" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;u16&gt;</h4></section><section id="method.from_i16-8" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#601">source</a><a href="#method.from_i16-8" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;u16&gt;</h4></section><section id="method.from_i32-8" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#601">source</a><a href="#method.from_i32-8" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;u16&gt;</h4></section><section id="method.from_i64-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#601">source</a><a href="#method.from_i64-7" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;u16&gt;</h4></section><section id="method.from_usize-8" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#601">source</a><a href="#method.from_usize-8" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;u16&gt;</h4></section><section id="method.from_u8-8" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#601">source</a><a href="#method.from_u8-8" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;u16&gt;</h4></section><section id="method.from_u16-8" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#601">source</a><a href="#method.from_u16-8" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;u16&gt;</h4></section><section id="method.from_u32-8" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#601">source</a><a href="#method.from_u32-8" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;u16&gt;</h4></section><section id="method.from_u64-7" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#601">source</a><a href="#method.from_u64-7" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;u16&gt;</h4></section><section id="method.from_f32-8" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#601">source</a><a href="#method.from_f32-8" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;u16&gt;</h4></section><section id="method.from_f64-8" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#601">source</a><a href="#method.from_f64-8" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;u16&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-FromPrimitive-for-u32" class="impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#602">source</a><a href="#impl-FromPrimitive-for-u32" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a> for u32</h3></section></summary><div class="impl-items"><section id="method.from_isize-9" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#602">source</a><a href="#method.from_isize-9" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;u32&gt;</h4></section><section id="method.from_i8-9" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#602">source</a><a href="#method.from_i8-9" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;u32&gt;</h4></section><section id="method.from_i16-9" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#602">source</a><a href="#method.from_i16-9" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;u32&gt;</h4></section><section id="method.from_i32-9" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#602">source</a><a href="#method.from_i32-9" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;u32&gt;</h4></section><section id="method.from_i64-8" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#602">source</a><a href="#method.from_i64-8" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;u32&gt;</h4></section><section id="method.from_usize-9" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#602">source</a><a href="#method.from_usize-9" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;u32&gt;</h4></section><section id="method.from_u8-9" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#602">source</a><a href="#method.from_u8-9" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;u32&gt;</h4></section><section id="method.from_u16-9" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#602">source</a><a href="#method.from_u16-9" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;u32&gt;</h4></section><section id="method.from_u32-9" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#602">source</a><a href="#method.from_u32-9" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;u32&gt;</h4></section><section id="method.from_u64-8" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#602">source</a><a href="#method.from_u64-8" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;u32&gt;</h4></section><section id="method.from_f32-9" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#602">source</a><a href="#method.from_f32-9" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;u32&gt;</h4></section><section id="method.from_f64-9" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#602">source</a><a href="#method.from_f64-9" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;u32&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-FromPrimitive-for-u64" class="impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#603">source</a><a href="#impl-FromPrimitive-for-u64" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a> for u64</h3></section></summary><div class="impl-items"><section id="method.from_isize-10" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#603">source</a><a href="#method.from_isize-10" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;u64&gt;</h4></section><section id="method.from_i8-10" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#603">source</a><a href="#method.from_i8-10" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;u64&gt;</h4></section><section id="method.from_i16-10" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#603">source</a><a href="#method.from_i16-10" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;u64&gt;</h4></section><section id="method.from_i32-10" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#603">source</a><a href="#method.from_i32-10" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;u64&gt;</h4></section><section id="method.from_i64-9" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#603">source</a><a href="#method.from_i64-9" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;u64&gt;</h4></section><section id="method.from_usize-10" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#603">source</a><a href="#method.from_usize-10" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;u64&gt;</h4></section><section id="method.from_u8-10" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#603">source</a><a href="#method.from_u8-10" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;u64&gt;</h4></section><section id="method.from_u16-10" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#603">source</a><a href="#method.from_u16-10" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;u64&gt;</h4></section><section id="method.from_u32-10" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#603">source</a><a href="#method.from_u32-10" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;u64&gt;</h4></section><section id="method.from_u64-9" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#603">source</a><a href="#method.from_u64-9" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;u64&gt;</h4></section><section id="method.from_f32-10" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#603">source</a><a href="#method.from_f32-10" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;u64&gt;</h4></section><section id="method.from_f64-10" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#603">source</a><a href="#method.from_f64-10" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;u64&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-FromPrimitive-for-f32" class="impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#606">source</a><a href="#impl-FromPrimitive-for-f32" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a> for f32</h3></section></summary><div class="impl-items"><section id="method.from_isize-11" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#606">source</a><a href="#method.from_isize-11" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;f32&gt;</h4></section><section id="method.from_i8-11" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#606">source</a><a href="#method.from_i8-11" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;f32&gt;</h4></section><section id="method.from_i16-11" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#606">source</a><a href="#method.from_i16-11" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;f32&gt;</h4></section><section id="method.from_i32-11" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#606">source</a><a href="#method.from_i32-11" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;f32&gt;</h4></section><section id="method.from_i64-10" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#606">source</a><a href="#method.from_i64-10" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;f32&gt;</h4></section><section id="method.from_usize-11" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#606">source</a><a href="#method.from_usize-11" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;f32&gt;</h4></section><section id="method.from_u8-11" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#606">source</a><a href="#method.from_u8-11" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;f32&gt;</h4></section><section id="method.from_u16-11" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#606">source</a><a href="#method.from_u16-11" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;f32&gt;</h4></section><section id="method.from_u32-11" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#606">source</a><a href="#method.from_u32-11" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;f32&gt;</h4></section><section id="method.from_u64-10" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#606">source</a><a href="#method.from_u64-10" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;f32&gt;</h4></section><section id="method.from_f32-11" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#606">source</a><a href="#method.from_f32-11" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;f32&gt;</h4></section><section id="method.from_f64-11" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#606">source</a><a href="#method.from_f64-11" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;f32&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-FromPrimitive-for-f64" class="impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#607">source</a><a href="#impl-FromPrimitive-for-f64" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a> for f64</h3></section></summary><div class="impl-items"><section id="method.from_isize-12" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#607">source</a><a href="#method.from_isize-12" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;f64&gt;</h4></section><section id="method.from_i8-12" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#607">source</a><a href="#method.from_i8-12" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;f64&gt;</h4></section><section id="method.from_i16-12" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#607">source</a><a href="#method.from_i16-12" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;f64&gt;</h4></section><section id="method.from_i32-12" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#607">source</a><a href="#method.from_i32-12" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;f64&gt;</h4></section><section id="method.from_i64-11" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#607">source</a><a href="#method.from_i64-11" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;f64&gt;</h4></section><section id="method.from_usize-12" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#607">source</a><a href="#method.from_usize-12" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;f64&gt;</h4></section><section id="method.from_u8-12" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#607">source</a><a href="#method.from_u8-12" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;f64&gt;</h4></section><section id="method.from_u16-12" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#607">source</a><a href="#method.from_u16-12" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;f64&gt;</h4></section><section id="method.from_u32-12" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#607">source</a><a href="#method.from_u32-12" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;f64&gt;</h4></section><section id="method.from_u64-11" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#607">source</a><a href="#method.from_u64-11" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;f64&gt;</h4></section><section id="method.from_f32-12" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#607">source</a><a href="#method.from_f32-12" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;f64&gt;</h4></section><section id="method.from_f64-12" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#607">source</a><a href="#method.from_f64-12" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;f64&gt;</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-FromPrimitive-for-Wrapping%3CT%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#652-673">source</a><a href="#impl-FromPrimitive-for-Wrapping%3CT%3E" class="anchor"></a><h3 class="code-header">impl&lt;T:&nbsp;<a class="trait" href="trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a>&gt; <a class="trait" href="trait.FromPrimitive.html" title="trait num_traits::cast::FromPrimitive">FromPrimitive</a> for Wrapping&lt;T&gt;</h3></section></summary><div class="impl-items"><section id="method.from_isize-13" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#653-672">source</a><a href="#method.from_isize-13" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_isize" class="fnname">from_isize</a>(n: isize) -&gt; Option&lt;Self&gt;</h4></section><section id="method.from_i8-13" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#653-672">source</a><a href="#method.from_i8-13" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i8" class="fnname">from_i8</a>(n: i8) -&gt; Option&lt;Self&gt;</h4></section><section id="method.from_i16-13" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#653-672">source</a><a href="#method.from_i16-13" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i16" class="fnname">from_i16</a>(n: i16) -&gt; Option&lt;Self&gt;</h4></section><section id="method.from_i32-13" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#653-672">source</a><a href="#method.from_i32-13" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_i32" class="fnname">from_i32</a>(n: i32) -&gt; Option&lt;Self&gt;</h4></section><section id="method.from_i64-12" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#653-672">source</a><a href="#method.from_i64-12" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_i64" class="fnname">from_i64</a>(n: i64) -&gt; Option&lt;Self&gt;</h4></section><section id="method.from_usize-13" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#653-672">source</a><a href="#method.from_usize-13" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_usize" class="fnname">from_usize</a>(n: usize) -&gt; Option&lt;Self&gt;</h4></section><section id="method.from_u8-13" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#653-672">source</a><a href="#method.from_u8-13" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u8" class="fnname">from_u8</a>(n: u8) -&gt; Option&lt;Self&gt;</h4></section><section id="method.from_u16-13" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#653-672">source</a><a href="#method.from_u16-13" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u16" class="fnname">from_u16</a>(n: u16) -&gt; Option&lt;Self&gt;</h4></section><section id="method.from_u32-13" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#653-672">source</a><a href="#method.from_u32-13" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_u32" class="fnname">from_u32</a>(n: u32) -&gt; Option&lt;Self&gt;</h4></section><section id="method.from_u64-12" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#653-672">source</a><a href="#method.from_u64-12" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_u64" class="fnname">from_u64</a>(n: u64) -&gt; Option&lt;Self&gt;</h4></section><section id="method.from_f32-13" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#653-672">source</a><a href="#method.from_f32-13" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f32" class="fnname">from_f32</a>(n: f32) -&gt; Option&lt;Self&gt;</h4></section><section id="method.from_f64-13" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/num_traits/cast.rs.html#653-672">source</a><a href="#method.from_f64-13" class="anchor"></a><h4 class="code-header">fn <a href="#method.from_f64" class="fnname">from_f64</a>(n: f64) -&gt; Option&lt;Self&gt;</h4></section></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div id="implementors-list"></div><script src="../../implementors/num_traits/cast/trait.FromPrimitive.js" data-ignore-extern-crates="core" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="num_traits" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>