ssw/doc/serde/de/trait.Visitor.html
2023-01-09 19:23:20 +01:00

203 lines
63 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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="This trait represents a visitor that walks through a deserializer."><meta name="keywords" content="rust, rustlang, rust-lang, Visitor"><title>Visitor 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">&#9776;</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="#">Visitor</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.expecting">expecting</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#provided-methods">Provided Methods</a></h3><ul><li><a href="#method.visit_bool">visit_bool</a></li><li><a href="#method.visit_borrowed_bytes">visit_borrowed_bytes</a></li><li><a href="#method.visit_borrowed_str">visit_borrowed_str</a></li><li><a href="#method.visit_byte_buf">visit_byte_buf</a></li><li><a href="#method.visit_bytes">visit_bytes</a></li><li><a href="#method.visit_char">visit_char</a></li><li><a href="#method.visit_enum">visit_enum</a></li><li><a href="#method.visit_f32">visit_f32</a></li><li><a href="#method.visit_f64">visit_f64</a></li><li><a href="#method.visit_i128">visit_i128</a></li><li><a href="#method.visit_i16">visit_i16</a></li><li><a href="#method.visit_i32">visit_i32</a></li><li><a href="#method.visit_i64">visit_i64</a></li><li><a href="#method.visit_i8">visit_i8</a></li><li><a href="#method.visit_map">visit_map</a></li><li><a href="#method.visit_newtype_struct">visit_newtype_struct</a></li><li><a href="#method.visit_none">visit_none</a></li><li><a href="#method.visit_seq">visit_seq</a></li><li><a href="#method.visit_some">visit_some</a></li><li><a href="#method.visit_str">visit_str</a></li><li><a href="#method.visit_string">visit_string</a></li><li><a href="#method.visit_u128">visit_u128</a></li><li><a href="#method.visit_u16">visit_u16</a></li><li><a href="#method.visit_u32">visit_u32</a></li><li><a href="#method.visit_u64">visit_u64</a></li><li><a href="#method.visit_u8">visit_u8</a></li><li><a href="#method.visit_unit">visit_unit</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="#">Visitor</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#1282-1684">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Visitor&lt;'de&gt;: <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>;
<details class="rustdoc-toggle type-contents-toggle"><summary class="hideme"><span>Show 28 methods</span></summary> fn <a href="#tymethod.expecting" class="fnname">expecting</a>(&amp;self, formatter: &amp;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>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.64.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a>;
fn <a href="#method.visit_bool" class="fnname">visit_bool</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.bool.html">bool</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_i8" class="fnname">visit_i8</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.i8.html">i8</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_i16" class="fnname">visit_i16</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.i16.html">i16</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_i32" class="fnname">visit_i32</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.i32.html">i32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_i64" class="fnname">visit_i64</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.i64.html">i64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_i128" class="fnname">visit_i128</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.i128.html">i128</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_u8" class="fnname">visit_u8</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_u16" class="fnname">visit_u16</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u16.html">u16</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_u32" class="fnname">visit_u32</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_u64" class="fnname">visit_u64</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u64.html">u64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_u128" class="fnname">visit_u128</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u128.html">u128</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_f32" class="fnname">visit_f32</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.f32.html">f32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_f64" class="fnname">visit_f64</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.f64.html">f64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_char" class="fnname">visit_char</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.char.html">char</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_str" class="fnname">visit_str</a>&lt;E&gt;(self, v: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_borrowed_str" class="fnname">visit_borrowed_str</a>&lt;E&gt;(self, v: &amp;'de <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_string" class="fnname">visit_string</a>&lt;E&gt;(self, v: <a class="struct" href="https://doc.rust-lang.org/1.64.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_bytes" class="fnname">visit_bytes</a>&lt;E&gt;(self, v: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_borrowed_bytes" class="fnname">visit_borrowed_bytes</a>&lt;E&gt;(self, v: &amp;'de [<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_byte_buf" class="fnname">visit_byte_buf</a>&lt;E&gt;(self, v: <a class="struct" href="https://doc.rust-lang.org/1.64.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_none" class="fnname">visit_none</a>&lt;E&gt;(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_some" class="fnname">visit_some</a>&lt;D&gt;(self, deserializer: D) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, D::<a class="associatedtype" href="../trait.Deserializer.html#associatedtype.Error" title="type serde::Deserializer::Error">Error</a>&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;D: <a class="trait" href="../trait.Deserializer.html" title="trait serde::Deserializer">Deserializer</a>&lt;'de&gt;</span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_unit" class="fnname">visit_unit</a>&lt;E&gt;(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_newtype_struct" class="fnname">visit_newtype_struct</a>&lt;D&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;deserializer: D<br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, D::<a class="associatedtype" href="../trait.Deserializer.html#associatedtype.Error" title="type serde::Deserializer::Error">Error</a>&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;D: <a class="trait" href="../trait.Deserializer.html" title="trait serde::Deserializer">Deserializer</a>&lt;'de&gt;</span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_seq" class="fnname">visit_seq</a>&lt;A&gt;(self, seq: A) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, A::<a class="associatedtype" href="trait.SeqAccess.html#associatedtype.Error" title="type serde::de::SeqAccess::Error">Error</a>&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A: <a class="trait" href="trait.SeqAccess.html" title="trait serde::de::SeqAccess">SeqAccess</a>&lt;'de&gt;</span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_map" class="fnname">visit_map</a>&lt;A&gt;(self, map: A) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, A::<a class="associatedtype" href="trait.MapAccess.html#associatedtype.Error" title="type serde::de::MapAccess::Error">Error</a>&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A: <a class="trait" href="trait.MapAccess.html" title="trait serde::de::MapAccess">MapAccess</a>&lt;'de&gt;</span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.visit_enum" class="fnname">visit_enum</a>&lt;A&gt;(self, data: A) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, A::<a class="associatedtype" href="trait.EnumAccess.html#associatedtype.Error" title="type serde::de::EnumAccess::Error">Error</a>&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A: <a class="trait" href="trait.EnumAccess.html" title="trait serde::de::EnumAccess">EnumAccess</a>&lt;'de&gt;</span>,
{ ... }
</details>}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This trait represents a visitor that walks through a deserializer.</p>
<h2 id="lifetime"><a href="#lifetime">Lifetime</a></h2>
<p>The <code>'de</code> lifetime of this trait is the requirement for lifetime of data
that may be borrowed by <code>Self::Value</code>. 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>
<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="doccomment">/// A visitor that deserializes a long string - a string containing at least</span>
<span class="doccomment">/// some minimum number of bytes.</span>
<span class="kw">struct</span> <span class="ident">LongString</span> {
<span class="ident">min</span>: <span class="ident">usize</span>,
}
<span class="kw">impl</span><span class="op">&lt;</span><span class="lifetime">&#39;de</span><span class="op">&gt;</span> <span class="ident">Visitor</span><span class="op">&lt;</span><span class="lifetime">&#39;de</span><span class="op">&gt;</span> <span class="kw">for</span> <span class="ident">LongString</span> {
<span class="kw">type</span> <span class="ident">Value</span> <span class="op">=</span> <span class="ident">String</span>;
<span class="kw">fn</span> <span class="ident">expecting</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">formatter</span>: <span class="kw-2">&amp;mut</span> <span class="ident">fmt::Formatter</span>) -&gt; <span class="ident">fmt::Result</span> {
<span class="macro">write!</span>(<span class="ident">formatter</span>, <span class="string">&quot;a string containing at least {} bytes&quot;</span>, <span class="self">self</span>.<span class="ident">min</span>)
}
<span class="kw">fn</span> <span class="ident">visit_str</span><span class="op">&lt;</span><span class="ident">E</span><span class="op">&gt;</span>(<span class="self">self</span>, <span class="ident">s</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>) -&gt; <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident"><span class="self">Self</span>::Value</span>, <span class="ident">E</span><span class="op">&gt;</span>
<span class="kw">where</span>
<span class="ident">E</span>: <span class="ident">de::Error</span>,
{
<span class="kw">if</span> <span class="ident">s</span>.<span class="ident">len</span>() <span class="op">&gt;</span><span class="op">=</span> <span class="self">self</span>.<span class="ident">min</span> {
<span class="prelude-val">Ok</span>(<span class="ident">s</span>.<span class="ident">to_owned</span>())
} <span class="kw">else</span> {
<span class="prelude-val">Err</span>(<span class="ident">de::Error::invalid_value</span>(<span class="ident">Unexpected::Str</span>(<span class="ident">s</span>), <span class="kw-2">&amp;</span><span class="self">self</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#1284">source</a></div><h4 class="code-header">type <a href="#associatedtype.Value" class="associatedtype">Value</a></h4></div></summary><div class="docblock"><p>The value produced by this visitor.</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.expecting" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1308">source</a></div><h4 class="code-header">fn <a href="#tymethod.expecting" class="fnname">expecting</a>(&amp;self, formatter: &amp;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>&lt;'_&gt;) -&gt; <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 a message stating what data this Visitor expects to receive.</p>
<p>This is used in error messages. The message should complete 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>
<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">expecting</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">formatter</span>: <span class="kw-2">&amp;mut</span> <span class="ident">fmt::Formatter</span>) -&gt; <span class="ident">fmt::Result</span> {
<span class="macro">write!</span>(<span class="ident">formatter</span>, <span class="string">&quot;an integer between 0 and {}&quot;</span>, <span class="self">self</span>.<span class="ident">max</span>)
}</code></pre></div>
</div></details></div><h2 id="provided-methods" class="small-section-header">Provided Methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="method.visit_bool" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1313-1318">source</a></div><h4 class="code-header">fn <a href="#method.visit_bool" class="fnname">visit_bool</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.bool.html">bool</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a boolean.</p>
<p>The default implementation fails with a type error.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_i8" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1325-1330">source</a></div><h4 class="code-header">fn <a href="#method.visit_i8" class="fnname">visit_i8</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.i8.html">i8</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains an <code>i8</code>.</p>
<p>The default implementation forwards to <a href="#method.visit_i64"><code>visit_i64</code></a>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_i16" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1337-1342">source</a></div><h4 class="code-header">fn <a href="#method.visit_i16" class="fnname">visit_i16</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.i16.html">i16</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains an <code>i16</code>.</p>
<p>The default implementation forwards to <a href="#method.visit_i64"><code>visit_i64</code></a>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_i32" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1349-1354">source</a></div><h4 class="code-header">fn <a href="#method.visit_i32" class="fnname">visit_i32</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.i32.html">i32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains an <code>i32</code>.</p>
<p>The default implementation forwards to <a href="#method.visit_i64"><code>visit_i64</code></a>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_i64" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1359-1364">source</a></div><h4 class="code-header">fn <a href="#method.visit_i64" class="fnname">visit_i64</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.i64.html">i64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains an <code>i64</code>.</p>
<p>The default implementation fails with a type error.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_i128" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1371-1379">source</a></div><h4 class="code-header">fn <a href="#method.visit_i128" class="fnname">visit_i128</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.i128.html">i128</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a <code>i128</code>.</p>
<p>This method is available only on Rust compiler versions &gt;=1.26. The
default implementation fails with a type error.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_u8" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1387-1392">source</a></div><h4 class="code-header">fn <a href="#method.visit_u8" class="fnname">visit_u8</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a <code>u8</code>.</p>
<p>The default implementation forwards to <a href="#method.visit_u64"><code>visit_u64</code></a>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_u16" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1399-1404">source</a></div><h4 class="code-header">fn <a href="#method.visit_u16" class="fnname">visit_u16</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u16.html">u16</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a <code>u16</code>.</p>
<p>The default implementation forwards to <a href="#method.visit_u64"><code>visit_u64</code></a>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_u32" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1411-1416">source</a></div><h4 class="code-header">fn <a href="#method.visit_u32" class="fnname">visit_u32</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a <code>u32</code>.</p>
<p>The default implementation forwards to <a href="#method.visit_u64"><code>visit_u64</code></a>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_u64" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1421-1426">source</a></div><h4 class="code-header">fn <a href="#method.visit_u64" class="fnname">visit_u64</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u64.html">u64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a <code>u64</code>.</p>
<p>The default implementation fails with a type error.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_u128" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1433-1441">source</a></div><h4 class="code-header">fn <a href="#method.visit_u128" class="fnname">visit_u128</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u128.html">u128</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a <code>u128</code>.</p>
<p>This method is available only on Rust compiler versions &gt;=1.26. The
default implementation fails with a type error.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_f32" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1449-1454">source</a></div><h4 class="code-header">fn <a href="#method.visit_f32" class="fnname">visit_f32</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.f32.html">f32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains an <code>f32</code>.</p>
<p>The default implementation forwards to <a href="#method.visit_f64"><code>visit_f64</code></a>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_f64" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1459-1464">source</a></div><h4 class="code-header">fn <a href="#method.visit_f64" class="fnname">visit_f64</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.f64.html">f64</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains an <code>f64</code>.</p>
<p>The default implementation fails with a type error.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_char" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1473-1478">source</a></div><h4 class="code-header">fn <a href="#method.visit_char" class="fnname">visit_char</a>&lt;E&gt;(self, v: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.char.html">char</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a <code>char</code>.</p>
<p>The default implementation forwards to <a href="#method.visit_str"><code>visit_str</code></a> as a one-character
string.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_str" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1491-1496">source</a></div><h4 class="code-header">fn <a href="#method.visit_str" class="fnname">visit_str</a>&lt;E&gt;(self, v: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a string. The lifetime of the string is ephemeral and
it may be destroyed after this method returns.</p>
<p>This method allows the <code>Deserializer</code> to avoid a copy by retaining
ownership of any buffered data. <code>Deserialize</code> implementations that do
not benefit from taking ownership of <code>String</code> data should indicate that
to the deserializer by using <code>Deserializer::deserialize_str</code> rather than
<code>Deserializer::deserialize_string</code>.</p>
<p>It is never correct to implement <code>visit_string</code> without implementing
<code>visit_str</code>. Implement neither, both, or just <code>visit_str</code>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_borrowed_str" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1508-1513">source</a></div><h4 class="code-header">fn <a href="#method.visit_borrowed_str" class="fnname">visit_borrowed_str</a>&lt;E&gt;(self, v: &amp;'de <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a string that lives at least as long as the
<code>Deserializer</code>.</p>
<p>This enables zero-copy deserialization of strings in some formats. For
example JSON input containing the JSON string <code>&quot;borrowed&quot;</code> can be
deserialized with zero copying into a <code>&amp;'a str</code> as long as the input
data outlives <code>'a</code>.</p>
<p>The default implementation forwards to <code>visit_str</code>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_string" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1532-1537">source</a></div><h4 class="code-header">fn <a href="#method.visit_string" class="fnname">visit_string</a>&lt;E&gt;(self, v: <a class="struct" href="https://doc.rust-lang.org/1.64.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a string and ownership of the string is being given
to the <code>Visitor</code>.</p>
<p>This method allows the <code>Visitor</code> to avoid a copy by taking ownership of
a string created by the <code>Deserializer</code>. <code>Deserialize</code> implementations
that benefit from taking ownership of <code>String</code> data should indicate that
to the deserializer by using <code>Deserializer::deserialize_string</code> rather
than <code>Deserializer::deserialize_str</code>, although not every deserializer
will honor such a request.</p>
<p>It is never correct to implement <code>visit_string</code> without implementing
<code>visit_str</code>. Implement neither, both, or just <code>visit_str</code>.</p>
<p>The default implementation forwards to <code>visit_str</code> and then drops the
<code>String</code>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_bytes" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1550-1556">source</a></div><h4 class="code-header">fn <a href="#method.visit_bytes" class="fnname">visit_bytes</a>&lt;E&gt;(self, v: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a byte array. The lifetime of the byte array is
ephemeral and it may be destroyed after this method returns.</p>
<p>This method allows the <code>Deserializer</code> to avoid a copy by retaining
ownership of any buffered data. <code>Deserialize</code> implementations that do
not benefit from taking ownership of <code>Vec&lt;u8&gt;</code> data should indicate that
to the deserializer by using <code>Deserializer::deserialize_bytes</code> rather
than <code>Deserializer::deserialize_byte_buf</code>.</p>
<p>It is never correct to implement <code>visit_byte_buf</code> without implementing
<code>visit_bytes</code>. Implement neither, both, or just <code>visit_bytes</code>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_borrowed_bytes" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1567-1572">source</a></div><h4 class="code-header">fn <a href="#method.visit_borrowed_bytes" class="fnname">visit_borrowed_bytes</a>&lt;E&gt;(self, v: &amp;'de [<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a byte array that lives at least as long as the
<code>Deserializer</code>.</p>
<p>This enables zero-copy deserialization of bytes in some formats. For
example Postcard data containing bytes can be deserialized with zero
copying into a <code>&amp;'a [u8]</code> as long as the input data outlives <code>'a</code>.</p>
<p>The default implementation forwards to <code>visit_bytes</code>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_byte_buf" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1591-1596">source</a></div><h4 class="code-header">fn <a href="#method.visit_byte_buf" class="fnname">visit_byte_buf</a>&lt;E&gt;(self, v: <a class="struct" href="https://doc.rust-lang.org/1.64.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>&gt;) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a byte array and ownership of the byte array is being
given to the <code>Visitor</code>.</p>
<p>This method allows the <code>Visitor</code> to avoid a copy by taking ownership of
a byte buffer created by the <code>Deserializer</code>. <code>Deserialize</code>
implementations that benefit from taking ownership of <code>Vec&lt;u8&gt;</code> data
should indicate that to the deserializer by using
<code>Deserializer::deserialize_byte_buf</code> rather than
<code>Deserializer::deserialize_bytes</code>, although not every deserializer will
honor such a request.</p>
<p>It is never correct to implement <code>visit_byte_buf</code> without implementing
<code>visit_bytes</code>. Implement neither, both, or just <code>visit_bytes</code>.</p>
<p>The default implementation forwards to <code>visit_bytes</code> and then drops the
<code>Vec&lt;u8&gt;</code>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_none" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1601-1606">source</a></div><h4 class="code-header">fn <a href="#method.visit_none" class="fnname">visit_none</a>&lt;E&gt;(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains an optional that is absent.</p>
<p>The default implementation fails with a type error.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_some" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1611-1617">source</a></div><h4 class="code-header">fn <a href="#method.visit_some" class="fnname">visit_some</a>&lt;D&gt;(self, deserializer: D) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, D::<a class="associatedtype" href="../trait.Deserializer.html#associatedtype.Error" title="type serde::Deserializer::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;D: <a class="trait" href="../trait.Deserializer.html" title="trait serde::Deserializer">Deserializer</a>&lt;'de&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains an optional that is present.</p>
<p>The default implementation fails with a type error.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_unit" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1622-1627">source</a></div><h4 class="code-header">fn <a href="#method.visit_unit" class="fnname">visit_unit</a>&lt;E&gt;(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, E&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="trait.Error.html" title="trait serde::de::Error">Error</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a unit <code>()</code>.</p>
<p>The default implementation fails with a type error.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_newtype_struct" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1635-1641">source</a></div><h4 class="code-header">fn <a href="#method.visit_newtype_struct" class="fnname">visit_newtype_struct</a>&lt;D&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;self,<br>&nbsp;&nbsp;&nbsp;&nbsp;deserializer: D<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, D::<a class="associatedtype" href="../trait.Deserializer.html#associatedtype.Error" title="type serde::Deserializer::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;D: <a class="trait" href="../trait.Deserializer.html" title="trait serde::Deserializer">Deserializer</a>&lt;'de&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a newtype struct.</p>
<p>The content of the newtype struct may be read from the given
<code>Deserializer</code>.</p>
<p>The default implementation fails with a type error.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_seq" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1646-1652">source</a></div><h4 class="code-header">fn <a href="#method.visit_seq" class="fnname">visit_seq</a>&lt;A&gt;(self, seq: A) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, A::<a class="associatedtype" href="trait.SeqAccess.html#associatedtype.Error" title="type serde::de::SeqAccess::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;A: <a class="trait" href="trait.SeqAccess.html" title="trait serde::de::SeqAccess">SeqAccess</a>&lt;'de&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a sequence of elements.</p>
<p>The default implementation fails with a type error.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_map" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1657-1663">source</a></div><h4 class="code-header">fn <a href="#method.visit_map" class="fnname">visit_map</a>&lt;A&gt;(self, map: A) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, A::<a class="associatedtype" href="trait.MapAccess.html#associatedtype.Error" title="type serde::de::MapAccess::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;A: <a class="trait" href="trait.MapAccess.html" title="trait serde::de::MapAccess">MapAccess</a>&lt;'de&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains a key-value map.</p>
<p>The default implementation fails with a type error.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.visit_enum" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/serde/de/mod.rs.html#1668-1674">source</a></div><h4 class="code-header">fn <a href="#method.visit_enum" class="fnname">visit_enum</a>&lt;A&gt;(self, data: A) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Value" title="type serde::de::Visitor::Value">Value</a>, A::<a class="associatedtype" href="trait.EnumAccess.html#associatedtype.Error" title="type serde::de::EnumAccess::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;A: <a class="trait" href="trait.EnumAccess.html" title="trait serde::de::EnumAccess">EnumAccess</a>&lt;'de&gt;,&nbsp;</span></h4></div></summary><div class="docblock"><p>The input contains an enum.</p>
<p>The default implementation fails with a type error.</p>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Visitor%3C%27de%3E-for-IgnoredAny" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/serde/de/ignored_any.rs.html#114-233">source</a></span><a href="#impl-Visitor%3C%27de%3E-for-IgnoredAny" class="anchor"></a><h3 class="code-header in-band">impl&lt;'de&gt; <a class="trait" href="trait.Visitor.html" title="trait serde::de::Visitor">Visitor</a>&lt;'de&gt; for <a class="struct" href="struct.IgnoredAny.html" title="struct serde::de::IgnoredAny">IgnoredAny</a></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> = <a class="struct" href="struct.IgnoredAny.html" title="struct serde::de::IgnoredAny">IgnoredAny</a></h4></section></div></details></div><script type="text/javascript" src="../../implementors/serde/de/trait.Visitor.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>