mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-25 12:44:07 +01:00
95 lines
50 KiB
HTML
95 lines
50 KiB
HTML
<!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 `Error` struct in crate `serde_json`."><meta name="keywords" content="rust, rustlang, rust-lang, Error"><title>serde_json::error::Error - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script id="default-settings"></script><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../favicon.svg">
|
||
<link rel="alternate icon" type="image/png" href="../../favicon-16x16.png">
|
||
<link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../serde_json/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class="location">Struct Error</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.classify">classify</a><a href="#method.column">column</a><a href="#method.is_data">is_data</a><a href="#method.is_eof">is_eof</a><a href="#method.is_io">is_io</a><a href="#method.is_syntax">is_syntax</a><a href="#method.line">line</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a><a href="#impl-From%3CError%3E">From<Error></a><a href="#impl-IntoDeserializer%3C%27de%2C%20Error%3E">IntoDeserializer<'de, Error></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">!RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">!UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-ToString">ToString</a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><p class="location"><a href="../index.html">serde_json</a>::<wbr><a href="index.html">error</a></p><div id="sidebar-vars" data-name="Error" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="../index.html">serde_json</a>::<wbr><a href="index.html">error</a>::<wbr><a class="struct" href="">Error</a></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../../src/serde_json/error.rs.html#10-15" title="goto source code">[src]</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">pub struct Error { /* fields omitted */ }</pre></div><div class="docblock"><p>This type represents all possible errors that can occur when serializing or
|
||
deserializing JSON data.</p>
|
||
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../src/serde_json/error.rs.html#20-102" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.line" class="method"><code>pub fn <a href="#method.line" class="fnname">line</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class="srclink" href="../../src/serde_json/error.rs.html#25-27" title="goto source code">[src]</a></h4><div class="docblock"><p>One-based line number at which the error was detected.</p>
|
||
<p>Characters in the first line of the input (before the first newline
|
||
character) are in line 1.</p>
|
||
</div><h4 id="method.column" class="method"><code>pub fn <a href="#method.column" class="fnname">column</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class="srclink" href="../../src/serde_json/error.rs.html#36-38" title="goto source code">[src]</a></h4><div class="docblock"><p>One-based column number at which the error was detected.</p>
|
||
<p>The first character in the input and any characters immediately
|
||
following a newline character are in column 1.</p>
|
||
<p>Note that errors may occur in column 0, for example if a read from an IO
|
||
stream fails immediately following a previously read newline character.</p>
|
||
</div><h4 id="method.classify" class="method"><code>pub fn <a href="#method.classify" class="fnname">classify</a>(&self) -> <a class="enum" href="../../serde_json/error/enum.Category.html" title="enum serde_json::error::Category">Category</a></code><a class="srclink" href="../../src/serde_json/error.rs.html#46-71" title="goto source code">[src]</a></h4><div class="docblock"><p>Categorizes the cause of this error.</p>
|
||
<ul>
|
||
<li><code>Category::Io</code> - failure to read or write bytes on an IO stream</li>
|
||
<li><code>Category::Syntax</code> - input that is not syntactically valid JSON</li>
|
||
<li><code>Category::Data</code> - input data that is semantically incorrect</li>
|
||
<li><code>Category::Eof</code> - unexpected end of the input data</li>
|
||
</ul>
|
||
</div><h4 id="method.is_io" class="method"><code>pub fn <a href="#method.is_io" class="fnname">is_io</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/serde_json/error.rs.html#75-77" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns true if this error was caused by a failure to read or write
|
||
bytes on an IO stream.</p>
|
||
</div><h4 id="method.is_syntax" class="method"><code>pub fn <a href="#method.is_syntax" class="fnname">is_syntax</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/serde_json/error.rs.html#81-83" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns true if this error was caused by input that was not
|
||
syntactically valid JSON.</p>
|
||
</div><h4 id="method.is_data" class="method"><code>pub fn <a href="#method.is_data" class="fnname">is_data</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/serde_json/error.rs.html#90-92" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns true if this error was caused by input data that was
|
||
semantically incorrect.</p>
|
||
<p>For example, JSON containing a number is semantically incorrect when the
|
||
type being deserialized into holds a String.</p>
|
||
</div><h4 id="method.is_eof" class="method"><code>pub fn <a href="#method.is_eof" class="fnname">is_eof</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class="srclink" href="../../src/serde_json/error.rs.html#99-101" title="goto source code">[src]</a></h4><div class="docblock"><p>Returns true if this error was caused by prematurely reaching the end of
|
||
the input data.</p>
|
||
<p>Callers that process streaming input may be interested in retrying the
|
||
deserialization once more data is available.</p>
|
||
</div></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-Debug" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a></code><a href="#impl-Debug" class="anchor"></a><a class="srclink" href="../../src/serde_json/error.rs.html#345-355" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/serde_json/error.rs.html#346-354" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||
</div></div><h3 id="impl-Display" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a></code><a href="#impl-Display" class="anchor"></a><a class="srclink" href="../../src/serde_json/error.rs.html#323-327" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.fmt-1" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class="srclink" href="../../src/serde_json/error.rs.html#324-326" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
|
||
</div></div><h3 id="impl-Error" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a></code><a href="#impl-Error" class="anchor"></a><a class="srclink" href="../../src/serde_json/error.rs.html#313-321" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.source" class="method hidden"><code>fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source" class="fnname">source</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&(dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> + 'static)></code><a class="srclink" href="../../src/serde_json/error.rs.html#315-320" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>The lower-level source of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.source">Read more</a></p>
|
||
</div><h4 id="method.backtrace" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace" class="fnname">backtrace</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&<a class="struct" href="https://doc.rust-lang.org/nightly/std/backtrace/struct.Backtrace.html" title="struct std::backtrace::Backtrace">Backtrace</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#126" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab unstable"><span class="emoji">🔬</span> This is a nightly-only experimental API. (<code>backtrace</code>)</div></div><div class='docblock hidden'><p>Returns a stack backtrace, if available, of where this error occurred. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.backtrace">Read more</a></p>
|
||
</div><h4 id="method.description" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description" class="fnname">description</a>(&self) -> &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#138" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab deprecated"><span class="emoji">👎</span> Deprecated since 1.42.0: <p>use the Display impl or to_string()</p>
|
||
</div></div><div class='docblock hidden'> <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description">Read more</a></div><h4 id="method.cause" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause" class="fnname">cause</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><&dyn <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>></code><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span><a class="srclink" href="https://doc.rust-lang.org/nightly/src/std/error.rs.html#148" title="goto source code">[src]</a></h4><div class="item-info hidden"><div class="stab deprecated"><span class="emoji">👎</span> Deprecated since 1.33.0: <p>replaced by Error::source, which can support downcasting</p>
|
||
</div></div></div><h3 id="impl-Error-1" class="impl"><code class="in-band">impl <a class="trait" href="../../serde/ser/trait.Error.html" title="trait serde::ser::Error">Error</a> for <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a></code><a href="#impl-Error-1" class="anchor"></a><a class="srclink" href="../../src/serde_json/error.rs.html#373-378" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.custom" class="method hidden"><code>fn <a href="../../serde/ser/trait.Error.html#tymethod.custom" class="fnname">custom</a><T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a>>(msg: T) -> <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a></code><a class="srclink" href="../../src/serde_json/error.rs.html#375-377" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Used when a <a href="../trait.Serialize.html"><code>Serialize</code></a> implementation encounters any error
|
||
while serializing a type. <a href="../../serde/ser/trait.Error.html#tymethod.custom">Read more</a></p>
|
||
</div></div><h3 id="impl-Error-2" class="impl"><code class="in-band">impl <a class="trait" href="../../serde/de/trait.Error.html" title="trait serde::de::Error">Error</a> for <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a></code><a href="#impl-Error-2" class="anchor"></a><a class="srclink" href="../../src/serde_json/error.rs.html#357-371" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.custom-1" class="method hidden"><code>fn <a href="../../serde/de/trait.Error.html#tymethod.custom" class="fnname">custom</a><T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a>>(msg: T) -> <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a></code><a class="srclink" href="../../src/serde_json/error.rs.html#359-361" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Raised when there is general error when deserializing a type. <a href="../../serde/de/trait.Error.html#tymethod.custom">Read more</a></p>
|
||
</div><h4 id="method.invalid_type" class="method hidden"><code>fn <a href="../../serde/de/trait.Error.html#method.invalid_type" class="fnname">invalid_type</a>(unexp: <a class="enum" href="../../serde/de/enum.Unexpected.html" title="enum serde::de::Unexpected">Unexpected</a><'_>, exp: &dyn <a class="trait" href="../../serde/de/trait.Expected.html" title="trait serde::de::Expected">Expected</a>) -> Self</code><a class="srclink" href="../../src/serde_json/error.rs.html#364-370" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Raised when a <code>Deserialize</code> receives a type different from what it was
|
||
expecting. <a href="../../serde/de/trait.Error.html#method.invalid_type">Read more</a></p>
|
||
</div><h4 id="method.invalid_value" class="method hidden"><code>pub fn <a href="../../serde/de/trait.Error.html#method.invalid_value" class="fnname">invalid_value</a>(unexp: <a class="enum" href="../../serde/de/enum.Unexpected.html" title="enum serde::de::Unexpected">Unexpected</a><'_>, exp: &dyn <a class="trait" href="../../serde/de/trait.Expected.html" title="trait serde::de::Expected">Expected</a>) -> Self</code><a class="srclink" href="../../src/serde/de/mod.rs.html#297" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Raised when a <code>Deserialize</code> receives a value of the right type but that
|
||
is wrong for some other reason. <a href="../../serde/de/trait.Error.html#method.invalid_value">Read more</a></p>
|
||
</div><h4 id="method.invalid_length" class="method hidden"><code>pub fn <a href="../../serde/de/trait.Error.html#method.invalid_length" class="fnname">invalid_length</a>(len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, exp: &dyn <a class="trait" href="../../serde/de/trait.Expected.html" title="trait serde::de::Expected">Expected</a>) -> Self</code><a class="srclink" href="../../src/serde/de/mod.rs.html#297" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Raised when deserializing a sequence or map and the input data contains
|
||
too many or too few elements. <a href="../../serde/de/trait.Error.html#method.invalid_length">Read more</a></p>
|
||
</div><h4 id="method.unknown_variant" class="method hidden"><code>pub fn <a href="../../serde/de/trait.Error.html#method.unknown_variant" class="fnname">unknown_variant</a>(variant: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, expected: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'static [</a>&'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> Self</code><a class="srclink" href="../../src/serde/de/mod.rs.html#297" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Raised when a <code>Deserialize</code> enum type received a variant with an
|
||
unrecognized name. <a href="../../serde/de/trait.Error.html#method.unknown_variant">Read more</a></p>
|
||
</div><h4 id="method.unknown_field" class="method hidden"><code>pub fn <a href="../../serde/de/trait.Error.html#method.unknown_field" class="fnname">unknown_field</a>(field: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, expected: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'static [</a>&'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -> Self</code><a class="srclink" href="../../src/serde/de/mod.rs.html#297" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Raised when a <code>Deserialize</code> struct type received a field with an
|
||
unrecognized name. <a href="../../serde/de/trait.Error.html#method.unknown_field">Read more</a></p>
|
||
</div><h4 id="method.missing_field" class="method hidden"><code>pub fn <a href="../../serde/de/trait.Error.html#method.missing_field" class="fnname">missing_field</a>(field: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Self</code><a class="srclink" href="../../src/serde/de/mod.rs.html#297" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Raised when a <code>Deserialize</code> struct type expected to receive a required
|
||
field with a particular name but that field was not present in the
|
||
input. <a href="../../serde/de/trait.Error.html#method.missing_field">Read more</a></p>
|
||
</div><h4 id="method.duplicate_field" class="method hidden"><code>pub fn <a href="../../serde/de/trait.Error.html#method.duplicate_field" class="fnname">duplicate_field</a>(field: &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> Self</code><a class="srclink" href="../../src/serde/de/mod.rs.html#297" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Raised when a <code>Deserialize</code> struct type received more than one of the
|
||
same field. <a href="../../serde/de/trait.Error.html#method.duplicate_field">Read more</a></p>
|
||
</div></div><h3 id="impl-From%3CError%3E" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a>> for <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a></code><a href="#impl-From%3CError%3E" class="anchor"></a><a class="srclink" href="../../src/serde_json/error.rs.html#129-168" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from" class="method"><code>fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(j: <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a>) -> Self</code><a class="srclink" href="../../src/serde_json/error.rs.html#157-167" title="goto source code">[src]</a></h4><div class="docblock"><p>Convert a <code>serde_json::Error</code> into an <code>io::Error</code>.</p>
|
||
<p>JSON syntax and data errors are turned into <code>InvalidData</code> IO errors.
|
||
EOF errors are turned into <code>UnexpectedEof</code> IO errors.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered">
|
||
<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">io</span>;
|
||
|
||
<span class="kw">enum</span> <span class="ident">MyError</span> {
|
||
<span class="ident">Io</span>(<span class="ident">io</span>::<span class="ident">Error</span>),
|
||
<span class="ident">Json</span>(<span class="ident">serde_json</span>::<span class="ident">Error</span>),
|
||
}
|
||
|
||
<span class="kw">impl</span> <span class="ident">From</span><span class="op"><</span><span class="ident">serde_json</span>::<span class="ident">Error</span><span class="op">></span> <span class="kw">for</span> <span class="ident">MyError</span> {
|
||
<span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">err</span>: <span class="ident">serde_json</span>::<span class="ident">Error</span>) <span class="op">-</span><span class="op">></span> <span class="ident">MyError</span> {
|
||
<span class="kw">use</span> <span class="ident">serde_json</span>::<span class="ident">error</span>::<span class="ident">Category</span>;
|
||
<span class="kw">match</span> <span class="ident">err</span>.<span class="ident">classify</span>() {
|
||
<span class="ident">Category</span>::<span class="ident">Io</span> <span class="op">=</span><span class="op">></span> {
|
||
<span class="ident">MyError</span>::<span class="ident">Io</span>(<span class="ident">err</span>.<span class="ident">into</span>())
|
||
}
|
||
<span class="ident">Category</span>::<span class="ident">Syntax</span> <span class="op">|</span> <span class="ident">Category</span>::<span class="ident">Data</span> <span class="op">|</span> <span class="ident">Category</span>::<span class="ident">Eof</span> <span class="op">=</span><span class="op">></span> {
|
||
<span class="ident">MyError</span>::<span class="ident">Json</span>(<span class="ident">err</span>)
|
||
}
|
||
}
|
||
}
|
||
}</pre></div>
|
||
</div></div><h3 id="impl-IntoDeserializer%3C%27de%2C%20Error%3E" class="impl"><code class="in-band">impl<'de> <a class="trait" href="../../serde/de/trait.IntoDeserializer.html" title="trait serde::de::IntoDeserializer">IntoDeserializer</a><'de, <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a>> for <a class="enum" href="../../serde_json/enum.Value.html" title="enum serde_json::Value">Value</a></code><a href="#impl-IntoDeserializer%3C%27de%2C%20Error%3E" class="anchor"></a><a class="srclink" href="../../src/serde_json/value/de.rs.html#474-480" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Deserializer" class="type"><code>type <a href="../../serde/de/trait.IntoDeserializer.html#associatedtype.Deserializer" class="type">Deserializer</a> = Self</code></h4><div class='docblock'><p>The type of the deserializer being converted into.</p>
|
||
</div><h4 id="method.into_deserializer" class="method hidden"><code>fn <a href="../../serde/de/trait.IntoDeserializer.html#tymethod.into_deserializer" class="fnname">into_deserializer</a>(self) -> Self::<a class="type" href="../../serde/de/trait.IntoDeserializer.html#associatedtype.Deserializer" title="type serde::de::IntoDeserializer::Deserializer">Deserializer</a></code><a class="srclink" href="../../src/serde_json/value/de.rs.html#477-479" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Convert this value into a deserializer.</p>
|
||
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a></code><a href="#impl-RefUnwindSafe" class="anchor"></a><a class="srclink" href="../../src/serde_json/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a></code><a href="#impl-Send" class="anchor"></a><a class="srclink" href="../../src/serde_json/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a></code><a href="#impl-Sync" class="anchor"></a><a class="srclink" href="../../src/serde_json/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a></code><a href="#impl-Unpin" class="anchor"></a><a class="srclink" href="../../src/serde_json/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../serde_json/struct.Error.html" title="struct serde_json::Error">Error</a></code><a href="#impl-UnwindSafe" class="anchor"></a><a class="srclink" href="../../src/serde_json/lib.rs.html#1" title="goto source code">[src]</a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#131-135" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#207-211" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T<span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'_ mut </a>R</h3><code class="content"><span class="where fmt-newline">impl<'_, R> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'_ mut </a>R <span class="where fmt-newline">where<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline">impl<'_, W> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'_ mut </a>W <span class="where fmt-newline">where<br> W: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline">impl<'_, I> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'_ mut </a>I <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="type">Item</a> = <I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>;</span><span class="where fmt-newline">impl<'_, F> <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'_ mut </a>F <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <F as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#208" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||
</div></div><h3 id="impl-BorrowMut%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214-218" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow_mut" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T<span class="notable-traits"><span class="notable-traits-tooltip">ⓘ<div class="notable-traits-tooltiptext"><span class="docblock"><h3 class="notable">Notable traits for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'_ mut </a>R</h3><code class="content"><span class="where fmt-newline">impl<'_, R> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'_ mut </a>R <span class="where fmt-newline">where<br> R: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline">impl<'_, W> <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'_ mut </a>W <span class="where fmt-newline">where<br> W: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Write.html" title="trait std::io::Write">Write</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline">impl<'_, I> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'_ mut </a>I <span class="where fmt-newline">where<br> I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" class="type">Item</a> = <I as <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item" title="type core::iter::traits::iterator::Iterator::Item">Item</a>;</span><span class="where fmt-newline">impl<'_, F> <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&'_ mut </a>F <span class="where fmt-newline">where<br> F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></span><span class="where fmt-newline"> type <a href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" class="type">Output</a> = <F as <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html#associatedtype.Output" title="type core::future::future::Future::Output">Output</a>;</span></code></span></div></span></span></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#215" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||
</div></div><h3 id="impl-From%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</code><a href="#impl-From%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#545-549" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.from-1" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#546" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id="impl-Into%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href="#impl-Into%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#534-541" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#538" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id="impl-ToString" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html" title="trait alloc::string::ToString">ToString</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-ToString" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2203-2216" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.to_string" class="method hidden"><code>pub default fn <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string" class="fnname">to_string</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/alloc/string.rs.html#2209" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Converts the given value to a <code>String</code>. <a href="https://doc.rust-lang.org/nightly/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></p>
|
||
</div></div><h3 id="impl-TryFrom%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></code><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#582-591" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||
</div><h4 id="method.try_from" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#588" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div><h3 id="impl-TryInto%3CU%3E" class="impl"><code class="in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><a href="#impl-TryInto%3CU%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#568-577" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="associatedtype.Error-1" class="type"><code>type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></code></h4><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||
</div><h4 id="method.try_into" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#574" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||
</div></div></div></section><section id="search" class="content hidden"></section><section class="footer"></section><div id="rustdoc-vars" data-root-path="../../" data-current-crate="serde_json"></div>
|
||
<script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html> |