Now a REAL lib
This commit is contained in:
77
doc/serde/de/enum.Unexpected.html
Normal file
77
doc/serde/de/enum.Unexpected.html
Normal file
File diff suppressed because one or more lines are too long
11
doc/serde/de/ignored_any/struct.IgnoredAny.html
Normal file
11
doc/serde/de/ignored_any/struct.IgnoredAny.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;URL=../../../serde/de/struct.IgnoredAny.html">
|
||||
<title>Redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="../../../serde/de/struct.IgnoredAny.html">../../../serde/de/struct.IgnoredAny.html</a>...</p>
|
||||
<script>location.replace("../../../serde/de/struct.IgnoredAny.html" + location.search + location.hash);</script>
|
||||
</body>
|
||||
</html>
|
||||
148
doc/serde/de/index.html
Normal file
148
doc/serde/de/index.html
Normal file
@ -0,0 +1,148 @@
|
||||
<!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="Generic data structure deserialization framework."><meta name="keywords" content="rust, rustlang, rust-lang, de"><title>serde::de - 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" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.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 mod"><!--[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">☰</button><a class="sidebar-logo" href="../../serde/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../serde/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module de</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../serde/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><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"><button type="button">?</button></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></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">serde</a>::<wbr><a class="mod" href="#">de</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></span></h1><span class="out-of-band"><a class="srclink" href="../../src/serde/de/mod.rs.html#1-2299">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Generic data structure deserialization framework.</p>
|
||||
<p>The two most important traits in this module are <a href="../trait.Deserialize.html"><code>Deserialize</code></a> and
|
||||
<a href="../trait.Deserializer.html"><code>Deserializer</code></a>.</p>
|
||||
<ul>
|
||||
<li><strong>A type that implements <code>Deserialize</code> is a data structure</strong> that can be
|
||||
deserialized from any data format supported by Serde, and conversely</li>
|
||||
<li><strong>A type that implements <code>Deserializer</code> is a data format</strong> that can
|
||||
deserialize any data structure supported by Serde.</li>
|
||||
</ul>
|
||||
<h2 id="the-deserialize-trait"><a href="#the-deserialize-trait">The Deserialize trait</a></h2>
|
||||
<p>Serde provides <a href="../trait.Deserialize.html"><code>Deserialize</code></a> implementations for many Rust primitive and
|
||||
standard library types. The complete list is below. All of these can be
|
||||
deserialized using Serde out of the box.</p>
|
||||
<p>Additionally, Serde provides a procedural macro called <a href="https://crates.io/crates/serde_derive"><code>serde_derive</code></a> to
|
||||
automatically generate <a href="../trait.Deserialize.html"><code>Deserialize</code></a> implementations for structs and enums
|
||||
in your program. See the <a href="https://serde.rs/derive.html">derive section of the manual</a> for how to use this.</p>
|
||||
<p>In rare cases it may be necessary to implement <a href="../trait.Deserialize.html"><code>Deserialize</code></a> manually for
|
||||
some type in your program. See the <a href="https://serde.rs/impl-deserialize.html">Implementing <code>Deserialize</code></a> section of
|
||||
the manual for more about this.</p>
|
||||
<p>Third-party crates may provide <a href="../trait.Deserialize.html"><code>Deserialize</code></a> implementations for types
|
||||
that they expose. For example the <a href="https://crates.io/crates/linked-hash-map"><code>linked-hash-map</code></a> crate provides a
|
||||
<a href="https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html"><code>LinkedHashMap<K, V></code></a> type that is deserializable by Serde because the
|
||||
crate provides an implementation of <a href="../trait.Deserialize.html"><code>Deserialize</code></a> for it.</p>
|
||||
<h2 id="the-deserializer-trait"><a href="#the-deserializer-trait">The Deserializer trait</a></h2>
|
||||
<p><a href="../trait.Deserializer.html"><code>Deserializer</code></a> implementations are provided by third-party crates, for
|
||||
example <a href="https://github.com/serde-rs/json"><code>serde_json</code></a>, <a href="https://github.com/dtolnay/serde-yaml"><code>serde_yaml</code></a> and <a href="https://github.com/jamesmunns/postcard"><code>postcard</code></a>.</p>
|
||||
<p>A partial list of well-maintained formats is given on the <a href="https://serde.rs/#data-formats">Serde
|
||||
website</a>.</p>
|
||||
<h2 id="implementations-of-deserialize-provided-by-serde"><a href="#implementations-of-deserialize-provided-by-serde">Implementations of Deserialize provided by Serde</a></h2>
|
||||
<p>This is a slightly different set of types than what is supported for
|
||||
serialization. Some types can be serialized by Serde but not deserialized.
|
||||
One example is <code>OsStr</code>.</p>
|
||||
<ul>
|
||||
<li><strong>Primitive types</strong>:
|
||||
<ul>
|
||||
<li>bool</li>
|
||||
<li>i8, i16, i32, i64, i128, isize</li>
|
||||
<li>u8, u16, u32, u64, u128, usize</li>
|
||||
<li>f32, f64</li>
|
||||
<li>char</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Compound types</strong>:
|
||||
<ul>
|
||||
<li>[T; 0] through [T; 32]</li>
|
||||
<li>tuples up to size 16</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Common standard library types</strong>:
|
||||
<ul>
|
||||
<li>String</li>
|
||||
<li>Option<T></li>
|
||||
<li>Result<T, E></li>
|
||||
<li>PhantomData<T></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Wrapper types</strong>:
|
||||
<ul>
|
||||
<li>Box<T></li>
|
||||
<li>Box<[T]></li>
|
||||
<li>Box<str></li>
|
||||
<li>Cow<’a, T></li>
|
||||
<li>Cell<T></li>
|
||||
<li>RefCell<T></li>
|
||||
<li>Mutex<T></li>
|
||||
<li>RwLock<T></li>
|
||||
<li>Rc<T> <em>(if</em> features = [“rc”] <em>is enabled)</em></li>
|
||||
<li>Arc<T> <em>(if</em> features = [“rc”] <em>is enabled)</em></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Collection types</strong>:
|
||||
<ul>
|
||||
<li>BTreeMap<K, V></li>
|
||||
<li>BTreeSet<T></li>
|
||||
<li>BinaryHeap<T></li>
|
||||
<li>HashMap<K, V, H></li>
|
||||
<li>HashSet<T, H></li>
|
||||
<li>LinkedList<T></li>
|
||||
<li>VecDeque<T></li>
|
||||
<li>Vec<T></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Zero-copy types</strong>:
|
||||
<ul>
|
||||
<li>&str</li>
|
||||
<li>&[u8]</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>FFI types</strong>:
|
||||
<ul>
|
||||
<li>CString</li>
|
||||
<li>Box<CStr></li>
|
||||
<li>OsString</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Miscellaneous standard library types</strong>:
|
||||
<ul>
|
||||
<li>Duration</li>
|
||||
<li>SystemTime</li>
|
||||
<li>Path</li>
|
||||
<li>PathBuf</li>
|
||||
<li>Range<T></li>
|
||||
<li>RangeInclusive<T></li>
|
||||
<li>Bound<T></li>
|
||||
<li>num::NonZero*</li>
|
||||
<li><code>!</code> <em>(unstable)</em></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Net types</strong>:
|
||||
<ul>
|
||||
<li>IpAddr</li>
|
||||
<li>Ipv4Addr</li>
|
||||
<li>Ipv6Addr</li>
|
||||
<li>SocketAddr</li>
|
||||
<li>SocketAddrV4</li>
|
||||
<li>SocketAddrV6</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div></details><h2 id="reexports" class="small-section-header"><a href="#reexports">Re-exports</a></h2><div class="item-table"><div class="item-row"><div class="item-left import-item" id="reexport.StdError"><code>pub use std::error::<a class="trait" href="https://doc.rust-lang.org/1.64.0/std/error/trait.Error.html" title="trait std::error::Error">Error</a> as StdError;</code></div><div class="item-right docblock-short"></div></div></div><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="value/index.html" title="serde::de::value mod">value</a></div><div class="item-right docblock-short"><p>Building blocks for deserializing basic values using the <code>IntoDeserializer</code>
|
||||
trait.</p>
|
||||
</div></div></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.IgnoredAny.html" title="serde::de::IgnoredAny struct">IgnoredAny</a></div><div class="item-right docblock-short"><p>An efficient way of discarding data from a deserializer.</p>
|
||||
</div></div></div><h2 id="enums" class="small-section-header"><a href="#enums">Enums</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.Unexpected.html" title="serde::de::Unexpected enum">Unexpected</a></div><div class="item-right docblock-short"><p><code>Unexpected</code> represents an unexpected invocation of any one of the <code>Visitor</code>
|
||||
trait methods.</p>
|
||||
</div></div></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Deserialize.html" title="serde::de::Deserialize trait">Deserialize</a></div><div class="item-right docblock-short"><p>A <strong>data structure</strong> that can be deserialized from any data format supported
|
||||
by Serde.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.DeserializeOwned.html" title="serde::de::DeserializeOwned trait">DeserializeOwned</a></div><div class="item-right docblock-short"><p>A data structure that can be deserialized without borrowing any data from
|
||||
the deserializer.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.DeserializeSeed.html" title="serde::de::DeserializeSeed trait">DeserializeSeed</a></div><div class="item-right docblock-short"><p><code>DeserializeSeed</code> is the stateful form of the <code>Deserialize</code> trait. If you
|
||||
ever find yourself looking for a way to pass data into a <code>Deserialize</code> impl,
|
||||
this trait is the way to do it.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Deserializer.html" title="serde::de::Deserializer trait">Deserializer</a></div><div class="item-right docblock-short"><p>A <strong>data format</strong> that can deserialize any data structure supported by
|
||||
Serde.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.EnumAccess.html" title="serde::de::EnumAccess trait">EnumAccess</a></div><div class="item-right docblock-short"><p>Provides a <code>Visitor</code> access to the data of an enum in the input.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Error.html" title="serde::de::Error trait">Error</a></div><div class="item-right docblock-short"><p>The <code>Error</code> trait allows <code>Deserialize</code> implementations to create descriptive
|
||||
error messages belonging to the <code>Deserializer</code> against which they are
|
||||
currently running.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Expected.html" title="serde::de::Expected trait">Expected</a></div><div class="item-right docblock-short"><p><code>Expected</code> represents an explanation of what data a <code>Visitor</code> was expecting
|
||||
to receive.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.IntoDeserializer.html" title="serde::de::IntoDeserializer trait">IntoDeserializer</a></div><div class="item-right docblock-short"><p>Converts an existing value into a <code>Deserializer</code> from which other values can
|
||||
be deserialized.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.MapAccess.html" title="serde::de::MapAccess trait">MapAccess</a></div><div class="item-right docblock-short"><p>Provides a <code>Visitor</code> access to each entry of a map in the input.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.SeqAccess.html" title="serde::de::SeqAccess trait">SeqAccess</a></div><div class="item-right docblock-short"><p>Provides a <code>Visitor</code> access to each element of a sequence in the input.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.VariantAccess.html" title="serde::de::VariantAccess trait">VariantAccess</a></div><div class="item-right docblock-short"><p><code>VariantAccess</code> is a visitor that is created by the <code>Deserializer</code> and
|
||||
passed to the <code>Deserialize</code> to deserialize the content of a particular enum
|
||||
variant.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Visitor.html" title="serde::de::Visitor trait">Visitor</a></div><div class="item-right docblock-short"><p>This trait represents a visitor that walks through a deserializer.</p>
|
||||
</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="serde" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>
|
||||
1
doc/serde/de/sidebar-items.js
Normal file
1
doc/serde/de/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"enum":[["Unexpected","`Unexpected` represents an unexpected invocation of any one of the `Visitor` trait methods."]],"mod":[["value","Building blocks for deserializing basic values using the `IntoDeserializer` trait."]],"struct":[["IgnoredAny","An efficient way of discarding data from a deserializer."]],"trait":[["Deserialize","A data structure that can be deserialized from any data format supported by Serde."],["DeserializeOwned","A data structure that can be deserialized without borrowing any data from the deserializer."],["DeserializeSeed","`DeserializeSeed` is the stateful form of the `Deserialize` trait. If you ever find yourself looking for a way to pass data into a `Deserialize` impl, this trait is the way to do it."],["Deserializer","A data format that can deserialize any data structure supported by Serde."],["EnumAccess","Provides a `Visitor` access to the data of an enum in the input."],["Error","The `Error` trait allows `Deserialize` implementations to create descriptive error messages belonging to the `Deserializer` against which they are currently running."],["Expected","`Expected` represents an explanation of what data a `Visitor` was expecting to receive."],["IntoDeserializer","Converts an existing value into a `Deserializer` from which other values can be deserialized."],["MapAccess","Provides a `Visitor` access to each entry of a map in the input."],["SeqAccess","Provides a `Visitor` access to each element of a sequence in the input."],["VariantAccess","`VariantAccess` is a visitor that is created by the `Deserializer` and passed to the `Deserialize` to deserialize the content of a particular enum variant."],["Visitor","This trait represents a visitor that walks through a deserializer."]]};
|
||||
152
doc/serde/de/struct.IgnoredAny.html
Normal file
152
doc/serde/de/struct.IgnoredAny.html
Normal file
File diff suppressed because one or more lines are too long
26
doc/serde/de/trait.Deserialize.html
Normal file
26
doc/serde/de/trait.Deserialize.html
Normal file
File diff suppressed because one or more lines are too long
20
doc/serde/de/trait.DeserializeOwned.html
Normal file
20
doc/serde/de/trait.DeserializeOwned.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!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 data structure that can be deserialized without borrowing any data from the deserializer."><meta name="keywords" content="rust, rustlang, rust-lang, DeserializeOwned"><title>DeserializeOwned in serde::de - 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" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" 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">☰</button><a class="sidebar-logo" href="../../serde/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../serde/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">DeserializeOwned</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In serde::de</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../serde/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><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"><button type="button">?</button></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></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Trait <a href="../index.html">serde</a>::<wbr><a href="index.html">de</a>::<wbr><a class="trait" href="#">DeserializeOwned</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></span></h1><span class="out-of-band"><a class="srclink" href="../../src/serde/de/mod.rs.html#603">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait DeserializeOwned: for<'de> <a class="trait" href="../trait.Deserialize.html" title="trait serde::Deserialize">Deserialize</a><'de> { }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A data structure that can be deserialized without borrowing any data from
|
||||
the deserializer.</p>
|
||||
<p>This is primarily useful for trait bounds on functions. For example a
|
||||
<code>from_str</code> function may be able to deserialize a data structure that borrows
|
||||
from the input string, but a <code>from_reader</code> function may only deserialize
|
||||
owned data.</p>
|
||||
|
||||
<div class='information'><div class='tooltip edition' data-edition="2018">ⓘ</div></div><div class="example-wrap"><pre class="rust rust-example-rendered edition"><code><span class="kw">fn</span> <span class="ident">from_str</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="ident">T</span><span class="op">></span>(<span class="ident">s</span>: <span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">str</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>
|
||||
<span class="kw">where</span>
|
||||
<span class="ident">T</span>: <span class="ident">Deserialize</span><span class="op"><</span><span class="lifetime">'a</span><span class="op">></span>;
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">from_reader</span><span class="op"><</span><span class="ident">R</span>, <span class="ident">T</span><span class="op">></span>(<span class="ident">rdr</span>: <span class="ident">R</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>
|
||||
<span class="kw">where</span>
|
||||
<span class="ident">R</span>: <span class="ident">Read</span>,
|
||||
<span class="ident">T</span>: <span class="ident">DeserializeOwned</span>;</code></pre></div>
|
||||
<h2 id="lifetime"><a href="#lifetime">Lifetime</a></h2>
|
||||
<p>The relationship between <code>Deserialize</code> and <code>DeserializeOwned</code> in trait
|
||||
bounds is explained in more detail on the page <a href="https://serde.rs/lifetimes.html">Understanding deserializer
|
||||
lifetimes</a>.</p>
|
||||
</div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><section id="impl-DeserializeOwned-for-T" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#604">source</a></span><a href="#impl-DeserializeOwned-for-T" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="trait.DeserializeOwned.html" title="trait serde::de::DeserializeOwned">DeserializeOwned</a> for T <span class="where fmt-newline">where<br> T: for<'de> <a class="trait" href="../trait.Deserialize.html" title="trait serde::Deserialize">Deserialize</a><'de>, </span></h3></section></div><script type="text/javascript" src="../../implementors/serde/de/trait.DeserializeOwned.js" data-ignore-extern-crates="" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="serde" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>
|
||||
134
doc/serde/de/trait.DeserializeSeed.html
Normal file
134
doc/serde/de/trait.DeserializeSeed.html
Normal file
@ -0,0 +1,134 @@
|
||||
<!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="`DeserializeSeed` is the stateful form of the `Deserialize` trait. If you ever find yourself looking for a way to pass data into a `Deserialize` impl, this trait is the way to do it."><meta name="keywords" content="rust, rustlang, rust-lang, DeserializeSeed"><title>DeserializeSeed in serde::de - 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" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" 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">☰</button><a class="sidebar-logo" href="../../serde/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../serde/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">DeserializeSeed</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#required-associated-types">Required Associated Types</a></h3><ul><li><a href="#associatedtype.Value">Value</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.deserialize">deserialize</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul><li><a href="#impl-DeserializeSeed%3C%27de%3E-for-PhantomData%3CT%3E">PhantomData<T></a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In serde::de</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../serde/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><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"><button type="button">?</button></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></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Trait <a href="../index.html">serde</a>::<wbr><a href="index.html">de</a>::<wbr><a class="trait" href="#">DeserializeSeed</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></span></h1><span class="out-of-band"><a class="srclink" href="../../src/serde/de/mod.rs.html#769-778">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait DeserializeSeed<'de>: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
|
||||
type <a href="#associatedtype.Value" class="associatedtype">Value</a>;
|
||||
|
||||
fn <a href="#tymethod.deserialize" class="fnname">deserialize</a><D>(self, deserializer: D) -> <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self::<a class="associatedtype" href="trait.DeserializeSeed.html#associatedtype.Value" title="type serde::de::DeserializeSeed::Value">Value</a>, D::<a class="associatedtype" href="../trait.Deserializer.html#associatedtype.Error" title="type serde::Deserializer::Error">Error</a>><br> <span class="where">where<br> D: <a class="trait" href="../trait.Deserializer.html" title="trait serde::Deserializer">Deserializer</a><'de></span>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>DeserializeSeed</code> is the stateful form of the <code>Deserialize</code> trait. If you
|
||||
ever find yourself looking for a way to pass data into a <code>Deserialize</code> impl,
|
||||
this trait is the way to do it.</p>
|
||||
<p>As one example of stateful deserialization consider deserializing a JSON
|
||||
array into an existing buffer. Using the <code>Deserialize</code> trait we could
|
||||
deserialize a JSON array into a <code>Vec<T></code> but it would be a freshly allocated
|
||||
<code>Vec<T></code>; there is no way for <code>Deserialize</code> to reuse a previously allocated
|
||||
buffer. Using <code>DeserializeSeed</code> instead makes this possible as in the
|
||||
example code below.</p>
|
||||
<p>The canonical API for stateless deserialization looks like this:</p>
|
||||
|
||||
<div class='information'><div class='tooltip edition' data-edition="2018">ⓘ</div></div><div class="example-wrap"><pre class="rust rust-example-rendered edition"><code><span class="kw">fn</span> <span class="ident">func</span><span class="op"><</span><span class="lifetime">'de</span>, <span class="ident">T</span>: <span class="ident">Deserialize</span><span class="op"><</span><span class="lifetime">'de</span><span class="op">></span><span class="op">></span>() -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">T</span>, <span class="ident">Error</span><span class="op">></span></code></pre></div>
|
||||
<p>Adjusting an API like this to support stateful deserialization is a matter
|
||||
of accepting a seed as input:</p>
|
||||
|
||||
<div class='information'><div class='tooltip edition' data-edition="2018">ⓘ</div></div><div class="example-wrap"><pre class="rust rust-example-rendered edition"><code><span class="kw">fn</span> <span class="ident">func_seed</span><span class="op"><</span><span class="lifetime">'de</span>, <span class="ident">T</span>: <span class="ident">DeserializeSeed</span><span class="op"><</span><span class="lifetime">'de</span><span class="op">></span><span class="op">></span>(<span class="ident">seed</span>: <span class="ident">T</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">T::Value</span>, <span class="ident">Error</span><span class="op">></span></code></pre></div>
|
||||
<p>In practice the majority of deserialization is stateless. An API expecting a
|
||||
seed can be appeased by passing <code>std::marker::PhantomData</code> as a seed in the
|
||||
case of stateless deserialization.</p>
|
||||
<h2 id="lifetime"><a href="#lifetime">Lifetime</a></h2>
|
||||
<p>The <code>'de</code> lifetime of this trait is the lifetime of data that may be
|
||||
borrowed by <code>Self::Value</code> when deserialized. See the page <a href="https://serde.rs/lifetimes.html">Understanding
|
||||
deserializer lifetimes</a> for a more detailed explanation of these lifetimes.</p>
|
||||
<h2 id="example"><a href="#example">Example</a></h2>
|
||||
<p>Suppose we have JSON that looks like <code>[[1, 2], [3, 4, 5], [6]]</code> and we need
|
||||
to deserialize it into a flat representation like <code>vec![1, 2, 3, 4, 5, 6]</code>.
|
||||
Allocating a brand new <code>Vec<T></code> for each subarray would be slow. Instead we
|
||||
would like to allocate a single <code>Vec<T></code> and then deserialize each subarray
|
||||
into it. This requires stateful deserialization using the <code>DeserializeSeed</code>
|
||||
trait.</p>
|
||||
|
||||
<div class='information'><div class='tooltip edition' data-edition="2018">ⓘ</div></div><div class="example-wrap"><pre class="rust rust-example-rendered edition"><code><span class="kw">use</span> <span class="ident">std::fmt</span>;
|
||||
<span class="kw">use</span> <span class="ident">std::marker::PhantomData</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">serde::de</span>::{<span class="ident">Deserialize</span>, <span class="ident">DeserializeSeed</span>, <span class="ident">Deserializer</span>, <span class="ident">SeqAccess</span>, <span class="ident">Visitor</span>};
|
||||
|
||||
<span class="comment">// A DeserializeSeed implementation that uses stateful deserialization to</span>
|
||||
<span class="comment">// append array elements onto the end of an existing vector. The preexisting</span>
|
||||
<span class="comment">// state ("seed") in this case is the Vec<T>. The `deserialize` method of</span>
|
||||
<span class="comment">// `ExtendVec` will be traversing the inner arrays of the JSON input and</span>
|
||||
<span class="comment">// appending each integer into the existing Vec.</span>
|
||||
<span class="kw">struct</span> <span class="ident">ExtendVec</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="ident">T</span>: <span class="lifetime">'a</span><span class="op">></span>(<span class="kw-2">&</span><span class="lifetime">'a</span> <span class="kw-2">mut</span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>);
|
||||
|
||||
<span class="kw">impl</span><span class="op"><</span><span class="lifetime">'de</span>, <span class="lifetime">'a</span>, <span class="ident">T</span><span class="op">></span> <span class="ident">DeserializeSeed</span><span class="op"><</span><span class="lifetime">'de</span><span class="op">></span> <span class="kw">for</span> <span class="ident">ExtendVec</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="ident">T</span><span class="op">></span>
|
||||
<span class="kw">where</span>
|
||||
<span class="ident">T</span>: <span class="ident">Deserialize</span><span class="op"><</span><span class="lifetime">'de</span><span class="op">></span>,
|
||||
{
|
||||
<span class="comment">// The return type of the `deserialize` method. This implementation</span>
|
||||
<span class="comment">// appends onto an existing vector but does not create any new data</span>
|
||||
<span class="comment">// structure, so the return type is ().</span>
|
||||
<span class="kw">type</span> <span class="ident">Value</span> <span class="op">=</span> ();
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">deserialize</span><span class="op"><</span><span class="ident">D</span><span class="op">></span>(<span class="self">self</span>, <span class="ident">deserializer</span>: <span class="ident">D</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident"><span class="self">Self</span>::Value</span>, <span class="ident">D::Error</span><span class="op">></span>
|
||||
<span class="kw">where</span>
|
||||
<span class="ident">D</span>: <span class="ident">Deserializer</span><span class="op"><</span><span class="lifetime">'de</span><span class="op">></span>,
|
||||
{
|
||||
<span class="comment">// Visitor implementation that will walk an inner array of the JSON</span>
|
||||
<span class="comment">// input.</span>
|
||||
<span class="kw">struct</span> <span class="ident">ExtendVecVisitor</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="ident">T</span>: <span class="lifetime">'a</span><span class="op">></span>(<span class="kw-2">&</span><span class="lifetime">'a</span> <span class="kw-2">mut</span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>);
|
||||
|
||||
<span class="kw">impl</span><span class="op"><</span><span class="lifetime">'de</span>, <span class="lifetime">'a</span>, <span class="ident">T</span><span class="op">></span> <span class="ident">Visitor</span><span class="op"><</span><span class="lifetime">'de</span><span class="op">></span> <span class="kw">for</span> <span class="ident">ExtendVecVisitor</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="ident">T</span><span class="op">></span>
|
||||
<span class="kw">where</span>
|
||||
<span class="ident">T</span>: <span class="ident">Deserialize</span><span class="op"><</span><span class="lifetime">'de</span><span class="op">></span>,
|
||||
{
|
||||
<span class="kw">type</span> <span class="ident">Value</span> <span class="op">=</span> ();
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">expecting</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">formatter</span>: <span class="kw-2">&mut</span> <span class="ident">fmt::Formatter</span>) -> <span class="ident">fmt::Result</span> {
|
||||
<span class="macro">write!</span>(<span class="ident">formatter</span>, <span class="string">"an array of integers"</span>)
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">visit_seq</span><span class="op"><</span><span class="ident">A</span><span class="op">></span>(<span class="self">self</span>, <span class="kw-2">mut</span> <span class="ident">seq</span>: <span class="ident">A</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span>(), <span class="ident">A::Error</span><span class="op">></span>
|
||||
<span class="kw">where</span>
|
||||
<span class="ident">A</span>: <span class="ident">SeqAccess</span><span class="op"><</span><span class="lifetime">'de</span><span class="op">></span>,
|
||||
{
|
||||
<span class="comment">// Decrease the number of reallocations if there are many elements</span>
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">size_hint</span>) <span class="op">=</span> <span class="ident">seq</span>.<span class="ident">size_hint</span>() {
|
||||
<span class="self">self</span>.<span class="number">0</span>.<span class="ident">reserve</span>(<span class="ident">size_hint</span>);
|
||||
}
|
||||
|
||||
<span class="comment">// Visit each element in the inner array and push it onto</span>
|
||||
<span class="comment">// the existing vector.</span>
|
||||
<span class="kw">while</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">elem</span>) <span class="op">=</span> <span class="ident">seq</span>.<span class="ident">next_element</span>()<span class="question-mark">?</span> {
|
||||
<span class="self">self</span>.<span class="number">0</span>.<span class="ident">push</span>(<span class="ident">elem</span>);
|
||||
}
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
}
|
||||
|
||||
<span class="ident">deserializer</span>.<span class="ident">deserialize_seq</span>(<span class="ident">ExtendVecVisitor</span>(<span class="self">self</span>.<span class="number">0</span>))
|
||||
}
|
||||
}
|
||||
|
||||
<span class="comment">// Visitor implementation that will walk the outer array of the JSON input.</span>
|
||||
<span class="kw">struct</span> <span class="ident">FlattenedVecVisitor</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>(<span class="ident">PhantomData</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>);
|
||||
|
||||
<span class="kw">impl</span><span class="op"><</span><span class="lifetime">'de</span>, <span class="ident">T</span><span class="op">></span> <span class="ident">Visitor</span><span class="op"><</span><span class="lifetime">'de</span><span class="op">></span> <span class="kw">for</span> <span class="ident">FlattenedVecVisitor</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>
|
||||
<span class="kw">where</span>
|
||||
<span class="ident">T</span>: <span class="ident">Deserialize</span><span class="op"><</span><span class="lifetime">'de</span><span class="op">></span>,
|
||||
{
|
||||
<span class="comment">// This Visitor constructs a single Vec<T> to hold the flattened</span>
|
||||
<span class="comment">// contents of the inner arrays.</span>
|
||||
<span class="kw">type</span> <span class="ident">Value</span> <span class="op">=</span> <span class="ident">Vec</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>;
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">expecting</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">formatter</span>: <span class="kw-2">&mut</span> <span class="ident">fmt::Formatter</span>) -> <span class="ident">fmt::Result</span> {
|
||||
<span class="macro">write!</span>(<span class="ident">formatter</span>, <span class="string">"an array of arrays"</span>)
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">visit_seq</span><span class="op"><</span><span class="ident">A</span><span class="op">></span>(<span class="self">self</span>, <span class="kw-2">mut</span> <span class="ident">seq</span>: <span class="ident">A</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident">Vec</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>, <span class="ident">A::Error</span><span class="op">></span>
|
||||
<span class="kw">where</span>
|
||||
<span class="ident">A</span>: <span class="ident">SeqAccess</span><span class="op"><</span><span class="lifetime">'de</span><span class="op">></span>,
|
||||
{
|
||||
<span class="comment">// Create a single Vec to hold the flattened contents.</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">vec</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||
|
||||
<span class="comment">// Each iteration through this loop is one inner array.</span>
|
||||
<span class="kw">while</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(()) <span class="op">=</span> <span class="ident">seq</span>.<span class="ident">next_element_seed</span>(<span class="ident">ExtendVec</span>(<span class="kw-2">&mut</span> <span class="ident">vec</span>))<span class="question-mark">?</span> {
|
||||
<span class="comment">// Nothing to do; inner array has been appended into `vec`.</span>
|
||||
}
|
||||
|
||||
<span class="comment">// Return the finished vec.</span>
|
||||
<span class="prelude-val">Ok</span>(<span class="ident">vec</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="ident">visitor</span> <span class="op">=</span> <span class="ident">FlattenedVecVisitor</span>(<span class="ident">PhantomData</span>);
|
||||
<span class="kw">let</span> <span class="ident">flattened</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">u64</span><span class="op">></span> <span class="op">=</span> <span class="ident">deserializer</span>.<span class="ident">deserialize_seq</span>(<span class="ident">visitor</span>)<span class="question-mark">?</span>;</code></pre></div>
|
||||
</div></details><h2 id="required-associated-types" class="small-section-header">Required Associated Types<a href="#required-associated-types" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Value" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#771">source</a></div><h4 class="code-header">type <a href="#associatedtype.Value" class="associatedtype">Value</a></h4></div></summary><div class="docblock"><p>The type produced by using this seed.</p>
|
||||
</div></details></div><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" open><summary><div id="tymethod.deserialize" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#775-777">source</a></div><h4 class="code-header">fn <a href="#tymethod.deserialize" class="fnname">deserialize</a><D>(self, deserializer: D) -> <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><Self::<a class="associatedtype" href="trait.DeserializeSeed.html#associatedtype.Value" title="type serde::de::DeserializeSeed::Value">Value</a>, D::<a class="associatedtype" href="../trait.Deserializer.html#associatedtype.Error" title="type serde::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> D: <a class="trait" href="../trait.Deserializer.html" title="trait serde::Deserializer">Deserializer</a><'de>, </span></h4></div></summary><div class="docblock"><p>Equivalent to the more common <code>Deserialize::deserialize</code> method, except
|
||||
with some initial piece of data (the seed) passed in.</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-DeserializeSeed%3C%27de%3E-for-PhantomData%3CT%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#780-793">source</a></span><a href="#impl-DeserializeSeed%3C%27de%3E-for-PhantomData%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<'de, T> <a class="trait" href="trait.DeserializeSeed.html" title="trait serde::de::DeserializeSeed">DeserializeSeed</a><'de> for <a class="struct" href="https://doc.rust-lang.org/1.64.0/core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a><T> <span class="where fmt-newline">where<br> T: <a class="trait" href="../trait.Deserialize.html" title="trait serde::Deserialize">Deserialize</a><'de>, </span></h3></section></summary><div class="impl-items"><section id="associatedtype.Value-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Value-1" class="anchor"></a><h4 class="code-header">type <a href="#associatedtype.Value" class="associatedtype">Value</a> = T</h4></section><section id="method.deserialize" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#787-792">source</a></span><a href="#method.deserialize" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.deserialize" class="fnname">deserialize</a><D>(self, deserializer: D) -> <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, D::<a class="associatedtype" href="../trait.Deserializer.html#associatedtype.Error" title="type serde::Deserializer::Error">Error</a>> <span class="where fmt-newline">where<br> D: <a class="trait" href="../trait.Deserializer.html" title="trait serde::Deserializer">Deserializer</a><'de>, </span></h4></section></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"></div><script type="text/javascript" src="../../implementors/serde/de/trait.DeserializeSeed.js" data-ignore-extern-crates="core" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="serde" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>
|
||||
294
doc/serde/de/trait.Deserializer.html
Normal file
294
doc/serde/de/trait.Deserializer.html
Normal file
File diff suppressed because one or more lines are too long
29
doc/serde/de/trait.EnumAccess.html
Normal file
29
doc/serde/de/trait.EnumAccess.html
Normal file
File diff suppressed because one or more lines are too long
75
doc/serde/de/trait.Error.html
Normal file
75
doc/serde/de/trait.Error.html
Normal file
File diff suppressed because one or more lines are too long
26
doc/serde/de/trait.Expected.html
Normal file
26
doc/serde/de/trait.Expected.html
Normal file
@ -0,0 +1,26 @@
|
||||
<!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="`Expected` represents an explanation of what data a `Visitor` was expecting to receive."><meta name="keywords" content="rust, rustlang, rust-lang, Expected"><title>Expected in serde::de - 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" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" 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">☰</button><a class="sidebar-logo" href="../../serde/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../serde/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Expected</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.fmt">fmt</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul><li><a href="#impl-Expected-for-%26%27a%20str">&'a str</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Display-for-dyn%20Expected%20+%20%27a">Display</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In serde::de</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../serde/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><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"><button type="button">?</button></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></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Trait <a href="../index.html">serde</a>::<wbr><a href="index.html">de</a>::<wbr><a class="trait" href="#">Expected</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></span></h1><span class="out-of-band"><a class="srclink" href="../../src/serde/de/mod.rs.html#471-475">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Expected {
|
||||
fn <a href="#tymethod.fmt" class="fnname">fmt</a>(&self, formatter: &mut <a class="struct" href="https://doc.rust-lang.org/1.64.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.64.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a>;
|
||||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>Expected</code> represents an explanation of what data a <code>Visitor</code> was expecting
|
||||
to receive.</p>
|
||||
<p>This is used as an argument to the <code>invalid_type</code>, <code>invalid_value</code>, and
|
||||
<code>invalid_length</code> methods of the <code>Error</code> trait to build error messages. The
|
||||
message should be a noun or noun phrase that completes the sentence “This
|
||||
Visitor expects to receive …”, for example the message could be “an
|
||||
integer between 0 and 64”. The message should not be capitalized and should
|
||||
not end with a period.</p>
|
||||
<p>Within the context of a <code>Visitor</code> implementation, the <code>Visitor</code> itself
|
||||
(<code>&self</code>) is an implementation of this trait.</p>
|
||||
|
||||
<div class='information'><div class='tooltip edition' data-edition="2018">ⓘ</div></div><div class="example-wrap"><pre class="rust rust-example-rendered edition"><code><span class="kw">fn</span> <span class="ident">visit_bool</span><span class="op"><</span><span class="ident">E</span><span class="op">></span>(<span class="self">self</span>, <span class="ident">v</span>: <span class="ident">bool</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="ident"><span class="self">Self</span>::Value</span>, <span class="ident">E</span><span class="op">></span>
|
||||
<span class="kw">where</span>
|
||||
<span class="ident">E</span>: <span class="ident">de::Error</span>,
|
||||
{
|
||||
<span class="prelude-val">Err</span>(<span class="ident">de::Error::invalid_type</span>(<span class="ident">Unexpected::Bool</span>(<span class="ident">v</span>), <span class="kw-2">&</span><span class="self">self</span>))
|
||||
}</code></pre></div>
|
||||
<p>Outside of a <code>Visitor</code>, <code>&"..."</code> can be used.</p>
|
||||
|
||||
<div class='information'><div class='tooltip edition' data-edition="2018">ⓘ</div></div><div class="example-wrap"><pre class="rust rust-example-rendered edition"><code><span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">de::Error::invalid_type</span>(<span class="ident">Unexpected::Bool</span>(<span class="ident">v</span>), <span class="kw-2">&</span><span class="string">"a negative integer"</span>));</code></pre></div>
|
||||
</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" open><summary><div id="tymethod.fmt" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#474">source</a></div><h4 class="code-header">fn <a href="#tymethod.fmt" class="fnname">fmt</a>(&self, formatter: &mut <a class="struct" href="https://doc.rust-lang.org/1.64.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.64.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></div></summary><div class="docblock"><p>Format an explanation of what data was being expected. Same signature as
|
||||
the <code>Display</code> and <code>Debug</code> traits.</p>
|
||||
</div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Display-for-dyn%20Expected%20+%20%27a" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#492-496">source</a></span><a href="#impl-Display-for-dyn%20Expected%20+%20%27a" class="anchor"></a><h3 class="code-header in-band">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for dyn <a class="trait" href="trait.Expected.html" title="trait serde::de::Expected">Expected</a> + 'a</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#493-495">source</a></span><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.64.0/core/fmt/trait.Display.html#tymethod.fmt" class="fnname">fmt</a>(&self, formatter: &mut <a class="struct" href="https://doc.rust-lang.org/1.64.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.64.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.64.0/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
|
||||
</div></details></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-Expected-for-%26%27a%20str" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#486-490">source</a></span><a href="#impl-Expected-for-%26%27a%20str" class="anchor"></a><h3 class="code-header in-band">impl<'a> <a class="trait" href="trait.Expected.html" title="trait serde::de::Expected">Expected</a> for &'a <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.str.html">str</a></h3></section></summary><div class="impl-items"><section id="method.fmt-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#487-489">source</a></span><a href="#method.fmt-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.fmt" class="fnname">fmt</a>(&self, formatter: &mut <a class="struct" href="https://doc.rust-lang.org/1.64.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a><'_>) -> <a class="type" href="https://doc.rust-lang.org/1.64.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><section id="impl-Expected-for-T" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#477-484">source</a></span><a href="#impl-Expected-for-T" class="anchor"></a><h3 class="code-header in-band">impl<'de, T> <a class="trait" href="trait.Expected.html" title="trait serde::de::Expected">Expected</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="trait.Visitor.html" title="trait serde::de::Visitor">Visitor</a><'de>, </span></h3></section></div><script type="text/javascript" src="../../implementors/serde/de/trait.Expected.js" data-ignore-extern-crates="std" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="serde" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>
|
||||
31
doc/serde/de/trait.IntoDeserializer.html
Normal file
31
doc/serde/de/trait.IntoDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
58
doc/serde/de/trait.MapAccess.html
Normal file
58
doc/serde/de/trait.MapAccess.html
Normal file
File diff suppressed because one or more lines are too long
30
doc/serde/de/trait.SeqAccess.html
Normal file
30
doc/serde/de/trait.SeqAccess.html
Normal file
File diff suppressed because one or more lines are too long
84
doc/serde/de/trait.VariantAccess.html
Normal file
84
doc/serde/de/trait.VariantAccess.html
Normal file
File diff suppressed because one or more lines are too long
203
doc/serde/de/trait.Visitor.html
Normal file
203
doc/serde/de/trait.Visitor.html
Normal file
File diff suppressed because one or more lines are too long
68
doc/serde/de/value/index.html
Normal file
68
doc/serde/de/value/index.html
Normal file
@ -0,0 +1,68 @@
|
||||
<!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="Building blocks for deserializing basic values using the `IntoDeserializer` trait."><meta name="keywords" content="rust, rustlang, rust-lang, value"><title>serde::de::value - 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" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.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 mod"><!--[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">☰</button><a class="sidebar-logo" href="../../../serde/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../../serde/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module value</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../serde/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><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"><button type="button">?</button></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></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">serde</a>::<wbr><a href="../index.html">de</a>::<wbr><a class="mod" href="#">value</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></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/serde/de/value.rs.html#1-1714">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Building blocks for deserializing basic values using the <code>IntoDeserializer</code>
|
||||
trait.</p>
|
||||
|
||||
<div class='information'><div class='tooltip edition' data-edition="2018">ⓘ</div></div><div class="example-wrap"><pre class="rust rust-example-rendered edition"><code><span class="kw">use</span> <span class="ident">std::str::FromStr</span>;
|
||||
<span class="kw">use</span> <span class="ident">serde::Deserialize</span>;
|
||||
<span class="kw">use</span> <span class="ident">serde::de</span>::{<span class="ident">value</span>, <span class="ident">IntoDeserializer</span>};
|
||||
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Deserialize</span>)]</span>
|
||||
<span class="kw">enum</span> <span class="ident">Setting</span> {
|
||||
<span class="ident">On</span>,
|
||||
<span class="ident">Off</span>,
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">FromStr</span> <span class="kw">for</span> <span class="ident">Setting</span> {
|
||||
<span class="kw">type</span> <span class="prelude-val">Err</span> <span class="op">=</span> <span class="ident">value::Error</span>;
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">from_str</span>(<span class="ident">s</span>: <span class="kw-2">&</span><span class="ident">str</span>) -> <span class="prelude-ty">Result</span><span class="op"><</span><span class="self">Self</span>, <span class="ident"><span class="self">Self</span>::Err</span><span class="op">></span> {
|
||||
<span class="ident"><span class="self">Self</span>::deserialize</span>(<span class="ident">s</span>.<span class="ident">into_deserializer</span>())
|
||||
}
|
||||
}</code></pre></div>
|
||||
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.BoolDeserializer.html" title="serde::de::value::BoolDeserializer struct">BoolDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
a <code>bool</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.BorrowedBytesDeserializer.html" title="serde::de::value::BorrowedBytesDeserializer struct">BorrowedBytesDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding a <code>&[u8]</code> with a lifetime tied to another
|
||||
deserializer. Always calls <a href="../trait.Visitor.html#method.visit_borrowed_bytes" title="Visitor::visit_borrowed_bytes"><code>Visitor::visit_borrowed_bytes</code></a>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.BorrowedStrDeserializer.html" title="serde::de::value::BorrowedStrDeserializer struct">BorrowedStrDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding a <code>&str</code> with a lifetime tied to another
|
||||
deserializer.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.BytesDeserializer.html" title="serde::de::value::BytesDeserializer struct">BytesDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding a <code>&[u8]</code>. Always calls <a href="../trait.Visitor.html#method.visit_bytes" title="Visitor::visit_bytes"><code>Visitor::visit_bytes</code></a>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.CharDeserializer.html" title="serde::de::value::CharDeserializer struct">CharDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
a <code>char</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.CowStrDeserializer.html" title="serde::de::value::CowStrDeserializer struct">CowStrDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding a <code>Cow<str></code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.EnumAccessDeserializer.html" title="serde::de::value::EnumAccessDeserializer struct">EnumAccessDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding an <code>EnumAccess</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Error.html" title="serde::de::value::Error struct">Error</a></div><div class="item-right docblock-short"><p>A minimal representation of all possible errors that can occur using the
|
||||
<code>IntoDeserializer</code> trait.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.F32Deserializer.html" title="serde::de::value::F32Deserializer struct">F32Deserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
an <code>f32</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.F64Deserializer.html" title="serde::de::value::F64Deserializer struct">F64Deserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
an <code>f64</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.I8Deserializer.html" title="serde::de::value::I8Deserializer struct">I8Deserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
an <code>i8</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.I16Deserializer.html" title="serde::de::value::I16Deserializer struct">I16Deserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
an <code>i16</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.I32Deserializer.html" title="serde::de::value::I32Deserializer struct">I32Deserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
an <code>i32</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.I64Deserializer.html" title="serde::de::value::I64Deserializer struct">I64Deserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
an <code>i64</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.I128Deserializer.html" title="serde::de::value::I128Deserializer struct">I128Deserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
an <code>i128</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.IsizeDeserializer.html" title="serde::de::value::IsizeDeserializer struct">IsizeDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
an <code>isize</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.MapAccessDeserializer.html" title="serde::de::value::MapAccessDeserializer struct">MapAccessDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding a <code>MapAccess</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.MapDeserializer.html" title="serde::de::value::MapDeserializer struct">MapDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer that iterates over a map.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.SeqAccessDeserializer.html" title="serde::de::value::SeqAccessDeserializer struct">SeqAccessDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding a <code>SeqAccess</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.SeqDeserializer.html" title="serde::de::value::SeqDeserializer struct">SeqDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer that iterates over a sequence.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.StrDeserializer.html" title="serde::de::value::StrDeserializer struct">StrDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding a <code>&str</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.StringDeserializer.html" title="serde::de::value::StringDeserializer struct">StringDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding a <code>String</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.U8Deserializer.html" title="serde::de::value::U8Deserializer struct">U8Deserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
a <code>u8</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.U16Deserializer.html" title="serde::de::value::U16Deserializer struct">U16Deserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
a <code>u16</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.U32Deserializer.html" title="serde::de::value::U32Deserializer struct">U32Deserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding a <code>u32</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.U64Deserializer.html" title="serde::de::value::U64Deserializer struct">U64Deserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
a <code>u64</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.U128Deserializer.html" title="serde::de::value::U128Deserializer struct">U128Deserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
a <code>u128</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.UnitDeserializer.html" title="serde::de::value::UnitDeserializer struct">UnitDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding a <code>()</code>.</p>
|
||||
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.UsizeDeserializer.html" title="serde::de::value::UsizeDeserializer struct">UsizeDeserializer</a></div><div class="item-right docblock-short"><p>A deserializer holding
|
||||
a <code>usize</code>.</p>
|
||||
</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="serde" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>
|
||||
1
doc/serde/de/value/sidebar-items.js
Normal file
1
doc/serde/de/value/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
window.SIDEBAR_ITEMS = {"struct":[["BoolDeserializer","A deserializer holding a `bool`."],["BorrowedBytesDeserializer","A deserializer holding a `&[u8]` with a lifetime tied to another deserializer. Always calls [`Visitor::visit_borrowed_bytes`]."],["BorrowedStrDeserializer","A deserializer holding a `&str` with a lifetime tied to another deserializer."],["BytesDeserializer","A deserializer holding a `&[u8]`. Always calls [`Visitor::visit_bytes`]."],["CharDeserializer","A deserializer holding a `char`."],["CowStrDeserializer","A deserializer holding a `Cow<str>`."],["EnumAccessDeserializer","A deserializer holding an `EnumAccess`."],["Error","A minimal representation of all possible errors that can occur using the `IntoDeserializer` trait."],["F32Deserializer","A deserializer holding an `f32`."],["F64Deserializer","A deserializer holding an `f64`."],["I128Deserializer","A deserializer holding an `i128`."],["I16Deserializer","A deserializer holding an `i16`."],["I32Deserializer","A deserializer holding an `i32`."],["I64Deserializer","A deserializer holding an `i64`."],["I8Deserializer","A deserializer holding an `i8`."],["IsizeDeserializer","A deserializer holding an `isize`."],["MapAccessDeserializer","A deserializer holding a `MapAccess`."],["MapDeserializer","A deserializer that iterates over a map."],["SeqAccessDeserializer","A deserializer holding a `SeqAccess`."],["SeqDeserializer","A deserializer that iterates over a sequence."],["StrDeserializer","A deserializer holding a `&str`."],["StringDeserializer","A deserializer holding a `String`."],["U128Deserializer","A deserializer holding a `u128`."],["U16Deserializer","A deserializer holding a `u16`."],["U32Deserializer","A deserializer holding a `u32`."],["U64Deserializer","A deserializer holding a `u64`."],["U8Deserializer","A deserializer holding a `u8`."],["UnitDeserializer","A deserializer holding a `()`."],["UsizeDeserializer","A deserializer holding a `usize`."]]};
|
||||
72
doc/serde/de/value/struct.BoolDeserializer.html
Normal file
72
doc/serde/de/value/struct.BoolDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
73
doc/serde/de/value/struct.BorrowedBytesDeserializer.html
Normal file
73
doc/serde/de/value/struct.BorrowedBytesDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
79
doc/serde/de/value/struct.BorrowedStrDeserializer.html
Normal file
79
doc/serde/de/value/struct.BorrowedStrDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.BytesDeserializer.html
Normal file
72
doc/serde/de/value/struct.BytesDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.CharDeserializer.html
Normal file
72
doc/serde/de/value/struct.CharDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
77
doc/serde/de/value/struct.CowStrDeserializer.html
Normal file
77
doc/serde/de/value/struct.CowStrDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.EnumAccessDeserializer.html
Normal file
72
doc/serde/de/value/struct.EnumAccessDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
47
doc/serde/de/value/struct.Error.html
Normal file
47
doc/serde/de/value/struct.Error.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.F32Deserializer.html
Normal file
72
doc/serde/de/value/struct.F32Deserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.F64Deserializer.html
Normal file
72
doc/serde/de/value/struct.F64Deserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.I128Deserializer.html
Normal file
72
doc/serde/de/value/struct.I128Deserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.I16Deserializer.html
Normal file
72
doc/serde/de/value/struct.I16Deserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.I32Deserializer.html
Normal file
72
doc/serde/de/value/struct.I32Deserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.I64Deserializer.html
Normal file
72
doc/serde/de/value/struct.I64Deserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.I8Deserializer.html
Normal file
72
doc/serde/de/value/struct.I8Deserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.IsizeDeserializer.html
Normal file
72
doc/serde/de/value/struct.IsizeDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
78
doc/serde/de/value/struct.MapAccessDeserializer.html
Normal file
78
doc/serde/de/value/struct.MapAccessDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
94
doc/serde/de/value/struct.MapDeserializer.html
Normal file
94
doc/serde/de/value/struct.MapDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.SeqAccessDeserializer.html
Normal file
72
doc/serde/de/value/struct.SeqAccessDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
81
doc/serde/de/value/struct.SeqDeserializer.html
Normal file
81
doc/serde/de/value/struct.SeqDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
77
doc/serde/de/value/struct.StrDeserializer.html
Normal file
77
doc/serde/de/value/struct.StrDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
77
doc/serde/de/value/struct.StringDeserializer.html
Normal file
77
doc/serde/de/value/struct.StringDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.U128Deserializer.html
Normal file
72
doc/serde/de/value/struct.U128Deserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.U16Deserializer.html
Normal file
72
doc/serde/de/value/struct.U16Deserializer.html
Normal file
File diff suppressed because one or more lines are too long
77
doc/serde/de/value/struct.U32Deserializer.html
Normal file
77
doc/serde/de/value/struct.U32Deserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.U64Deserializer.html
Normal file
72
doc/serde/de/value/struct.U64Deserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.U8Deserializer.html
Normal file
72
doc/serde/de/value/struct.U8Deserializer.html
Normal file
File diff suppressed because one or more lines are too long
71
doc/serde/de/value/struct.UnitDeserializer.html
Normal file
71
doc/serde/de/value/struct.UnitDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
72
doc/serde/de/value/struct.UsizeDeserializer.html
Normal file
72
doc/serde/de/value/struct.UsizeDeserializer.html
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user