commit 01b843e56f324a98caedf97a21e36b8546d721e0 Author: Lionel Sambuc Date: Wed Mar 18 17:27:18 2020 +0100 doc: 2020-03-18 17:26:24 +0100: a7ac8f0 - Adding documentation diff --git a/.lock b/.lock new file mode 100755 index 0000000..e69de29 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt new file mode 100644 index 0000000..af77776 --- /dev/null +++ b/COPYRIGHT.txt @@ -0,0 +1,45 @@ +These documentation pages include resources by third parties. This copyright +file applies only to those resources. The following third party resources are +included, and carry their own copyright notices and license terms: + +* Fira Sans (FiraSans-Regular.woff, FiraSans-Medium.woff): + + Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ + with Reserved Font Name Fira Sans. + + Copyright (c) 2014, Telefonica S.A. + + Licensed under the SIL Open Font License, Version 1.1. + See FiraSans-LICENSE.txt. + +* rustdoc.css, main.js, and playpen.js: + + Copyright 2015 The Rust Developers. + Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or + the MIT license (LICENSE-MIT.txt) at your option. + +* normalize.css: + + Copyright (c) Nicolas Gallagher and Jonathan Neal. + Licensed under the MIT license (see LICENSE-MIT.txt). + +* Source Code Pro (SourceCodePro-Regular.woff, SourceCodePro-Semibold.woff): + + Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), + with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark + of Adobe Systems Incorporated in the United States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceCodePro-LICENSE.txt. + +* Source Serif Pro (SourceSerifPro-Regular.ttf.woff, + SourceSerifPro-Bold.ttf.woff, SourceSerifPro-It.ttf.woff): + + Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/), with + Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of + Adobe Systems Incorporated in the United States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceSerifPro-LICENSE.txt. + +This copyright file is intended to be distributed with rustdoc output. diff --git a/FiraSans-LICENSE.txt b/FiraSans-LICENSE.txt new file mode 100644 index 0000000..d444ea9 --- /dev/null +++ b/FiraSans-LICENSE.txt @@ -0,0 +1,94 @@ +Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. +with Reserved Font Name < Fira >, + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/FiraSans-Medium.woff b/FiraSans-Medium.woff new file mode 100644 index 0000000..7d742c5 Binary files /dev/null and b/FiraSans-Medium.woff differ diff --git a/FiraSans-Regular.woff b/FiraSans-Regular.woff new file mode 100644 index 0000000..d8e0363 Binary files /dev/null and b/FiraSans-Regular.woff differ diff --git a/LICENSE-APACHE.txt b/LICENSE-APACHE.txt new file mode 100644 index 0000000..16fe87b --- /dev/null +++ b/LICENSE-APACHE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/LICENSE-MIT.txt b/LICENSE-MIT.txt new file mode 100644 index 0000000..31aa793 --- /dev/null +++ b/LICENSE-MIT.txt @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/SourceCodePro-LICENSE.txt b/SourceCodePro-LICENSE.txt new file mode 100644 index 0000000..0754257 --- /dev/null +++ b/SourceCodePro-LICENSE.txt @@ -0,0 +1,93 @@ +Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/SourceCodePro-Regular.woff b/SourceCodePro-Regular.woff new file mode 100644 index 0000000..5576670 Binary files /dev/null and b/SourceCodePro-Regular.woff differ diff --git a/SourceCodePro-Semibold.woff b/SourceCodePro-Semibold.woff new file mode 100644 index 0000000..ca972a1 Binary files /dev/null and b/SourceCodePro-Semibold.woff differ diff --git a/SourceSerifPro-Bold.ttf.woff b/SourceSerifPro-Bold.ttf.woff new file mode 100644 index 0000000..ca25431 Binary files /dev/null and b/SourceSerifPro-Bold.ttf.woff differ diff --git a/SourceSerifPro-It.ttf.woff b/SourceSerifPro-It.ttf.woff new file mode 100644 index 0000000..a287bbe Binary files /dev/null and b/SourceSerifPro-It.ttf.woff differ diff --git a/SourceSerifPro-LICENSE.md b/SourceSerifPro-LICENSE.md new file mode 100644 index 0000000..22cb755 --- /dev/null +++ b/SourceSerifPro-LICENSE.md @@ -0,0 +1,93 @@ +Copyright 2014-2018 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/SourceSerifPro-Regular.ttf.woff b/SourceSerifPro-Regular.ttf.woff new file mode 100644 index 0000000..a3d55cf Binary files /dev/null and b/SourceSerifPro-Regular.ttf.woff differ diff --git a/aliases.js b/aliases.js new file mode 100644 index 0000000..33626fa --- /dev/null +++ b/aliases.js @@ -0,0 +1,14 @@ +var ALIASES = {}; +ALIASES["arrayref"] = {}; +ALIASES["bincode"] = {}; +ALIASES["byteorder"] = {}; +ALIASES["cfg_if"] = {}; +ALIASES["ironsea_index"] = {}; +ALIASES["ironsea_index_sfc_dbc"] = {}; +ALIASES["log"] = {}; +ALIASES["proc_macro2"] = {}; +ALIASES["quote"] = {}; +ALIASES["serde"] = {}; +ALIASES["serde_derive"] = {}; +ALIASES["syn"] = {}; +ALIASES["unicode_xid"] = {}; diff --git a/arrayref/all.html b/arrayref/all.html new file mode 100644 index 0000000..6eaddcf --- /dev/null +++ b/arrayref/all.html @@ -0,0 +1,3 @@ +List of all items in this crate

[] + + List of all items

Macros

\ No newline at end of file diff --git a/arrayref/index.html b/arrayref/index.html new file mode 100644 index 0000000..0b8984f --- /dev/null +++ b/arrayref/index.html @@ -0,0 +1,47 @@ +arrayref - Rust

[][src]Crate arrayref

This package contains just four macros, which enable the creation +of array references to portions of arrays or slices (or things +that can be sliced).

+

Examples

+

Here is a simple example of slicing and dicing a slice into array +references with these macros. Here we implement a simple +little-endian conversion from bytes to u16, and demonstrate code +that uses array_ref! to extract an array reference from a larger +array. Note that the documentation for each macro also has an +example of its use.

+ +
+#[macro_use]
+extern crate arrayref;
+
+fn read_u16(bytes: &[u8; 2]) -> u16 {
+     bytes[0] as u16 + ((bytes[1] as u16) << 8)
+}
+// ...
+let data = [0,1,2,3,4,0,6,7,8,9];
+assert_eq!(256, read_u16(array_ref![data,0,2]));
+assert_eq!(4, read_u16(array_ref![data,4,2]));
+

Macros

+
array_mut_ref

You can use array_mut_ref to generate a mutable array reference +to a subset of a sliceable bit of data (which could be an array, +or a slice, or a Vec).

+
array_ref

You can use array_ref to generate an array reference to a subset +of a sliceable bit of data (which could be an array, or a slice, +or a Vec).

+
array_refs

You can use array_refs to generate a series of array references +to an input array reference. The idea is if you want to break an +array into a series of contiguous and non-overlapping arrays. +array_refs is a bit funny in that it insists on slicing up the +entire array. This is intentional, as I find it handy to make +me ensure that my sub-arrays add up to the entire array. This +macro will never panic, since the sizes are all checked at +compile time.

+
mut_array_refs

You can use mut_array_refs to generate a series of mutable array +references to an input mutable array reference. The idea is if +you want to break an array into a series of contiguous and +non-overlapping mutable array references. Like array_refs!, +mut_array_refs! is a bit funny in that it insists on slicing up +the entire array. This is intentional, as I find it handy to +make me ensure that my sub-arrays add up to the entire array. +This macro will never panic, since the sizes are all checked at +compile time.

+
\ No newline at end of file diff --git a/arrayref/macro.array_mut_ref!.html b/arrayref/macro.array_mut_ref!.html new file mode 100644 index 0000000..e0bad84 --- /dev/null +++ b/arrayref/macro.array_mut_ref!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.array_mut_ref.html...

+ + + \ No newline at end of file diff --git a/arrayref/macro.array_mut_ref.html b/arrayref/macro.array_mut_ref.html new file mode 100644 index 0000000..458a799 --- /dev/null +++ b/arrayref/macro.array_mut_ref.html @@ -0,0 +1,25 @@ +arrayref::array_mut_ref - Rust

[][src]Macro arrayref::array_mut_ref

+macro_rules! array_mut_ref {
+    ($arr:expr, $offset:expr, $len:expr) => { ... };
+}
+

You can use array_mut_ref to generate a mutable array reference +to a subset of a sliceable bit of data (which could be an array, +or a slice, or a Vec).

+

Panics if the slice is out of bounds.

+ +
+#[macro_use]
+extern crate arrayref;
+
+fn write_u16(bytes: &mut [u8; 2], num: u16) {
+     bytes[0] = num as u8;
+     bytes[1] = (num >> 8) as u8;
+}
+// ...
+let mut data = [0,1,2,3,4,0,6,7,8,9];
+write_u16(array_mut_ref![data,0,2], 1);
+write_u16(array_mut_ref![data,2,2], 5);
+assert_eq!(*array_ref![data,0,4], [1,0,5,0]);
+*array_mut_ref![data,4,5] = [4,3,2,1,0];
+assert_eq!(data, [1,0,5,0,4,3,2,1,0,9]);
+
\ No newline at end of file diff --git a/arrayref/macro.array_ref!.html b/arrayref/macro.array_ref!.html new file mode 100644 index 0000000..af602d4 --- /dev/null +++ b/arrayref/macro.array_ref!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.array_ref.html...

+ + + \ No newline at end of file diff --git a/arrayref/macro.array_ref.html b/arrayref/macro.array_ref.html new file mode 100644 index 0000000..7ce1cf3 --- /dev/null +++ b/arrayref/macro.array_ref.html @@ -0,0 +1,21 @@ +arrayref::array_ref - Rust

[][src]Macro arrayref::array_ref

+macro_rules! array_ref {
+    ($arr:expr, $offset:expr, $len:expr) => { ... };
+}
+

You can use array_ref to generate an array reference to a subset +of a sliceable bit of data (which could be an array, or a slice, +or a Vec).

+

Panics if the slice is out of bounds.

+ +
+#[macro_use]
+extern crate arrayref;
+
+fn read_u16(bytes: &[u8; 2]) -> u16 {
+     bytes[0] as u16 + ((bytes[1] as u16) << 8)
+}
+// ...
+let data = [0,1,2,3,4,0,6,7,8,9];
+assert_eq!(256, read_u16(array_ref![data,0,2]));
+assert_eq!(4, read_u16(array_ref![data,4,2]));
+
\ No newline at end of file diff --git a/arrayref/macro.array_refs!.html b/arrayref/macro.array_refs!.html new file mode 100644 index 0000000..a25f1c2 --- /dev/null +++ b/arrayref/macro.array_refs!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.array_refs.html...

+ + + \ No newline at end of file diff --git a/arrayref/macro.array_refs.html b/arrayref/macro.array_refs.html new file mode 100644 index 0000000..fc09080 --- /dev/null +++ b/arrayref/macro.array_refs.html @@ -0,0 +1,32 @@ +arrayref::array_refs - Rust

[][src]Macro arrayref::array_refs

+macro_rules! array_refs {
+    ( $arr:expr, $( $pre:expr ),* ; .. ;  $( $post:expr ),* ) => { ... };
+    ( $arr:expr, $( $len:expr ),* ) => { ... };
+}
+

You can use array_refs to generate a series of array references +to an input array reference. The idea is if you want to break an +array into a series of contiguous and non-overlapping arrays. +array_refs is a bit funny in that it insists on slicing up the +entire array. This is intentional, as I find it handy to make +me ensure that my sub-arrays add up to the entire array. This +macro will never panic, since the sizes are all checked at +compile time.

+

Note that unlike array_ref!, array_refs requires that the +first argument be an array reference. The following arguments are +the lengths of each subarray you wish a reference to. The total +of these arguments must equal the size of the array itself.

+ +
+#[macro_use]
+extern crate arrayref;
+
+fn read_u16(bytes: &[u8; 2]) -> u16 {
+     bytes[0] as u16 + ((bytes[1] as u16) << 8)
+}
+// ...
+let data = [0,1,2,3,4,0,6,7];
+let (a,b,c) = array_refs![&data,2,2,4];
+assert_eq!(read_u16(a), 256);
+assert_eq!(read_u16(b), 3*256+2);
+assert_eq!(*c, [4,0,6,7]);
+
\ No newline at end of file diff --git a/arrayref/macro.mut_array_refs!.html b/arrayref/macro.mut_array_refs!.html new file mode 100644 index 0000000..50f5db5 --- /dev/null +++ b/arrayref/macro.mut_array_refs!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.mut_array_refs.html...

+ + + \ No newline at end of file diff --git a/arrayref/macro.mut_array_refs.html b/arrayref/macro.mut_array_refs.html new file mode 100644 index 0000000..619a9dd --- /dev/null +++ b/arrayref/macro.mut_array_refs.html @@ -0,0 +1,42 @@ +arrayref::mut_array_refs - Rust

[][src]Macro arrayref::mut_array_refs

+macro_rules! mut_array_refs {
+    ( $arr:expr, $( $pre:expr ),* ; .. ;  $( $post:expr ),* ) => { ... };
+    ( $arr:expr, $( $len:expr ),* ) => { ... };
+}
+

You can use mut_array_refs to generate a series of mutable array +references to an input mutable array reference. The idea is if +you want to break an array into a series of contiguous and +non-overlapping mutable array references. Like array_refs!, +mut_array_refs! is a bit funny in that it insists on slicing up +the entire array. This is intentional, as I find it handy to +make me ensure that my sub-arrays add up to the entire array. +This macro will never panic, since the sizes are all checked at +compile time.

+

Note that unlike array_mut_ref!, mut_array_refs requires +that the first argument be a mutable array reference. The +following arguments are the lengths of each subarray you wish a +reference to. The total of these arguments must equal the size +of the array itself. Also note that this macro allows you to take +out multiple mutable references to a single object, which is both +weird and powerful.

+ +
+#[macro_use]
+extern crate arrayref;
+
+fn write_u16(bytes: &mut [u8; 2], num: u16) {
+     bytes[0] = num as u8;
+     bytes[1] = (num >> 8) as u8;
+}
+fn write_u32(bytes: &mut [u8; 4], num: u32) {
+     bytes[0] = num as u8;
+     bytes[1] = (num >> 8) as u8; // this is buggy to save space...
+}
+// ...
+let mut data = [0,1,2,3,4,0,6,7];
+let (a,b,c) = mut_array_refs![&mut data,2,2,4];
+// let's write out some nice prime numbers!
+write_u16(a, 37);
+write_u16(b, 73);
+write_u32(c, 137); // approximate inverse of the fine structure constant!
+
\ No newline at end of file diff --git a/arrayref/sidebar-items.js b/arrayref/sidebar-items.js new file mode 100644 index 0000000..73402ed --- /dev/null +++ b/arrayref/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"macro":[["array_mut_ref","You can use `array_mut_ref` to generate a mutable array reference to a subset of a sliceable bit of data (which could be an array, or a slice, or a Vec)."],["array_ref","You can use `array_ref` to generate an array reference to a subset of a sliceable bit of data (which could be an array, or a slice, or a Vec)."],["array_refs","You can use `array_refs` to generate a series of array references to an input array reference. The idea is if you want to break an array into a series of contiguous and non-overlapping arrays. `array_refs` is a bit funny in that it insists on slicing up the entire array. This is intentional, as I find it handy to make me ensure that my sub-arrays add up to the entire array. This macro will never panic, since the sizes are all checked at compile time."],["mut_array_refs","You can use `mut_array_refs` to generate a series of mutable array references to an input mutable array reference. The idea is if you want to break an array into a series of contiguous and non-overlapping mutable array references. Like `array_refs!`, `mut_array_refs!` is a bit funny in that it insists on slicing up the entire array. This is intentional, as I find it handy to make me ensure that my sub-arrays add up to the entire array. This macro will never panic, since the sizes are all checked at compile time."]]}); \ No newline at end of file diff --git a/bincode/all.html b/bincode/all.html new file mode 100644 index 0000000..9cfb331 --- /dev/null +++ b/bincode/all.html @@ -0,0 +1,3 @@ +List of all items in this crate

[] + + List of all items

Structs

Enums

Traits

Functions

Typedefs

\ No newline at end of file diff --git a/bincode/config/struct.Config.html b/bincode/config/struct.Config.html new file mode 100644 index 0000000..6d05b58 --- /dev/null +++ b/bincode/config/struct.Config.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../bincode/struct.Config.html...

+ + + \ No newline at end of file diff --git a/bincode/de/read/trait.BincodeRead.html b/bincode/de/read/trait.BincodeRead.html new file mode 100644 index 0000000..de20552 --- /dev/null +++ b/bincode/de/read/trait.BincodeRead.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../bincode/trait.BincodeRead.html...

+ + + \ No newline at end of file diff --git a/bincode/enum.ErrorKind.html b/bincode/enum.ErrorKind.html new file mode 100644 index 0000000..c401539 --- /dev/null +++ b/bincode/enum.ErrorKind.html @@ -0,0 +1,45 @@ +bincode::ErrorKind - Rust

[][src]Enum bincode::ErrorKind

pub enum ErrorKind {
+    Io(Error),
+    InvalidUtf8Encoding(Utf8Error),
+    InvalidBoolEncoding(u8),
+    InvalidCharEncoding,
+    InvalidTagEncoding(usize),
+    DeserializeAnyNotSupported,
+    SizeLimit,
+    SequenceMustHaveLength,
+    Custom(String),
+}

The kind of error that can be produced during a serialization or deserialization.

+

+ Variants

+
Io(Error)

If the error stems from the reader/writer that is being used +during (de)serialization, that error will be stored and returned here.

+
InvalidUtf8Encoding(Utf8Error)

Returned if the deserializer attempts to deserialize a string that is not valid utf8

+
InvalidBoolEncoding(u8)

Returned if the deserializer attempts to deserialize a bool that was +not encoded as either a 1 or a 0

+
InvalidCharEncoding

Returned if the deserializer attempts to deserialize a char that is not in the correct format.

+
InvalidTagEncoding(usize)

Returned if the deserializer attempts to deserialize the tag of an enum that is +not in the expected ranges

+
DeserializeAnyNotSupported

Serde has a deserialize_any method that lets the format hint to the +object which route to take in deserializing.

+
SizeLimit

If (de)serializing a message takes more than the provided size limit, this +error is returned.

+
SequenceMustHaveLength

Bincode can not encode sequences of unknown length (like iterators).

+
Custom(String)

A custom error message from Serde.

+

Trait Implementations

impl Debug for ErrorKind[src]

impl Display for ErrorKind[src]

impl Error for ErrorKind[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/bincode/error/enum.ErrorKind.html b/bincode/error/enum.ErrorKind.html new file mode 100644 index 0000000..e40f8b5 --- /dev/null +++ b/bincode/error/enum.ErrorKind.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../bincode/enum.ErrorKind.html...

+ + + \ No newline at end of file diff --git a/bincode/error/type.Error.html b/bincode/error/type.Error.html new file mode 100644 index 0000000..4688a3c --- /dev/null +++ b/bincode/error/type.Error.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../bincode/type.Error.html...

+ + + \ No newline at end of file diff --git a/bincode/error/type.Result.html b/bincode/error/type.Result.html new file mode 100644 index 0000000..2967f64 --- /dev/null +++ b/bincode/error/type.Result.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../bincode/type.Result.html...

+ + + \ No newline at end of file diff --git a/bincode/fn.config.html b/bincode/fn.config.html new file mode 100644 index 0000000..f4614b6 --- /dev/null +++ b/bincode/fn.config.html @@ -0,0 +1,5 @@ +bincode::config - Rust

[][src]Function bincode::config

pub fn config() -> Config

Get a default configuration object.

+

Default Configuration:

+ +
Byte limitEndianness
UnlimitedLittle
+
\ No newline at end of file diff --git a/bincode/fn.deserialize.html b/bincode/fn.deserialize.html new file mode 100644 index 0000000..2355d5b --- /dev/null +++ b/bincode/fn.deserialize.html @@ -0,0 +1,2 @@ +bincode::deserialize - Rust

[][src]Function bincode::deserialize

pub fn deserialize<'a, T>(bytes: &'a [u8]) -> Result<T> where
    T: Deserialize<'a>, 

Deserializes a slice of bytes into an instance of T using the default configuration.

+
\ No newline at end of file diff --git a/bincode/fn.deserialize_from.html b/bincode/fn.deserialize_from.html new file mode 100644 index 0000000..d173187 --- /dev/null +++ b/bincode/fn.deserialize_from.html @@ -0,0 +1,3 @@ +bincode::deserialize_from - Rust

[][src]Function bincode::deserialize_from

pub fn deserialize_from<R, T>(reader: R) -> Result<T> where
    R: Read,
    T: DeserializeOwned

Deserializes an object directly from a Reader using the default configuration.

+

If this returns an Error, reader may be in an invalid state.

+
\ No newline at end of file diff --git a/bincode/fn.deserialize_from_custom.html b/bincode/fn.deserialize_from_custom.html new file mode 100644 index 0000000..2fadec6 --- /dev/null +++ b/bincode/fn.deserialize_from_custom.html @@ -0,0 +1,5 @@ +bincode::deserialize_from_custom - Rust

[][src]Function bincode::deserialize_from_custom

pub fn deserialize_from_custom<'a, R, T>(reader: R) -> Result<T> where
    R: BincodeRead<'a>,
    T: DeserializeOwned

Deserializes an object from a custom BincodeReader using the default configuration. +It is highly recommended to use deserialize_from unless you need to implement +BincodeRead for performance reasons.

+

If this returns an Error, reader may be in an invalid state.

+
\ No newline at end of file diff --git a/bincode/fn.serialize.html b/bincode/fn.serialize.html new file mode 100644 index 0000000..de6cb8b --- /dev/null +++ b/bincode/fn.serialize.html @@ -0,0 +1,2 @@ +bincode::serialize - Rust

[][src]Function bincode::serialize

pub fn serialize<T: ?Sized>(value: &T) -> Result<Vec<u8>> where
    T: Serialize

Serializes a serializable object into a Vec of bytes using the default configuration.

+
\ No newline at end of file diff --git a/bincode/fn.serialize_into.html b/bincode/fn.serialize_into.html new file mode 100644 index 0000000..e7cea16 --- /dev/null +++ b/bincode/fn.serialize_into.html @@ -0,0 +1,4 @@ +bincode::serialize_into - Rust

[][src]Function bincode::serialize_into

pub fn serialize_into<W, T: ?Sized>(writer: W, value: &T) -> Result<()> where
    W: Write,
    T: Serialize

Serializes an object directly into a Writer using the default configuration.

+

If the serialization would take more bytes than allowed by the size limit, an error +is returned and no bytes will be written into the Writer.

+
\ No newline at end of file diff --git a/bincode/fn.serialized_size.html b/bincode/fn.serialized_size.html new file mode 100644 index 0000000..608661b --- /dev/null +++ b/bincode/fn.serialized_size.html @@ -0,0 +1,2 @@ +bincode::serialized_size - Rust

[][src]Function bincode::serialized_size

pub fn serialized_size<T: ?Sized>(value: &T) -> Result<u64> where
    T: Serialize

Returns the size that an object would be if serialized using Bincode with the default configuration.

+
\ No newline at end of file diff --git a/bincode/index.html b/bincode/index.html new file mode 100644 index 0000000..1f8d44c --- /dev/null +++ b/bincode/index.html @@ -0,0 +1,38 @@ +bincode - Rust

[][src]Crate bincode

Bincode is a crate for encoding and decoding using a tiny binary +serialization strategy. Using it, you can easily go from having +an object in memory, quickly serialize it to bytes, and then +deserialize it back just as fast!

+

Using Basic Functions

+
This code runs with edition 2018
+fn main() {
+    // The object that we will serialize.
+    let target: Option<String>  = Some("hello world".to_string());
+
+    let encoded: Vec<u8> = bincode::serialize(&target).unwrap();
+    let decoded: Option<String> = bincode::deserialize(&encoded[..]).unwrap();
+    assert_eq!(target, decoded);
+}
+

128bit numbers

+

Support for i128 and u128 is automatically enabled on Rust toolchains +greater than or equal to 1.26.0 and disabled for targets which do not support it

+

Structs

+
Config

A configuration builder whose options Bincode will use +while serializing and deserializing.

+

Enums

+
ErrorKind

The kind of error that can be produced during a serialization or deserialization.

+

Traits

+
BincodeRead

An optional Read trait for advanced Bincode usage.

+

Functions

+
config

Get a default configuration object.

+
deserialize

Deserializes a slice of bytes into an instance of T using the default configuration.

+
deserialize_from

Deserializes an object directly from a Reader using the default configuration.

+
deserialize_from_custom

Deserializes an object from a custom BincodeReader using the default configuration. +It is highly recommended to use deserialize_from unless you need to implement +BincodeRead for performance reasons.

+
serialize

Serializes a serializable object into a Vec of bytes using the default configuration.

+
serialize_into

Serializes an object directly into a Writer using the default configuration.

+
serialized_size

Returns the size that an object would be if serialized using Bincode with the default configuration.

+

Type Definitions

+
Error

An error that can be produced during (de)serializing.

+
Result

The result of a serialization or deserialization operation.

+
\ No newline at end of file diff --git a/bincode/sidebar-items.js b/bincode/sidebar-items.js new file mode 100644 index 0000000..a0fd799 --- /dev/null +++ b/bincode/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["ErrorKind","The kind of error that can be produced during a serialization or deserialization."]],"fn":[["config","Get a default configuration object."],["deserialize","Deserializes a slice of bytes into an instance of `T` using the default configuration."],["deserialize_from","Deserializes an object directly from a `Read`er using the default configuration."],["deserialize_from_custom","Deserializes an object from a custom `BincodeRead`er using the default configuration. It is highly recommended to use `deserialize_from` unless you need to implement `BincodeRead` for performance reasons."],["serialize","Serializes a serializable object into a `Vec` of bytes using the default configuration."],["serialize_into","Serializes an object directly into a `Writer` using the default configuration."],["serialized_size","Returns the size that an object would be if serialized using Bincode with the default configuration."]],"struct":[["Config","A configuration builder whose options Bincode will use while serializing and deserializing."]],"trait":[["BincodeRead","An optional Read trait for advanced Bincode usage."]],"type":[["Error","An error that can be produced during (de)serializing."],["Result","The result of a serialization or deserialization operation."]]}); \ No newline at end of file diff --git a/bincode/struct.Config.html b/bincode/struct.Config.html new file mode 100644 index 0000000..1b5b4d1 --- /dev/null +++ b/bincode/struct.Config.html @@ -0,0 +1,52 @@ +bincode::Config - Rust

[][src]Struct bincode::Config

pub struct Config { /* fields omitted */ }

A configuration builder whose options Bincode will use +while serializing and deserializing.

+

Options

+

Endianness: The endianness with which multi-byte integers will be read/written. default: little endian +Limit: The maximum number of bytes that will be read/written in a bincode serialize/deserialize. default: unlimited

+

Byte Limit Details

+

The purpose of byte-limiting is to prevent Denial-Of-Service attacks whereby malicious attackers get bincode +deserialization to crash your process by allocating too much memory or keeping a connection open for too long.

+

When a byte limit is set, bincode will return Err on any deserialization that goes over the limit, or any +serialization that goes over the limit.

+

Methods

impl Config[src]

pub fn no_limit(&mut self) -> &mut Self[src]

Sets the byte limit to be unlimited. +This is the default.

+

pub fn limit(&mut self, limit: u64) -> &mut Self[src]

Sets the byte limit to limit.

+

pub fn little_endian(&mut self) -> &mut Self[src]

Sets the endianness to little-endian +This is the default.

+

pub fn big_endian(&mut self) -> &mut Self[src]

Sets the endianness to big-endian

+

pub fn native_endian(&mut self) -> &mut Self[src]

Sets the endianness to the the machine-native endianness

+

pub fn serialize<T: ?Sized + Serialize>(&self, t: &T) -> Result<Vec<u8>>[src]

Serializes a serializable object into a Vec of bytes using this configuration

+

pub fn serialized_size<T: ?Sized + Serialize>(&self, t: &T) -> Result<u64>[src]

Returns the size that an object would be if serialized using Bincode with this configuration

+

pub fn serialize_into<W: Write, T: ?Sized + Serialize>(
    &self,
    w: W,
    t: &T
) -> Result<()>
[src]

Serializes an object directly into a Writer using this configuration

+

If the serialization would take more bytes than allowed by the size limit, an error +is returned and no bytes will be written into the Writer

+

pub fn deserialize<'a, T: Deserialize<'a>>(&self, bytes: &'a [u8]) -> Result<T>[src]

Deserializes a slice of bytes into an instance of T using this configuration

+

pub fn deserialize_seed<'a, T: DeserializeSeed<'a>>(
    &self,
    seed: T,
    bytes: &'a [u8]
) -> Result<T::Value>
[src]

Deserializes a slice of bytes with state seed using this configuration.

+

pub fn deserialize_from<R: Read, T: DeserializeOwned>(
    &self,
    reader: R
) -> Result<T>
[src]

Deserializes an object directly from a Reader using this configuration

+

If this returns an Error, reader may be in an invalid state.

+

pub fn deserialize_from_seed<'a, R: Read, T: DeserializeSeed<'a>>(
    &self,
    seed: T,
    reader: R
) -> Result<T::Value>
[src]

Deserializes an object directly from a Reader with state seed using this configuration

+

If this returns an Error, reader may be in an invalid state.

+

pub fn deserialize_from_custom<'a, R: BincodeRead<'a>, T: DeserializeOwned>(
    &self,
    reader: R
) -> Result<T>
[src]

Deserializes an object from a custom BincodeReader using the default configuration. +It is highly recommended to use deserialize_from unless you need to implement +BincodeRead for performance reasons.

+

If this returns an Error, reader may be in an invalid state.

+

pub fn deserialize_from_custom_seed<'a, R: BincodeRead<'a>, T: DeserializeSeed<'a>>(
    &self,
    seed: T,
    reader: R
) -> Result<T::Value>
[src]

Deserializes an object from a custom BincodeReader with state seed using the default +configuration. It is highly recommended to use deserialize_from unless you need to +implement BincodeRead for performance reasons.

+

If this returns an Error, reader may be in an invalid state.

+

Trait Implementations

impl Clone for Config[src]

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/bincode/trait.BincodeRead.html b/bincode/trait.BincodeRead.html new file mode 100644 index 0000000..f1eea18 --- /dev/null +++ b/bincode/trait.BincodeRead.html @@ -0,0 +1,13 @@ +bincode::BincodeRead - Rust

[][src]Trait bincode::BincodeRead

pub trait BincodeRead<'storage>: Read {
+    fn forward_read_str<V>(
        &mut self,
        length: usize,
        visitor: V
    ) -> Result<V::Value>
    where
        V: Visitor<'storage>
; +
fn get_byte_buffer(&mut self, length: usize) -> Result<Vec<u8>>; +
fn forward_read_bytes<V>(
        &mut self,
        length: usize,
        visitor: V
    ) -> Result<V::Value>
    where
        V: Visitor<'storage>
; +}

An optional Read trait for advanced Bincode usage.

+

It is highly recommended to use bincode with io::Read or &[u8] before +implementing a custom BincodeRead.

+
+

Required methods

fn forward_read_str<V>(&mut self, length: usize, visitor: V) -> Result<V::Value> where
    V: Visitor<'storage>, 

Forwards reading length bytes of a string on to the serde reader.

+

fn get_byte_buffer(&mut self, length: usize) -> Result<Vec<u8>>

Return the first length bytes of the internal byte buffer.

+

fn forward_read_bytes<V>(
    &mut self,
    length: usize,
    visitor: V
) -> Result<V::Value> where
    V: Visitor<'storage>, 

Forwards reading length bytes on to the serde reader.

+
Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/bincode/type.Error.html b/bincode/type.Error.html new file mode 100644 index 0000000..e1fe065 --- /dev/null +++ b/bincode/type.Error.html @@ -0,0 +1,12 @@ +bincode::Error - Rust

[][src]Type Definition bincode::Error

type Error = Box<ErrorKind>;

An error that can be produced during (de)serializing.

+

Trait Implementations

impl Error for Error[src]

impl Error for Error[src]

impl From<Error> for Error[src]

\ No newline at end of file diff --git a/bincode/type.Result.html b/bincode/type.Result.html new file mode 100644 index 0000000..0c800d2 --- /dev/null +++ b/bincode/type.Result.html @@ -0,0 +1,2 @@ +bincode::Result - Rust

[][src]Type Definition bincode::Result

type Result<T> = Result<T, Error>;

The result of a serialization or deserialization operation.

+
\ No newline at end of file diff --git a/brush.svg b/brush.svg new file mode 100644 index 0000000..ea266e8 --- /dev/null +++ b/brush.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/byteorder/all.html b/byteorder/all.html new file mode 100644 index 0000000..c9cf383 --- /dev/null +++ b/byteorder/all.html @@ -0,0 +1,3 @@ +List of all items in this crate

[] + + List of all items

Enums

Traits

Typedefs

\ No newline at end of file diff --git a/byteorder/enum.BigEndian.html b/byteorder/enum.BigEndian.html new file mode 100644 index 0000000..0efdd04 --- /dev/null +++ b/byteorder/enum.BigEndian.html @@ -0,0 +1,121 @@ +byteorder::BigEndian - Rust

[][src]Enum byteorder::BigEndian

pub enum BigEndian {}

Defines big-endian serialization.

+

Note that this type has no value constructor. It is used purely at the +type level.

+

Examples

+

Write and read u32 numbers in big endian order:

+ +
+use byteorder::{ByteOrder, BigEndian};
+
+let mut buf = [0; 4];
+BigEndian::write_u32(&mut buf, 1_000_000);
+assert_eq!(1_000_000, BigEndian::read_u32(&buf));
+

Trait Implementations

impl ByteOrder for BigEndian[src]

impl Clone for BigEndian[src]

impl Copy for BigEndian[src]

impl Debug for BigEndian[src]

impl Default for BigEndian[src]

impl Eq for BigEndian[src]

impl Hash for BigEndian[src]

impl Ord for BigEndian[src]

impl PartialEq<BigEndian> for BigEndian[src]

impl PartialOrd<BigEndian> for BigEndian[src]

impl StructuralEq for BigEndian[src]

impl StructuralPartialEq for BigEndian[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/byteorder/enum.LittleEndian.html b/byteorder/enum.LittleEndian.html new file mode 100644 index 0000000..b9abd9f --- /dev/null +++ b/byteorder/enum.LittleEndian.html @@ -0,0 +1,121 @@ +byteorder::LittleEndian - Rust

[][src]Enum byteorder::LittleEndian

pub enum LittleEndian {}

Defines little-endian serialization.

+

Note that this type has no value constructor. It is used purely at the +type level.

+

Examples

+

Write and read u32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 4];
+LittleEndian::write_u32(&mut buf, 1_000_000);
+assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
+

Trait Implementations

impl ByteOrder for LittleEndian[src]

impl Clone for LittleEndian[src]

impl Copy for LittleEndian[src]

impl Debug for LittleEndian[src]

impl Default for LittleEndian[src]

impl Eq for LittleEndian[src]

impl Hash for LittleEndian[src]

impl Ord for LittleEndian[src]

impl PartialEq<LittleEndian> for LittleEndian[src]

impl PartialOrd<LittleEndian> for LittleEndian[src]

impl StructuralEq for LittleEndian[src]

impl StructuralPartialEq for LittleEndian[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/byteorder/index.html b/byteorder/index.html new file mode 100644 index 0000000..f371a9d --- /dev/null +++ b/byteorder/index.html @@ -0,0 +1,55 @@ +byteorder - Rust

[][src]Crate byteorder

This crate provides convenience methods for encoding and decoding numbers in +either big-endian or little-endian order.

+

The organization of the crate is pretty simple. A trait, ByteOrder, specifies +byte conversion methods for each type of number in Rust (sans numbers that have +a platform dependent size like usize and isize). Two types, BigEndian +and LittleEndian implement these methods. Finally, ReadBytesExt and +WriteBytesExt provide convenience methods available to all types that +implement Read and Write.

+

An alias, NetworkEndian, for BigEndian is provided to help improve +code clarity.

+

An additional alias, NativeEndian, is provided for the endianness of the +local platform. This is convenient when serializing data for use and +conversions are not desired.

+

Examples

+

Read unsigned 16 bit big-endian integers from a Read type:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
+// Note that we use type parameters to indicate which kind of byte order
+// we want!
+assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap());
+assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
+

Write unsigned 16 bit little-endian integers to a Write type:

+ +
+use byteorder::{LittleEndian, WriteBytesExt};
+
+let mut wtr = vec![];
+wtr.write_u16::<LittleEndian>(517).unwrap();
+wtr.write_u16::<LittleEndian>(768).unwrap();
+assert_eq!(wtr, vec![5, 2, 0, 3]);
+

Optional Features

+

This crate optionally provides support for 128 bit values (i128 and u128) +when built with the i128 feature enabled.

+

This crate can also be used without the standard library.

+

Alternatives

+

Note that as of Rust 1.32, the standard numeric types provide built-in methods +like to_le_bytes and from_le_bytes, which support some of the same use +cases.

+

Enums

+
BigEndian

Defines big-endian serialization.

+
LittleEndian

Defines little-endian serialization.

+

Traits

+
ByteOrder

ByteOrder describes types that can serialize integers as bytes.

+
ReadBytesExt

Extends Read with methods for reading numbers. (For std::io.)

+
WriteBytesExt

Extends Write with methods for writing numbers. (For std::io.)

+

Type Definitions

+
BE

A type alias for BigEndian.

+
LE

A type alias for LittleEndian.

+
NativeEndian

Defines system native-endian serialization.

+
NetworkEndian

Defines network byte order serialization.

+
\ No newline at end of file diff --git a/byteorder/io/trait.ReadBytesExt.html b/byteorder/io/trait.ReadBytesExt.html new file mode 100644 index 0000000..c93c35f --- /dev/null +++ b/byteorder/io/trait.ReadBytesExt.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../byteorder/trait.ReadBytesExt.html...

+ + + \ No newline at end of file diff --git a/byteorder/io/trait.WriteBytesExt.html b/byteorder/io/trait.WriteBytesExt.html new file mode 100644 index 0000000..bd7d12d --- /dev/null +++ b/byteorder/io/trait.WriteBytesExt.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../byteorder/trait.WriteBytesExt.html...

+ + + \ No newline at end of file diff --git a/byteorder/sidebar-items.js b/byteorder/sidebar-items.js new file mode 100644 index 0000000..0a93e8d --- /dev/null +++ b/byteorder/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["BigEndian","Defines big-endian serialization."],["LittleEndian","Defines little-endian serialization."]],"trait":[["ByteOrder","`ByteOrder` describes types that can serialize integers as bytes."],["ReadBytesExt","Extends [`Read`] with methods for reading numbers. (For `std::io`.)"],["WriteBytesExt","Extends [`Write`] with methods for writing numbers. (For `std::io`.)"]],"type":[["BE","A type alias for [`BigEndian`]."],["LE","A type alias for [`LittleEndian`]."],["NativeEndian","Defines system native-endian serialization."],["NetworkEndian","Defines network byte order serialization."]]}); \ No newline at end of file diff --git a/byteorder/trait.ByteOrder.html b/byteorder/trait.ByteOrder.html new file mode 100644 index 0000000..cb0e1bc --- /dev/null +++ b/byteorder/trait.ByteOrder.html @@ -0,0 +1,1014 @@ +byteorder::ByteOrder - Rust

[][src]Trait byteorder::ByteOrder

pub trait ByteOrder: Clone + Copy + Debug + Default + Eq + Hash + Ord + PartialEq + PartialOrd + Sealed {
+    fn read_u16(buf: &[u8]) -> u16;
+
fn read_u32(buf: &[u8]) -> u32; +
fn read_u64(buf: &[u8]) -> u64; +
fn read_u128(buf: &[u8]) -> u128; +
fn read_uint(buf: &[u8], nbytes: usize) -> u64; +
fn read_uint128(buf: &[u8], nbytes: usize) -> u128; +
fn write_u16(buf: &mut [u8], n: u16); +
fn write_u32(buf: &mut [u8], n: u32); +
fn write_u64(buf: &mut [u8], n: u64); +
fn write_u128(buf: &mut [u8], n: u128); +
fn write_uint(buf: &mut [u8], n: u64, nbytes: usize); +
fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize); +
fn read_u16_into(src: &[u8], dst: &mut [u16]); +
fn read_u32_into(src: &[u8], dst: &mut [u32]); +
fn read_u64_into(src: &[u8], dst: &mut [u64]); +
fn read_u128_into(src: &[u8], dst: &mut [u128]); +
fn write_u16_into(src: &[u16], dst: &mut [u8]); +
fn write_u32_into(src: &[u32], dst: &mut [u8]); +
fn write_u64_into(src: &[u64], dst: &mut [u8]); +
fn write_u128_into(src: &[u128], dst: &mut [u8]); +
fn from_slice_u16(numbers: &mut [u16]); +
fn from_slice_u32(numbers: &mut [u32]); +
fn from_slice_u64(numbers: &mut [u64]); +
fn from_slice_u128(numbers: &mut [u128]); +
fn from_slice_f32(numbers: &mut [f32]); +
fn from_slice_f64(numbers: &mut [f64]); + + fn read_u24(buf: &[u8]) -> u32 { ... } +
fn read_u48(buf: &[u8]) -> u64 { ... } +
fn write_u24(buf: &mut [u8], n: u32) { ... } +
fn write_u48(buf: &mut [u8], n: u64) { ... } +
fn read_i16(buf: &[u8]) -> i16 { ... } +
fn read_i24(buf: &[u8]) -> i32 { ... } +
fn read_i32(buf: &[u8]) -> i32 { ... } +
fn read_i48(buf: &[u8]) -> i64 { ... } +
fn read_i64(buf: &[u8]) -> i64 { ... } +
fn read_i128(buf: &[u8]) -> i128 { ... } +
fn read_int(buf: &[u8], nbytes: usize) -> i64 { ... } +
fn read_int128(buf: &[u8], nbytes: usize) -> i128 { ... } +
fn read_f32(buf: &[u8]) -> f32 { ... } +
fn read_f64(buf: &[u8]) -> f64 { ... } +
fn write_i16(buf: &mut [u8], n: i16) { ... } +
fn write_i24(buf: &mut [u8], n: i32) { ... } +
fn write_i32(buf: &mut [u8], n: i32) { ... } +
fn write_i48(buf: &mut [u8], n: i64) { ... } +
fn write_i64(buf: &mut [u8], n: i64) { ... } +
fn write_i128(buf: &mut [u8], n: i128) { ... } +
fn write_int(buf: &mut [u8], n: i64, nbytes: usize) { ... } +
fn write_int128(buf: &mut [u8], n: i128, nbytes: usize) { ... } +
fn write_f32(buf: &mut [u8], n: f32) { ... } +
fn write_f64(buf: &mut [u8], n: f64) { ... } +
fn read_i16_into(src: &[u8], dst: &mut [i16]) { ... } +
fn read_i32_into(src: &[u8], dst: &mut [i32]) { ... } +
fn read_i64_into(src: &[u8], dst: &mut [i64]) { ... } +
fn read_i128_into(src: &[u8], dst: &mut [i128]) { ... } +
fn read_f32_into(src: &[u8], dst: &mut [f32]) { ... } +
fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32]) { ... } +
fn read_f64_into(src: &[u8], dst: &mut [f64]) { ... } +
fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64]) { ... } +
fn write_i16_into(src: &[i16], dst: &mut [u8]) { ... } +
fn write_i32_into(src: &[i32], dst: &mut [u8]) { ... } +
fn write_i64_into(src: &[i64], dst: &mut [u8]) { ... } +
fn write_i128_into(src: &[i128], dst: &mut [u8]) { ... } +
fn write_f32_into(src: &[f32], dst: &mut [u8]) { ... } +
fn write_f64_into(src: &[f64], dst: &mut [u8]) { ... } +
fn from_slice_i16(src: &mut [i16]) { ... } +
fn from_slice_i32(src: &mut [i32]) { ... } +
fn from_slice_i64(src: &mut [i64]) { ... } +
fn from_slice_i128(src: &mut [i128]) { ... } +}

ByteOrder describes types that can serialize integers as bytes.

+

Note that Self does not appear anywhere in this trait's definition! +Therefore, in order to use it, you'll need to use syntax like +T::read_u16(&[0, 1]) where T implements ByteOrder.

+

This crate provides two types that implement ByteOrder: BigEndian +and LittleEndian. +This trait is sealed and cannot be implemented for callers to avoid +breaking backwards compatibility when adding new derived traits.

+

Examples

+

Write and read u32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 4];
+LittleEndian::write_u32(&mut buf, 1_000_000);
+assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
+

Write and read i16 numbers in big endian order:

+ +
+use byteorder::{ByteOrder, BigEndian};
+
+let mut buf = [0; 2];
+BigEndian::write_i16(&mut buf, -5_000);
+assert_eq!(-5_000, BigEndian::read_i16(&buf));
+
+

Required methods

fn read_u16(buf: &[u8]) -> u16

Reads an unsigned 16 bit integer from buf.

+

Panics

+

Panics when buf.len() < 2.

+

fn read_u32(buf: &[u8]) -> u32

Reads an unsigned 32 bit integer from buf.

+

Panics

+

Panics when buf.len() < 4.

+

Examples

+

Write and read u32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 4];
+LittleEndian::write_u32(&mut buf, 1_000_000);
+assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
+

fn read_u64(buf: &[u8]) -> u64

Reads an unsigned 64 bit integer from buf.

+

Panics

+

Panics when buf.len() < 8.

+

Examples

+

Write and read u64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 8];
+LittleEndian::write_u64(&mut buf, 1_000_000);
+assert_eq!(1_000_000, LittleEndian::read_u64(&buf));
+

fn read_u128(buf: &[u8]) -> u128

Reads an unsigned 128 bit integer from buf.

+

Panics

+

Panics when buf.len() < 16.

+

Examples

+

Write and read u128 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 16];
+LittleEndian::write_u128(&mut buf, 1_000_000);
+assert_eq!(1_000_000, LittleEndian::read_u128(&buf));
+

fn read_uint(buf: &[u8], nbytes: usize) -> u64

Reads an unsigned n-bytes integer from buf.

+

Panics

+

Panics when nbytes < 1 or nbytes > 8 or +buf.len() < nbytes

+

Examples

+

Write and read an n-byte number in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 3];
+LittleEndian::write_uint(&mut buf, 1_000_000, 3);
+assert_eq!(1_000_000, LittleEndian::read_uint(&buf, 3));
+

fn read_uint128(buf: &[u8], nbytes: usize) -> u128

Reads an unsigned n-bytes integer from buf.

+

Panics

+

Panics when nbytes < 1 or nbytes > 16 or +buf.len() < nbytes

+

Examples

+

Write and read an n-byte number in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 3];
+LittleEndian::write_uint128(&mut buf, 1_000_000, 3);
+assert_eq!(1_000_000, LittleEndian::read_uint128(&buf, 3));
+

fn write_u16(buf: &mut [u8], n: u16)

Writes an unsigned 16 bit integer n to buf.

+

Panics

+

Panics when buf.len() < 2.

+

Examples

+

Write and read u16 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 2];
+LittleEndian::write_u16(&mut buf, 1_000);
+assert_eq!(1_000, LittleEndian::read_u16(&buf));
+

fn write_u32(buf: &mut [u8], n: u32)

Writes an unsigned 32 bit integer n to buf.

+

Panics

+

Panics when buf.len() < 4.

+

Examples

+

Write and read u32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 4];
+LittleEndian::write_u32(&mut buf, 1_000_000);
+assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
+

fn write_u64(buf: &mut [u8], n: u64)

Writes an unsigned 64 bit integer n to buf.

+

Panics

+

Panics when buf.len() < 8.

+

Examples

+

Write and read u64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 8];
+LittleEndian::write_u64(&mut buf, 1_000_000);
+assert_eq!(1_000_000, LittleEndian::read_u64(&buf));
+

fn write_u128(buf: &mut [u8], n: u128)

Writes an unsigned 128 bit integer n to buf.

+

Panics

+

Panics when buf.len() < 16.

+

Examples

+

Write and read u128 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 16];
+LittleEndian::write_u128(&mut buf, 1_000_000);
+assert_eq!(1_000_000, LittleEndian::read_u128(&buf));
+

fn write_uint(buf: &mut [u8], n: u64, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes.

+

Panics

+

If n is not representable in nbytes, or if nbytes is > 8, then +this method panics.

+

Examples

+

Write and read an n-byte number in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 3];
+LittleEndian::write_uint(&mut buf, 1_000_000, 3);
+assert_eq!(1_000_000, LittleEndian::read_uint(&buf, 3));
+

fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize)

Writes an unsigned integer n to buf using only nbytes.

+

Panics

+

If n is not representable in nbytes, or if nbytes is > 16, then +this method panics.

+

Examples

+

Write and read an n-byte number in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 3];
+LittleEndian::write_uint128(&mut buf, 1_000_000, 3);
+assert_eq!(1_000_000, LittleEndian::read_uint128(&buf, 3));
+

fn read_u16_into(src: &[u8], dst: &mut [u16])

Reads unsigned 16 bit integers from src into dst.

+

Panics

+

Panics when src.len() != 2*dst.len().

+

Examples

+

Write and read u16 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 8];
+let numbers_given = [1, 2, 0xf00f, 0xffee];
+LittleEndian::write_u16_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_u16_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn read_u32_into(src: &[u8], dst: &mut [u32])

Reads unsigned 32 bit integers from src into dst.

+

Panics

+

Panics when src.len() != 4*dst.len().

+

Examples

+

Write and read u32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 16];
+let numbers_given = [1, 2, 0xf00f, 0xffee];
+LittleEndian::write_u32_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_u32_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn read_u64_into(src: &[u8], dst: &mut [u64])

Reads unsigned 64 bit integers from src into dst.

+

Panics

+

Panics when src.len() != 8*dst.len().

+

Examples

+

Write and read u64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 32];
+let numbers_given = [1, 2, 0xf00f, 0xffee];
+LittleEndian::write_u64_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_u64_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn read_u128_into(src: &[u8], dst: &mut [u128])

Reads unsigned 128 bit integers from src into dst.

+

Panics

+

Panics when src.len() != 16*dst.len().

+

Examples

+

Write and read u128 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 64];
+let numbers_given = [1, 2, 0xf00f, 0xffee];
+LittleEndian::write_u128_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_u128_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn write_u16_into(src: &[u16], dst: &mut [u8])

Writes unsigned 16 bit integers from src into dst.

+

Panics

+

Panics when dst.len() != 2*src.len().

+

Examples

+

Write and read u16 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 8];
+let numbers_given = [1, 2, 0xf00f, 0xffee];
+LittleEndian::write_u16_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_u16_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn write_u32_into(src: &[u32], dst: &mut [u8])

Writes unsigned 32 bit integers from src into dst.

+

Panics

+

Panics when dst.len() != 4*src.len().

+

Examples

+

Write and read u32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 16];
+let numbers_given = [1, 2, 0xf00f, 0xffee];
+LittleEndian::write_u32_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_u32_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn write_u64_into(src: &[u64], dst: &mut [u8])

Writes unsigned 64 bit integers from src into dst.

+

Panics

+

Panics when dst.len() != 8*src.len().

+

Examples

+

Write and read u64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 32];
+let numbers_given = [1, 2, 0xf00f, 0xffee];
+LittleEndian::write_u64_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_u64_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn write_u128_into(src: &[u128], dst: &mut [u8])

Writes unsigned 128 bit integers from src into dst.

+

Panics

+

Panics when dst.len() != 16*src.len().

+

Examples

+

Write and read u128 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 64];
+let numbers_given = [1, 2, 0xf00f, 0xffee];
+LittleEndian::write_u128_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_u128_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn from_slice_u16(numbers: &mut [u16])

Converts the given slice of unsigned 16 bit integers to a particular +endianness.

+

If the endianness matches the endianness of the host platform, then +this is a no-op.

+

Examples

+

Convert the host platform's endianness to big-endian:

+ +
+use byteorder::{ByteOrder, BigEndian};
+
+let mut numbers = [5, 65000];
+BigEndian::from_slice_u16(&mut numbers);
+assert_eq!(numbers, [5u16.to_be(), 65000u16.to_be()]);
+

fn from_slice_u32(numbers: &mut [u32])

Converts the given slice of unsigned 32 bit integers to a particular +endianness.

+

If the endianness matches the endianness of the host platform, then +this is a no-op.

+

Examples

+

Convert the host platform's endianness to big-endian:

+ +
+use byteorder::{ByteOrder, BigEndian};
+
+let mut numbers = [5, 65000];
+BigEndian::from_slice_u32(&mut numbers);
+assert_eq!(numbers, [5u32.to_be(), 65000u32.to_be()]);
+

fn from_slice_u64(numbers: &mut [u64])

Converts the given slice of unsigned 64 bit integers to a particular +endianness.

+

If the endianness matches the endianness of the host platform, then +this is a no-op.

+

Examples

+

Convert the host platform's endianness to big-endian:

+ +
+use byteorder::{ByteOrder, BigEndian};
+
+let mut numbers = [5, 65000];
+BigEndian::from_slice_u64(&mut numbers);
+assert_eq!(numbers, [5u64.to_be(), 65000u64.to_be()]);
+

fn from_slice_u128(numbers: &mut [u128])

Converts the given slice of unsigned 128 bit integers to a particular +endianness.

+

If the endianness matches the endianness of the host platform, then +this is a no-op.

+

Examples

+

Convert the host platform's endianness to big-endian:

+ +
+use byteorder::{ByteOrder, BigEndian};
+
+let mut numbers = [5, 65000];
+BigEndian::from_slice_u128(&mut numbers);
+assert_eq!(numbers, [5u128.to_be(), 65000u128.to_be()]);
+

fn from_slice_f32(numbers: &mut [f32])

Converts the given slice of IEEE754 single-precision (4 bytes) floating +point numbers to a particular endianness.

+

If the endianness matches the endianness of the host platform, then +this is a no-op.

+

fn from_slice_f64(numbers: &mut [f64])

Converts the given slice of IEEE754 double-precision (8 bytes) floating +point numbers to a particular endianness.

+

If the endianness matches the endianness of the host platform, then +this is a no-op.

+
Loading content... +

Provided methods

fn read_u24(buf: &[u8]) -> u32

Reads an unsigned 24 bit integer from buf, stored in u32.

+

Panics

+

Panics when buf.len() < 3.

+

Examples

+

Write and read 24 bit u32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 3];
+LittleEndian::write_u24(&mut buf, 1_000_000);
+assert_eq!(1_000_000, LittleEndian::read_u24(&buf));
+

fn read_u48(buf: &[u8]) -> u64

Reads an unsigned 48 bit integer from buf, stored in u64.

+

Panics

+

Panics when buf.len() < 6.

+

Examples

+

Write and read 48 bit u64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 6];
+LittleEndian::write_u48(&mut buf, 1_000_000_000_000);
+assert_eq!(1_000_000_000_000, LittleEndian::read_u48(&buf));
+

fn write_u24(buf: &mut [u8], n: u32)

Writes an unsigned 24 bit integer n to buf, stored in u32.

+

Panics

+

Panics when buf.len() < 3.

+

Examples

+

Write and read 24 bit u32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 3];
+LittleEndian::write_u24(&mut buf, 1_000_000);
+assert_eq!(1_000_000, LittleEndian::read_u24(&buf));
+

fn write_u48(buf: &mut [u8], n: u64)

Writes an unsigned 48 bit integer n to buf, stored in u64.

+

Panics

+

Panics when buf.len() < 6.

+

Examples

+

Write and read 48 bit u64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 6];
+LittleEndian::write_u48(&mut buf, 1_000_000_000_000);
+assert_eq!(1_000_000_000_000, LittleEndian::read_u48(&buf));
+

fn read_i16(buf: &[u8]) -> i16

Reads a signed 16 bit integer from buf.

+

Panics

+

Panics when buf.len() < 2.

+

Examples

+

Write and read i16 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 2];
+LittleEndian::write_i16(&mut buf, -1_000);
+assert_eq!(-1_000, LittleEndian::read_i16(&buf));
+

fn read_i24(buf: &[u8]) -> i32

Reads a signed 24 bit integer from buf, stored in i32.

+

Panics

+

Panics when buf.len() < 3.

+

Examples

+

Write and read 24 bit i32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 3];
+LittleEndian::write_i24(&mut buf, -1_000_000);
+assert_eq!(-1_000_000, LittleEndian::read_i24(&buf));
+

fn read_i32(buf: &[u8]) -> i32

Reads a signed 32 bit integer from buf.

+

Panics

+

Panics when buf.len() < 4.

+

Examples

+

Write and read i32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 4];
+LittleEndian::write_i32(&mut buf, -1_000_000);
+assert_eq!(-1_000_000, LittleEndian::read_i32(&buf));
+

fn read_i48(buf: &[u8]) -> i64

Reads a signed 48 bit integer from buf, stored in i64.

+

Panics

+

Panics when buf.len() < 6.

+

Examples

+

Write and read 48 bit i64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 6];
+LittleEndian::write_i48(&mut buf, -1_000_000_000_000);
+assert_eq!(-1_000_000_000_000, LittleEndian::read_i48(&buf));
+

fn read_i64(buf: &[u8]) -> i64

Reads a signed 64 bit integer from buf.

+

Panics

+

Panics when buf.len() < 8.

+

Examples

+

Write and read i64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 8];
+LittleEndian::write_i64(&mut buf, -1_000_000_000);
+assert_eq!(-1_000_000_000, LittleEndian::read_i64(&buf));
+

fn read_i128(buf: &[u8]) -> i128

Reads a signed 128 bit integer from buf.

+

Panics

+

Panics when buf.len() < 16.

+

Examples

+

Write and read i128 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 16];
+LittleEndian::write_i128(&mut buf, -1_000_000_000);
+assert_eq!(-1_000_000_000, LittleEndian::read_i128(&buf));
+

fn read_int(buf: &[u8], nbytes: usize) -> i64

Reads a signed n-bytes integer from buf.

+

Panics

+

Panics when nbytes < 1 or nbytes > 8 or +buf.len() < nbytes

+

Examples

+

Write and read n-length signed numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 3];
+LittleEndian::write_int(&mut buf, -1_000, 3);
+assert_eq!(-1_000, LittleEndian::read_int(&buf, 3));
+

fn read_int128(buf: &[u8], nbytes: usize) -> i128

Reads a signed n-bytes integer from buf.

+

Panics

+

Panics when nbytes < 1 or nbytes > 16 or +buf.len() < nbytes

+

Examples

+

Write and read n-length signed numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 3];
+LittleEndian::write_int128(&mut buf, -1_000, 3);
+assert_eq!(-1_000, LittleEndian::read_int128(&buf, 3));
+

fn read_f32(buf: &[u8]) -> f32

Reads a IEEE754 single-precision (4 bytes) floating point number.

+

Panics

+

Panics when buf.len() < 4.

+

Examples

+

Write and read f32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let e = 2.71828;
+let mut buf = [0; 4];
+LittleEndian::write_f32(&mut buf, e);
+assert_eq!(e, LittleEndian::read_f32(&buf));
+

fn read_f64(buf: &[u8]) -> f64

Reads a IEEE754 double-precision (8 bytes) floating point number.

+

Panics

+

Panics when buf.len() < 8.

+

Examples

+

Write and read f64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let phi = 1.6180339887;
+let mut buf = [0; 8];
+LittleEndian::write_f64(&mut buf, phi);
+assert_eq!(phi, LittleEndian::read_f64(&buf));
+

fn write_i16(buf: &mut [u8], n: i16)

Writes a signed 16 bit integer n to buf.

+

Panics

+

Panics when buf.len() < 2.

+

Examples

+

Write and read i16 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 2];
+LittleEndian::write_i16(&mut buf, -1_000);
+assert_eq!(-1_000, LittleEndian::read_i16(&buf));
+

fn write_i24(buf: &mut [u8], n: i32)

Writes a signed 24 bit integer n to buf, stored in i32.

+

Panics

+

Panics when buf.len() < 3.

+

Examples

+

Write and read 24 bit i32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 3];
+LittleEndian::write_i24(&mut buf, -1_000_000);
+assert_eq!(-1_000_000, LittleEndian::read_i24(&buf));
+

fn write_i32(buf: &mut [u8], n: i32)

Writes a signed 32 bit integer n to buf.

+

Panics

+

Panics when buf.len() < 4.

+

Examples

+

Write and read i32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 4];
+LittleEndian::write_i32(&mut buf, -1_000_000);
+assert_eq!(-1_000_000, LittleEndian::read_i32(&buf));
+

fn write_i48(buf: &mut [u8], n: i64)

Writes a signed 48 bit integer n to buf, stored in i64.

+

Panics

+

Panics when buf.len() < 6.

+

Examples

+

Write and read 48 bit i64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 6];
+LittleEndian::write_i48(&mut buf, -1_000_000_000_000);
+assert_eq!(-1_000_000_000_000, LittleEndian::read_i48(&buf));
+

fn write_i64(buf: &mut [u8], n: i64)

Writes a signed 64 bit integer n to buf.

+

Panics

+

Panics when buf.len() < 8.

+

Examples

+

Write and read i64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 8];
+LittleEndian::write_i64(&mut buf, -1_000_000_000);
+assert_eq!(-1_000_000_000, LittleEndian::read_i64(&buf));
+

fn write_i128(buf: &mut [u8], n: i128)

Writes a signed 128 bit integer n to buf.

+

Panics

+

Panics when buf.len() < 16.

+

Examples

+

Write and read n-byte i128 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 16];
+LittleEndian::write_i128(&mut buf, -1_000_000_000);
+assert_eq!(-1_000_000_000, LittleEndian::read_i128(&buf));
+

fn write_int(buf: &mut [u8], n: i64, nbytes: usize)

Writes a signed integer n to buf using only nbytes.

+

Panics

+

If n is not representable in nbytes, or if nbytes is > 8, then +this method panics.

+

Examples

+

Write and read an n-byte number in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 3];
+LittleEndian::write_int(&mut buf, -1_000, 3);
+assert_eq!(-1_000, LittleEndian::read_int(&buf, 3));
+

fn write_int128(buf: &mut [u8], n: i128, nbytes: usize)

Writes a signed integer n to buf using only nbytes.

+

Panics

+

If n is not representable in nbytes, or if nbytes is > 16, then +this method panics.

+

Examples

+

Write and read n-length signed numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut buf = [0; 3];
+LittleEndian::write_int128(&mut buf, -1_000, 3);
+assert_eq!(-1_000, LittleEndian::read_int128(&buf, 3));
+

fn write_f32(buf: &mut [u8], n: f32)

Writes a IEEE754 single-precision (4 bytes) floating point number.

+

Panics

+

Panics when buf.len() < 4.

+

Examples

+

Write and read f32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let e = 2.71828;
+let mut buf = [0; 4];
+LittleEndian::write_f32(&mut buf, e);
+assert_eq!(e, LittleEndian::read_f32(&buf));
+

fn write_f64(buf: &mut [u8], n: f64)

Writes a IEEE754 double-precision (8 bytes) floating point number.

+

Panics

+

Panics when buf.len() < 8.

+

Examples

+

Write and read f64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let phi = 1.6180339887;
+let mut buf = [0; 8];
+LittleEndian::write_f64(&mut buf, phi);
+assert_eq!(phi, LittleEndian::read_f64(&buf));
+

fn read_i16_into(src: &[u8], dst: &mut [i16])

Reads signed 16 bit integers from src to dst.

+

Panics

+

Panics when buf.len() != 2*dst.len().

+

Examples

+

Write and read i16 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 8];
+let numbers_given = [1, 2, 0x0f, 0xee];
+LittleEndian::write_i16_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_i16_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn read_i32_into(src: &[u8], dst: &mut [i32])

Reads signed 32 bit integers from src into dst.

+

Panics

+

Panics when src.len() != 4*dst.len().

+

Examples

+

Write and read i32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 16];
+let numbers_given = [1, 2, 0xf00f, 0xffee];
+LittleEndian::write_i32_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_i32_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn read_i64_into(src: &[u8], dst: &mut [i64])

Reads signed 64 bit integers from src into dst.

+

Panics

+

Panics when src.len() != 8*dst.len().

+

Examples

+

Write and read i64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 32];
+let numbers_given = [1, 2, 0xf00f, 0xffee];
+LittleEndian::write_i64_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_i64_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn read_i128_into(src: &[u8], dst: &mut [i128])

Reads signed 128 bit integers from src into dst.

+

Panics

+

Panics when src.len() != 16*dst.len().

+

Examples

+

Write and read i128 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 64];
+let numbers_given = [1, 2, 0xf00f, 0xffee];
+LittleEndian::write_i128_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_i128_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn read_f32_into(src: &[u8], dst: &mut [f32])

Reads IEEE754 single-precision (4 bytes) floating point numbers from +src into dst.

+

Panics

+

Panics when src.len() != 4*dst.len().

+

Examples

+

Write and read f32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 16];
+let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
+LittleEndian::write_f32_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0.0; 4];
+LittleEndian::read_f32_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32])

Deprecated since 1.3.0:

please use read_f32_into instead

+

DEPRECATED.

+

This method is deprecated. Use read_f32_into instead. +Reads IEEE754 single-precision (4 bytes) floating point numbers from +src into dst.

+

Panics

+

Panics when src.len() != 4*dst.len().

+

Examples

+

Write and read f32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 16];
+let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
+LittleEndian::write_f32_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0.0; 4];
+LittleEndian::read_f32_into_unchecked(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn read_f64_into(src: &[u8], dst: &mut [f64])

Reads IEEE754 single-precision (4 bytes) floating point numbers from +src into dst.

+

Panics

+

Panics when src.len() != 8*dst.len().

+

Examples

+

Write and read f64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 32];
+let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
+LittleEndian::write_f64_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0.0; 4];
+LittleEndian::read_f64_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64])

Deprecated since 1.3.0:

please use read_f64_into instead

+

DEPRECATED.

+

This method is deprecated. Use read_f64_into instead.

+

Reads IEEE754 single-precision (4 bytes) floating point numbers from +src into dst.

+

Panics

+

Panics when src.len() != 8*dst.len().

+

Examples

+

Write and read f64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 32];
+let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
+LittleEndian::write_f64_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0.0; 4];
+LittleEndian::read_f64_into_unchecked(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn write_i16_into(src: &[i16], dst: &mut [u8])

Writes signed 16 bit integers from src into dst.

+

Panics

+

Panics when buf.len() != 2*src.len().

+

Examples

+

Write and read i16 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 8];
+let numbers_given = [1, 2, 0x0f, 0xee];
+LittleEndian::write_i16_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_i16_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn write_i32_into(src: &[i32], dst: &mut [u8])

Writes signed 32 bit integers from src into dst.

+

Panics

+

Panics when dst.len() != 4*src.len().

+

Examples

+

Write and read i32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 16];
+let numbers_given = [1, 2, 0xf00f, 0xffee];
+LittleEndian::write_i32_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_i32_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn write_i64_into(src: &[i64], dst: &mut [u8])

Writes signed 64 bit integers from src into dst.

+

Panics

+

Panics when dst.len() != 8*src.len().

+

Examples

+

Write and read i64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 32];
+let numbers_given = [1, 2, 0xf00f, 0xffee];
+LittleEndian::write_i64_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_i64_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn write_i128_into(src: &[i128], dst: &mut [u8])

Writes signed 128 bit integers from src into dst.

+

Panics

+

Panics when dst.len() != 16*src.len().

+

Examples

+

Write and read i128 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 64];
+let numbers_given = [1, 2, 0xf00f, 0xffee];
+LittleEndian::write_i128_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0; 4];
+LittleEndian::read_i128_into(&bytes, &mut numbers_got);
+assert_eq!(numbers_given, numbers_got);
+

fn write_f32_into(src: &[f32], dst: &mut [u8])

Writes IEEE754 single-precision (4 bytes) floating point numbers from +src into dst.

+

Panics

+

Panics when src.len() != 4*dst.len().

+

Examples

+

Write and read f32 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 16];
+let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
+LittleEndian::write_f32_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0.0; 4];
+unsafe {
+    LittleEndian::read_f32_into(&bytes, &mut numbers_got);
+}
+assert_eq!(numbers_given, numbers_got);
+

fn write_f64_into(src: &[f64], dst: &mut [u8])

Writes IEEE754 double-precision (8 bytes) floating point numbers from +src into dst.

+

Panics

+

Panics when src.len() != 8*dst.len().

+

Examples

+

Write and read f64 numbers in little endian order:

+ +
+use byteorder::{ByteOrder, LittleEndian};
+
+let mut bytes = [0; 32];
+let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
+LittleEndian::write_f64_into(&numbers_given, &mut bytes);
+
+let mut numbers_got = [0.0; 4];
+unsafe {
+    LittleEndian::read_f64_into(&bytes, &mut numbers_got);
+}
+assert_eq!(numbers_given, numbers_got);
+

fn from_slice_i16(src: &mut [i16])

Converts the given slice of signed 16 bit integers to a particular +endianness.

+

If the endianness matches the endianness of the host platform, then +this is a no-op.

+

Examples

+

Convert the host platform's endianness to big-endian:

+ +
+use byteorder::{ByteOrder, BigEndian};
+
+let mut numbers = [5, 6500];
+BigEndian::from_slice_i16(&mut numbers);
+assert_eq!(numbers, [5i16.to_be(), 6500i16.to_be()]);
+

fn from_slice_i32(src: &mut [i32])

Converts the given slice of signed 32 bit integers to a particular +endianness.

+

If the endianness matches the endianness of the host platform, then +this is a no-op.

+

Examples

+

Convert the host platform's endianness to big-endian:

+ +
+use byteorder::{ByteOrder, BigEndian};
+
+let mut numbers = [5, 65000];
+BigEndian::from_slice_i32(&mut numbers);
+assert_eq!(numbers, [5i32.to_be(), 65000i32.to_be()]);
+

fn from_slice_i64(src: &mut [i64])

Converts the given slice of signed 64 bit integers to a particular +endianness.

+

If the endianness matches the endianness of the host platform, then +this is a no-op.

+

Examples

+

Convert the host platform's endianness to big-endian:

+ +
+use byteorder::{ByteOrder, BigEndian};
+
+let mut numbers = [5, 65000];
+BigEndian::from_slice_i64(&mut numbers);
+assert_eq!(numbers, [5i64.to_be(), 65000i64.to_be()]);
+

fn from_slice_i128(src: &mut [i128])

Converts the given slice of signed 128 bit integers to a particular +endianness.

+

If the endianness matches the endianness of the host platform, then +this is a no-op.

+

Examples

+

Convert the host platform's endianness to big-endian:

+ +
+use byteorder::{ByteOrder, BigEndian};
+
+let mut numbers = [5, 65000];
+BigEndian::from_slice_i128(&mut numbers);
+assert_eq!(numbers, [5i128.to_be(), 65000i128.to_be()]);
+
Loading content... +

Implementors

impl ByteOrder for BigEndian[src]

impl ByteOrder for LittleEndian[src]

Loading content...
\ No newline at end of file diff --git a/byteorder/trait.ReadBytesExt.html b/byteorder/trait.ReadBytesExt.html new file mode 100644 index 0000000..e7a670e --- /dev/null +++ b/byteorder/trait.ReadBytesExt.html @@ -0,0 +1,563 @@ +byteorder::ReadBytesExt - Rust

[][src]Trait byteorder::ReadBytesExt

pub trait ReadBytesExt: Read {
+    fn read_u8(&mut self) -> Result<u8> { ... }
+
fn read_i8(&mut self) -> Result<i8> { ... } +
fn read_u16<T: ByteOrder>(&mut self) -> Result<u16> { ... } +
fn read_i16<T: ByteOrder>(&mut self) -> Result<i16> { ... } +
fn read_u24<T: ByteOrder>(&mut self) -> Result<u32> { ... } +
fn read_i24<T: ByteOrder>(&mut self) -> Result<i32> { ... } +
fn read_u32<T: ByteOrder>(&mut self) -> Result<u32> { ... } +
fn read_i32<T: ByteOrder>(&mut self) -> Result<i32> { ... } +
fn read_u48<T: ByteOrder>(&mut self) -> Result<u64> { ... } +
fn read_i48<T: ByteOrder>(&mut self) -> Result<i64> { ... } +
fn read_u64<T: ByteOrder>(&mut self) -> Result<u64> { ... } +
fn read_i64<T: ByteOrder>(&mut self) -> Result<i64> { ... } +
fn read_u128<T: ByteOrder>(&mut self) -> Result<u128> { ... } +
fn read_i128<T: ByteOrder>(&mut self) -> Result<i128> { ... } +
fn read_uint<T: ByteOrder>(&mut self, nbytes: usize) -> Result<u64> { ... } +
fn read_int<T: ByteOrder>(&mut self, nbytes: usize) -> Result<i64> { ... } +
fn read_uint128<T: ByteOrder>(&mut self, nbytes: usize) -> Result<u128> { ... } +
fn read_int128<T: ByteOrder>(&mut self, nbytes: usize) -> Result<i128> { ... } +
fn read_f32<T: ByteOrder>(&mut self) -> Result<f32> { ... } +
fn read_f64<T: ByteOrder>(&mut self) -> Result<f64> { ... } +
fn read_u16_into<T: ByteOrder>(&mut self, dst: &mut [u16]) -> Result<()> { ... } +
fn read_u32_into<T: ByteOrder>(&mut self, dst: &mut [u32]) -> Result<()> { ... } +
fn read_u64_into<T: ByteOrder>(&mut self, dst: &mut [u64]) -> Result<()> { ... } +
fn read_u128_into<T: ByteOrder>(&mut self, dst: &mut [u128]) -> Result<()> { ... } +
fn read_i8_into(&mut self, dst: &mut [i8]) -> Result<()> { ... } +
fn read_i16_into<T: ByteOrder>(&mut self, dst: &mut [i16]) -> Result<()> { ... } +
fn read_i32_into<T: ByteOrder>(&mut self, dst: &mut [i32]) -> Result<()> { ... } +
fn read_i64_into<T: ByteOrder>(&mut self, dst: &mut [i64]) -> Result<()> { ... } +
fn read_i128_into<T: ByteOrder>(&mut self, dst: &mut [i128]) -> Result<()> { ... } +
fn read_f32_into<T: ByteOrder>(&mut self, dst: &mut [f32]) -> Result<()> { ... } +
fn read_f32_into_unchecked<T: ByteOrder>(
        &mut self,
        dst: &mut [f32]
    ) -> Result<()> { ... } +
fn read_f64_into<T: ByteOrder>(&mut self, dst: &mut [f64]) -> Result<()> { ... } +
fn read_f64_into_unchecked<T: ByteOrder>(
        &mut self,
        dst: &mut [f64]
    ) -> Result<()> { ... } +}

Extends Read with methods for reading numbers. (For std::io.)

+

Most of the methods defined here have an unconstrained type parameter that +must be explicitly instantiated. Typically, it is instantiated with either +the BigEndian or LittleEndian types defined in this crate.

+

Examples

+

Read unsigned 16 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
+assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap());
+assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
+
+

Provided methods

fn read_u8(&mut self) -> Result<u8>

Reads an unsigned 8 bit integer from the underlying reader.

+

Note that since this reads a single byte, no byte order conversions +are used. It is included for completeness.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read unsigned 8 bit integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::ReadBytesExt;
+
+let mut rdr = Cursor::new(vec![2, 5]);
+assert_eq!(2, rdr.read_u8().unwrap());
+assert_eq!(5, rdr.read_u8().unwrap());
+

fn read_i8(&mut self) -> Result<i8>

Reads a signed 8 bit integer from the underlying reader.

+

Note that since this reads a single byte, no byte order conversions +are used. It is included for completeness.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read signed 8 bit integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::ReadBytesExt;
+
+let mut rdr = Cursor::new(vec![0x02, 0xfb]);
+assert_eq!(2, rdr.read_i8().unwrap());
+assert_eq!(-5, rdr.read_i8().unwrap());
+

fn read_u16<T: ByteOrder>(&mut self) -> Result<u16>

Reads an unsigned 16 bit integer from the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read unsigned 16 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
+assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap());
+assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
+

fn read_i16<T: ByteOrder>(&mut self) -> Result<i16>

Reads a signed 16 bit integer from the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read signed 16 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![0x00, 0xc1, 0xff, 0x7c]);
+assert_eq!(193, rdr.read_i16::<BigEndian>().unwrap());
+assert_eq!(-132, rdr.read_i16::<BigEndian>().unwrap());
+

fn read_u24<T: ByteOrder>(&mut self) -> Result<u32>

Reads an unsigned 24 bit integer from the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read unsigned 24 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![0x00, 0x01, 0x0b]);
+assert_eq!(267, rdr.read_u24::<BigEndian>().unwrap());
+

fn read_i24<T: ByteOrder>(&mut self) -> Result<i32>

Reads a signed 24 bit integer from the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read signed 24 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![0xff, 0x7a, 0x33]);
+assert_eq!(-34253, rdr.read_i24::<BigEndian>().unwrap());
+

fn read_u32<T: ByteOrder>(&mut self) -> Result<u32>

Reads an unsigned 32 bit integer from the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read unsigned 32 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![0x00, 0x00, 0x01, 0x0b]);
+assert_eq!(267, rdr.read_u32::<BigEndian>().unwrap());
+

fn read_i32<T: ByteOrder>(&mut self) -> Result<i32>

Reads a signed 32 bit integer from the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read signed 32 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![0xff, 0xff, 0x7a, 0x33]);
+assert_eq!(-34253, rdr.read_i32::<BigEndian>().unwrap());
+

fn read_u48<T: ByteOrder>(&mut self) -> Result<u64>

Reads an unsigned 48 bit integer from the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read unsigned 48 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![0xb6, 0x71, 0x6b, 0xdc, 0x2b, 0x31]);
+assert_eq!(200598257150769, rdr.read_u48::<BigEndian>().unwrap());
+

fn read_i48<T: ByteOrder>(&mut self) -> Result<i64>

Reads a signed 48 bit integer from the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read signed 48 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![0x9d, 0x71, 0xab, 0xe7, 0x97, 0x8f]);
+assert_eq!(-108363435763825, rdr.read_i48::<BigEndian>().unwrap());
+

fn read_u64<T: ByteOrder>(&mut self) -> Result<u64>

Reads an unsigned 64 bit integer from the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read an unsigned 64 bit big-endian integer from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![0x00, 0x03, 0x43, 0x95, 0x4d, 0x60, 0x86, 0x83]);
+assert_eq!(918733457491587, rdr.read_u64::<BigEndian>().unwrap());
+

fn read_i64<T: ByteOrder>(&mut self) -> Result<i64>

Reads a signed 64 bit integer from the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a signed 64 bit big-endian integer from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![0x80, 0, 0, 0, 0, 0, 0, 0]);
+assert_eq!(i64::min_value(), rdr.read_i64::<BigEndian>().unwrap());
+

fn read_u128<T: ByteOrder>(&mut self) -> Result<u128>

Reads an unsigned 128 bit integer from the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read an unsigned 128 bit big-endian integer from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![
+    0x00, 0x03, 0x43, 0x95, 0x4d, 0x60, 0x86, 0x83,
+    0x00, 0x03, 0x43, 0x95, 0x4d, 0x60, 0x86, 0x83
+]);
+assert_eq!(16947640962301618749969007319746179, rdr.read_u128::<BigEndian>().unwrap());
+

fn read_i128<T: ByteOrder>(&mut self) -> Result<i128>

Reads a signed 128 bit integer from the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a signed 128 bit big-endian integer from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
+assert_eq!(i128::min_value(), rdr.read_i128::<BigEndian>().unwrap());
+

fn read_uint<T: ByteOrder>(&mut self, nbytes: usize) -> Result<u64>

Reads an unsigned n-bytes integer from the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read an unsigned n-byte big-endian integer from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![0x80, 0x74, 0xfa]);
+assert_eq!(8418554, rdr.read_uint::<BigEndian>(3).unwrap());
+

fn read_int<T: ByteOrder>(&mut self, nbytes: usize) -> Result<i64>

Reads a signed n-bytes integer from the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read an unsigned n-byte big-endian integer from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![0xc1, 0xff, 0x7c]);
+assert_eq!(-4063364, rdr.read_int::<BigEndian>(3).unwrap());
+

fn read_uint128<T: ByteOrder>(&mut self, nbytes: usize) -> Result<u128>

Reads an unsigned n-bytes integer from the underlying reader.

+

fn read_int128<T: ByteOrder>(&mut self, nbytes: usize) -> Result<i128>

Reads a signed n-bytes integer from the underlying reader.

+

fn read_f32<T: ByteOrder>(&mut self) -> Result<f32>

Reads a IEEE754 single-precision (4 bytes) floating point number from +the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a big-endian single-precision floating point number from a Read:

+ +
+use std::f32;
+use std::io::Cursor;
+
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![
+    0x40, 0x49, 0x0f, 0xdb,
+]);
+assert_eq!(f32::consts::PI, rdr.read_f32::<BigEndian>().unwrap());
+

fn read_f64<T: ByteOrder>(&mut self) -> Result<f64>

Reads a IEEE754 double-precision (8 bytes) floating point number from +the underlying reader.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a big-endian double-precision floating point number from a Read:

+ +
+use std::f64;
+use std::io::Cursor;
+
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![
+    0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18,
+]);
+assert_eq!(f64::consts::PI, rdr.read_f64::<BigEndian>().unwrap());
+

fn read_u16_into<T: ByteOrder>(&mut self, dst: &mut [u16]) -> Result<()>

Reads a sequence of unsigned 16 bit integers from the underlying +reader.

+

The given buffer is either filled completely or an error is returned. +If an error is returned, the contents of dst are unspecified.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a sequence of unsigned 16 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
+let mut dst = [0; 2];
+rdr.read_u16_into::<BigEndian>(&mut dst).unwrap();
+assert_eq!([517, 768], dst);
+

fn read_u32_into<T: ByteOrder>(&mut self, dst: &mut [u32]) -> Result<()>

Reads a sequence of unsigned 32 bit integers from the underlying +reader.

+

The given buffer is either filled completely or an error is returned. +If an error is returned, the contents of dst are unspecified.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a sequence of unsigned 32 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![0, 0, 2, 5, 0, 0, 3, 0]);
+let mut dst = [0; 2];
+rdr.read_u32_into::<BigEndian>(&mut dst).unwrap();
+assert_eq!([517, 768], dst);
+

fn read_u64_into<T: ByteOrder>(&mut self, dst: &mut [u64]) -> Result<()>

Reads a sequence of unsigned 64 bit integers from the underlying +reader.

+

The given buffer is either filled completely or an error is returned. +If an error is returned, the contents of dst are unspecified.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a sequence of unsigned 64 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![
+    0, 0, 0, 0, 0, 0, 2, 5,
+    0, 0, 0, 0, 0, 0, 3, 0,
+]);
+let mut dst = [0; 2];
+rdr.read_u64_into::<BigEndian>(&mut dst).unwrap();
+assert_eq!([517, 768], dst);
+

fn read_u128_into<T: ByteOrder>(&mut self, dst: &mut [u128]) -> Result<()>

Reads a sequence of unsigned 128 bit integers from the underlying +reader.

+

The given buffer is either filled completely or an error is returned. +If an error is returned, the contents of dst are unspecified.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a sequence of unsigned 128 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+]);
+let mut dst = [0; 2];
+rdr.read_u128_into::<BigEndian>(&mut dst).unwrap();
+assert_eq!([517, 768], dst);
+

fn read_i8_into(&mut self, dst: &mut [i8]) -> Result<()>

Reads a sequence of signed 8 bit integers from the underlying reader.

+

The given buffer is either filled completely or an error is returned. +If an error is returned, the contents of dst are unspecified.

+

Note that since each i8 is a single byte, no byte order conversions +are used. This method is included because it provides a safe, simple +way for the caller to read into a &mut [i8] buffer. (Without this +method, the caller would have to either use unsafe code or convert +each byte to i8 individually.)

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a sequence of signed 8 bit integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![2, 251, 3]);
+let mut dst = [0; 3];
+rdr.read_i8_into(&mut dst).unwrap();
+assert_eq!([2, -5, 3], dst);
+

fn read_i16_into<T: ByteOrder>(&mut self, dst: &mut [i16]) -> Result<()>

Reads a sequence of signed 16 bit integers from the underlying +reader.

+

The given buffer is either filled completely or an error is returned. +If an error is returned, the contents of dst are unspecified.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a sequence of signed 16 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
+let mut dst = [0; 2];
+rdr.read_i16_into::<BigEndian>(&mut dst).unwrap();
+assert_eq!([517, 768], dst);
+

fn read_i32_into<T: ByteOrder>(&mut self, dst: &mut [i32]) -> Result<()>

Reads a sequence of signed 32 bit integers from the underlying +reader.

+

The given buffer is either filled completely or an error is returned. +If an error is returned, the contents of dst are unspecified.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a sequence of signed 32 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![0, 0, 2, 5, 0, 0, 3, 0]);
+let mut dst = [0; 2];
+rdr.read_i32_into::<BigEndian>(&mut dst).unwrap();
+assert_eq!([517, 768], dst);
+

fn read_i64_into<T: ByteOrder>(&mut self, dst: &mut [i64]) -> Result<()>

Reads a sequence of signed 64 bit integers from the underlying +reader.

+

The given buffer is either filled completely or an error is returned. +If an error is returned, the contents of dst are unspecified.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a sequence of signed 64 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![
+    0, 0, 0, 0, 0, 0, 2, 5,
+    0, 0, 0, 0, 0, 0, 3, 0,
+]);
+let mut dst = [0; 2];
+rdr.read_i64_into::<BigEndian>(&mut dst).unwrap();
+assert_eq!([517, 768], dst);
+

fn read_i128_into<T: ByteOrder>(&mut self, dst: &mut [i128]) -> Result<()>

Reads a sequence of signed 128 bit integers from the underlying +reader.

+

The given buffer is either filled completely or an error is returned. +If an error is returned, the contents of dst are unspecified.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a sequence of signed 128 bit big-endian integers from a Read:

+ +
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+]);
+let mut dst = [0; 2];
+rdr.read_i128_into::<BigEndian>(&mut dst).unwrap();
+assert_eq!([517, 768], dst);
+

fn read_f32_into<T: ByteOrder>(&mut self, dst: &mut [f32]) -> Result<()>

Reads a sequence of IEEE754 single-precision (4 bytes) floating +point numbers from the underlying reader.

+

The given buffer is either filled completely or an error is returned. +If an error is returned, the contents of dst are unspecified.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a sequence of big-endian single-precision floating point number +from a Read:

+ +
+use std::f32;
+use std::io::Cursor;
+
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![
+    0x40, 0x49, 0x0f, 0xdb,
+    0x3f, 0x80, 0x00, 0x00,
+]);
+let mut dst = [0.0; 2];
+rdr.read_f32_into::<BigEndian>(&mut dst).unwrap();
+assert_eq!([f32::consts::PI, 1.0], dst);
+

fn read_f32_into_unchecked<T: ByteOrder>(
    &mut self,
    dst: &mut [f32]
) -> Result<()>

Deprecated since 1.2.0:

please use read_f32_into instead

+

DEPRECATED.

+

This method is deprecated. Use read_f32_into instead.

+

Reads a sequence of IEEE754 single-precision (4 bytes) floating +point numbers from the underlying reader.

+

The given buffer is either filled completely or an error is returned. +If an error is returned, the contents of dst are unspecified.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a sequence of big-endian single-precision floating point number +from a Read:

+ +
+use std::f32;
+use std::io::Cursor;
+
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![
+    0x40, 0x49, 0x0f, 0xdb,
+    0x3f, 0x80, 0x00, 0x00,
+]);
+let mut dst = [0.0; 2];
+rdr.read_f32_into_unchecked::<BigEndian>(&mut dst).unwrap();
+assert_eq!([f32::consts::PI, 1.0], dst);
+

fn read_f64_into<T: ByteOrder>(&mut self, dst: &mut [f64]) -> Result<()>

Reads a sequence of IEEE754 double-precision (8 bytes) floating +point numbers from the underlying reader.

+

The given buffer is either filled completely or an error is returned. +If an error is returned, the contents of dst are unspecified.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a sequence of big-endian single-precision floating point number +from a Read:

+ +
+use std::f64;
+use std::io::Cursor;
+
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![
+    0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18,
+    0x3f, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+]);
+let mut dst = [0.0; 2];
+rdr.read_f64_into::<BigEndian>(&mut dst).unwrap();
+assert_eq!([f64::consts::PI, 1.0], dst);
+

fn read_f64_into_unchecked<T: ByteOrder>(
    &mut self,
    dst: &mut [f64]
) -> Result<()>

Deprecated since 1.2.0:

please use read_f64_into instead

+

DEPRECATED.

+

This method is deprecated. Use read_f64_into instead.

+

Reads a sequence of IEEE754 double-precision (8 bytes) floating +point numbers from the underlying reader.

+

The given buffer is either filled completely or an error is returned. +If an error is returned, the contents of dst are unspecified.

+

Safety

+

This method is unsafe because there are no guarantees made about the +floating point values. In particular, this method does not check for +signaling NaNs, which may result in undefined behavior.

+

Errors

+

This method returns the same errors as Read::read_exact.

+

Examples

+

Read a sequence of big-endian single-precision floating point number +from a Read:

+ +
+use std::f64;
+use std::io::Cursor;
+
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![
+    0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18,
+    0x3f, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+]);
+let mut dst = [0.0; 2];
+rdr.read_f64_into_unchecked::<BigEndian>(&mut dst).unwrap();
+assert_eq!([f64::consts::PI, 1.0], dst);
+
Loading content... +

Implementors

impl<R: Read + ?Sized> ReadBytesExt for R[src]

All types that implement Read get methods defined in ReadBytesExt +for free.

+
Loading content...
\ No newline at end of file diff --git a/byteorder/trait.WriteBytesExt.html b/byteorder/trait.WriteBytesExt.html new file mode 100644 index 0000000..8115834 --- /dev/null +++ b/byteorder/trait.WriteBytesExt.html @@ -0,0 +1,270 @@ +byteorder::WriteBytesExt - Rust

[][src]Trait byteorder::WriteBytesExt

pub trait WriteBytesExt: Write {
+    fn write_u8(&mut self, n: u8) -> Result<()> { ... }
+
fn write_i8(&mut self, n: i8) -> Result<()> { ... } +
fn write_u16<T: ByteOrder>(&mut self, n: u16) -> Result<()> { ... } +
fn write_i16<T: ByteOrder>(&mut self, n: i16) -> Result<()> { ... } +
fn write_u24<T: ByteOrder>(&mut self, n: u32) -> Result<()> { ... } +
fn write_i24<T: ByteOrder>(&mut self, n: i32) -> Result<()> { ... } +
fn write_u32<T: ByteOrder>(&mut self, n: u32) -> Result<()> { ... } +
fn write_i32<T: ByteOrder>(&mut self, n: i32) -> Result<()> { ... } +
fn write_u48<T: ByteOrder>(&mut self, n: u64) -> Result<()> { ... } +
fn write_i48<T: ByteOrder>(&mut self, n: i64) -> Result<()> { ... } +
fn write_u64<T: ByteOrder>(&mut self, n: u64) -> Result<()> { ... } +
fn write_i64<T: ByteOrder>(&mut self, n: i64) -> Result<()> { ... } +
fn write_u128<T: ByteOrder>(&mut self, n: u128) -> Result<()> { ... } +
fn write_i128<T: ByteOrder>(&mut self, n: i128) -> Result<()> { ... } +
fn write_uint<T: ByteOrder>(&mut self, n: u64, nbytes: usize) -> Result<()> { ... } +
fn write_int<T: ByteOrder>(&mut self, n: i64, nbytes: usize) -> Result<()> { ... } +
fn write_uint128<T: ByteOrder>(
        &mut self,
        n: u128,
        nbytes: usize
    ) -> Result<()> { ... } +
fn write_int128<T: ByteOrder>(
        &mut self,
        n: i128,
        nbytes: usize
    ) -> Result<()> { ... } +
fn write_f32<T: ByteOrder>(&mut self, n: f32) -> Result<()> { ... } +
fn write_f64<T: ByteOrder>(&mut self, n: f64) -> Result<()> { ... } +}

Extends Write with methods for writing numbers. (For std::io.)

+

Most of the methods defined here have an unconstrained type parameter that +must be explicitly instantiated. Typically, it is instantiated with either +the BigEndian or LittleEndian types defined in this crate.

+

Examples

+

Write unsigned 16 bit big-endian integers to a Write:

+ +
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = vec![];
+wtr.write_u16::<BigEndian>(517).unwrap();
+wtr.write_u16::<BigEndian>(768).unwrap();
+assert_eq!(wtr, vec![2, 5, 3, 0]);
+
+

Provided methods

fn write_u8(&mut self, n: u8) -> Result<()>

Writes an unsigned 8 bit integer to the underlying writer.

+

Note that since this writes a single byte, no byte order conversions +are used. It is included for completeness.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Examples

+

Write unsigned 8 bit integers to a Write:

+ +
+use byteorder::WriteBytesExt;
+
+let mut wtr = Vec::new();
+wtr.write_u8(2).unwrap();
+wtr.write_u8(5).unwrap();
+assert_eq!(wtr, b"\x02\x05");
+

fn write_i8(&mut self, n: i8) -> Result<()>

Writes a signed 8 bit integer to the underlying writer.

+

Note that since this writes a single byte, no byte order conversions +are used. It is included for completeness.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Examples

+

Write signed 8 bit integers to a Write:

+ +
+use byteorder::WriteBytesExt;
+
+let mut wtr = Vec::new();
+wtr.write_i8(2).unwrap();
+wtr.write_i8(-5).unwrap();
+assert_eq!(wtr, b"\x02\xfb");
+

fn write_u16<T: ByteOrder>(&mut self, n: u16) -> Result<()>

Writes an unsigned 16 bit integer to the underlying writer.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Examples

+

Write unsigned 16 bit big-endian integers to a Write:

+ +
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = Vec::new();
+wtr.write_u16::<BigEndian>(517).unwrap();
+wtr.write_u16::<BigEndian>(768).unwrap();
+assert_eq!(wtr, b"\x02\x05\x03\x00");
+

fn write_i16<T: ByteOrder>(&mut self, n: i16) -> Result<()>

Writes a signed 16 bit integer to the underlying writer.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Examples

+

Write signed 16 bit big-endian integers to a Write:

+ +
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = Vec::new();
+wtr.write_i16::<BigEndian>(193).unwrap();
+wtr.write_i16::<BigEndian>(-132).unwrap();
+assert_eq!(wtr, b"\x00\xc1\xff\x7c");
+

fn write_u24<T: ByteOrder>(&mut self, n: u32) -> Result<()>

Writes an unsigned 24 bit integer to the underlying writer.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Examples

+

Write unsigned 24 bit big-endian integers to a Write:

+ +
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = Vec::new();
+wtr.write_u24::<BigEndian>(267).unwrap();
+wtr.write_u24::<BigEndian>(120111).unwrap();
+assert_eq!(wtr, b"\x00\x01\x0b\x01\xd5\x2f");
+

fn write_i24<T: ByteOrder>(&mut self, n: i32) -> Result<()>

Writes a signed 24 bit integer to the underlying writer.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Examples

+

Write signed 24 bit big-endian integers to a Write:

+ +
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = Vec::new();
+wtr.write_i24::<BigEndian>(-34253).unwrap();
+wtr.write_i24::<BigEndian>(120111).unwrap();
+assert_eq!(wtr, b"\xff\x7a\x33\x01\xd5\x2f");
+

fn write_u32<T: ByteOrder>(&mut self, n: u32) -> Result<()>

Writes an unsigned 32 bit integer to the underlying writer.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Examples

+

Write unsigned 32 bit big-endian integers to a Write:

+ +
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = Vec::new();
+wtr.write_u32::<BigEndian>(267).unwrap();
+wtr.write_u32::<BigEndian>(1205419366).unwrap();
+assert_eq!(wtr, b"\x00\x00\x01\x0b\x47\xd9\x3d\x66");
+

fn write_i32<T: ByteOrder>(&mut self, n: i32) -> Result<()>

Writes a signed 32 bit integer to the underlying writer.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Examples

+

Write signed 32 bit big-endian integers to a Write:

+ +
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = Vec::new();
+wtr.write_i32::<BigEndian>(-34253).unwrap();
+wtr.write_i32::<BigEndian>(1205419366).unwrap();
+assert_eq!(wtr, b"\xff\xff\x7a\x33\x47\xd9\x3d\x66");
+

fn write_u48<T: ByteOrder>(&mut self, n: u64) -> Result<()>

Writes an unsigned 48 bit integer to the underlying writer.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Examples

+

Write unsigned 48 bit big-endian integers to a Write:

+ +
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = Vec::new();
+wtr.write_u48::<BigEndian>(52360336390828).unwrap();
+wtr.write_u48::<BigEndian>(541).unwrap();
+assert_eq!(wtr, b"\x2f\x9f\x17\x40\x3a\xac\x00\x00\x00\x00\x02\x1d");
+

fn write_i48<T: ByteOrder>(&mut self, n: i64) -> Result<()>

Writes a signed 48 bit integer to the underlying writer.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Examples

+

Write signed 48 bit big-endian integers to a Write:

+ +
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = Vec::new();
+wtr.write_i48::<BigEndian>(-108363435763825).unwrap();
+wtr.write_i48::<BigEndian>(77).unwrap();
+assert_eq!(wtr, b"\x9d\x71\xab\xe7\x97\x8f\x00\x00\x00\x00\x00\x4d");
+

fn write_u64<T: ByteOrder>(&mut self, n: u64) -> Result<()>

Writes an unsigned 64 bit integer to the underlying writer.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Examples

+

Write unsigned 64 bit big-endian integers to a Write:

+ +
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = Vec::new();
+wtr.write_u64::<BigEndian>(918733457491587).unwrap();
+wtr.write_u64::<BigEndian>(143).unwrap();
+assert_eq!(wtr, b"\x00\x03\x43\x95\x4d\x60\x86\x83\x00\x00\x00\x00\x00\x00\x00\x8f");
+

fn write_i64<T: ByteOrder>(&mut self, n: i64) -> Result<()>

Writes a signed 64 bit integer to the underlying writer.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Examples

+

Write signed 64 bit big-endian integers to a Write:

+ +
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = Vec::new();
+wtr.write_i64::<BigEndian>(i64::min_value()).unwrap();
+wtr.write_i64::<BigEndian>(i64::max_value()).unwrap();
+assert_eq!(wtr, b"\x80\x00\x00\x00\x00\x00\x00\x00\x7f\xff\xff\xff\xff\xff\xff\xff");
+

fn write_u128<T: ByteOrder>(&mut self, n: u128) -> Result<()>

Writes an unsigned 128 bit integer to the underlying writer.

+

fn write_i128<T: ByteOrder>(&mut self, n: i128) -> Result<()>

Writes a signed 128 bit integer to the underlying writer.

+

fn write_uint<T: ByteOrder>(&mut self, n: u64, nbytes: usize) -> Result<()>

Writes an unsigned n-bytes integer to the underlying writer.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Panics

+

If the given integer is not representable in the given number of bytes, +this method panics. If nbytes > 8, this method panics.

+

Examples

+

Write unsigned 40 bit big-endian integers to a Write:

+ +
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = Vec::new();
+wtr.write_uint::<BigEndian>(312550384361, 5).unwrap();
+wtr.write_uint::<BigEndian>(43, 5).unwrap();
+assert_eq!(wtr, b"\x48\xc5\x74\x62\xe9\x00\x00\x00\x00\x2b");
+

fn write_int<T: ByteOrder>(&mut self, n: i64, nbytes: usize) -> Result<()>

Writes a signed n-bytes integer to the underlying writer.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Panics

+

If the given integer is not representable in the given number of bytes, +this method panics. If nbytes > 8, this method panics.

+

Examples

+

Write signed 56 bit big-endian integers to a Write:

+ +
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = Vec::new();
+wtr.write_int::<BigEndian>(-3548172039376767, 7).unwrap();
+wtr.write_int::<BigEndian>(43, 7).unwrap();
+assert_eq!(wtr, b"\xf3\x64\xf4\xd1\xfd\xb0\x81\x00\x00\x00\x00\x00\x00\x2b");
+

fn write_uint128<T: ByteOrder>(&mut self, n: u128, nbytes: usize) -> Result<()>

Writes an unsigned n-bytes integer to the underlying writer.

+

If the given integer is not representable in the given number of bytes, +this method panics. If nbytes > 16, this method panics.

+

fn write_int128<T: ByteOrder>(&mut self, n: i128, nbytes: usize) -> Result<()>

Writes a signed n-bytes integer to the underlying writer.

+

If the given integer is not representable in the given number of bytes, +this method panics. If nbytes > 16, this method panics.

+

fn write_f32<T: ByteOrder>(&mut self, n: f32) -> Result<()>

Writes a IEEE754 single-precision (4 bytes) floating point number to +the underlying writer.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Examples

+

Write a big-endian single-precision floating point number to a Write:

+ +
+use std::f32;
+
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = Vec::new();
+wtr.write_f32::<BigEndian>(f32::consts::PI).unwrap();
+assert_eq!(wtr, b"\x40\x49\x0f\xdb");
+

fn write_f64<T: ByteOrder>(&mut self, n: f64) -> Result<()>

Writes a IEEE754 double-precision (8 bytes) floating point number to +the underlying writer.

+

Errors

+

This method returns the same errors as Write::write_all.

+

Examples

+

Write a big-endian double-precision floating point number to a Write:

+ +
+use std::f64;
+
+use byteorder::{BigEndian, WriteBytesExt};
+
+let mut wtr = Vec::new();
+wtr.write_f64::<BigEndian>(f64::consts::PI).unwrap();
+assert_eq!(wtr, b"\x40\x09\x21\xfb\x54\x44\x2d\x18");
+
Loading content... +

Implementors

impl<W: Write + ?Sized> WriteBytesExt for W[src]

All types that implement Write get methods defined in WriteBytesExt +for free.

+
Loading content...
\ No newline at end of file diff --git a/byteorder/type.BE.html b/byteorder/type.BE.html new file mode 100644 index 0000000..3d4d095 --- /dev/null +++ b/byteorder/type.BE.html @@ -0,0 +1,2 @@ +byteorder::BE - Rust

[][src]Type Definition byteorder::BE

type BE = BigEndian;

A type alias for BigEndian.

+
\ No newline at end of file diff --git a/byteorder/type.LE.html b/byteorder/type.LE.html new file mode 100644 index 0000000..72de43f --- /dev/null +++ b/byteorder/type.LE.html @@ -0,0 +1,2 @@ +byteorder::LE - Rust

[][src]Type Definition byteorder::LE

type LE = LittleEndian;

A type alias for LittleEndian.

+
\ No newline at end of file diff --git a/byteorder/type.NativeEndian.html b/byteorder/type.NativeEndian.html new file mode 100644 index 0000000..c1447fb --- /dev/null +++ b/byteorder/type.NativeEndian.html @@ -0,0 +1,5 @@ +byteorder::NativeEndian - Rust

[][src]Type Definition byteorder::NativeEndian

type NativeEndian = LittleEndian;

Defines system native-endian serialization.

+

Note that this type has no value constructor. It is used purely at the +type level.

+

On this platform, this is an alias for LittleEndian.

+
\ No newline at end of file diff --git a/byteorder/type.NetworkEndian.html b/byteorder/type.NetworkEndian.html new file mode 100644 index 0000000..69c8983 --- /dev/null +++ b/byteorder/type.NetworkEndian.html @@ -0,0 +1,16 @@ +byteorder::NetworkEndian - Rust

[][src]Type Definition byteorder::NetworkEndian

type NetworkEndian = BigEndian;

Defines network byte order serialization.

+

Network byte order is defined by RFC 1700 to be big-endian, and is +referred to in several protocol specifications. This type is an alias of +BigEndian.

+

Note that this type has no value constructor. It is used purely at the +type level.

+

Examples

+

Write and read i16 numbers in big endian order:

+ +
+use byteorder::{ByteOrder, NetworkEndian, BigEndian};
+
+let mut buf = [0; 2];
+BigEndian::write_i16(&mut buf, -5_000);
+assert_eq!(-5_000, NetworkEndian::read_i16(&buf));
+
\ No newline at end of file diff --git a/cfg_if/all.html b/cfg_if/all.html new file mode 100644 index 0000000..393f3ad --- /dev/null +++ b/cfg_if/all.html @@ -0,0 +1,3 @@ +List of all items in this crate

[] + + List of all items

Macros

\ No newline at end of file diff --git a/cfg_if/index.html b/cfg_if/index.html new file mode 100644 index 0000000..c46040d --- /dev/null +++ b/cfg_if/index.html @@ -0,0 +1,22 @@ +cfg_if - Rust

[][src]Crate cfg_if

A macro for defining #[cfg] if-else statements.

+

The macro provided by this crate, cfg_if, is similar to the if/elif C +preprocessor macro by allowing definition of a cascade of #[cfg] cases, +emitting the implementation which matches first.

+

This allows you to conveniently provide a long list #[cfg]'d blocks of code +without having to rewrite each clause multiple times.

+

Example

+
+cfg_if::cfg_if! {
+    if #[cfg(unix)] {
+        fn foo() { /* unix specific functionality */ }
+    } else if #[cfg(target_pointer_width = "32")] {
+        fn foo() { /* non-unix, 32-bit functionality */ }
+    } else {
+        fn foo() { /* fallback implementation */ }
+    }
+}
+
+

Macros

+
cfg_if

The main macro provided by this crate. See crate documentation for more +information.

+
\ No newline at end of file diff --git a/cfg_if/macro.cfg_if!.html b/cfg_if/macro.cfg_if!.html new file mode 100644 index 0000000..36f9a6d --- /dev/null +++ b/cfg_if/macro.cfg_if!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.cfg_if.html...

+ + + \ No newline at end of file diff --git a/cfg_if/macro.cfg_if.html b/cfg_if/macro.cfg_if.html new file mode 100644 index 0000000..2a785d9 --- /dev/null +++ b/cfg_if/macro.cfg_if.html @@ -0,0 +1,20 @@ +cfg_if::cfg_if - Rust

[][src]Macro cfg_if::cfg_if

+macro_rules! cfg_if {
+    ($(
+        if #[cfg($($meta:meta),*)] { $($tokens:tt)* }
+    ) else * else {
+        $($tokens2:tt)*
+    }) => { ... };
+    (
+        if #[cfg($($i_met:meta),*)] { $($i_tokens:tt)* }
+        $(
+            else if #[cfg($($e_met:meta),*)] { $($e_tokens:tt)* }
+        )*
+    ) => { ... };
+    (@__items ($($not:meta,)*) ; ) => { ... };
+    (@__items ($($not:meta,)*) ; ( ($($m:meta),*) ($($tokens:tt)*) ), $($rest:tt)*) => { ... };
+    (@__identity $($tokens:tt)*) => { ... };
+}
+

The main macro provided by this crate. See crate documentation for more +information.

+
\ No newline at end of file diff --git a/cfg_if/sidebar-items.js b/cfg_if/sidebar-items.js new file mode 100644 index 0000000..dbc0f91 --- /dev/null +++ b/cfg_if/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"macro":[["cfg_if","The main macro provided by this crate. See crate documentation for more information."]]}); \ No newline at end of file diff --git a/dark.css b/dark.css new file mode 100644 index 0000000..0e47c69 --- /dev/null +++ b/dark.css @@ -0,0 +1 @@ +body{background-color:#353535;color:#ddd;}h1,h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){color:#ddd;}h1.fqn{border-bottom-color:#d2d2d2;}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){border-bottom-color:#d2d2d2;}.in-band{background-color:#353535;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#2A2A2A;}pre{background-color:#2A2A2A;}.sidebar{background-color:#505050;}.sidebar .current{background-color:#333;}.source .sidebar{background-color:#353535;}.sidebar .location{border-color:#fff;background:#575757;color:#DDD;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#444;}.line-numbers span{color:#3B91E2;}.line-numbers .line-highlighted{background-color:#0a042f !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom-color:#DDD;}.docblock table,.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#ddd;}.content .highlighted{color:#eee !important;background-color:#616161;}.content .highlighted a,.content .highlighted span{color:#eee !important;}.content .highlighted.trait{background-color:#013191;}.content .highlighted.traitalias{background-color:#013191;}.content .highlighted.mod,.content .highlighted.externcrate{background-color:#afc6e4;}.content .highlighted.mod{background-color:#803a1b;}.content .highlighted.externcrate{background-color:#396bac;}.content .highlighted.enum{background-color:#5b4e68;}.content .highlighted.struct{background-color:#194e9f;}.content .highlighted.union{background-color:#b7bd49;}.content .highlighted.fn,.content .highlighted.method,.content .highlighted.tymethod{background-color:#4950ed;}.content .highlighted.type{background-color:#38902c;}.content .highlighted.foreigntype{background-color:#b200d6;}.content .highlighted.attr,.content .highlighted.derive,.content .highlighted.macro{background-color:#217d1c;}.content .highlighted.constant,.content .highlighted.static{background-color:#0063cc;}.content .highlighted.primitive{background-color:#00708a;}.content .highlighted.keyword{background-color:#884719;}.content .stability::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#82b089;}.content span.struct,.content a.struct,.block a.current.struct{color:#2dbfb8;}.content span.type,.content a.type,.block a.current.type{color:#ff7f00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#dd7de8;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#09bd00;}.content span.union,.content a.union,.block a.current.union{color:#a6ae37;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#82a5c9;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#43aec7;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#bda000;}.content span.trait,.content a.trait,.block a.current.trait{color:#b78cf2;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#b397da;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#2BAB63;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}pre.rust .comment{color:#8d8d8b;}pre.rust .doccomment{color:#8ca375;}nav:not(.sidebar){border-bottom-color:#4e4e4e;}nav.main .current{border-top-color:#eee;border-bottom-color:#eee;}nav.main .separator{border-color:#eee;}a{color:#ddd;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.stability a{color:#D2991D;}.stab.internal a{color:#304FFE;}a.test-arrow{color:#dedede;}.collapse-toggle{color:#999;}#crate-search{color:#111;background-color:#f0f0f0;border-color:#000;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input{color:#111;background-color:#f0f0f0;box-shadow:0 0 0 1px #000,0 0 0 2px transparent;}.search-input:focus{border-color:#008dfd;}.search-focus:disabled{background-color:#c5c4c4;}#crate-search+.search-input:focus{box-shadow:0 0 8px 4px #078dd8;}.module-item .stab{color:#ddd;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;color:#2f2f2f;}.stab.internal{background:#FFB9B3;border-color:#B71C1C;color:#2f2f2f;}.stab.deprecated{background:#F3DFFF;border-color:#7F0087;color:#2f2f2f;}.stab.portability{background:#C4ECFF;border-color:#7BA5DB;color:#2f2f2f;}.stab.portability>code{color:#ddd;}#help>div{background:#4d4d4d;border-color:#bfbfbf;}#help dt{border-color:#bfbfbf;background:rgba(0,0,0,0);color:black;}.since{color:grey;}tr.result span.primitive::after,tr.result span.keyword::after{color:#ddd;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#ab8ac1;}pre.rust .kw-2,pre.rust .prelude-ty{color:#769acb;}pre.rust .number,pre.rust .string{color:#83a300;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#ee6868;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#d97f26;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#4a4949;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label{color:#999;}:target>code,:target>.in-band{background-color:#494a3d;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.6);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.6);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.6);}.information>.compile_fail:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.6);}.information>.ignore:hover{color:rgba(255,142,0,1);}.search-failed a{color:#0089ff;}.tooltip .tooltiptext{background-color:black;color:#fff;}.tooltip .tooltiptext::after{border-color:transparent black transparent transparent;}#titles>div:not(.selected){background-color:#252525;border-top-color:#252525;}#titles>div:hover,#titles>div.selected{border-top-color:#0089ff;}#titles>div>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#505050;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#505050;border-right-color:#000;}#sidebar-filler{background-color:#505050;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu{border-color:#e0e0e0;background:#f0f0f0;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus{border-color:#ffb900;}#theme-choices{border-color:#e0e0e0;background-color:#353535;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#4e4e4e;}@media (max-width:700px){#theme-picker{background:#f0f0f0;}}#all-types{background-color:#505050;}#all-types:hover{background-color:#606060;}.search-results td span.alias{color:#fff;}.search-results td span.grey{color:#ccc;}#sidebar-toggle{background-color:#565656;}#sidebar-toggle:hover{background-color:#676767;}#source-sidebar{background-color:#565656;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#444;}div.files>.selected{background-color:#333;}.setting-line>.title{border-bottom-color:#ddd;} \ No newline at end of file diff --git a/down-arrow.svg b/down-arrow.svg new file mode 100644 index 0000000..35437e7 --- /dev/null +++ b/down-arrow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..b8ad237 Binary files /dev/null and b/favicon.ico differ diff --git a/implementors/byteorder/trait.ByteOrder.js b/implementors/byteorder/trait.ByteOrder.js new file mode 100644 index 0000000..1f24d3f --- /dev/null +++ b/implementors/byteorder/trait.ByteOrder.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["byteorder"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/byteorder/trait.ReadBytesExt.js b/implementors/byteorder/trait.ReadBytesExt.js new file mode 100644 index 0000000..1f24d3f --- /dev/null +++ b/implementors/byteorder/trait.ReadBytesExt.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["byteorder"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/byteorder/trait.WriteBytesExt.js b/implementors/byteorder/trait.WriteBytesExt.js new file mode 100644 index 0000000..1f24d3f --- /dev/null +++ b/implementors/byteorder/trait.WriteBytesExt.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["byteorder"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/clone/trait.Clone.js b/implementors/core/clone/trait.Clone.js new file mode 100644 index 0000000..03230ce --- /dev/null +++ b/implementors/core/clone/trait.Clone.js @@ -0,0 +1,9 @@ +(function() {var implementors = {}; +implementors["bincode"] = [{"text":"impl Clone for Config","synthetic":false,"types":["bincode::config::Config"]}]; +implementors["byteorder"] = [{"text":"impl Clone for BigEndian","synthetic":false,"types":["byteorder::BigEndian"]},{"text":"impl Clone for LittleEndian","synthetic":false,"types":["byteorder::LittleEndian"]}]; +implementors["ironsea_index_sfc_dbc"] = [{"text":"impl<F: Clone, K: Clone, V: Clone> Clone for SpaceFillingCurve<F, K, V> where
    F: PartialEq,
    K: Debug + FromIterator<V> + Index<usize, Output = V>,
    V: Clone + Debug + From<usize> + Ord
","synthetic":false,"types":["ironsea_index_sfc_dbc::sfc::SpaceFillingCurve"]}]; +implementors["log"] = [{"text":"impl Clone for Level","synthetic":false,"types":["log::Level"]},{"text":"impl Clone for LevelFilter","synthetic":false,"types":["log::LevelFilter"]},{"text":"impl<'a> Clone for Record<'a>","synthetic":false,"types":["log::Record"]},{"text":"impl<'a> Clone for Metadata<'a>","synthetic":false,"types":["log::Metadata"]}]; +implementors["proc_macro2"] = [{"text":"impl Clone for TokenStream","synthetic":false,"types":["proc_macro2::TokenStream"]},{"text":"impl Clone for Span","synthetic":false,"types":["proc_macro2::Span"]},{"text":"impl Clone for TokenTree","synthetic":false,"types":["proc_macro2::TokenTree"]},{"text":"impl Clone for Group","synthetic":false,"types":["proc_macro2::Group"]},{"text":"impl Clone for Delimiter","synthetic":false,"types":["proc_macro2::Delimiter"]},{"text":"impl Clone for Punct","synthetic":false,"types":["proc_macro2::Punct"]},{"text":"impl Clone for Spacing","synthetic":false,"types":["proc_macro2::Spacing"]},{"text":"impl Clone for Ident","synthetic":false,"types":["proc_macro2::Ident"]},{"text":"impl Clone for Literal","synthetic":false,"types":["proc_macro2::Literal"]},{"text":"impl Clone for IntoIter","synthetic":false,"types":["proc_macro2::token_stream::IntoIter"]}]; +implementors["serde"] = [{"text":"impl Clone for Error","synthetic":false,"types":["serde::de::value::Error"]},{"text":"impl<E> Clone for UnitDeserializer<E>","synthetic":false,"types":["serde::de::value::UnitDeserializer"]},{"text":"impl<E> Clone for BoolDeserializer<E>","synthetic":false,"types":["serde::de::value::BoolDeserializer"]},{"text":"impl<E> Clone for I8Deserializer<E>","synthetic":false,"types":["serde::de::value::I8Deserializer"]},{"text":"impl<E> Clone for I16Deserializer<E>","synthetic":false,"types":["serde::de::value::I16Deserializer"]},{"text":"impl<E> Clone for I32Deserializer<E>","synthetic":false,"types":["serde::de::value::I32Deserializer"]},{"text":"impl<E> Clone for I64Deserializer<E>","synthetic":false,"types":["serde::de::value::I64Deserializer"]},{"text":"impl<E> Clone for IsizeDeserializer<E>","synthetic":false,"types":["serde::de::value::IsizeDeserializer"]},{"text":"impl<E> Clone for U8Deserializer<E>","synthetic":false,"types":["serde::de::value::U8Deserializer"]},{"text":"impl<E> Clone for U16Deserializer<E>","synthetic":false,"types":["serde::de::value::U16Deserializer"]},{"text":"impl<E> Clone for U64Deserializer<E>","synthetic":false,"types":["serde::de::value::U64Deserializer"]},{"text":"impl<E> Clone for UsizeDeserializer<E>","synthetic":false,"types":["serde::de::value::UsizeDeserializer"]},{"text":"impl<E> Clone for F32Deserializer<E>","synthetic":false,"types":["serde::de::value::F32Deserializer"]},{"text":"impl<E> Clone for F64Deserializer<E>","synthetic":false,"types":["serde::de::value::F64Deserializer"]},{"text":"impl<E> Clone for CharDeserializer<E>","synthetic":false,"types":["serde::de::value::CharDeserializer"]},{"text":"impl<E> Clone for I128Deserializer<E>","synthetic":false,"types":["serde::de::value::I128Deserializer"]},{"text":"impl<E> Clone for U128Deserializer<E>","synthetic":false,"types":["serde::de::value::U128Deserializer"]},{"text":"impl<E> Clone for U32Deserializer<E>","synthetic":false,"types":["serde::de::value::U32Deserializer"]},{"text":"impl<'de, E> Clone for StrDeserializer<'de, E>","synthetic":false,"types":["serde::de::value::StrDeserializer"]},{"text":"impl<'de, E> Clone for BorrowedStrDeserializer<'de, E>","synthetic":false,"types":["serde::de::value::BorrowedStrDeserializer"]},{"text":"impl<E> Clone for StringDeserializer<E>","synthetic":false,"types":["serde::de::value::StringDeserializer"]},{"text":"impl<'a, E> Clone for CowStrDeserializer<'a, E>","synthetic":false,"types":["serde::de::value::CowStrDeserializer"]},{"text":"impl<'de, E> Clone for BorrowedBytesDeserializer<'de, E>","synthetic":false,"types":["serde::de::value::BorrowedBytesDeserializer"]},{"text":"impl<I: Clone, E: Clone> Clone for SeqDeserializer<I, E>","synthetic":false,"types":["serde::de::value::SeqDeserializer"]},{"text":"impl<A: Clone> Clone for SeqAccessDeserializer<A>","synthetic":false,"types":["serde::de::value::SeqAccessDeserializer"]},{"text":"impl<'de, I, E> Clone for MapDeserializer<'de, I, E> where
    I: Iterator + Clone,
    I::Item: Pair,
    <I::Item as Pair>::Second: Clone
","synthetic":false,"types":["serde::de::value::MapDeserializer"]},{"text":"impl<A: Clone> Clone for MapAccessDeserializer<A>","synthetic":false,"types":["serde::de::value::MapAccessDeserializer"]},{"text":"impl Clone for IgnoredAny","synthetic":false,"types":["serde::de::ignored_any::IgnoredAny"]},{"text":"impl<'a> Clone for Unexpected<'a>","synthetic":false,"types":["serde::de::Unexpected"]}]; +implementors["syn"] = [{"text":"impl Clone for Underscore","synthetic":false,"types":["syn::token::Underscore"]},{"text":"impl Clone for Abstract","synthetic":false,"types":["syn::token::Abstract"]},{"text":"impl Clone for As","synthetic":false,"types":["syn::token::As"]},{"text":"impl Clone for Async","synthetic":false,"types":["syn::token::Async"]},{"text":"impl Clone for Auto","synthetic":false,"types":["syn::token::Auto"]},{"text":"impl Clone for Await","synthetic":false,"types":["syn::token::Await"]},{"text":"impl Clone for Become","synthetic":false,"types":["syn::token::Become"]},{"text":"impl Clone for Box","synthetic":false,"types":["syn::token::Box"]},{"text":"impl Clone for Break","synthetic":false,"types":["syn::token::Break"]},{"text":"impl Clone for Const","synthetic":false,"types":["syn::token::Const"]},{"text":"impl Clone for Continue","synthetic":false,"types":["syn::token::Continue"]},{"text":"impl Clone for Crate","synthetic":false,"types":["syn::token::Crate"]},{"text":"impl Clone for Default","synthetic":false,"types":["syn::token::Default"]},{"text":"impl Clone for Do","synthetic":false,"types":["syn::token::Do"]},{"text":"impl Clone for Dyn","synthetic":false,"types":["syn::token::Dyn"]},{"text":"impl Clone for Else","synthetic":false,"types":["syn::token::Else"]},{"text":"impl Clone for Enum","synthetic":false,"types":["syn::token::Enum"]},{"text":"impl Clone for Extern","synthetic":false,"types":["syn::token::Extern"]},{"text":"impl Clone for Final","synthetic":false,"types":["syn::token::Final"]},{"text":"impl Clone for Fn","synthetic":false,"types":["syn::token::Fn"]},{"text":"impl Clone for For","synthetic":false,"types":["syn::token::For"]},{"text":"impl Clone for If","synthetic":false,"types":["syn::token::If"]},{"text":"impl Clone for Impl","synthetic":false,"types":["syn::token::Impl"]},{"text":"impl Clone for In","synthetic":false,"types":["syn::token::In"]},{"text":"impl Clone for Let","synthetic":false,"types":["syn::token::Let"]},{"text":"impl Clone for Loop","synthetic":false,"types":["syn::token::Loop"]},{"text":"impl Clone for Macro","synthetic":false,"types":["syn::token::Macro"]},{"text":"impl Clone for Match","synthetic":false,"types":["syn::token::Match"]},{"text":"impl Clone for Mod","synthetic":false,"types":["syn::token::Mod"]},{"text":"impl Clone for Move","synthetic":false,"types":["syn::token::Move"]},{"text":"impl Clone for Mut","synthetic":false,"types":["syn::token::Mut"]},{"text":"impl Clone for Override","synthetic":false,"types":["syn::token::Override"]},{"text":"impl Clone for Priv","synthetic":false,"types":["syn::token::Priv"]},{"text":"impl Clone for Pub","synthetic":false,"types":["syn::token::Pub"]},{"text":"impl Clone for Ref","synthetic":false,"types":["syn::token::Ref"]},{"text":"impl Clone for Return","synthetic":false,"types":["syn::token::Return"]},{"text":"impl Clone for SelfType","synthetic":false,"types":["syn::token::SelfType"]},{"text":"impl Clone for SelfValue","synthetic":false,"types":["syn::token::SelfValue"]},{"text":"impl Clone for Static","synthetic":false,"types":["syn::token::Static"]},{"text":"impl Clone for Struct","synthetic":false,"types":["syn::token::Struct"]},{"text":"impl Clone for Super","synthetic":false,"types":["syn::token::Super"]},{"text":"impl Clone for Trait","synthetic":false,"types":["syn::token::Trait"]},{"text":"impl Clone for Try","synthetic":false,"types":["syn::token::Try"]},{"text":"impl Clone for Type","synthetic":false,"types":["syn::token::Type"]},{"text":"impl Clone for Typeof","synthetic":false,"types":["syn::token::Typeof"]},{"text":"impl Clone for Union","synthetic":false,"types":["syn::token::Union"]},{"text":"impl Clone for Unsafe","synthetic":false,"types":["syn::token::Unsafe"]},{"text":"impl Clone for Unsized","synthetic":false,"types":["syn::token::Unsized"]},{"text":"impl Clone for Use","synthetic":false,"types":["syn::token::Use"]},{"text":"impl Clone for Virtual","synthetic":false,"types":["syn::token::Virtual"]},{"text":"impl Clone for Where","synthetic":false,"types":["syn::token::Where"]},{"text":"impl Clone for While","synthetic":false,"types":["syn::token::While"]},{"text":"impl Clone for Yield","synthetic":false,"types":["syn::token::Yield"]},{"text":"impl Clone for Add","synthetic":false,"types":["syn::token::Add"]},{"text":"impl Clone for AddEq","synthetic":false,"types":["syn::token::AddEq"]},{"text":"impl Clone for And","synthetic":false,"types":["syn::token::And"]},{"text":"impl Clone for AndAnd","synthetic":false,"types":["syn::token::AndAnd"]},{"text":"impl Clone for AndEq","synthetic":false,"types":["syn::token::AndEq"]},{"text":"impl Clone for At","synthetic":false,"types":["syn::token::At"]},{"text":"impl Clone for Bang","synthetic":false,"types":["syn::token::Bang"]},{"text":"impl Clone for Caret","synthetic":false,"types":["syn::token::Caret"]},{"text":"impl Clone for CaretEq","synthetic":false,"types":["syn::token::CaretEq"]},{"text":"impl Clone for Colon","synthetic":false,"types":["syn::token::Colon"]},{"text":"impl Clone for Colon2","synthetic":false,"types":["syn::token::Colon2"]},{"text":"impl Clone for Comma","synthetic":false,"types":["syn::token::Comma"]},{"text":"impl Clone for Div","synthetic":false,"types":["syn::token::Div"]},{"text":"impl Clone for DivEq","synthetic":false,"types":["syn::token::DivEq"]},{"text":"impl Clone for Dollar","synthetic":false,"types":["syn::token::Dollar"]},{"text":"impl Clone for Dot","synthetic":false,"types":["syn::token::Dot"]},{"text":"impl Clone for Dot2","synthetic":false,"types":["syn::token::Dot2"]},{"text":"impl Clone for Dot3","synthetic":false,"types":["syn::token::Dot3"]},{"text":"impl Clone for DotDotEq","synthetic":false,"types":["syn::token::DotDotEq"]},{"text":"impl Clone for Eq","synthetic":false,"types":["syn::token::Eq"]},{"text":"impl Clone for EqEq","synthetic":false,"types":["syn::token::EqEq"]},{"text":"impl Clone for Ge","synthetic":false,"types":["syn::token::Ge"]},{"text":"impl Clone for Gt","synthetic":false,"types":["syn::token::Gt"]},{"text":"impl Clone for Le","synthetic":false,"types":["syn::token::Le"]},{"text":"impl Clone for Lt","synthetic":false,"types":["syn::token::Lt"]},{"text":"impl Clone for MulEq","synthetic":false,"types":["syn::token::MulEq"]},{"text":"impl Clone for Ne","synthetic":false,"types":["syn::token::Ne"]},{"text":"impl Clone for Or","synthetic":false,"types":["syn::token::Or"]},{"text":"impl Clone for OrEq","synthetic":false,"types":["syn::token::OrEq"]},{"text":"impl Clone for OrOr","synthetic":false,"types":["syn::token::OrOr"]},{"text":"impl Clone for Pound","synthetic":false,"types":["syn::token::Pound"]},{"text":"impl Clone for Question","synthetic":false,"types":["syn::token::Question"]},{"text":"impl Clone for RArrow","synthetic":false,"types":["syn::token::RArrow"]},{"text":"impl Clone for LArrow","synthetic":false,"types":["syn::token::LArrow"]},{"text":"impl Clone for Rem","synthetic":false,"types":["syn::token::Rem"]},{"text":"impl Clone for RemEq","synthetic":false,"types":["syn::token::RemEq"]},{"text":"impl Clone for FatArrow","synthetic":false,"types":["syn::token::FatArrow"]},{"text":"impl Clone for Semi","synthetic":false,"types":["syn::token::Semi"]},{"text":"impl Clone for Shl","synthetic":false,"types":["syn::token::Shl"]},{"text":"impl Clone for ShlEq","synthetic":false,"types":["syn::token::ShlEq"]},{"text":"impl Clone for Shr","synthetic":false,"types":["syn::token::Shr"]},{"text":"impl Clone for ShrEq","synthetic":false,"types":["syn::token::ShrEq"]},{"text":"impl Clone for Star","synthetic":false,"types":["syn::token::Star"]},{"text":"impl Clone for Sub","synthetic":false,"types":["syn::token::Sub"]},{"text":"impl Clone for SubEq","synthetic":false,"types":["syn::token::SubEq"]},{"text":"impl Clone for Tilde","synthetic":false,"types":["syn::token::Tilde"]},{"text":"impl Clone for Brace","synthetic":false,"types":["syn::token::Brace"]},{"text":"impl Clone for Bracket","synthetic":false,"types":["syn::token::Bracket"]},{"text":"impl Clone for Paren","synthetic":false,"types":["syn::token::Paren"]},{"text":"impl Clone for Group","synthetic":false,"types":["syn::token::Group"]},{"text":"impl Clone for Attribute","synthetic":false,"types":["syn::attr::Attribute"]},{"text":"impl Clone for AttrStyle","synthetic":false,"types":["syn::attr::AttrStyle"]},{"text":"impl Clone for Meta","synthetic":false,"types":["syn::attr::Meta"]},{"text":"impl Clone for MetaList","synthetic":false,"types":["syn::attr::MetaList"]},{"text":"impl Clone for MetaNameValue","synthetic":false,"types":["syn::attr::MetaNameValue"]},{"text":"impl Clone for NestedMeta","synthetic":false,"types":["syn::attr::NestedMeta"]},{"text":"impl Clone for Variant","synthetic":false,"types":["syn::data::Variant"]},{"text":"impl Clone for Fields","synthetic":false,"types":["syn::data::Fields"]},{"text":"impl Clone for FieldsNamed","synthetic":false,"types":["syn::data::FieldsNamed"]},{"text":"impl Clone for FieldsUnnamed","synthetic":false,"types":["syn::data::FieldsUnnamed"]},{"text":"impl Clone for Field","synthetic":false,"types":["syn::data::Field"]},{"text":"impl Clone for Visibility","synthetic":false,"types":["syn::data::Visibility"]},{"text":"impl Clone for VisPublic","synthetic":false,"types":["syn::data::VisPublic"]},{"text":"impl Clone for VisCrate","synthetic":false,"types":["syn::data::VisCrate"]},{"text":"impl Clone for VisRestricted","synthetic":false,"types":["syn::data::VisRestricted"]},{"text":"impl Clone for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl Clone for ExprArray","synthetic":false,"types":["syn::expr::ExprArray"]},{"text":"impl Clone for ExprAssign","synthetic":false,"types":["syn::expr::ExprAssign"]},{"text":"impl Clone for ExprAssignOp","synthetic":false,"types":["syn::expr::ExprAssignOp"]},{"text":"impl Clone for ExprAsync","synthetic":false,"types":["syn::expr::ExprAsync"]},{"text":"impl Clone for ExprAwait","synthetic":false,"types":["syn::expr::ExprAwait"]},{"text":"impl Clone for ExprBinary","synthetic":false,"types":["syn::expr::ExprBinary"]},{"text":"impl Clone for ExprBlock","synthetic":false,"types":["syn::expr::ExprBlock"]},{"text":"impl Clone for ExprBox","synthetic":false,"types":["syn::expr::ExprBox"]},{"text":"impl Clone for ExprBreak","synthetic":false,"types":["syn::expr::ExprBreak"]},{"text":"impl Clone for ExprCall","synthetic":false,"types":["syn::expr::ExprCall"]},{"text":"impl Clone for ExprCast","synthetic":false,"types":["syn::expr::ExprCast"]},{"text":"impl Clone for ExprClosure","synthetic":false,"types":["syn::expr::ExprClosure"]},{"text":"impl Clone for ExprContinue","synthetic":false,"types":["syn::expr::ExprContinue"]},{"text":"impl Clone for ExprField","synthetic":false,"types":["syn::expr::ExprField"]},{"text":"impl Clone for ExprForLoop","synthetic":false,"types":["syn::expr::ExprForLoop"]},{"text":"impl Clone for ExprGroup","synthetic":false,"types":["syn::expr::ExprGroup"]},{"text":"impl Clone for ExprIf","synthetic":false,"types":["syn::expr::ExprIf"]},{"text":"impl Clone for ExprIndex","synthetic":false,"types":["syn::expr::ExprIndex"]},{"text":"impl Clone for ExprLet","synthetic":false,"types":["syn::expr::ExprLet"]},{"text":"impl Clone for ExprLit","synthetic":false,"types":["syn::expr::ExprLit"]},{"text":"impl Clone for ExprLoop","synthetic":false,"types":["syn::expr::ExprLoop"]},{"text":"impl Clone for ExprMacro","synthetic":false,"types":["syn::expr::ExprMacro"]},{"text":"impl Clone for ExprMatch","synthetic":false,"types":["syn::expr::ExprMatch"]},{"text":"impl Clone for ExprMethodCall","synthetic":false,"types":["syn::expr::ExprMethodCall"]},{"text":"impl Clone for ExprParen","synthetic":false,"types":["syn::expr::ExprParen"]},{"text":"impl Clone for ExprPath","synthetic":false,"types":["syn::expr::ExprPath"]},{"text":"impl Clone for ExprRange","synthetic":false,"types":["syn::expr::ExprRange"]},{"text":"impl Clone for ExprReference","synthetic":false,"types":["syn::expr::ExprReference"]},{"text":"impl Clone for ExprRepeat","synthetic":false,"types":["syn::expr::ExprRepeat"]},{"text":"impl Clone for ExprReturn","synthetic":false,"types":["syn::expr::ExprReturn"]},{"text":"impl Clone for ExprStruct","synthetic":false,"types":["syn::expr::ExprStruct"]},{"text":"impl Clone for ExprTry","synthetic":false,"types":["syn::expr::ExprTry"]},{"text":"impl Clone for ExprTryBlock","synthetic":false,"types":["syn::expr::ExprTryBlock"]},{"text":"impl Clone for ExprTuple","synthetic":false,"types":["syn::expr::ExprTuple"]},{"text":"impl Clone for ExprType","synthetic":false,"types":["syn::expr::ExprType"]},{"text":"impl Clone for ExprUnary","synthetic":false,"types":["syn::expr::ExprUnary"]},{"text":"impl Clone for ExprUnsafe","synthetic":false,"types":["syn::expr::ExprUnsafe"]},{"text":"impl Clone for ExprWhile","synthetic":false,"types":["syn::expr::ExprWhile"]},{"text":"impl Clone for ExprYield","synthetic":false,"types":["syn::expr::ExprYield"]},{"text":"impl Clone for Member","synthetic":false,"types":["syn::expr::Member"]},{"text":"impl Clone for Index","synthetic":false,"types":["syn::expr::Index"]},{"text":"impl Clone for Generics","synthetic":false,"types":["syn::generics::Generics"]},{"text":"impl Clone for GenericParam","synthetic":false,"types":["syn::generics::GenericParam"]},{"text":"impl Clone for TypeParam","synthetic":false,"types":["syn::generics::TypeParam"]},{"text":"impl Clone for LifetimeDef","synthetic":false,"types":["syn::generics::LifetimeDef"]},{"text":"impl Clone for ConstParam","synthetic":false,"types":["syn::generics::ConstParam"]},{"text":"impl<'a> Clone for ImplGenerics<'a>","synthetic":false,"types":["syn::generics::ImplGenerics"]},{"text":"impl<'a> Clone for TypeGenerics<'a>","synthetic":false,"types":["syn::generics::TypeGenerics"]},{"text":"impl<'a> Clone for Turbofish<'a>","synthetic":false,"types":["syn::generics::Turbofish"]},{"text":"impl Clone for BoundLifetimes","synthetic":false,"types":["syn::generics::BoundLifetimes"]},{"text":"impl Clone for TypeParamBound","synthetic":false,"types":["syn::generics::TypeParamBound"]},{"text":"impl Clone for TraitBound","synthetic":false,"types":["syn::generics::TraitBound"]},{"text":"impl Clone for TraitBoundModifier","synthetic":false,"types":["syn::generics::TraitBoundModifier"]},{"text":"impl Clone for WhereClause","synthetic":false,"types":["syn::generics::WhereClause"]},{"text":"impl Clone for WherePredicate","synthetic":false,"types":["syn::generics::WherePredicate"]},{"text":"impl Clone for PredicateType","synthetic":false,"types":["syn::generics::PredicateType"]},{"text":"impl Clone for PredicateLifetime","synthetic":false,"types":["syn::generics::PredicateLifetime"]},{"text":"impl Clone for PredicateEq","synthetic":false,"types":["syn::generics::PredicateEq"]},{"text":"impl Clone for Lifetime","synthetic":false,"types":["syn::lifetime::Lifetime"]},{"text":"impl Clone for Lit","synthetic":false,"types":["syn::lit::Lit"]},{"text":"impl Clone for LitStr","synthetic":false,"types":["syn::lit::LitStr"]},{"text":"impl Clone for LitByteStr","synthetic":false,"types":["syn::lit::LitByteStr"]},{"text":"impl Clone for LitByte","synthetic":false,"types":["syn::lit::LitByte"]},{"text":"impl Clone for LitChar","synthetic":false,"types":["syn::lit::LitChar"]},{"text":"impl Clone for LitInt","synthetic":false,"types":["syn::lit::LitInt"]},{"text":"impl Clone for LitFloat","synthetic":false,"types":["syn::lit::LitFloat"]},{"text":"impl Clone for LitBool","synthetic":false,"types":["syn::lit::LitBool"]},{"text":"impl Clone for StrStyle","synthetic":false,"types":["syn::lit::StrStyle"]},{"text":"impl Clone for Macro","synthetic":false,"types":["syn::mac::Macro"]},{"text":"impl Clone for MacroDelimiter","synthetic":false,"types":["syn::mac::MacroDelimiter"]},{"text":"impl Clone for DeriveInput","synthetic":false,"types":["syn::derive::DeriveInput"]},{"text":"impl Clone for Data","synthetic":false,"types":["syn::derive::Data"]},{"text":"impl Clone for DataStruct","synthetic":false,"types":["syn::derive::DataStruct"]},{"text":"impl Clone for DataEnum","synthetic":false,"types":["syn::derive::DataEnum"]},{"text":"impl Clone for DataUnion","synthetic":false,"types":["syn::derive::DataUnion"]},{"text":"impl Clone for BinOp","synthetic":false,"types":["syn::op::BinOp"]},{"text":"impl Clone for UnOp","synthetic":false,"types":["syn::op::UnOp"]},{"text":"impl Clone for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl Clone for TypeArray","synthetic":false,"types":["syn::ty::TypeArray"]},{"text":"impl Clone for TypeBareFn","synthetic":false,"types":["syn::ty::TypeBareFn"]},{"text":"impl Clone for TypeGroup","synthetic":false,"types":["syn::ty::TypeGroup"]},{"text":"impl Clone for TypeImplTrait","synthetic":false,"types":["syn::ty::TypeImplTrait"]},{"text":"impl Clone for TypeInfer","synthetic":false,"types":["syn::ty::TypeInfer"]},{"text":"impl Clone for TypeMacro","synthetic":false,"types":["syn::ty::TypeMacro"]},{"text":"impl Clone for TypeNever","synthetic":false,"types":["syn::ty::TypeNever"]},{"text":"impl Clone for TypeParen","synthetic":false,"types":["syn::ty::TypeParen"]},{"text":"impl Clone for TypePath","synthetic":false,"types":["syn::ty::TypePath"]},{"text":"impl Clone for TypePtr","synthetic":false,"types":["syn::ty::TypePtr"]},{"text":"impl Clone for TypeReference","synthetic":false,"types":["syn::ty::TypeReference"]},{"text":"impl Clone for TypeSlice","synthetic":false,"types":["syn::ty::TypeSlice"]},{"text":"impl Clone for TypeTraitObject","synthetic":false,"types":["syn::ty::TypeTraitObject"]},{"text":"impl Clone for TypeTuple","synthetic":false,"types":["syn::ty::TypeTuple"]},{"text":"impl Clone for Abi","synthetic":false,"types":["syn::ty::Abi"]},{"text":"impl Clone for BareFnArg","synthetic":false,"types":["syn::ty::BareFnArg"]},{"text":"impl Clone for Variadic","synthetic":false,"types":["syn::ty::Variadic"]},{"text":"impl Clone for ReturnType","synthetic":false,"types":["syn::ty::ReturnType"]},{"text":"impl Clone for Path","synthetic":false,"types":["syn::path::Path"]},{"text":"impl Clone for PathSegment","synthetic":false,"types":["syn::path::PathSegment"]},{"text":"impl Clone for PathArguments","synthetic":false,"types":["syn::path::PathArguments"]},{"text":"impl Clone for GenericArgument","synthetic":false,"types":["syn::path::GenericArgument"]},{"text":"impl Clone for AngleBracketedGenericArguments","synthetic":false,"types":["syn::path::AngleBracketedGenericArguments"]},{"text":"impl Clone for Binding","synthetic":false,"types":["syn::path::Binding"]},{"text":"impl Clone for Constraint","synthetic":false,"types":["syn::path::Constraint"]},{"text":"impl Clone for ParenthesizedGenericArguments","synthetic":false,"types":["syn::path::ParenthesizedGenericArguments"]},{"text":"impl Clone for QSelf","synthetic":false,"types":["syn::path::QSelf"]},{"text":"impl<'a> Clone for Cursor<'a>","synthetic":false,"types":["syn::buffer::Cursor"]},{"text":"impl<T: Clone, P: Clone> Clone for Punctuated<T, P>","synthetic":false,"types":["syn::punctuated::Punctuated"]},{"text":"impl<'a, T, P> Clone for Pairs<'a, T, P>","synthetic":false,"types":["syn::punctuated::Pairs"]},{"text":"impl<T: Clone, P: Clone> Clone for IntoPairs<T, P>","synthetic":false,"types":["syn::punctuated::IntoPairs"]},{"text":"impl<T: Clone> Clone for IntoIter<T>","synthetic":false,"types":["syn::punctuated::IntoIter"]},{"text":"impl<'a, T> Clone for Iter<'a, T>","synthetic":false,"types":["syn::punctuated::Iter"]},{"text":"impl<T: Clone, P: Clone> Clone for Pair<T, P>","synthetic":false,"types":["syn::punctuated::Pair"]},{"text":"impl<'c, 'a> Clone for StepCursor<'c, 'a>","synthetic":false,"types":["syn::parse::StepCursor"]},{"text":"impl Clone for Error","synthetic":false,"types":["syn::error::Error"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/cmp/trait.Eq.js b/implementors/core/cmp/trait.Eq.js new file mode 100644 index 0000000..21e9a93 --- /dev/null +++ b/implementors/core/cmp/trait.Eq.js @@ -0,0 +1,6 @@ +(function() {var implementors = {}; +implementors["byteorder"] = [{"text":"impl Eq for BigEndian","synthetic":false,"types":["byteorder::BigEndian"]},{"text":"impl Eq for LittleEndian","synthetic":false,"types":["byteorder::LittleEndian"]}]; +implementors["log"] = [{"text":"impl Eq for Level","synthetic":false,"types":["log::Level"]},{"text":"impl Eq for LevelFilter","synthetic":false,"types":["log::LevelFilter"]},{"text":"impl<'a> Eq for Metadata<'a>","synthetic":false,"types":["log::Metadata"]},{"text":"impl<'a> Eq for MetadataBuilder<'a>","synthetic":false,"types":["log::MetadataBuilder"]}]; +implementors["proc_macro2"] = [{"text":"impl Eq for Delimiter","synthetic":false,"types":["proc_macro2::Delimiter"]},{"text":"impl Eq for Spacing","synthetic":false,"types":["proc_macro2::Spacing"]},{"text":"impl Eq for Ident","synthetic":false,"types":["proc_macro2::Ident"]}]; +implementors["syn"] = [{"text":"impl Eq for Member","synthetic":false,"types":["syn::expr::Member"]},{"text":"impl Eq for Index","synthetic":false,"types":["syn::expr::Index"]},{"text":"impl Eq for Lifetime","synthetic":false,"types":["syn::lifetime::Lifetime"]},{"text":"impl<'a> Eq for Cursor<'a>","synthetic":false,"types":["syn::buffer::Cursor"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/cmp/trait.Ord.js b/implementors/core/cmp/trait.Ord.js new file mode 100644 index 0000000..85a16ff --- /dev/null +++ b/implementors/core/cmp/trait.Ord.js @@ -0,0 +1,6 @@ +(function() {var implementors = {}; +implementors["byteorder"] = [{"text":"impl Ord for BigEndian","synthetic":false,"types":["byteorder::BigEndian"]},{"text":"impl Ord for LittleEndian","synthetic":false,"types":["byteorder::LittleEndian"]}]; +implementors["log"] = [{"text":"impl Ord for Level","synthetic":false,"types":["log::Level"]},{"text":"impl Ord for LevelFilter","synthetic":false,"types":["log::LevelFilter"]},{"text":"impl<'a> Ord for Metadata<'a>","synthetic":false,"types":["log::Metadata"]},{"text":"impl<'a> Ord for MetadataBuilder<'a>","synthetic":false,"types":["log::MetadataBuilder"]}]; +implementors["proc_macro2"] = [{"text":"impl Ord for Ident","synthetic":false,"types":["proc_macro2::Ident"]}]; +implementors["syn"] = [{"text":"impl Ord for Lifetime","synthetic":false,"types":["syn::lifetime::Lifetime"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/cmp/trait.PartialEq.js b/implementors/core/cmp/trait.PartialEq.js new file mode 100644 index 0000000..0e1b204 --- /dev/null +++ b/implementors/core/cmp/trait.PartialEq.js @@ -0,0 +1,7 @@ +(function() {var implementors = {}; +implementors["byteorder"] = [{"text":"impl PartialEq<BigEndian> for BigEndian","synthetic":false,"types":["byteorder::BigEndian"]},{"text":"impl PartialEq<LittleEndian> for LittleEndian","synthetic":false,"types":["byteorder::LittleEndian"]}]; +implementors["log"] = [{"text":"impl PartialEq<Level> for Level","synthetic":false,"types":["log::Level"]},{"text":"impl PartialEq<LevelFilter> for Level","synthetic":false,"types":["log::Level"]},{"text":"impl PartialEq<LevelFilter> for LevelFilter","synthetic":false,"types":["log::LevelFilter"]},{"text":"impl PartialEq<Level> for LevelFilter","synthetic":false,"types":["log::LevelFilter"]},{"text":"impl<'a> PartialEq<Metadata<'a>> for Metadata<'a>","synthetic":false,"types":["log::Metadata"]},{"text":"impl<'a> PartialEq<MetadataBuilder<'a>> for MetadataBuilder<'a>","synthetic":false,"types":["log::MetadataBuilder"]},{"text":"impl PartialEq<ParseLevelError> for ParseLevelError","synthetic":false,"types":["log::ParseLevelError"]}]; +implementors["proc_macro2"] = [{"text":"impl PartialEq<Delimiter> for Delimiter","synthetic":false,"types":["proc_macro2::Delimiter"]},{"text":"impl PartialEq<Spacing> for Spacing","synthetic":false,"types":["proc_macro2::Spacing"]},{"text":"impl PartialEq<Ident> for Ident","synthetic":false,"types":["proc_macro2::Ident"]},{"text":"impl<T: ?Sized> PartialEq<T> for Ident where
    T: AsRef<str>, 
","synthetic":false,"types":["proc_macro2::Ident"]}]; +implementors["serde"] = [{"text":"impl PartialEq<Error> for Error","synthetic":false,"types":["serde::de::value::Error"]},{"text":"impl<'a> PartialEq<Unexpected<'a>> for Unexpected<'a>","synthetic":false,"types":["serde::de::Unexpected"]}]; +implementors["syn"] = [{"text":"impl PartialEq<Member> for Member","synthetic":false,"types":["syn::expr::Member"]},{"text":"impl PartialEq<Index> for Index","synthetic":false,"types":["syn::expr::Index"]},{"text":"impl PartialEq<Lifetime> for Lifetime","synthetic":false,"types":["syn::lifetime::Lifetime"]},{"text":"impl<'a> PartialEq<Cursor<'a>> for Cursor<'a>","synthetic":false,"types":["syn::buffer::Cursor"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/cmp/trait.PartialOrd.js b/implementors/core/cmp/trait.PartialOrd.js new file mode 100644 index 0000000..1bff9fd --- /dev/null +++ b/implementors/core/cmp/trait.PartialOrd.js @@ -0,0 +1,6 @@ +(function() {var implementors = {}; +implementors["byteorder"] = [{"text":"impl PartialOrd<BigEndian> for BigEndian","synthetic":false,"types":["byteorder::BigEndian"]},{"text":"impl PartialOrd<LittleEndian> for LittleEndian","synthetic":false,"types":["byteorder::LittleEndian"]}]; +implementors["log"] = [{"text":"impl PartialOrd<Level> for Level","synthetic":false,"types":["log::Level"]},{"text":"impl PartialOrd<LevelFilter> for Level","synthetic":false,"types":["log::Level"]},{"text":"impl PartialOrd<LevelFilter> for LevelFilter","synthetic":false,"types":["log::LevelFilter"]},{"text":"impl PartialOrd<Level> for LevelFilter","synthetic":false,"types":["log::LevelFilter"]},{"text":"impl<'a> PartialOrd<Metadata<'a>> for Metadata<'a>","synthetic":false,"types":["log::Metadata"]},{"text":"impl<'a> PartialOrd<MetadataBuilder<'a>> for MetadataBuilder<'a>","synthetic":false,"types":["log::MetadataBuilder"]}]; +implementors["proc_macro2"] = [{"text":"impl PartialOrd<Ident> for Ident","synthetic":false,"types":["proc_macro2::Ident"]}]; +implementors["syn"] = [{"text":"impl PartialOrd<Lifetime> for Lifetime","synthetic":false,"types":["syn::lifetime::Lifetime"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/convert/trait.From.js b/implementors/core/convert/trait.From.js new file mode 100644 index 0000000..99bad00 --- /dev/null +++ b/implementors/core/convert/trait.From.js @@ -0,0 +1,5 @@ +(function() {var implementors = {}; +implementors["bincode"] = [{"text":"impl From<Error> for Error","synthetic":false,"types":["bincode::error::Error"]}]; +implementors["proc_macro2"] = [{"text":"impl From<Span> for Span","synthetic":false,"types":["proc_macro2::Span"]},{"text":"impl From<TokenStream> for TokenStream","synthetic":false,"types":["proc_macro2::TokenStream"]},{"text":"impl From<TokenStream> for TokenStream","synthetic":false,"types":["proc_macro::TokenStream"]},{"text":"impl From<TokenTree> for TokenStream","synthetic":false,"types":["proc_macro2::TokenStream"]},{"text":"impl From<Group> for TokenTree","synthetic":false,"types":["proc_macro2::TokenTree"]},{"text":"impl From<Ident> for TokenTree","synthetic":false,"types":["proc_macro2::TokenTree"]},{"text":"impl From<Punct> for TokenTree","synthetic":false,"types":["proc_macro2::TokenTree"]},{"text":"impl From<Literal> for TokenTree","synthetic":false,"types":["proc_macro2::TokenTree"]}]; +implementors["syn"] = [{"text":"impl From<SelfValue> for Ident","synthetic":false,"types":["proc_macro2::Ident"]},{"text":"impl From<SelfType> for Ident","synthetic":false,"types":["proc_macro2::Ident"]},{"text":"impl From<Super> for Ident","synthetic":false,"types":["proc_macro2::Ident"]},{"text":"impl From<Crate> for Ident","synthetic":false,"types":["proc_macro2::Ident"]},{"text":"impl From<Extern> for Ident","synthetic":false,"types":["proc_macro2::Ident"]},{"text":"impl From<Underscore> for Ident","synthetic":false,"types":["proc_macro2::Ident"]},{"text":"impl From<Path> for Meta","synthetic":false,"types":["syn::attr::Meta"]},{"text":"impl From<MetaList> for Meta","synthetic":false,"types":["syn::attr::Meta"]},{"text":"impl From<MetaNameValue> for Meta","synthetic":false,"types":["syn::attr::Meta"]},{"text":"impl From<Meta> for NestedMeta","synthetic":false,"types":["syn::attr::NestedMeta"]},{"text":"impl From<Lit> for NestedMeta","synthetic":false,"types":["syn::attr::NestedMeta"]},{"text":"impl From<FieldsNamed> for Fields","synthetic":false,"types":["syn::data::Fields"]},{"text":"impl From<FieldsUnnamed> for Fields","synthetic":false,"types":["syn::data::Fields"]},{"text":"impl From<VisPublic> for Visibility","synthetic":false,"types":["syn::data::Visibility"]},{"text":"impl From<VisCrate> for Visibility","synthetic":false,"types":["syn::data::Visibility"]},{"text":"impl From<VisRestricted> for Visibility","synthetic":false,"types":["syn::data::Visibility"]},{"text":"impl From<ExprArray> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprAssign> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprAssignOp> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprAsync> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprAwait> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprBinary> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprBlock> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprBox> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprBreak> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprCall> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprCast> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprClosure> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprContinue> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprField> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprForLoop> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprGroup> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprIf> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprIndex> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprLet> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprLit> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprLoop> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprMacro> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprMatch> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprMethodCall> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprParen> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprPath> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprRange> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprReference> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprRepeat> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprReturn> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprStruct> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprTry> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprTryBlock> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprTuple> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprType> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprUnary> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprUnsafe> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprWhile> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<ExprYield> for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl From<usize> for Index","synthetic":false,"types":["syn::expr::Index"]},{"text":"impl From<TypeParam> for GenericParam","synthetic":false,"types":["syn::generics::GenericParam"]},{"text":"impl From<LifetimeDef> for GenericParam","synthetic":false,"types":["syn::generics::GenericParam"]},{"text":"impl From<ConstParam> for GenericParam","synthetic":false,"types":["syn::generics::GenericParam"]},{"text":"impl From<Ident> for TypeParam","synthetic":false,"types":["syn::generics::TypeParam"]},{"text":"impl From<TraitBound> for TypeParamBound","synthetic":false,"types":["syn::generics::TypeParamBound"]},{"text":"impl From<Lifetime> for TypeParamBound","synthetic":false,"types":["syn::generics::TypeParamBound"]},{"text":"impl From<PredicateType> for WherePredicate","synthetic":false,"types":["syn::generics::WherePredicate"]},{"text":"impl From<PredicateLifetime> for WherePredicate","synthetic":false,"types":["syn::generics::WherePredicate"]},{"text":"impl From<PredicateEq> for WherePredicate","synthetic":false,"types":["syn::generics::WherePredicate"]},{"text":"impl From<LitStr> for Lit","synthetic":false,"types":["syn::lit::Lit"]},{"text":"impl From<LitByteStr> for Lit","synthetic":false,"types":["syn::lit::Lit"]},{"text":"impl From<LitByte> for Lit","synthetic":false,"types":["syn::lit::Lit"]},{"text":"impl From<LitChar> for Lit","synthetic":false,"types":["syn::lit::Lit"]},{"text":"impl From<LitInt> for Lit","synthetic":false,"types":["syn::lit::Lit"]},{"text":"impl From<LitFloat> for Lit","synthetic":false,"types":["syn::lit::Lit"]},{"text":"impl From<LitBool> for Lit","synthetic":false,"types":["syn::lit::Lit"]},{"text":"impl From<Literal> for LitInt","synthetic":false,"types":["syn::lit::LitInt"]},{"text":"impl From<Literal> for LitFloat","synthetic":false,"types":["syn::lit::LitFloat"]},{"text":"impl From<DataStruct> for Data","synthetic":false,"types":["syn::derive::Data"]},{"text":"impl From<DataEnum> for Data","synthetic":false,"types":["syn::derive::Data"]},{"text":"impl From<DataUnion> for Data","synthetic":false,"types":["syn::derive::Data"]},{"text":"impl From<TypeArray> for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl From<TypeBareFn> for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl From<TypeGroup> for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl From<TypeImplTrait> for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl From<TypeInfer> for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl From<TypeMacro> for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl From<TypeNever> for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl From<TypeParen> for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl From<TypePath> for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl From<TypePtr> for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl From<TypeReference> for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl From<TypeSlice> for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl From<TypeTraitObject> for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl From<TypeTuple> for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl<T> From<T> for Path where
    T: Into<PathSegment>, 
","synthetic":false,"types":["syn::path::Path"]},{"text":"impl<T> From<T> for PathSegment where
    T: Into<Ident>, 
","synthetic":false,"types":["syn::path::PathSegment"]},{"text":"impl From<LexError> for Error","synthetic":false,"types":["syn::error::Error"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/default/trait.Default.js b/implementors/core/default/trait.Default.js new file mode 100644 index 0000000..0f6c40a --- /dev/null +++ b/implementors/core/default/trait.Default.js @@ -0,0 +1,6 @@ +(function() {var implementors = {}; +implementors["byteorder"] = [{"text":"impl Default for BigEndian","synthetic":false,"types":["byteorder::BigEndian"]},{"text":"impl Default for LittleEndian","synthetic":false,"types":["byteorder::LittleEndian"]}]; +implementors["proc_macro2"] = [{"text":"impl Default for TokenStream","synthetic":false,"types":["proc_macro2::TokenStream"]}]; +implementors["serde"] = [{"text":"impl Default for IgnoredAny","synthetic":false,"types":["serde::de::ignored_any::IgnoredAny"]}]; +implementors["syn"] = [{"text":"impl Default for Underscore","synthetic":false,"types":["syn::token::Underscore"]},{"text":"impl Default for Abstract","synthetic":false,"types":["syn::token::Abstract"]},{"text":"impl Default for As","synthetic":false,"types":["syn::token::As"]},{"text":"impl Default for Async","synthetic":false,"types":["syn::token::Async"]},{"text":"impl Default for Auto","synthetic":false,"types":["syn::token::Auto"]},{"text":"impl Default for Await","synthetic":false,"types":["syn::token::Await"]},{"text":"impl Default for Become","synthetic":false,"types":["syn::token::Become"]},{"text":"impl Default for Box","synthetic":false,"types":["syn::token::Box"]},{"text":"impl Default for Break","synthetic":false,"types":["syn::token::Break"]},{"text":"impl Default for Const","synthetic":false,"types":["syn::token::Const"]},{"text":"impl Default for Continue","synthetic":false,"types":["syn::token::Continue"]},{"text":"impl Default for Crate","synthetic":false,"types":["syn::token::Crate"]},{"text":"impl Default for Default","synthetic":false,"types":["syn::token::Default"]},{"text":"impl Default for Do","synthetic":false,"types":["syn::token::Do"]},{"text":"impl Default for Dyn","synthetic":false,"types":["syn::token::Dyn"]},{"text":"impl Default for Else","synthetic":false,"types":["syn::token::Else"]},{"text":"impl Default for Enum","synthetic":false,"types":["syn::token::Enum"]},{"text":"impl Default for Extern","synthetic":false,"types":["syn::token::Extern"]},{"text":"impl Default for Final","synthetic":false,"types":["syn::token::Final"]},{"text":"impl Default for Fn","synthetic":false,"types":["syn::token::Fn"]},{"text":"impl Default for For","synthetic":false,"types":["syn::token::For"]},{"text":"impl Default for If","synthetic":false,"types":["syn::token::If"]},{"text":"impl Default for Impl","synthetic":false,"types":["syn::token::Impl"]},{"text":"impl Default for In","synthetic":false,"types":["syn::token::In"]},{"text":"impl Default for Let","synthetic":false,"types":["syn::token::Let"]},{"text":"impl Default for Loop","synthetic":false,"types":["syn::token::Loop"]},{"text":"impl Default for Macro","synthetic":false,"types":["syn::token::Macro"]},{"text":"impl Default for Match","synthetic":false,"types":["syn::token::Match"]},{"text":"impl Default for Mod","synthetic":false,"types":["syn::token::Mod"]},{"text":"impl Default for Move","synthetic":false,"types":["syn::token::Move"]},{"text":"impl Default for Mut","synthetic":false,"types":["syn::token::Mut"]},{"text":"impl Default for Override","synthetic":false,"types":["syn::token::Override"]},{"text":"impl Default for Priv","synthetic":false,"types":["syn::token::Priv"]},{"text":"impl Default for Pub","synthetic":false,"types":["syn::token::Pub"]},{"text":"impl Default for Ref","synthetic":false,"types":["syn::token::Ref"]},{"text":"impl Default for Return","synthetic":false,"types":["syn::token::Return"]},{"text":"impl Default for SelfType","synthetic":false,"types":["syn::token::SelfType"]},{"text":"impl Default for SelfValue","synthetic":false,"types":["syn::token::SelfValue"]},{"text":"impl Default for Static","synthetic":false,"types":["syn::token::Static"]},{"text":"impl Default for Struct","synthetic":false,"types":["syn::token::Struct"]},{"text":"impl Default for Super","synthetic":false,"types":["syn::token::Super"]},{"text":"impl Default for Trait","synthetic":false,"types":["syn::token::Trait"]},{"text":"impl Default for Try","synthetic":false,"types":["syn::token::Try"]},{"text":"impl Default for Type","synthetic":false,"types":["syn::token::Type"]},{"text":"impl Default for Typeof","synthetic":false,"types":["syn::token::Typeof"]},{"text":"impl Default for Union","synthetic":false,"types":["syn::token::Union"]},{"text":"impl Default for Unsafe","synthetic":false,"types":["syn::token::Unsafe"]},{"text":"impl Default for Unsized","synthetic":false,"types":["syn::token::Unsized"]},{"text":"impl Default for Use","synthetic":false,"types":["syn::token::Use"]},{"text":"impl Default for Virtual","synthetic":false,"types":["syn::token::Virtual"]},{"text":"impl Default for Where","synthetic":false,"types":["syn::token::Where"]},{"text":"impl Default for While","synthetic":false,"types":["syn::token::While"]},{"text":"impl Default for Yield","synthetic":false,"types":["syn::token::Yield"]},{"text":"impl Default for Add","synthetic":false,"types":["syn::token::Add"]},{"text":"impl Default for AddEq","synthetic":false,"types":["syn::token::AddEq"]},{"text":"impl Default for And","synthetic":false,"types":["syn::token::And"]},{"text":"impl Default for AndAnd","synthetic":false,"types":["syn::token::AndAnd"]},{"text":"impl Default for AndEq","synthetic":false,"types":["syn::token::AndEq"]},{"text":"impl Default for At","synthetic":false,"types":["syn::token::At"]},{"text":"impl Default for Bang","synthetic":false,"types":["syn::token::Bang"]},{"text":"impl Default for Caret","synthetic":false,"types":["syn::token::Caret"]},{"text":"impl Default for CaretEq","synthetic":false,"types":["syn::token::CaretEq"]},{"text":"impl Default for Colon","synthetic":false,"types":["syn::token::Colon"]},{"text":"impl Default for Colon2","synthetic":false,"types":["syn::token::Colon2"]},{"text":"impl Default for Comma","synthetic":false,"types":["syn::token::Comma"]},{"text":"impl Default for Div","synthetic":false,"types":["syn::token::Div"]},{"text":"impl Default for DivEq","synthetic":false,"types":["syn::token::DivEq"]},{"text":"impl Default for Dollar","synthetic":false,"types":["syn::token::Dollar"]},{"text":"impl Default for Dot","synthetic":false,"types":["syn::token::Dot"]},{"text":"impl Default for Dot2","synthetic":false,"types":["syn::token::Dot2"]},{"text":"impl Default for Dot3","synthetic":false,"types":["syn::token::Dot3"]},{"text":"impl Default for DotDotEq","synthetic":false,"types":["syn::token::DotDotEq"]},{"text":"impl Default for Eq","synthetic":false,"types":["syn::token::Eq"]},{"text":"impl Default for EqEq","synthetic":false,"types":["syn::token::EqEq"]},{"text":"impl Default for Ge","synthetic":false,"types":["syn::token::Ge"]},{"text":"impl Default for Gt","synthetic":false,"types":["syn::token::Gt"]},{"text":"impl Default for Le","synthetic":false,"types":["syn::token::Le"]},{"text":"impl Default for Lt","synthetic":false,"types":["syn::token::Lt"]},{"text":"impl Default for MulEq","synthetic":false,"types":["syn::token::MulEq"]},{"text":"impl Default for Ne","synthetic":false,"types":["syn::token::Ne"]},{"text":"impl Default for Or","synthetic":false,"types":["syn::token::Or"]},{"text":"impl Default for OrEq","synthetic":false,"types":["syn::token::OrEq"]},{"text":"impl Default for OrOr","synthetic":false,"types":["syn::token::OrOr"]},{"text":"impl Default for Pound","synthetic":false,"types":["syn::token::Pound"]},{"text":"impl Default for Question","synthetic":false,"types":["syn::token::Question"]},{"text":"impl Default for RArrow","synthetic":false,"types":["syn::token::RArrow"]},{"text":"impl Default for LArrow","synthetic":false,"types":["syn::token::LArrow"]},{"text":"impl Default for Rem","synthetic":false,"types":["syn::token::Rem"]},{"text":"impl Default for RemEq","synthetic":false,"types":["syn::token::RemEq"]},{"text":"impl Default for FatArrow","synthetic":false,"types":["syn::token::FatArrow"]},{"text":"impl Default for Semi","synthetic":false,"types":["syn::token::Semi"]},{"text":"impl Default for Shl","synthetic":false,"types":["syn::token::Shl"]},{"text":"impl Default for ShlEq","synthetic":false,"types":["syn::token::ShlEq"]},{"text":"impl Default for Shr","synthetic":false,"types":["syn::token::Shr"]},{"text":"impl Default for ShrEq","synthetic":false,"types":["syn::token::ShrEq"]},{"text":"impl Default for Star","synthetic":false,"types":["syn::token::Star"]},{"text":"impl Default for Sub","synthetic":false,"types":["syn::token::Sub"]},{"text":"impl Default for SubEq","synthetic":false,"types":["syn::token::SubEq"]},{"text":"impl Default for Tilde","synthetic":false,"types":["syn::token::Tilde"]},{"text":"impl Default for Brace","synthetic":false,"types":["syn::token::Brace"]},{"text":"impl Default for Bracket","synthetic":false,"types":["syn::token::Bracket"]},{"text":"impl Default for Paren","synthetic":false,"types":["syn::token::Paren"]},{"text":"impl Default for Group","synthetic":false,"types":["syn::token::Group"]},{"text":"impl Default for Generics","synthetic":false,"types":["syn::generics::Generics"]},{"text":"impl Default for BoundLifetimes","synthetic":false,"types":["syn::generics::BoundLifetimes"]},{"text":"impl Default for PathArguments","synthetic":false,"types":["syn::path::PathArguments"]},{"text":"impl<T, P> Default for Punctuated<T, P>","synthetic":false,"types":["syn::punctuated::Punctuated"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/fmt/trait.Debug.js b/implementors/core/fmt/trait.Debug.js new file mode 100644 index 0000000..b8cbed9 --- /dev/null +++ b/implementors/core/fmt/trait.Debug.js @@ -0,0 +1,9 @@ +(function() {var implementors = {}; +implementors["bincode"] = [{"text":"impl Debug for ErrorKind","synthetic":false,"types":["bincode::error::ErrorKind"]}]; +implementors["byteorder"] = [{"text":"impl Debug for BigEndian","synthetic":false,"types":["byteorder::BigEndian"]},{"text":"impl Debug for LittleEndian","synthetic":false,"types":["byteorder::LittleEndian"]}]; +implementors["ironsea_index_sfc_dbc"] = [{"text":"impl<F: Debug, K: Debug, V: Debug> Debug for SpaceFillingCurve<F, K, V> where
    F: PartialEq,
    K: Debug + FromIterator<V> + Index<usize, Output = V>,
    V: Clone + Debug + From<usize> + Ord
","synthetic":false,"types":["ironsea_index_sfc_dbc::sfc::SpaceFillingCurve"]}]; +implementors["log"] = [{"text":"impl Debug for Level","synthetic":false,"types":["log::Level"]},{"text":"impl Debug for LevelFilter","synthetic":false,"types":["log::LevelFilter"]},{"text":"impl<'a> Debug for Record<'a>","synthetic":false,"types":["log::Record"]},{"text":"impl<'a> Debug for RecordBuilder<'a>","synthetic":false,"types":["log::RecordBuilder"]},{"text":"impl<'a> Debug for Metadata<'a>","synthetic":false,"types":["log::Metadata"]},{"text":"impl<'a> Debug for MetadataBuilder<'a>","synthetic":false,"types":["log::MetadataBuilder"]},{"text":"impl Debug for SetLoggerError","synthetic":false,"types":["log::SetLoggerError"]},{"text":"impl Debug for ParseLevelError","synthetic":false,"types":["log::ParseLevelError"]}]; +implementors["proc_macro2"] = [{"text":"impl Debug for TokenStream","synthetic":false,"types":["proc_macro2::TokenStream"]},{"text":"impl Debug for LexError","synthetic":false,"types":["proc_macro2::LexError"]},{"text":"impl Debug for Span","synthetic":false,"types":["proc_macro2::Span"]},{"text":"impl Debug for TokenTree","synthetic":false,"types":["proc_macro2::TokenTree"]},{"text":"impl Debug for Delimiter","synthetic":false,"types":["proc_macro2::Delimiter"]},{"text":"impl Debug for Group","synthetic":false,"types":["proc_macro2::Group"]},{"text":"impl Debug for Spacing","synthetic":false,"types":["proc_macro2::Spacing"]},{"text":"impl Debug for Punct","synthetic":false,"types":["proc_macro2::Punct"]},{"text":"impl Debug for Ident","synthetic":false,"types":["proc_macro2::Ident"]},{"text":"impl Debug for Literal","synthetic":false,"types":["proc_macro2::Literal"]},{"text":"impl Debug for IntoIter","synthetic":false,"types":["proc_macro2::token_stream::IntoIter"]}]; +implementors["serde"] = [{"text":"impl Debug for Error","synthetic":false,"types":["serde::de::value::Error"]},{"text":"impl<E: Debug> Debug for UnitDeserializer<E>","synthetic":false,"types":["serde::de::value::UnitDeserializer"]},{"text":"impl<E: Debug> Debug for BoolDeserializer<E>","synthetic":false,"types":["serde::de::value::BoolDeserializer"]},{"text":"impl<E: Debug> Debug for I8Deserializer<E>","synthetic":false,"types":["serde::de::value::I8Deserializer"]},{"text":"impl<E: Debug> Debug for I16Deserializer<E>","synthetic":false,"types":["serde::de::value::I16Deserializer"]},{"text":"impl<E: Debug> Debug for I32Deserializer<E>","synthetic":false,"types":["serde::de::value::I32Deserializer"]},{"text":"impl<E: Debug> Debug for I64Deserializer<E>","synthetic":false,"types":["serde::de::value::I64Deserializer"]},{"text":"impl<E: Debug> Debug for IsizeDeserializer<E>","synthetic":false,"types":["serde::de::value::IsizeDeserializer"]},{"text":"impl<E: Debug> Debug for U8Deserializer<E>","synthetic":false,"types":["serde::de::value::U8Deserializer"]},{"text":"impl<E: Debug> Debug for U16Deserializer<E>","synthetic":false,"types":["serde::de::value::U16Deserializer"]},{"text":"impl<E: Debug> Debug for U64Deserializer<E>","synthetic":false,"types":["serde::de::value::U64Deserializer"]},{"text":"impl<E: Debug> Debug for UsizeDeserializer<E>","synthetic":false,"types":["serde::de::value::UsizeDeserializer"]},{"text":"impl<E: Debug> Debug for F32Deserializer<E>","synthetic":false,"types":["serde::de::value::F32Deserializer"]},{"text":"impl<E: Debug> Debug for F64Deserializer<E>","synthetic":false,"types":["serde::de::value::F64Deserializer"]},{"text":"impl<E: Debug> Debug for CharDeserializer<E>","synthetic":false,"types":["serde::de::value::CharDeserializer"]},{"text":"impl<E: Debug> Debug for I128Deserializer<E>","synthetic":false,"types":["serde::de::value::I128Deserializer"]},{"text":"impl<E: Debug> Debug for U128Deserializer<E>","synthetic":false,"types":["serde::de::value::U128Deserializer"]},{"text":"impl<E: Debug> Debug for U32Deserializer<E>","synthetic":false,"types":["serde::de::value::U32Deserializer"]},{"text":"impl<'a, E: Debug> Debug for StrDeserializer<'a, E>","synthetic":false,"types":["serde::de::value::StrDeserializer"]},{"text":"impl<'de, E: Debug> Debug for BorrowedStrDeserializer<'de, E>","synthetic":false,"types":["serde::de::value::BorrowedStrDeserializer"]},{"text":"impl<E: Debug> Debug for StringDeserializer<E>","synthetic":false,"types":["serde::de::value::StringDeserializer"]},{"text":"impl<'a, E: Debug> Debug for CowStrDeserializer<'a, E>","synthetic":false,"types":["serde::de::value::CowStrDeserializer"]},{"text":"impl<'de, E: Debug> Debug for BorrowedBytesDeserializer<'de, E>","synthetic":false,"types":["serde::de::value::BorrowedBytesDeserializer"]},{"text":"impl<I: Debug, E: Debug> Debug for SeqDeserializer<I, E>","synthetic":false,"types":["serde::de::value::SeqDeserializer"]},{"text":"impl<A: Debug> Debug for SeqAccessDeserializer<A>","synthetic":false,"types":["serde::de::value::SeqAccessDeserializer"]},{"text":"impl<'de, I, E> Debug for MapDeserializer<'de, I, E> where
    I: Iterator + Debug,
    I::Item: Pair,
    <I::Item as Pair>::Second: Debug
","synthetic":false,"types":["serde::de::value::MapDeserializer"]},{"text":"impl<A: Debug> Debug for MapAccessDeserializer<A>","synthetic":false,"types":["serde::de::value::MapAccessDeserializer"]},{"text":"impl Debug for IgnoredAny","synthetic":false,"types":["serde::de::ignored_any::IgnoredAny"]},{"text":"impl<'a> Debug for Unexpected<'a>","synthetic":false,"types":["serde::de::Unexpected"]}]; +implementors["syn"] = [{"text":"impl<'a> Debug for ParseBuffer<'a>","synthetic":false,"types":["syn::parse::ParseBuffer"]},{"text":"impl Debug for Error","synthetic":false,"types":["syn::error::Error"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/fmt/trait.Display.js b/implementors/core/fmt/trait.Display.js new file mode 100644 index 0000000..8a16868 --- /dev/null +++ b/implementors/core/fmt/trait.Display.js @@ -0,0 +1,7 @@ +(function() {var implementors = {}; +implementors["bincode"] = [{"text":"impl Display for ErrorKind","synthetic":false,"types":["bincode::error::ErrorKind"]}]; +implementors["log"] = [{"text":"impl Display for Level","synthetic":false,"types":["log::Level"]},{"text":"impl Display for LevelFilter","synthetic":false,"types":["log::LevelFilter"]},{"text":"impl Display for SetLoggerError","synthetic":false,"types":["log::SetLoggerError"]},{"text":"impl Display for ParseLevelError","synthetic":false,"types":["log::ParseLevelError"]}]; +implementors["proc_macro2"] = [{"text":"impl Display for TokenStream","synthetic":false,"types":["proc_macro2::TokenStream"]},{"text":"impl Display for TokenTree","synthetic":false,"types":["proc_macro2::TokenTree"]},{"text":"impl Display for Group","synthetic":false,"types":["proc_macro2::Group"]},{"text":"impl Display for Punct","synthetic":false,"types":["proc_macro2::Punct"]},{"text":"impl Display for Ident","synthetic":false,"types":["proc_macro2::Ident"]},{"text":"impl Display for Literal","synthetic":false,"types":["proc_macro2::Literal"]}]; +implementors["serde"] = [{"text":"impl Display for Error","synthetic":false,"types":["serde::de::value::Error"]},{"text":"impl<'a> Display for Unexpected<'a>","synthetic":false,"types":["serde::de::Unexpected"]},{"text":"impl<'a> Display for dyn Expected + 'a","synthetic":false,"types":["serde::de::Expected"]}]; +implementors["syn"] = [{"text":"impl Display for Lifetime","synthetic":false,"types":["syn::lifetime::Lifetime"]},{"text":"impl Display for LitInt","synthetic":false,"types":["syn::lit::LitInt"]},{"text":"impl Display for LitFloat","synthetic":false,"types":["syn::lit::LitFloat"]},{"text":"impl<'a> Display for ParseBuffer<'a>","synthetic":false,"types":["syn::parse::ParseBuffer"]},{"text":"impl Display for Error","synthetic":false,"types":["syn::error::Error"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/hash/trait.Hash.js b/implementors/core/hash/trait.Hash.js new file mode 100644 index 0000000..f5bc49f --- /dev/null +++ b/implementors/core/hash/trait.Hash.js @@ -0,0 +1,6 @@ +(function() {var implementors = {}; +implementors["byteorder"] = [{"text":"impl Hash for BigEndian","synthetic":false,"types":["byteorder::BigEndian"]},{"text":"impl Hash for LittleEndian","synthetic":false,"types":["byteorder::LittleEndian"]}]; +implementors["log"] = [{"text":"impl Hash for Level","synthetic":false,"types":["log::Level"]},{"text":"impl Hash for LevelFilter","synthetic":false,"types":["log::LevelFilter"]},{"text":"impl<'a> Hash for Metadata<'a>","synthetic":false,"types":["log::Metadata"]},{"text":"impl<'a> Hash for MetadataBuilder<'a>","synthetic":false,"types":["log::MetadataBuilder"]}]; +implementors["proc_macro2"] = [{"text":"impl Hash for Ident","synthetic":false,"types":["proc_macro2::Ident"]}]; +implementors["syn"] = [{"text":"impl Hash for Member","synthetic":false,"types":["syn::expr::Member"]},{"text":"impl Hash for Index","synthetic":false,"types":["syn::expr::Index"]},{"text":"impl Hash for Lifetime","synthetic":false,"types":["syn::lifetime::Lifetime"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/iter/traits/collect/trait.Extend.js b/implementors/core/iter/traits/collect/trait.Extend.js new file mode 100644 index 0000000..ba3c636 --- /dev/null +++ b/implementors/core/iter/traits/collect/trait.Extend.js @@ -0,0 +1,4 @@ +(function() {var implementors = {}; +implementors["proc_macro2"] = [{"text":"impl Extend<TokenTree> for TokenStream","synthetic":false,"types":["proc_macro2::TokenStream"]},{"text":"impl Extend<TokenStream> for TokenStream","synthetic":false,"types":["proc_macro2::TokenStream"]}]; +implementors["syn"] = [{"text":"impl<T, P> Extend<T> for Punctuated<T, P> where
    P: Default
","synthetic":false,"types":["syn::punctuated::Punctuated"]},{"text":"impl<T, P> Extend<Pair<T, P>> for Punctuated<T, P>","synthetic":false,"types":["syn::punctuated::Punctuated"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/iter/traits/collect/trait.FromIterator.js b/implementors/core/iter/traits/collect/trait.FromIterator.js new file mode 100644 index 0000000..be7ee60 --- /dev/null +++ b/implementors/core/iter/traits/collect/trait.FromIterator.js @@ -0,0 +1,4 @@ +(function() {var implementors = {}; +implementors["proc_macro2"] = [{"text":"impl FromIterator<TokenTree> for TokenStream","synthetic":false,"types":["proc_macro2::TokenStream"]},{"text":"impl FromIterator<TokenStream> for TokenStream","synthetic":false,"types":["proc_macro2::TokenStream"]}]; +implementors["syn"] = [{"text":"impl<T, P> FromIterator<T> for Punctuated<T, P> where
    P: Default
","synthetic":false,"types":["syn::punctuated::Punctuated"]},{"text":"impl<T, P> FromIterator<Pair<T, P>> for Punctuated<T, P>","synthetic":false,"types":["syn::punctuated::Punctuated"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/iter/traits/collect/trait.IntoIterator.js b/implementors/core/iter/traits/collect/trait.IntoIterator.js new file mode 100644 index 0000000..e3e183a --- /dev/null +++ b/implementors/core/iter/traits/collect/trait.IntoIterator.js @@ -0,0 +1,4 @@ +(function() {var implementors = {}; +implementors["proc_macro2"] = [{"text":"impl IntoIterator for TokenStream","synthetic":false,"types":["proc_macro2::TokenStream"]}]; +implementors["syn"] = [{"text":"impl IntoIterator for Fields","synthetic":false,"types":["syn::data::Fields"]},{"text":"impl<'a> IntoIterator for &'a Fields","synthetic":false,"types":["syn::data::Fields"]},{"text":"impl<'a> IntoIterator for &'a mut Fields","synthetic":false,"types":["syn::data::Fields"]},{"text":"impl<T, P> IntoIterator for Punctuated<T, P>","synthetic":false,"types":["syn::punctuated::Punctuated"]},{"text":"impl<'a, T, P> IntoIterator for &'a Punctuated<T, P>","synthetic":false,"types":["syn::punctuated::Punctuated"]},{"text":"impl<'a, T, P> IntoIterator for &'a mut Punctuated<T, P>","synthetic":false,"types":["syn::punctuated::Punctuated"]},{"text":"impl IntoIterator for Error","synthetic":false,"types":["syn::error::Error"]},{"text":"impl<'a> IntoIterator for &'a Error","synthetic":false,"types":["syn::error::Error"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/iter/traits/double_ended/trait.DoubleEndedIterator.js b/implementors/core/iter/traits/double_ended/trait.DoubleEndedIterator.js new file mode 100644 index 0000000..0333b3b --- /dev/null +++ b/implementors/core/iter/traits/double_ended/trait.DoubleEndedIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = [{"text":"impl<'a, T, P> DoubleEndedIterator for Pairs<'a, T, P>","synthetic":false,"types":["syn::punctuated::Pairs"]},{"text":"impl<'a, T, P> DoubleEndedIterator for PairsMut<'a, T, P>","synthetic":false,"types":["syn::punctuated::PairsMut"]},{"text":"impl<T, P> DoubleEndedIterator for IntoPairs<T, P>","synthetic":false,"types":["syn::punctuated::IntoPairs"]},{"text":"impl<T> DoubleEndedIterator for IntoIter<T>","synthetic":false,"types":["syn::punctuated::IntoIter"]},{"text":"impl<'a, T> DoubleEndedIterator for Iter<'a, T>","synthetic":false,"types":["syn::punctuated::Iter"]},{"text":"impl<'a, T> DoubleEndedIterator for IterMut<'a, T>","synthetic":false,"types":["syn::punctuated::IterMut"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/iter/traits/exact_size/trait.ExactSizeIterator.js b/implementors/core/iter/traits/exact_size/trait.ExactSizeIterator.js new file mode 100644 index 0000000..30ef990 --- /dev/null +++ b/implementors/core/iter/traits/exact_size/trait.ExactSizeIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = [{"text":"impl<'a, T, P> ExactSizeIterator for Pairs<'a, T, P>","synthetic":false,"types":["syn::punctuated::Pairs"]},{"text":"impl<'a, T, P> ExactSizeIterator for PairsMut<'a, T, P>","synthetic":false,"types":["syn::punctuated::PairsMut"]},{"text":"impl<T, P> ExactSizeIterator for IntoPairs<T, P>","synthetic":false,"types":["syn::punctuated::IntoPairs"]},{"text":"impl<T> ExactSizeIterator for IntoIter<T>","synthetic":false,"types":["syn::punctuated::IntoIter"]},{"text":"impl<'a, T> ExactSizeIterator for Iter<'a, T>","synthetic":false,"types":["syn::punctuated::Iter"]},{"text":"impl<'a, T> ExactSizeIterator for IterMut<'a, T>","synthetic":false,"types":["syn::punctuated::IterMut"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/iter/traits/iterator/trait.Iterator.js b/implementors/core/iter/traits/iterator/trait.Iterator.js new file mode 100644 index 0000000..a732bea --- /dev/null +++ b/implementors/core/iter/traits/iterator/trait.Iterator.js @@ -0,0 +1,4 @@ +(function() {var implementors = {}; +implementors["proc_macro2"] = [{"text":"impl Iterator for IntoIter","synthetic":false,"types":["proc_macro2::token_stream::IntoIter"]}]; +implementors["syn"] = [{"text":"impl<'a, T, P> Iterator for Pairs<'a, T, P>","synthetic":false,"types":["syn::punctuated::Pairs"]},{"text":"impl<'a, T, P> Iterator for PairsMut<'a, T, P>","synthetic":false,"types":["syn::punctuated::PairsMut"]},{"text":"impl<T, P> Iterator for IntoPairs<T, P>","synthetic":false,"types":["syn::punctuated::IntoPairs"]},{"text":"impl<T> Iterator for IntoIter<T>","synthetic":false,"types":["syn::punctuated::IntoIter"]},{"text":"impl<'a, T> Iterator for Iter<'a, T>","synthetic":false,"types":["syn::punctuated::Iter"]},{"text":"impl<'a, T> Iterator for IterMut<'a, T>","synthetic":false,"types":["syn::punctuated::IterMut"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/marker/trait.Copy.js b/implementors/core/marker/trait.Copy.js new file mode 100644 index 0000000..23ad920 --- /dev/null +++ b/implementors/core/marker/trait.Copy.js @@ -0,0 +1,7 @@ +(function() {var implementors = {}; +implementors["byteorder"] = [{"text":"impl Copy for BigEndian","synthetic":false,"types":["byteorder::BigEndian"]},{"text":"impl Copy for LittleEndian","synthetic":false,"types":["byteorder::LittleEndian"]}]; +implementors["log"] = [{"text":"impl Copy for Level","synthetic":false,"types":["log::Level"]},{"text":"impl Copy for LevelFilter","synthetic":false,"types":["log::LevelFilter"]}]; +implementors["proc_macro2"] = [{"text":"impl Copy for Span","synthetic":false,"types":["proc_macro2::Span"]},{"text":"impl Copy for Delimiter","synthetic":false,"types":["proc_macro2::Delimiter"]},{"text":"impl Copy for Spacing","synthetic":false,"types":["proc_macro2::Spacing"]}]; +implementors["serde"] = [{"text":"impl<E> Copy for UnitDeserializer<E>","synthetic":false,"types":["serde::de::value::UnitDeserializer"]},{"text":"impl<E> Copy for BoolDeserializer<E>","synthetic":false,"types":["serde::de::value::BoolDeserializer"]},{"text":"impl<E> Copy for I8Deserializer<E>","synthetic":false,"types":["serde::de::value::I8Deserializer"]},{"text":"impl<E> Copy for I16Deserializer<E>","synthetic":false,"types":["serde::de::value::I16Deserializer"]},{"text":"impl<E> Copy for I32Deserializer<E>","synthetic":false,"types":["serde::de::value::I32Deserializer"]},{"text":"impl<E> Copy for I64Deserializer<E>","synthetic":false,"types":["serde::de::value::I64Deserializer"]},{"text":"impl<E> Copy for IsizeDeserializer<E>","synthetic":false,"types":["serde::de::value::IsizeDeserializer"]},{"text":"impl<E> Copy for U8Deserializer<E>","synthetic":false,"types":["serde::de::value::U8Deserializer"]},{"text":"impl<E> Copy for U16Deserializer<E>","synthetic":false,"types":["serde::de::value::U16Deserializer"]},{"text":"impl<E> Copy for U64Deserializer<E>","synthetic":false,"types":["serde::de::value::U64Deserializer"]},{"text":"impl<E> Copy for UsizeDeserializer<E>","synthetic":false,"types":["serde::de::value::UsizeDeserializer"]},{"text":"impl<E> Copy for F32Deserializer<E>","synthetic":false,"types":["serde::de::value::F32Deserializer"]},{"text":"impl<E> Copy for F64Deserializer<E>","synthetic":false,"types":["serde::de::value::F64Deserializer"]},{"text":"impl<E> Copy for CharDeserializer<E>","synthetic":false,"types":["serde::de::value::CharDeserializer"]},{"text":"impl<E> Copy for I128Deserializer<E>","synthetic":false,"types":["serde::de::value::I128Deserializer"]},{"text":"impl<E> Copy for U128Deserializer<E>","synthetic":false,"types":["serde::de::value::U128Deserializer"]},{"text":"impl<E> Copy for U32Deserializer<E>","synthetic":false,"types":["serde::de::value::U32Deserializer"]},{"text":"impl<'de, E> Copy for StrDeserializer<'de, E>","synthetic":false,"types":["serde::de::value::StrDeserializer"]},{"text":"impl<'de, E> Copy for BorrowedStrDeserializer<'de, E>","synthetic":false,"types":["serde::de::value::BorrowedStrDeserializer"]},{"text":"impl<'de, E> Copy for BorrowedBytesDeserializer<'de, E>","synthetic":false,"types":["serde::de::value::BorrowedBytesDeserializer"]},{"text":"impl Copy for IgnoredAny","synthetic":false,"types":["serde::de::ignored_any::IgnoredAny"]},{"text":"impl<'a> Copy for Unexpected<'a>","synthetic":false,"types":["serde::de::Unexpected"]}]; +implementors["syn"] = [{"text":"impl Copy for Underscore","synthetic":false,"types":["syn::token::Underscore"]},{"text":"impl Copy for Abstract","synthetic":false,"types":["syn::token::Abstract"]},{"text":"impl Copy for As","synthetic":false,"types":["syn::token::As"]},{"text":"impl Copy for Async","synthetic":false,"types":["syn::token::Async"]},{"text":"impl Copy for Auto","synthetic":false,"types":["syn::token::Auto"]},{"text":"impl Copy for Await","synthetic":false,"types":["syn::token::Await"]},{"text":"impl Copy for Become","synthetic":false,"types":["syn::token::Become"]},{"text":"impl Copy for Box","synthetic":false,"types":["syn::token::Box"]},{"text":"impl Copy for Break","synthetic":false,"types":["syn::token::Break"]},{"text":"impl Copy for Const","synthetic":false,"types":["syn::token::Const"]},{"text":"impl Copy for Continue","synthetic":false,"types":["syn::token::Continue"]},{"text":"impl Copy for Crate","synthetic":false,"types":["syn::token::Crate"]},{"text":"impl Copy for Default","synthetic":false,"types":["syn::token::Default"]},{"text":"impl Copy for Do","synthetic":false,"types":["syn::token::Do"]},{"text":"impl Copy for Dyn","synthetic":false,"types":["syn::token::Dyn"]},{"text":"impl Copy for Else","synthetic":false,"types":["syn::token::Else"]},{"text":"impl Copy for Enum","synthetic":false,"types":["syn::token::Enum"]},{"text":"impl Copy for Extern","synthetic":false,"types":["syn::token::Extern"]},{"text":"impl Copy for Final","synthetic":false,"types":["syn::token::Final"]},{"text":"impl Copy for Fn","synthetic":false,"types":["syn::token::Fn"]},{"text":"impl Copy for For","synthetic":false,"types":["syn::token::For"]},{"text":"impl Copy for If","synthetic":false,"types":["syn::token::If"]},{"text":"impl Copy for Impl","synthetic":false,"types":["syn::token::Impl"]},{"text":"impl Copy for In","synthetic":false,"types":["syn::token::In"]},{"text":"impl Copy for Let","synthetic":false,"types":["syn::token::Let"]},{"text":"impl Copy for Loop","synthetic":false,"types":["syn::token::Loop"]},{"text":"impl Copy for Macro","synthetic":false,"types":["syn::token::Macro"]},{"text":"impl Copy for Match","synthetic":false,"types":["syn::token::Match"]},{"text":"impl Copy for Mod","synthetic":false,"types":["syn::token::Mod"]},{"text":"impl Copy for Move","synthetic":false,"types":["syn::token::Move"]},{"text":"impl Copy for Mut","synthetic":false,"types":["syn::token::Mut"]},{"text":"impl Copy for Override","synthetic":false,"types":["syn::token::Override"]},{"text":"impl Copy for Priv","synthetic":false,"types":["syn::token::Priv"]},{"text":"impl Copy for Pub","synthetic":false,"types":["syn::token::Pub"]},{"text":"impl Copy for Ref","synthetic":false,"types":["syn::token::Ref"]},{"text":"impl Copy for Return","synthetic":false,"types":["syn::token::Return"]},{"text":"impl Copy for SelfType","synthetic":false,"types":["syn::token::SelfType"]},{"text":"impl Copy for SelfValue","synthetic":false,"types":["syn::token::SelfValue"]},{"text":"impl Copy for Static","synthetic":false,"types":["syn::token::Static"]},{"text":"impl Copy for Struct","synthetic":false,"types":["syn::token::Struct"]},{"text":"impl Copy for Super","synthetic":false,"types":["syn::token::Super"]},{"text":"impl Copy for Trait","synthetic":false,"types":["syn::token::Trait"]},{"text":"impl Copy for Try","synthetic":false,"types":["syn::token::Try"]},{"text":"impl Copy for Type","synthetic":false,"types":["syn::token::Type"]},{"text":"impl Copy for Typeof","synthetic":false,"types":["syn::token::Typeof"]},{"text":"impl Copy for Union","synthetic":false,"types":["syn::token::Union"]},{"text":"impl Copy for Unsafe","synthetic":false,"types":["syn::token::Unsafe"]},{"text":"impl Copy for Unsized","synthetic":false,"types":["syn::token::Unsized"]},{"text":"impl Copy for Use","synthetic":false,"types":["syn::token::Use"]},{"text":"impl Copy for Virtual","synthetic":false,"types":["syn::token::Virtual"]},{"text":"impl Copy for Where","synthetic":false,"types":["syn::token::Where"]},{"text":"impl Copy for While","synthetic":false,"types":["syn::token::While"]},{"text":"impl Copy for Yield","synthetic":false,"types":["syn::token::Yield"]},{"text":"impl Copy for Add","synthetic":false,"types":["syn::token::Add"]},{"text":"impl Copy for AddEq","synthetic":false,"types":["syn::token::AddEq"]},{"text":"impl Copy for And","synthetic":false,"types":["syn::token::And"]},{"text":"impl Copy for AndAnd","synthetic":false,"types":["syn::token::AndAnd"]},{"text":"impl Copy for AndEq","synthetic":false,"types":["syn::token::AndEq"]},{"text":"impl Copy for At","synthetic":false,"types":["syn::token::At"]},{"text":"impl Copy for Bang","synthetic":false,"types":["syn::token::Bang"]},{"text":"impl Copy for Caret","synthetic":false,"types":["syn::token::Caret"]},{"text":"impl Copy for CaretEq","synthetic":false,"types":["syn::token::CaretEq"]},{"text":"impl Copy for Colon","synthetic":false,"types":["syn::token::Colon"]},{"text":"impl Copy for Colon2","synthetic":false,"types":["syn::token::Colon2"]},{"text":"impl Copy for Comma","synthetic":false,"types":["syn::token::Comma"]},{"text":"impl Copy for Div","synthetic":false,"types":["syn::token::Div"]},{"text":"impl Copy for DivEq","synthetic":false,"types":["syn::token::DivEq"]},{"text":"impl Copy for Dollar","synthetic":false,"types":["syn::token::Dollar"]},{"text":"impl Copy for Dot","synthetic":false,"types":["syn::token::Dot"]},{"text":"impl Copy for Dot2","synthetic":false,"types":["syn::token::Dot2"]},{"text":"impl Copy for Dot3","synthetic":false,"types":["syn::token::Dot3"]},{"text":"impl Copy for DotDotEq","synthetic":false,"types":["syn::token::DotDotEq"]},{"text":"impl Copy for Eq","synthetic":false,"types":["syn::token::Eq"]},{"text":"impl Copy for EqEq","synthetic":false,"types":["syn::token::EqEq"]},{"text":"impl Copy for Ge","synthetic":false,"types":["syn::token::Ge"]},{"text":"impl Copy for Gt","synthetic":false,"types":["syn::token::Gt"]},{"text":"impl Copy for Le","synthetic":false,"types":["syn::token::Le"]},{"text":"impl Copy for Lt","synthetic":false,"types":["syn::token::Lt"]},{"text":"impl Copy for MulEq","synthetic":false,"types":["syn::token::MulEq"]},{"text":"impl Copy for Ne","synthetic":false,"types":["syn::token::Ne"]},{"text":"impl Copy for Or","synthetic":false,"types":["syn::token::Or"]},{"text":"impl Copy for OrEq","synthetic":false,"types":["syn::token::OrEq"]},{"text":"impl Copy for OrOr","synthetic":false,"types":["syn::token::OrOr"]},{"text":"impl Copy for Pound","synthetic":false,"types":["syn::token::Pound"]},{"text":"impl Copy for Question","synthetic":false,"types":["syn::token::Question"]},{"text":"impl Copy for RArrow","synthetic":false,"types":["syn::token::RArrow"]},{"text":"impl Copy for LArrow","synthetic":false,"types":["syn::token::LArrow"]},{"text":"impl Copy for Rem","synthetic":false,"types":["syn::token::Rem"]},{"text":"impl Copy for RemEq","synthetic":false,"types":["syn::token::RemEq"]},{"text":"impl Copy for FatArrow","synthetic":false,"types":["syn::token::FatArrow"]},{"text":"impl Copy for Semi","synthetic":false,"types":["syn::token::Semi"]},{"text":"impl Copy for Shl","synthetic":false,"types":["syn::token::Shl"]},{"text":"impl Copy for ShlEq","synthetic":false,"types":["syn::token::ShlEq"]},{"text":"impl Copy for Shr","synthetic":false,"types":["syn::token::Shr"]},{"text":"impl Copy for ShrEq","synthetic":false,"types":["syn::token::ShrEq"]},{"text":"impl Copy for Star","synthetic":false,"types":["syn::token::Star"]},{"text":"impl Copy for Sub","synthetic":false,"types":["syn::token::Sub"]},{"text":"impl Copy for SubEq","synthetic":false,"types":["syn::token::SubEq"]},{"text":"impl Copy for Tilde","synthetic":false,"types":["syn::token::Tilde"]},{"text":"impl Copy for Brace","synthetic":false,"types":["syn::token::Brace"]},{"text":"impl Copy for Bracket","synthetic":false,"types":["syn::token::Bracket"]},{"text":"impl Copy for Paren","synthetic":false,"types":["syn::token::Paren"]},{"text":"impl Copy for Group","synthetic":false,"types":["syn::token::Group"]},{"text":"impl Copy for AttrStyle","synthetic":false,"types":["syn::attr::AttrStyle"]},{"text":"impl Copy for TraitBoundModifier","synthetic":false,"types":["syn::generics::TraitBoundModifier"]},{"text":"impl Copy for BinOp","synthetic":false,"types":["syn::op::BinOp"]},{"text":"impl Copy for UnOp","synthetic":false,"types":["syn::op::UnOp"]},{"text":"impl<'a> Copy for Cursor<'a>","synthetic":false,"types":["syn::buffer::Cursor"]},{"text":"impl<'c, 'a> Copy for StepCursor<'c, 'a>","synthetic":false,"types":["syn::parse::StepCursor"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/marker/trait.Freeze.js b/implementors/core/marker/trait.Freeze.js new file mode 100644 index 0000000..4f13ab5 --- /dev/null +++ b/implementors/core/marker/trait.Freeze.js @@ -0,0 +1,9 @@ +(function() {var implementors = {}; +implementors["bincode"] = [{"text":"impl Freeze for Config","synthetic":true,"types":["bincode::config::Config"]},{"text":"impl Freeze for ErrorKind","synthetic":true,"types":["bincode::error::ErrorKind"]}]; +implementors["byteorder"] = [{"text":"impl Freeze for BigEndian","synthetic":true,"types":["byteorder::BigEndian"]},{"text":"impl Freeze for LittleEndian","synthetic":true,"types":["byteorder::LittleEndian"]}]; +implementors["ironsea_index_sfc_dbc"] = [{"text":"impl<F, K, V> Freeze for SpaceFillingCurve<F, K, V>","synthetic":true,"types":["ironsea_index_sfc_dbc::sfc::SpaceFillingCurve"]}]; +implementors["log"] = [{"text":"impl<'a> Freeze for Record<'a>","synthetic":true,"types":["log::Record"]},{"text":"impl<'a> Freeze for RecordBuilder<'a>","synthetic":true,"types":["log::RecordBuilder"]},{"text":"impl<'a> Freeze for Metadata<'a>","synthetic":true,"types":["log::Metadata"]},{"text":"impl<'a> Freeze for MetadataBuilder<'a>","synthetic":true,"types":["log::MetadataBuilder"]},{"text":"impl Freeze for SetLoggerError","synthetic":true,"types":["log::SetLoggerError"]},{"text":"impl Freeze for ParseLevelError","synthetic":true,"types":["log::ParseLevelError"]},{"text":"impl Freeze for Level","synthetic":true,"types":["log::Level"]},{"text":"impl Freeze for LevelFilter","synthetic":true,"types":["log::LevelFilter"]}]; +implementors["proc_macro2"] = [{"text":"impl Freeze for TokenStream","synthetic":true,"types":["proc_macro2::TokenStream"]},{"text":"impl Freeze for LexError","synthetic":true,"types":["proc_macro2::LexError"]},{"text":"impl Freeze for Span","synthetic":true,"types":["proc_macro2::Span"]},{"text":"impl Freeze for Group","synthetic":true,"types":["proc_macro2::Group"]},{"text":"impl Freeze for Punct","synthetic":true,"types":["proc_macro2::Punct"]},{"text":"impl Freeze for Ident","synthetic":true,"types":["proc_macro2::Ident"]},{"text":"impl Freeze for Literal","synthetic":true,"types":["proc_macro2::Literal"]},{"text":"impl Freeze for TokenTree","synthetic":true,"types":["proc_macro2::TokenTree"]},{"text":"impl Freeze for Delimiter","synthetic":true,"types":["proc_macro2::Delimiter"]},{"text":"impl Freeze for Spacing","synthetic":true,"types":["proc_macro2::Spacing"]},{"text":"impl Freeze for IntoIter","synthetic":true,"types":["proc_macro2::token_stream::IntoIter"]}]; +implementors["serde"] = [{"text":"impl Freeze for IgnoredAny","synthetic":true,"types":["serde::de::ignored_any::IgnoredAny"]},{"text":"impl<'a> Freeze for Unexpected<'a>","synthetic":true,"types":["serde::de::Unexpected"]},{"text":"impl Freeze for Error","synthetic":true,"types":["serde::de::value::Error"]},{"text":"impl<E> Freeze for UnitDeserializer<E>","synthetic":true,"types":["serde::de::value::UnitDeserializer"]},{"text":"impl<E> Freeze for BoolDeserializer<E>","synthetic":true,"types":["serde::de::value::BoolDeserializer"]},{"text":"impl<E> Freeze for I8Deserializer<E>","synthetic":true,"types":["serde::de::value::I8Deserializer"]},{"text":"impl<E> Freeze for I16Deserializer<E>","synthetic":true,"types":["serde::de::value::I16Deserializer"]},{"text":"impl<E> Freeze for I32Deserializer<E>","synthetic":true,"types":["serde::de::value::I32Deserializer"]},{"text":"impl<E> Freeze for I64Deserializer<E>","synthetic":true,"types":["serde::de::value::I64Deserializer"]},{"text":"impl<E> Freeze for IsizeDeserializer<E>","synthetic":true,"types":["serde::de::value::IsizeDeserializer"]},{"text":"impl<E> Freeze for U8Deserializer<E>","synthetic":true,"types":["serde::de::value::U8Deserializer"]},{"text":"impl<E> Freeze for U16Deserializer<E>","synthetic":true,"types":["serde::de::value::U16Deserializer"]},{"text":"impl<E> Freeze for U64Deserializer<E>","synthetic":true,"types":["serde::de::value::U64Deserializer"]},{"text":"impl<E> Freeze for UsizeDeserializer<E>","synthetic":true,"types":["serde::de::value::UsizeDeserializer"]},{"text":"impl<E> Freeze for F32Deserializer<E>","synthetic":true,"types":["serde::de::value::F32Deserializer"]},{"text":"impl<E> Freeze for F64Deserializer<E>","synthetic":true,"types":["serde::de::value::F64Deserializer"]},{"text":"impl<E> Freeze for CharDeserializer<E>","synthetic":true,"types":["serde::de::value::CharDeserializer"]},{"text":"impl<E> Freeze for I128Deserializer<E>","synthetic":true,"types":["serde::de::value::I128Deserializer"]},{"text":"impl<E> Freeze for U128Deserializer<E>","synthetic":true,"types":["serde::de::value::U128Deserializer"]},{"text":"impl<E> Freeze for U32Deserializer<E>","synthetic":true,"types":["serde::de::value::U32Deserializer"]},{"text":"impl<'a, E> Freeze for StrDeserializer<'a, E>","synthetic":true,"types":["serde::de::value::StrDeserializer"]},{"text":"impl<'de, E> Freeze for BorrowedStrDeserializer<'de, E>","synthetic":true,"types":["serde::de::value::BorrowedStrDeserializer"]},{"text":"impl<E> Freeze for StringDeserializer<E>","synthetic":true,"types":["serde::de::value::StringDeserializer"]},{"text":"impl<'a, E> Freeze for CowStrDeserializer<'a, E>","synthetic":true,"types":["serde::de::value::CowStrDeserializer"]},{"text":"impl<'de, E> Freeze for BorrowedBytesDeserializer<'de, E>","synthetic":true,"types":["serde::de::value::BorrowedBytesDeserializer"]},{"text":"impl<I, E> Freeze for SeqDeserializer<I, E> where
    I: Freeze, 
","synthetic":true,"types":["serde::de::value::SeqDeserializer"]},{"text":"impl<A> Freeze for SeqAccessDeserializer<A> where
    A: Freeze, 
","synthetic":true,"types":["serde::de::value::SeqAccessDeserializer"]},{"text":"impl<'de, I, E> Freeze for MapDeserializer<'de, I, E> where
    I: Freeze,
    <<I as Iterator>::Item as Pair>::Second: Freeze, 
","synthetic":true,"types":["serde::de::value::MapDeserializer"]},{"text":"impl<A> Freeze for MapAccessDeserializer<A> where
    A: Freeze, 
","synthetic":true,"types":["serde::de::value::MapAccessDeserializer"]},{"text":"impl<Ok, Error> Freeze for Impossible<Ok, Error>","synthetic":true,"types":["serde::ser::impossible::Impossible"]}]; +implementors["syn"] = [{"text":"impl Freeze for Attribute","synthetic":true,"types":["syn::attr::Attribute"]},{"text":"impl Freeze for MetaList","synthetic":true,"types":["syn::attr::MetaList"]},{"text":"impl Freeze for MetaNameValue","synthetic":true,"types":["syn::attr::MetaNameValue"]},{"text":"impl Freeze for Field","synthetic":true,"types":["syn::data::Field"]},{"text":"impl Freeze for FieldsNamed","synthetic":true,"types":["syn::data::FieldsNamed"]},{"text":"impl Freeze for FieldsUnnamed","synthetic":true,"types":["syn::data::FieldsUnnamed"]},{"text":"impl Freeze for Variant","synthetic":true,"types":["syn::data::Variant"]},{"text":"impl Freeze for VisCrate","synthetic":true,"types":["syn::data::VisCrate"]},{"text":"impl Freeze for VisPublic","synthetic":true,"types":["syn::data::VisPublic"]},{"text":"impl Freeze for VisRestricted","synthetic":true,"types":["syn::data::VisRestricted"]},{"text":"impl Freeze for ExprArray","synthetic":true,"types":["syn::expr::ExprArray"]},{"text":"impl Freeze for ExprAssign","synthetic":true,"types":["syn::expr::ExprAssign"]},{"text":"impl Freeze for ExprAssignOp","synthetic":true,"types":["syn::expr::ExprAssignOp"]},{"text":"impl Freeze for ExprAsync","synthetic":true,"types":["syn::expr::ExprAsync"]},{"text":"impl Freeze for ExprAwait","synthetic":true,"types":["syn::expr::ExprAwait"]},{"text":"impl Freeze for ExprBinary","synthetic":true,"types":["syn::expr::ExprBinary"]},{"text":"impl Freeze for ExprBlock","synthetic":true,"types":["syn::expr::ExprBlock"]},{"text":"impl Freeze for ExprBox","synthetic":true,"types":["syn::expr::ExprBox"]},{"text":"impl Freeze for ExprBreak","synthetic":true,"types":["syn::expr::ExprBreak"]},{"text":"impl Freeze for ExprCall","synthetic":true,"types":["syn::expr::ExprCall"]},{"text":"impl Freeze for ExprCast","synthetic":true,"types":["syn::expr::ExprCast"]},{"text":"impl Freeze for ExprClosure","synthetic":true,"types":["syn::expr::ExprClosure"]},{"text":"impl Freeze for ExprContinue","synthetic":true,"types":["syn::expr::ExprContinue"]},{"text":"impl Freeze for ExprField","synthetic":true,"types":["syn::expr::ExprField"]},{"text":"impl Freeze for ExprForLoop","synthetic":true,"types":["syn::expr::ExprForLoop"]},{"text":"impl Freeze for ExprGroup","synthetic":true,"types":["syn::expr::ExprGroup"]},{"text":"impl Freeze for ExprIf","synthetic":true,"types":["syn::expr::ExprIf"]},{"text":"impl Freeze for ExprIndex","synthetic":true,"types":["syn::expr::ExprIndex"]},{"text":"impl Freeze for ExprLet","synthetic":true,"types":["syn::expr::ExprLet"]},{"text":"impl Freeze for ExprLit","synthetic":true,"types":["syn::expr::ExprLit"]},{"text":"impl Freeze for ExprLoop","synthetic":true,"types":["syn::expr::ExprLoop"]},{"text":"impl Freeze for ExprMacro","synthetic":true,"types":["syn::expr::ExprMacro"]},{"text":"impl Freeze for ExprMatch","synthetic":true,"types":["syn::expr::ExprMatch"]},{"text":"impl Freeze for ExprMethodCall","synthetic":true,"types":["syn::expr::ExprMethodCall"]},{"text":"impl Freeze for ExprParen","synthetic":true,"types":["syn::expr::ExprParen"]},{"text":"impl Freeze for ExprPath","synthetic":true,"types":["syn::expr::ExprPath"]},{"text":"impl Freeze for ExprRange","synthetic":true,"types":["syn::expr::ExprRange"]},{"text":"impl Freeze for ExprReference","synthetic":true,"types":["syn::expr::ExprReference"]},{"text":"impl Freeze for ExprRepeat","synthetic":true,"types":["syn::expr::ExprRepeat"]},{"text":"impl Freeze for ExprReturn","synthetic":true,"types":["syn::expr::ExprReturn"]},{"text":"impl Freeze for ExprStruct","synthetic":true,"types":["syn::expr::ExprStruct"]},{"text":"impl Freeze for ExprTry","synthetic":true,"types":["syn::expr::ExprTry"]},{"text":"impl Freeze for ExprTryBlock","synthetic":true,"types":["syn::expr::ExprTryBlock"]},{"text":"impl Freeze for ExprTuple","synthetic":true,"types":["syn::expr::ExprTuple"]},{"text":"impl Freeze for ExprType","synthetic":true,"types":["syn::expr::ExprType"]},{"text":"impl Freeze for ExprUnary","synthetic":true,"types":["syn::expr::ExprUnary"]},{"text":"impl Freeze for ExprUnsafe","synthetic":true,"types":["syn::expr::ExprUnsafe"]},{"text":"impl Freeze for ExprWhile","synthetic":true,"types":["syn::expr::ExprWhile"]},{"text":"impl Freeze for ExprYield","synthetic":true,"types":["syn::expr::ExprYield"]},{"text":"impl Freeze for Index","synthetic":true,"types":["syn::expr::Index"]},{"text":"impl Freeze for BoundLifetimes","synthetic":true,"types":["syn::generics::BoundLifetimes"]},{"text":"impl Freeze for ConstParam","synthetic":true,"types":["syn::generics::ConstParam"]},{"text":"impl Freeze for Generics","synthetic":true,"types":["syn::generics::Generics"]},{"text":"impl Freeze for LifetimeDef","synthetic":true,"types":["syn::generics::LifetimeDef"]},{"text":"impl Freeze for PredicateEq","synthetic":true,"types":["syn::generics::PredicateEq"]},{"text":"impl Freeze for PredicateLifetime","synthetic":true,"types":["syn::generics::PredicateLifetime"]},{"text":"impl Freeze for PredicateType","synthetic":true,"types":["syn::generics::PredicateType"]},{"text":"impl Freeze for TraitBound","synthetic":true,"types":["syn::generics::TraitBound"]},{"text":"impl Freeze for TypeParam","synthetic":true,"types":["syn::generics::TypeParam"]},{"text":"impl Freeze for WhereClause","synthetic":true,"types":["syn::generics::WhereClause"]},{"text":"impl<'a> Freeze for ImplGenerics<'a>","synthetic":true,"types":["syn::generics::ImplGenerics"]},{"text":"impl<'a> Freeze for Turbofish<'a>","synthetic":true,"types":["syn::generics::Turbofish"]},{"text":"impl<'a> Freeze for TypeGenerics<'a>","synthetic":true,"types":["syn::generics::TypeGenerics"]},{"text":"impl Freeze for Lifetime","synthetic":true,"types":["syn::lifetime::Lifetime"]},{"text":"impl Freeze for LitBool","synthetic":true,"types":["syn::lit::LitBool"]},{"text":"impl Freeze for LitByte","synthetic":true,"types":["syn::lit::LitByte"]},{"text":"impl Freeze for LitByteStr","synthetic":true,"types":["syn::lit::LitByteStr"]},{"text":"impl Freeze for LitChar","synthetic":true,"types":["syn::lit::LitChar"]},{"text":"impl Freeze for LitFloat","synthetic":true,"types":["syn::lit::LitFloat"]},{"text":"impl Freeze for LitInt","synthetic":true,"types":["syn::lit::LitInt"]},{"text":"impl Freeze for LitStr","synthetic":true,"types":["syn::lit::LitStr"]},{"text":"impl Freeze for Macro","synthetic":true,"types":["syn::mac::Macro"]},{"text":"impl Freeze for DataEnum","synthetic":true,"types":["syn::derive::DataEnum"]},{"text":"impl Freeze for DataStruct","synthetic":true,"types":["syn::derive::DataStruct"]},{"text":"impl Freeze for DataUnion","synthetic":true,"types":["syn::derive::DataUnion"]},{"text":"impl Freeze for DeriveInput","synthetic":true,"types":["syn::derive::DeriveInput"]},{"text":"impl Freeze for Abi","synthetic":true,"types":["syn::ty::Abi"]},{"text":"impl Freeze for BareFnArg","synthetic":true,"types":["syn::ty::BareFnArg"]},{"text":"impl Freeze for TypeArray","synthetic":true,"types":["syn::ty::TypeArray"]},{"text":"impl Freeze for TypeBareFn","synthetic":true,"types":["syn::ty::TypeBareFn"]},{"text":"impl Freeze for TypeGroup","synthetic":true,"types":["syn::ty::TypeGroup"]},{"text":"impl Freeze for TypeImplTrait","synthetic":true,"types":["syn::ty::TypeImplTrait"]},{"text":"impl Freeze for TypeInfer","synthetic":true,"types":["syn::ty::TypeInfer"]},{"text":"impl Freeze for TypeMacro","synthetic":true,"types":["syn::ty::TypeMacro"]},{"text":"impl Freeze for TypeNever","synthetic":true,"types":["syn::ty::TypeNever"]},{"text":"impl Freeze for TypeParen","synthetic":true,"types":["syn::ty::TypeParen"]},{"text":"impl Freeze for TypePath","synthetic":true,"types":["syn::ty::TypePath"]},{"text":"impl Freeze for TypePtr","synthetic":true,"types":["syn::ty::TypePtr"]},{"text":"impl Freeze for TypeReference","synthetic":true,"types":["syn::ty::TypeReference"]},{"text":"impl Freeze for TypeSlice","synthetic":true,"types":["syn::ty::TypeSlice"]},{"text":"impl Freeze for TypeTraitObject","synthetic":true,"types":["syn::ty::TypeTraitObject"]},{"text":"impl Freeze for TypeTuple","synthetic":true,"types":["syn::ty::TypeTuple"]},{"text":"impl Freeze for Variadic","synthetic":true,"types":["syn::ty::Variadic"]},{"text":"impl Freeze for AngleBracketedGenericArguments","synthetic":true,"types":["syn::path::AngleBracketedGenericArguments"]},{"text":"impl Freeze for Binding","synthetic":true,"types":["syn::path::Binding"]},{"text":"impl Freeze for Constraint","synthetic":true,"types":["syn::path::Constraint"]},{"text":"impl Freeze for ParenthesizedGenericArguments","synthetic":true,"types":["syn::path::ParenthesizedGenericArguments"]},{"text":"impl Freeze for Path","synthetic":true,"types":["syn::path::Path"]},{"text":"impl Freeze for PathSegment","synthetic":true,"types":["syn::path::PathSegment"]},{"text":"impl Freeze for QSelf","synthetic":true,"types":["syn::path::QSelf"]},{"text":"impl Freeze for Error","synthetic":true,"types":["syn::error::Error"]},{"text":"impl Freeze for AttrStyle","synthetic":true,"types":["syn::attr::AttrStyle"]},{"text":"impl Freeze for Meta","synthetic":true,"types":["syn::attr::Meta"]},{"text":"impl Freeze for NestedMeta","synthetic":true,"types":["syn::attr::NestedMeta"]},{"text":"impl Freeze for Fields","synthetic":true,"types":["syn::data::Fields"]},{"text":"impl Freeze for Visibility","synthetic":true,"types":["syn::data::Visibility"]},{"text":"impl Freeze for Expr","synthetic":true,"types":["syn::expr::Expr"]},{"text":"impl Freeze for Member","synthetic":true,"types":["syn::expr::Member"]},{"text":"impl Freeze for GenericParam","synthetic":true,"types":["syn::generics::GenericParam"]},{"text":"impl Freeze for TraitBoundModifier","synthetic":true,"types":["syn::generics::TraitBoundModifier"]},{"text":"impl Freeze for TypeParamBound","synthetic":true,"types":["syn::generics::TypeParamBound"]},{"text":"impl Freeze for WherePredicate","synthetic":true,"types":["syn::generics::WherePredicate"]},{"text":"impl Freeze for Lit","synthetic":true,"types":["syn::lit::Lit"]},{"text":"impl Freeze for StrStyle","synthetic":true,"types":["syn::lit::StrStyle"]},{"text":"impl Freeze for MacroDelimiter","synthetic":true,"types":["syn::mac::MacroDelimiter"]},{"text":"impl Freeze for Data","synthetic":true,"types":["syn::derive::Data"]},{"text":"impl Freeze for BinOp","synthetic":true,"types":["syn::op::BinOp"]},{"text":"impl Freeze for UnOp","synthetic":true,"types":["syn::op::UnOp"]},{"text":"impl Freeze for ReturnType","synthetic":true,"types":["syn::ty::ReturnType"]},{"text":"impl Freeze for Type","synthetic":true,"types":["syn::ty::Type"]},{"text":"impl Freeze for GenericArgument","synthetic":true,"types":["syn::path::GenericArgument"]},{"text":"impl Freeze for PathArguments","synthetic":true,"types":["syn::path::PathArguments"]},{"text":"impl Freeze for Underscore","synthetic":true,"types":["syn::token::Underscore"]},{"text":"impl Freeze for Abstract","synthetic":true,"types":["syn::token::Abstract"]},{"text":"impl Freeze for As","synthetic":true,"types":["syn::token::As"]},{"text":"impl Freeze for Async","synthetic":true,"types":["syn::token::Async"]},{"text":"impl Freeze for Auto","synthetic":true,"types":["syn::token::Auto"]},{"text":"impl Freeze for Await","synthetic":true,"types":["syn::token::Await"]},{"text":"impl Freeze for Become","synthetic":true,"types":["syn::token::Become"]},{"text":"impl Freeze for Box","synthetic":true,"types":["syn::token::Box"]},{"text":"impl Freeze for Break","synthetic":true,"types":["syn::token::Break"]},{"text":"impl Freeze for Const","synthetic":true,"types":["syn::token::Const"]},{"text":"impl Freeze for Continue","synthetic":true,"types":["syn::token::Continue"]},{"text":"impl Freeze for Crate","synthetic":true,"types":["syn::token::Crate"]},{"text":"impl Freeze for Default","synthetic":true,"types":["syn::token::Default"]},{"text":"impl Freeze for Do","synthetic":true,"types":["syn::token::Do"]},{"text":"impl Freeze for Dyn","synthetic":true,"types":["syn::token::Dyn"]},{"text":"impl Freeze for Else","synthetic":true,"types":["syn::token::Else"]},{"text":"impl Freeze for Enum","synthetic":true,"types":["syn::token::Enum"]},{"text":"impl Freeze for Extern","synthetic":true,"types":["syn::token::Extern"]},{"text":"impl Freeze for Final","synthetic":true,"types":["syn::token::Final"]},{"text":"impl Freeze for Fn","synthetic":true,"types":["syn::token::Fn"]},{"text":"impl Freeze for For","synthetic":true,"types":["syn::token::For"]},{"text":"impl Freeze for If","synthetic":true,"types":["syn::token::If"]},{"text":"impl Freeze for Impl","synthetic":true,"types":["syn::token::Impl"]},{"text":"impl Freeze for In","synthetic":true,"types":["syn::token::In"]},{"text":"impl Freeze for Let","synthetic":true,"types":["syn::token::Let"]},{"text":"impl Freeze for Loop","synthetic":true,"types":["syn::token::Loop"]},{"text":"impl Freeze for Macro","synthetic":true,"types":["syn::token::Macro"]},{"text":"impl Freeze for Match","synthetic":true,"types":["syn::token::Match"]},{"text":"impl Freeze for Mod","synthetic":true,"types":["syn::token::Mod"]},{"text":"impl Freeze for Move","synthetic":true,"types":["syn::token::Move"]},{"text":"impl Freeze for Mut","synthetic":true,"types":["syn::token::Mut"]},{"text":"impl Freeze for Override","synthetic":true,"types":["syn::token::Override"]},{"text":"impl Freeze for Priv","synthetic":true,"types":["syn::token::Priv"]},{"text":"impl Freeze for Pub","synthetic":true,"types":["syn::token::Pub"]},{"text":"impl Freeze for Ref","synthetic":true,"types":["syn::token::Ref"]},{"text":"impl Freeze for Return","synthetic":true,"types":["syn::token::Return"]},{"text":"impl Freeze for SelfType","synthetic":true,"types":["syn::token::SelfType"]},{"text":"impl Freeze for SelfValue","synthetic":true,"types":["syn::token::SelfValue"]},{"text":"impl Freeze for Static","synthetic":true,"types":["syn::token::Static"]},{"text":"impl Freeze for Struct","synthetic":true,"types":["syn::token::Struct"]},{"text":"impl Freeze for Super","synthetic":true,"types":["syn::token::Super"]},{"text":"impl Freeze for Trait","synthetic":true,"types":["syn::token::Trait"]},{"text":"impl Freeze for Try","synthetic":true,"types":["syn::token::Try"]},{"text":"impl Freeze for Type","synthetic":true,"types":["syn::token::Type"]},{"text":"impl Freeze for Typeof","synthetic":true,"types":["syn::token::Typeof"]},{"text":"impl Freeze for Union","synthetic":true,"types":["syn::token::Union"]},{"text":"impl Freeze for Unsafe","synthetic":true,"types":["syn::token::Unsafe"]},{"text":"impl Freeze for Unsized","synthetic":true,"types":["syn::token::Unsized"]},{"text":"impl Freeze for Use","synthetic":true,"types":["syn::token::Use"]},{"text":"impl Freeze for Virtual","synthetic":true,"types":["syn::token::Virtual"]},{"text":"impl Freeze for Where","synthetic":true,"types":["syn::token::Where"]},{"text":"impl Freeze for While","synthetic":true,"types":["syn::token::While"]},{"text":"impl Freeze for Yield","synthetic":true,"types":["syn::token::Yield"]},{"text":"impl Freeze for Add","synthetic":true,"types":["syn::token::Add"]},{"text":"impl Freeze for AddEq","synthetic":true,"types":["syn::token::AddEq"]},{"text":"impl Freeze for And","synthetic":true,"types":["syn::token::And"]},{"text":"impl Freeze for AndAnd","synthetic":true,"types":["syn::token::AndAnd"]},{"text":"impl Freeze for AndEq","synthetic":true,"types":["syn::token::AndEq"]},{"text":"impl Freeze for At","synthetic":true,"types":["syn::token::At"]},{"text":"impl Freeze for Bang","synthetic":true,"types":["syn::token::Bang"]},{"text":"impl Freeze for Caret","synthetic":true,"types":["syn::token::Caret"]},{"text":"impl Freeze for CaretEq","synthetic":true,"types":["syn::token::CaretEq"]},{"text":"impl Freeze for Colon","synthetic":true,"types":["syn::token::Colon"]},{"text":"impl Freeze for Colon2","synthetic":true,"types":["syn::token::Colon2"]},{"text":"impl Freeze for Comma","synthetic":true,"types":["syn::token::Comma"]},{"text":"impl Freeze for Div","synthetic":true,"types":["syn::token::Div"]},{"text":"impl Freeze for DivEq","synthetic":true,"types":["syn::token::DivEq"]},{"text":"impl Freeze for Dollar","synthetic":true,"types":["syn::token::Dollar"]},{"text":"impl Freeze for Dot","synthetic":true,"types":["syn::token::Dot"]},{"text":"impl Freeze for Dot2","synthetic":true,"types":["syn::token::Dot2"]},{"text":"impl Freeze for Dot3","synthetic":true,"types":["syn::token::Dot3"]},{"text":"impl Freeze for DotDotEq","synthetic":true,"types":["syn::token::DotDotEq"]},{"text":"impl Freeze for Eq","synthetic":true,"types":["syn::token::Eq"]},{"text":"impl Freeze for EqEq","synthetic":true,"types":["syn::token::EqEq"]},{"text":"impl Freeze for Ge","synthetic":true,"types":["syn::token::Ge"]},{"text":"impl Freeze for Gt","synthetic":true,"types":["syn::token::Gt"]},{"text":"impl Freeze for Le","synthetic":true,"types":["syn::token::Le"]},{"text":"impl Freeze for Lt","synthetic":true,"types":["syn::token::Lt"]},{"text":"impl Freeze for MulEq","synthetic":true,"types":["syn::token::MulEq"]},{"text":"impl Freeze for Ne","synthetic":true,"types":["syn::token::Ne"]},{"text":"impl Freeze for Or","synthetic":true,"types":["syn::token::Or"]},{"text":"impl Freeze for OrEq","synthetic":true,"types":["syn::token::OrEq"]},{"text":"impl Freeze for OrOr","synthetic":true,"types":["syn::token::OrOr"]},{"text":"impl Freeze for Pound","synthetic":true,"types":["syn::token::Pound"]},{"text":"impl Freeze for Question","synthetic":true,"types":["syn::token::Question"]},{"text":"impl Freeze for RArrow","synthetic":true,"types":["syn::token::RArrow"]},{"text":"impl Freeze for LArrow","synthetic":true,"types":["syn::token::LArrow"]},{"text":"impl Freeze for Rem","synthetic":true,"types":["syn::token::Rem"]},{"text":"impl Freeze for RemEq","synthetic":true,"types":["syn::token::RemEq"]},{"text":"impl Freeze for FatArrow","synthetic":true,"types":["syn::token::FatArrow"]},{"text":"impl Freeze for Semi","synthetic":true,"types":["syn::token::Semi"]},{"text":"impl Freeze for Shl","synthetic":true,"types":["syn::token::Shl"]},{"text":"impl Freeze for ShlEq","synthetic":true,"types":["syn::token::ShlEq"]},{"text":"impl Freeze for Shr","synthetic":true,"types":["syn::token::Shr"]},{"text":"impl Freeze for ShrEq","synthetic":true,"types":["syn::token::ShrEq"]},{"text":"impl Freeze for Star","synthetic":true,"types":["syn::token::Star"]},{"text":"impl Freeze for Sub","synthetic":true,"types":["syn::token::Sub"]},{"text":"impl Freeze for SubEq","synthetic":true,"types":["syn::token::SubEq"]},{"text":"impl Freeze for Tilde","synthetic":true,"types":["syn::token::Tilde"]},{"text":"impl Freeze for Brace","synthetic":true,"types":["syn::token::Brace"]},{"text":"impl Freeze for Bracket","synthetic":true,"types":["syn::token::Bracket"]},{"text":"impl Freeze for Paren","synthetic":true,"types":["syn::token::Paren"]},{"text":"impl Freeze for Group","synthetic":true,"types":["syn::token::Group"]},{"text":"impl Freeze for TokenBuffer","synthetic":true,"types":["syn::buffer::TokenBuffer"]},{"text":"impl<'a> Freeze for Cursor<'a>","synthetic":true,"types":["syn::buffer::Cursor"]},{"text":"impl<T, P> Freeze for Punctuated<T, P>","synthetic":true,"types":["syn::punctuated::Punctuated"]},{"text":"impl<'a, T, P> Freeze for Pairs<'a, T, P>","synthetic":true,"types":["syn::punctuated::Pairs"]},{"text":"impl<'a, T, P> Freeze for PairsMut<'a, T, P>","synthetic":true,"types":["syn::punctuated::PairsMut"]},{"text":"impl<T, P> Freeze for IntoPairs<T, P> where
    T: Freeze, 
","synthetic":true,"types":["syn::punctuated::IntoPairs"]},{"text":"impl<T> Freeze for IntoIter<T>","synthetic":true,"types":["syn::punctuated::IntoIter"]},{"text":"impl<'a, T> Freeze for Iter<'a, T>","synthetic":true,"types":["syn::punctuated::Iter"]},{"text":"impl<'a, T> Freeze for IterMut<'a, T>","synthetic":true,"types":["syn::punctuated::IterMut"]},{"text":"impl<T, P> Freeze for Pair<T, P> where
    P: Freeze,
    T: Freeze, 
","synthetic":true,"types":["syn::punctuated::Pair"]},{"text":"impl<'a> !Freeze for Lookahead1<'a>","synthetic":true,"types":["syn::lookahead::Lookahead1"]},{"text":"impl<'a> !Freeze for ParseBuffer<'a>","synthetic":true,"types":["syn::parse::ParseBuffer"]},{"text":"impl<'c, 'a> Freeze for StepCursor<'c, 'a>","synthetic":true,"types":["syn::parse::StepCursor"]},{"text":"impl Freeze for Nothing","synthetic":true,"types":["syn::parse::Nothing"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/marker/trait.Send.js b/implementors/core/marker/trait.Send.js new file mode 100644 index 0000000..89bd9a5 --- /dev/null +++ b/implementors/core/marker/trait.Send.js @@ -0,0 +1,9 @@ +(function() {var implementors = {}; +implementors["bincode"] = [{"text":"impl Send for Config","synthetic":true,"types":["bincode::config::Config"]},{"text":"impl Send for ErrorKind","synthetic":true,"types":["bincode::error::ErrorKind"]}]; +implementors["byteorder"] = [{"text":"impl Send for BigEndian","synthetic":true,"types":["byteorder::BigEndian"]},{"text":"impl Send for LittleEndian","synthetic":true,"types":["byteorder::LittleEndian"]}]; +implementors["ironsea_index_sfc_dbc"] = [{"text":"impl<F, K, V> Send for SpaceFillingCurve<F, K, V> where
    F: Send,
    K: Send,
    V: Send
","synthetic":true,"types":["ironsea_index_sfc_dbc::sfc::SpaceFillingCurve"]}]; +implementors["log"] = [{"text":"impl<'a> !Send for Record<'a>","synthetic":true,"types":["log::Record"]},{"text":"impl<'a> !Send for RecordBuilder<'a>","synthetic":true,"types":["log::RecordBuilder"]},{"text":"impl<'a> Send for Metadata<'a>","synthetic":true,"types":["log::Metadata"]},{"text":"impl<'a> Send for MetadataBuilder<'a>","synthetic":true,"types":["log::MetadataBuilder"]},{"text":"impl Send for SetLoggerError","synthetic":true,"types":["log::SetLoggerError"]},{"text":"impl Send for ParseLevelError","synthetic":true,"types":["log::ParseLevelError"]},{"text":"impl Send for Level","synthetic":true,"types":["log::Level"]},{"text":"impl Send for LevelFilter","synthetic":true,"types":["log::LevelFilter"]}]; +implementors["proc_macro2"] = [{"text":"impl !Send for TokenStream","synthetic":true,"types":["proc_macro2::TokenStream"]},{"text":"impl !Send for LexError","synthetic":true,"types":["proc_macro2::LexError"]},{"text":"impl !Send for Span","synthetic":true,"types":["proc_macro2::Span"]},{"text":"impl !Send for Group","synthetic":true,"types":["proc_macro2::Group"]},{"text":"impl !Send for Punct","synthetic":true,"types":["proc_macro2::Punct"]},{"text":"impl !Send for Ident","synthetic":true,"types":["proc_macro2::Ident"]},{"text":"impl !Send for Literal","synthetic":true,"types":["proc_macro2::Literal"]},{"text":"impl !Send for TokenTree","synthetic":true,"types":["proc_macro2::TokenTree"]},{"text":"impl Send for Delimiter","synthetic":true,"types":["proc_macro2::Delimiter"]},{"text":"impl Send for Spacing","synthetic":true,"types":["proc_macro2::Spacing"]},{"text":"impl !Send for IntoIter","synthetic":true,"types":["proc_macro2::token_stream::IntoIter"]}]; +implementors["serde"] = [{"text":"impl Send for IgnoredAny","synthetic":true,"types":["serde::de::ignored_any::IgnoredAny"]},{"text":"impl<'a> Send for Unexpected<'a>","synthetic":true,"types":["serde::de::Unexpected"]},{"text":"impl Send for Error","synthetic":true,"types":["serde::de::value::Error"]},{"text":"impl<E> Send for UnitDeserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::UnitDeserializer"]},{"text":"impl<E> Send for BoolDeserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::BoolDeserializer"]},{"text":"impl<E> Send for I8Deserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::I8Deserializer"]},{"text":"impl<E> Send for I16Deserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::I16Deserializer"]},{"text":"impl<E> Send for I32Deserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::I32Deserializer"]},{"text":"impl<E> Send for I64Deserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::I64Deserializer"]},{"text":"impl<E> Send for IsizeDeserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::IsizeDeserializer"]},{"text":"impl<E> Send for U8Deserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::U8Deserializer"]},{"text":"impl<E> Send for U16Deserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::U16Deserializer"]},{"text":"impl<E> Send for U64Deserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::U64Deserializer"]},{"text":"impl<E> Send for UsizeDeserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::UsizeDeserializer"]},{"text":"impl<E> Send for F32Deserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::F32Deserializer"]},{"text":"impl<E> Send for F64Deserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::F64Deserializer"]},{"text":"impl<E> Send for CharDeserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::CharDeserializer"]},{"text":"impl<E> Send for I128Deserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::I128Deserializer"]},{"text":"impl<E> Send for U128Deserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::U128Deserializer"]},{"text":"impl<E> Send for U32Deserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::U32Deserializer"]},{"text":"impl<'a, E> Send for StrDeserializer<'a, E> where
    E: Send
","synthetic":true,"types":["serde::de::value::StrDeserializer"]},{"text":"impl<'de, E> Send for BorrowedStrDeserializer<'de, E> where
    E: Send
","synthetic":true,"types":["serde::de::value::BorrowedStrDeserializer"]},{"text":"impl<E> Send for StringDeserializer<E> where
    E: Send
","synthetic":true,"types":["serde::de::value::StringDeserializer"]},{"text":"impl<'a, E> Send for CowStrDeserializer<'a, E> where
    E: Send
","synthetic":true,"types":["serde::de::value::CowStrDeserializer"]},{"text":"impl<'de, E> Send for BorrowedBytesDeserializer<'de, E> where
    E: Send
","synthetic":true,"types":["serde::de::value::BorrowedBytesDeserializer"]},{"text":"impl<I, E> Send for SeqDeserializer<I, E> where
    E: Send,
    I: Send
","synthetic":true,"types":["serde::de::value::SeqDeserializer"]},{"text":"impl<A> Send for SeqAccessDeserializer<A> where
    A: Send
","synthetic":true,"types":["serde::de::value::SeqAccessDeserializer"]},{"text":"impl<'de, I, E> Send for MapDeserializer<'de, I, E> where
    E: Send,
    I: Send,
    <<I as Iterator>::Item as Pair>::Second: Send
","synthetic":true,"types":["serde::de::value::MapDeserializer"]},{"text":"impl<A> Send for MapAccessDeserializer<A> where
    A: Send
","synthetic":true,"types":["serde::de::value::MapAccessDeserializer"]},{"text":"impl<Ok, Error> Send for Impossible<Ok, Error> where
    Error: Send,
    Ok: Send
","synthetic":true,"types":["serde::ser::impossible::Impossible"]}]; +implementors["syn"] = [{"text":"impl !Send for Attribute","synthetic":true,"types":["syn::attr::Attribute"]},{"text":"impl !Send for MetaList","synthetic":true,"types":["syn::attr::MetaList"]},{"text":"impl !Send for MetaNameValue","synthetic":true,"types":["syn::attr::MetaNameValue"]},{"text":"impl !Send for Field","synthetic":true,"types":["syn::data::Field"]},{"text":"impl !Send for FieldsNamed","synthetic":true,"types":["syn::data::FieldsNamed"]},{"text":"impl !Send for FieldsUnnamed","synthetic":true,"types":["syn::data::FieldsUnnamed"]},{"text":"impl !Send for Variant","synthetic":true,"types":["syn::data::Variant"]},{"text":"impl !Send for VisCrate","synthetic":true,"types":["syn::data::VisCrate"]},{"text":"impl !Send for VisPublic","synthetic":true,"types":["syn::data::VisPublic"]},{"text":"impl !Send for VisRestricted","synthetic":true,"types":["syn::data::VisRestricted"]},{"text":"impl Send for ExprArray","synthetic":true,"types":["syn::expr::ExprArray"]},{"text":"impl Send for ExprAssign","synthetic":true,"types":["syn::expr::ExprAssign"]},{"text":"impl Send for ExprAssignOp","synthetic":true,"types":["syn::expr::ExprAssignOp"]},{"text":"impl Send for ExprAsync","synthetic":true,"types":["syn::expr::ExprAsync"]},{"text":"impl Send for ExprAwait","synthetic":true,"types":["syn::expr::ExprAwait"]},{"text":"impl !Send for ExprBinary","synthetic":true,"types":["syn::expr::ExprBinary"]},{"text":"impl Send for ExprBlock","synthetic":true,"types":["syn::expr::ExprBlock"]},{"text":"impl Send for ExprBox","synthetic":true,"types":["syn::expr::ExprBox"]},{"text":"impl Send for ExprBreak","synthetic":true,"types":["syn::expr::ExprBreak"]},{"text":"impl !Send for ExprCall","synthetic":true,"types":["syn::expr::ExprCall"]},{"text":"impl !Send for ExprCast","synthetic":true,"types":["syn::expr::ExprCast"]},{"text":"impl Send for ExprClosure","synthetic":true,"types":["syn::expr::ExprClosure"]},{"text":"impl Send for ExprContinue","synthetic":true,"types":["syn::expr::ExprContinue"]},{"text":"impl !Send for ExprField","synthetic":true,"types":["syn::expr::ExprField"]},{"text":"impl Send for ExprForLoop","synthetic":true,"types":["syn::expr::ExprForLoop"]},{"text":"impl Send for ExprGroup","synthetic":true,"types":["syn::expr::ExprGroup"]},{"text":"impl Send for ExprIf","synthetic":true,"types":["syn::expr::ExprIf"]},{"text":"impl !Send for ExprIndex","synthetic":true,"types":["syn::expr::ExprIndex"]},{"text":"impl Send for ExprLet","synthetic":true,"types":["syn::expr::ExprLet"]},{"text":"impl !Send for ExprLit","synthetic":true,"types":["syn::expr::ExprLit"]},{"text":"impl Send for ExprLoop","synthetic":true,"types":["syn::expr::ExprLoop"]},{"text":"impl Send for ExprMacro","synthetic":true,"types":["syn::expr::ExprMacro"]},{"text":"impl Send for ExprMatch","synthetic":true,"types":["syn::expr::ExprMatch"]},{"text":"impl Send for ExprMethodCall","synthetic":true,"types":["syn::expr::ExprMethodCall"]},{"text":"impl !Send for ExprParen","synthetic":true,"types":["syn::expr::ExprParen"]},{"text":"impl !Send for ExprPath","synthetic":true,"types":["syn::expr::ExprPath"]},{"text":"impl Send for ExprRange","synthetic":true,"types":["syn::expr::ExprRange"]},{"text":"impl Send for ExprReference","synthetic":true,"types":["syn::expr::ExprReference"]},{"text":"impl Send for ExprRepeat","synthetic":true,"types":["syn::expr::ExprRepeat"]},{"text":"impl Send for ExprReturn","synthetic":true,"types":["syn::expr::ExprReturn"]},{"text":"impl Send for ExprStruct","synthetic":true,"types":["syn::expr::ExprStruct"]},{"text":"impl Send for ExprTry","synthetic":true,"types":["syn::expr::ExprTry"]},{"text":"impl Send for ExprTryBlock","synthetic":true,"types":["syn::expr::ExprTryBlock"]},{"text":"impl Send for ExprTuple","synthetic":true,"types":["syn::expr::ExprTuple"]},{"text":"impl Send for ExprType","synthetic":true,"types":["syn::expr::ExprType"]},{"text":"impl !Send for ExprUnary","synthetic":true,"types":["syn::expr::ExprUnary"]},{"text":"impl Send for ExprUnsafe","synthetic":true,"types":["syn::expr::ExprUnsafe"]},{"text":"impl Send for ExprWhile","synthetic":true,"types":["syn::expr::ExprWhile"]},{"text":"impl Send for ExprYield","synthetic":true,"types":["syn::expr::ExprYield"]},{"text":"impl !Send for Index","synthetic":true,"types":["syn::expr::Index"]},{"text":"impl !Send for BoundLifetimes","synthetic":true,"types":["syn::generics::BoundLifetimes"]},{"text":"impl !Send for ConstParam","synthetic":true,"types":["syn::generics::ConstParam"]},{"text":"impl !Send for Generics","synthetic":true,"types":["syn::generics::Generics"]},{"text":"impl !Send for LifetimeDef","synthetic":true,"types":["syn::generics::LifetimeDef"]},{"text":"impl !Send for PredicateEq","synthetic":true,"types":["syn::generics::PredicateEq"]},{"text":"impl !Send for PredicateLifetime","synthetic":true,"types":["syn::generics::PredicateLifetime"]},{"text":"impl !Send for PredicateType","synthetic":true,"types":["syn::generics::PredicateType"]},{"text":"impl !Send for TraitBound","synthetic":true,"types":["syn::generics::TraitBound"]},{"text":"impl !Send for TypeParam","synthetic":true,"types":["syn::generics::TypeParam"]},{"text":"impl !Send for WhereClause","synthetic":true,"types":["syn::generics::WhereClause"]},{"text":"impl<'a> !Send for ImplGenerics<'a>","synthetic":true,"types":["syn::generics::ImplGenerics"]},{"text":"impl<'a> !Send for Turbofish<'a>","synthetic":true,"types":["syn::generics::Turbofish"]},{"text":"impl<'a> !Send for TypeGenerics<'a>","synthetic":true,"types":["syn::generics::TypeGenerics"]},{"text":"impl !Send for Lifetime","synthetic":true,"types":["syn::lifetime::Lifetime"]},{"text":"impl !Send for LitBool","synthetic":true,"types":["syn::lit::LitBool"]},{"text":"impl !Send for LitByte","synthetic":true,"types":["syn::lit::LitByte"]},{"text":"impl !Send for LitByteStr","synthetic":true,"types":["syn::lit::LitByteStr"]},{"text":"impl !Send for LitChar","synthetic":true,"types":["syn::lit::LitChar"]},{"text":"impl !Send for LitFloat","synthetic":true,"types":["syn::lit::LitFloat"]},{"text":"impl !Send for LitInt","synthetic":true,"types":["syn::lit::LitInt"]},{"text":"impl !Send for LitStr","synthetic":true,"types":["syn::lit::LitStr"]},{"text":"impl !Send for Macro","synthetic":true,"types":["syn::mac::Macro"]},{"text":"impl !Send for DataEnum","synthetic":true,"types":["syn::derive::DataEnum"]},{"text":"impl !Send for DataStruct","synthetic":true,"types":["syn::derive::DataStruct"]},{"text":"impl !Send for DataUnion","synthetic":true,"types":["syn::derive::DataUnion"]},{"text":"impl !Send for DeriveInput","synthetic":true,"types":["syn::derive::DeriveInput"]},{"text":"impl !Send for Abi","synthetic":true,"types":["syn::ty::Abi"]},{"text":"impl !Send for BareFnArg","synthetic":true,"types":["syn::ty::BareFnArg"]},{"text":"impl !Send for TypeArray","synthetic":true,"types":["syn::ty::TypeArray"]},{"text":"impl !Send for TypeBareFn","synthetic":true,"types":["syn::ty::TypeBareFn"]},{"text":"impl !Send for TypeGroup","synthetic":true,"types":["syn::ty::TypeGroup"]},{"text":"impl !Send for TypeImplTrait","synthetic":true,"types":["syn::ty::TypeImplTrait"]},{"text":"impl !Send for TypeInfer","synthetic":true,"types":["syn::ty::TypeInfer"]},{"text":"impl !Send for TypeMacro","synthetic":true,"types":["syn::ty::TypeMacro"]},{"text":"impl !Send for TypeNever","synthetic":true,"types":["syn::ty::TypeNever"]},{"text":"impl !Send for TypeParen","synthetic":true,"types":["syn::ty::TypeParen"]},{"text":"impl !Send for TypePath","synthetic":true,"types":["syn::ty::TypePath"]},{"text":"impl !Send for TypePtr","synthetic":true,"types":["syn::ty::TypePtr"]},{"text":"impl !Send for TypeReference","synthetic":true,"types":["syn::ty::TypeReference"]},{"text":"impl !Send for TypeSlice","synthetic":true,"types":["syn::ty::TypeSlice"]},{"text":"impl !Send for TypeTraitObject","synthetic":true,"types":["syn::ty::TypeTraitObject"]},{"text":"impl !Send for TypeTuple","synthetic":true,"types":["syn::ty::TypeTuple"]},{"text":"impl !Send for Variadic","synthetic":true,"types":["syn::ty::Variadic"]},{"text":"impl !Send for AngleBracketedGenericArguments","synthetic":true,"types":["syn::path::AngleBracketedGenericArguments"]},{"text":"impl !Send for Binding","synthetic":true,"types":["syn::path::Binding"]},{"text":"impl !Send for Constraint","synthetic":true,"types":["syn::path::Constraint"]},{"text":"impl !Send for ParenthesizedGenericArguments","synthetic":true,"types":["syn::path::ParenthesizedGenericArguments"]},{"text":"impl !Send for Path","synthetic":true,"types":["syn::path::Path"]},{"text":"impl !Send for PathSegment","synthetic":true,"types":["syn::path::PathSegment"]},{"text":"impl !Send for QSelf","synthetic":true,"types":["syn::path::QSelf"]},{"text":"impl Send for Error","synthetic":true,"types":["syn::error::Error"]},{"text":"impl !Send for AttrStyle","synthetic":true,"types":["syn::attr::AttrStyle"]},{"text":"impl !Send for Meta","synthetic":true,"types":["syn::attr::Meta"]},{"text":"impl !Send for NestedMeta","synthetic":true,"types":["syn::attr::NestedMeta"]},{"text":"impl !Send for Fields","synthetic":true,"types":["syn::data::Fields"]},{"text":"impl !Send for Visibility","synthetic":true,"types":["syn::data::Visibility"]},{"text":"impl !Send for Expr","synthetic":true,"types":["syn::expr::Expr"]},{"text":"impl !Send for Member","synthetic":true,"types":["syn::expr::Member"]},{"text":"impl !Send for GenericParam","synthetic":true,"types":["syn::generics::GenericParam"]},{"text":"impl !Send for TraitBoundModifier","synthetic":true,"types":["syn::generics::TraitBoundModifier"]},{"text":"impl !Send for TypeParamBound","synthetic":true,"types":["syn::generics::TypeParamBound"]},{"text":"impl !Send for WherePredicate","synthetic":true,"types":["syn::generics::WherePredicate"]},{"text":"impl !Send for Lit","synthetic":true,"types":["syn::lit::Lit"]},{"text":"impl Send for StrStyle","synthetic":true,"types":["syn::lit::StrStyle"]},{"text":"impl !Send for MacroDelimiter","synthetic":true,"types":["syn::mac::MacroDelimiter"]},{"text":"impl !Send for Data","synthetic":true,"types":["syn::derive::Data"]},{"text":"impl !Send for BinOp","synthetic":true,"types":["syn::op::BinOp"]},{"text":"impl !Send for UnOp","synthetic":true,"types":["syn::op::UnOp"]},{"text":"impl !Send for ReturnType","synthetic":true,"types":["syn::ty::ReturnType"]},{"text":"impl !Send for Type","synthetic":true,"types":["syn::ty::Type"]},{"text":"impl !Send for GenericArgument","synthetic":true,"types":["syn::path::GenericArgument"]},{"text":"impl !Send for PathArguments","synthetic":true,"types":["syn::path::PathArguments"]},{"text":"impl !Send for Underscore","synthetic":true,"types":["syn::token::Underscore"]},{"text":"impl !Send for Abstract","synthetic":true,"types":["syn::token::Abstract"]},{"text":"impl !Send for As","synthetic":true,"types":["syn::token::As"]},{"text":"impl !Send for Async","synthetic":true,"types":["syn::token::Async"]},{"text":"impl !Send for Auto","synthetic":true,"types":["syn::token::Auto"]},{"text":"impl !Send for Await","synthetic":true,"types":["syn::token::Await"]},{"text":"impl !Send for Become","synthetic":true,"types":["syn::token::Become"]},{"text":"impl !Send for Box","synthetic":true,"types":["syn::token::Box"]},{"text":"impl !Send for Break","synthetic":true,"types":["syn::token::Break"]},{"text":"impl !Send for Const","synthetic":true,"types":["syn::token::Const"]},{"text":"impl !Send for Continue","synthetic":true,"types":["syn::token::Continue"]},{"text":"impl !Send for Crate","synthetic":true,"types":["syn::token::Crate"]},{"text":"impl !Send for Default","synthetic":true,"types":["syn::token::Default"]},{"text":"impl !Send for Do","synthetic":true,"types":["syn::token::Do"]},{"text":"impl !Send for Dyn","synthetic":true,"types":["syn::token::Dyn"]},{"text":"impl !Send for Else","synthetic":true,"types":["syn::token::Else"]},{"text":"impl !Send for Enum","synthetic":true,"types":["syn::token::Enum"]},{"text":"impl !Send for Extern","synthetic":true,"types":["syn::token::Extern"]},{"text":"impl !Send for Final","synthetic":true,"types":["syn::token::Final"]},{"text":"impl !Send for Fn","synthetic":true,"types":["syn::token::Fn"]},{"text":"impl !Send for For","synthetic":true,"types":["syn::token::For"]},{"text":"impl !Send for If","synthetic":true,"types":["syn::token::If"]},{"text":"impl !Send for Impl","synthetic":true,"types":["syn::token::Impl"]},{"text":"impl !Send for In","synthetic":true,"types":["syn::token::In"]},{"text":"impl !Send for Let","synthetic":true,"types":["syn::token::Let"]},{"text":"impl !Send for Loop","synthetic":true,"types":["syn::token::Loop"]},{"text":"impl !Send for Macro","synthetic":true,"types":["syn::token::Macro"]},{"text":"impl !Send for Match","synthetic":true,"types":["syn::token::Match"]},{"text":"impl !Send for Mod","synthetic":true,"types":["syn::token::Mod"]},{"text":"impl !Send for Move","synthetic":true,"types":["syn::token::Move"]},{"text":"impl !Send for Mut","synthetic":true,"types":["syn::token::Mut"]},{"text":"impl !Send for Override","synthetic":true,"types":["syn::token::Override"]},{"text":"impl !Send for Priv","synthetic":true,"types":["syn::token::Priv"]},{"text":"impl !Send for Pub","synthetic":true,"types":["syn::token::Pub"]},{"text":"impl !Send for Ref","synthetic":true,"types":["syn::token::Ref"]},{"text":"impl !Send for Return","synthetic":true,"types":["syn::token::Return"]},{"text":"impl !Send for SelfType","synthetic":true,"types":["syn::token::SelfType"]},{"text":"impl !Send for SelfValue","synthetic":true,"types":["syn::token::SelfValue"]},{"text":"impl !Send for Static","synthetic":true,"types":["syn::token::Static"]},{"text":"impl !Send for Struct","synthetic":true,"types":["syn::token::Struct"]},{"text":"impl !Send for Super","synthetic":true,"types":["syn::token::Super"]},{"text":"impl !Send for Trait","synthetic":true,"types":["syn::token::Trait"]},{"text":"impl !Send for Try","synthetic":true,"types":["syn::token::Try"]},{"text":"impl !Send for Type","synthetic":true,"types":["syn::token::Type"]},{"text":"impl !Send for Typeof","synthetic":true,"types":["syn::token::Typeof"]},{"text":"impl !Send for Union","synthetic":true,"types":["syn::token::Union"]},{"text":"impl !Send for Unsafe","synthetic":true,"types":["syn::token::Unsafe"]},{"text":"impl !Send for Unsized","synthetic":true,"types":["syn::token::Unsized"]},{"text":"impl !Send for Use","synthetic":true,"types":["syn::token::Use"]},{"text":"impl !Send for Virtual","synthetic":true,"types":["syn::token::Virtual"]},{"text":"impl !Send for Where","synthetic":true,"types":["syn::token::Where"]},{"text":"impl !Send for While","synthetic":true,"types":["syn::token::While"]},{"text":"impl !Send for Yield","synthetic":true,"types":["syn::token::Yield"]},{"text":"impl !Send for Add","synthetic":true,"types":["syn::token::Add"]},{"text":"impl !Send for AddEq","synthetic":true,"types":["syn::token::AddEq"]},{"text":"impl !Send for And","synthetic":true,"types":["syn::token::And"]},{"text":"impl !Send for AndAnd","synthetic":true,"types":["syn::token::AndAnd"]},{"text":"impl !Send for AndEq","synthetic":true,"types":["syn::token::AndEq"]},{"text":"impl !Send for At","synthetic":true,"types":["syn::token::At"]},{"text":"impl !Send for Bang","synthetic":true,"types":["syn::token::Bang"]},{"text":"impl !Send for Caret","synthetic":true,"types":["syn::token::Caret"]},{"text":"impl !Send for CaretEq","synthetic":true,"types":["syn::token::CaretEq"]},{"text":"impl !Send for Colon","synthetic":true,"types":["syn::token::Colon"]},{"text":"impl !Send for Colon2","synthetic":true,"types":["syn::token::Colon2"]},{"text":"impl !Send for Comma","synthetic":true,"types":["syn::token::Comma"]},{"text":"impl !Send for Div","synthetic":true,"types":["syn::token::Div"]},{"text":"impl !Send for DivEq","synthetic":true,"types":["syn::token::DivEq"]},{"text":"impl !Send for Dollar","synthetic":true,"types":["syn::token::Dollar"]},{"text":"impl !Send for Dot","synthetic":true,"types":["syn::token::Dot"]},{"text":"impl !Send for Dot2","synthetic":true,"types":["syn::token::Dot2"]},{"text":"impl !Send for Dot3","synthetic":true,"types":["syn::token::Dot3"]},{"text":"impl !Send for DotDotEq","synthetic":true,"types":["syn::token::DotDotEq"]},{"text":"impl !Send for Eq","synthetic":true,"types":["syn::token::Eq"]},{"text":"impl !Send for EqEq","synthetic":true,"types":["syn::token::EqEq"]},{"text":"impl !Send for Ge","synthetic":true,"types":["syn::token::Ge"]},{"text":"impl !Send for Gt","synthetic":true,"types":["syn::token::Gt"]},{"text":"impl !Send for Le","synthetic":true,"types":["syn::token::Le"]},{"text":"impl !Send for Lt","synthetic":true,"types":["syn::token::Lt"]},{"text":"impl !Send for MulEq","synthetic":true,"types":["syn::token::MulEq"]},{"text":"impl !Send for Ne","synthetic":true,"types":["syn::token::Ne"]},{"text":"impl !Send for Or","synthetic":true,"types":["syn::token::Or"]},{"text":"impl !Send for OrEq","synthetic":true,"types":["syn::token::OrEq"]},{"text":"impl !Send for OrOr","synthetic":true,"types":["syn::token::OrOr"]},{"text":"impl !Send for Pound","synthetic":true,"types":["syn::token::Pound"]},{"text":"impl !Send for Question","synthetic":true,"types":["syn::token::Question"]},{"text":"impl !Send for RArrow","synthetic":true,"types":["syn::token::RArrow"]},{"text":"impl !Send for LArrow","synthetic":true,"types":["syn::token::LArrow"]},{"text":"impl !Send for Rem","synthetic":true,"types":["syn::token::Rem"]},{"text":"impl !Send for RemEq","synthetic":true,"types":["syn::token::RemEq"]},{"text":"impl !Send for FatArrow","synthetic":true,"types":["syn::token::FatArrow"]},{"text":"impl !Send for Semi","synthetic":true,"types":["syn::token::Semi"]},{"text":"impl !Send for Shl","synthetic":true,"types":["syn::token::Shl"]},{"text":"impl !Send for ShlEq","synthetic":true,"types":["syn::token::ShlEq"]},{"text":"impl !Send for Shr","synthetic":true,"types":["syn::token::Shr"]},{"text":"impl !Send for ShrEq","synthetic":true,"types":["syn::token::ShrEq"]},{"text":"impl !Send for Star","synthetic":true,"types":["syn::token::Star"]},{"text":"impl !Send for Sub","synthetic":true,"types":["syn::token::Sub"]},{"text":"impl !Send for SubEq","synthetic":true,"types":["syn::token::SubEq"]},{"text":"impl !Send for Tilde","synthetic":true,"types":["syn::token::Tilde"]},{"text":"impl !Send for Brace","synthetic":true,"types":["syn::token::Brace"]},{"text":"impl !Send for Bracket","synthetic":true,"types":["syn::token::Bracket"]},{"text":"impl !Send for Paren","synthetic":true,"types":["syn::token::Paren"]},{"text":"impl !Send for Group","synthetic":true,"types":["syn::token::Group"]},{"text":"impl !Send for TokenBuffer","synthetic":true,"types":["syn::buffer::TokenBuffer"]},{"text":"impl<'a> !Send for Cursor<'a>","synthetic":true,"types":["syn::buffer::Cursor"]},{"text":"impl<T, P> Send for Punctuated<T, P> where
    P: Send,
    T: Send
","synthetic":true,"types":["syn::punctuated::Punctuated"]},{"text":"impl<'a, T, P> Send for Pairs<'a, T, P> where
    P: Sync,
    T: Sync
","synthetic":true,"types":["syn::punctuated::Pairs"]},{"text":"impl<'a, T, P> Send for PairsMut<'a, T, P> where
    P: Send,
    T: Send
","synthetic":true,"types":["syn::punctuated::PairsMut"]},{"text":"impl<T, P> Send for IntoPairs<T, P> where
    P: Send,
    T: Send
","synthetic":true,"types":["syn::punctuated::IntoPairs"]},{"text":"impl<T> Send for IntoIter<T> where
    T: Send
","synthetic":true,"types":["syn::punctuated::IntoIter"]},{"text":"impl<'a, T> !Send for Iter<'a, T>","synthetic":true,"types":["syn::punctuated::Iter"]},{"text":"impl<'a, T> !Send for IterMut<'a, T>","synthetic":true,"types":["syn::punctuated::IterMut"]},{"text":"impl<T, P> Send for Pair<T, P> where
    P: Send,
    T: Send
","synthetic":true,"types":["syn::punctuated::Pair"]},{"text":"impl<'a> !Send for Lookahead1<'a>","synthetic":true,"types":["syn::lookahead::Lookahead1"]},{"text":"impl<'a> !Send for ParseBuffer<'a>","synthetic":true,"types":["syn::parse::ParseBuffer"]},{"text":"impl<'c, 'a> !Send for StepCursor<'c, 'a>","synthetic":true,"types":["syn::parse::StepCursor"]},{"text":"impl Send for Nothing","synthetic":true,"types":["syn::parse::Nothing"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/marker/trait.StructuralEq.js b/implementors/core/marker/trait.StructuralEq.js new file mode 100644 index 0000000..d64a869 --- /dev/null +++ b/implementors/core/marker/trait.StructuralEq.js @@ -0,0 +1,6 @@ +(function() {var implementors = {}; +implementors["byteorder"] = [{"text":"impl StructuralEq for BigEndian","synthetic":false,"types":["byteorder::BigEndian"]},{"text":"impl StructuralEq for LittleEndian","synthetic":false,"types":["byteorder::LittleEndian"]}]; +implementors["log"] = [{"text":"impl StructuralEq for Level","synthetic":false,"types":["log::Level"]},{"text":"impl StructuralEq for LevelFilter","synthetic":false,"types":["log::LevelFilter"]},{"text":"impl<'a> StructuralEq for Metadata<'a>","synthetic":false,"types":["log::Metadata"]},{"text":"impl<'a> StructuralEq for MetadataBuilder<'a>","synthetic":false,"types":["log::MetadataBuilder"]}]; +implementors["proc_macro2"] = [{"text":"impl StructuralEq for Delimiter","synthetic":false,"types":["proc_macro2::Delimiter"]},{"text":"impl StructuralEq for Spacing","synthetic":false,"types":["proc_macro2::Spacing"]}]; +implementors["syn"] = [{"text":"impl StructuralEq for Member","synthetic":false,"types":["syn::expr::Member"]},{"text":"impl<'a> StructuralEq for Cursor<'a>","synthetic":false,"types":["syn::buffer::Cursor"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/marker/trait.StructuralPartialEq.js b/implementors/core/marker/trait.StructuralPartialEq.js new file mode 100644 index 0000000..c9a546e --- /dev/null +++ b/implementors/core/marker/trait.StructuralPartialEq.js @@ -0,0 +1,7 @@ +(function() {var implementors = {}; +implementors["byteorder"] = [{"text":"impl StructuralPartialEq for BigEndian","synthetic":false,"types":["byteorder::BigEndian"]},{"text":"impl StructuralPartialEq for LittleEndian","synthetic":false,"types":["byteorder::LittleEndian"]}]; +implementors["log"] = [{"text":"impl<'a> StructuralPartialEq for Metadata<'a>","synthetic":false,"types":["log::Metadata"]},{"text":"impl<'a> StructuralPartialEq for MetadataBuilder<'a>","synthetic":false,"types":["log::MetadataBuilder"]},{"text":"impl StructuralPartialEq for ParseLevelError","synthetic":false,"types":["log::ParseLevelError"]}]; +implementors["proc_macro2"] = [{"text":"impl StructuralPartialEq for Delimiter","synthetic":false,"types":["proc_macro2::Delimiter"]},{"text":"impl StructuralPartialEq for Spacing","synthetic":false,"types":["proc_macro2::Spacing"]}]; +implementors["serde"] = [{"text":"impl StructuralPartialEq for Error","synthetic":false,"types":["serde::de::value::Error"]},{"text":"impl<'a> StructuralPartialEq for Unexpected<'a>","synthetic":false,"types":["serde::de::Unexpected"]}]; +implementors["syn"] = [{"text":"impl StructuralPartialEq for Member","synthetic":false,"types":["syn::expr::Member"]},{"text":"impl<'a> StructuralPartialEq for Cursor<'a>","synthetic":false,"types":["syn::buffer::Cursor"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/marker/trait.Sync.js b/implementors/core/marker/trait.Sync.js new file mode 100644 index 0000000..f0acb5d --- /dev/null +++ b/implementors/core/marker/trait.Sync.js @@ -0,0 +1,9 @@ +(function() {var implementors = {}; +implementors["bincode"] = [{"text":"impl Sync for Config","synthetic":true,"types":["bincode::config::Config"]},{"text":"impl Sync for ErrorKind","synthetic":true,"types":["bincode::error::ErrorKind"]}]; +implementors["byteorder"] = [{"text":"impl Sync for BigEndian","synthetic":true,"types":["byteorder::BigEndian"]},{"text":"impl Sync for LittleEndian","synthetic":true,"types":["byteorder::LittleEndian"]}]; +implementors["ironsea_index_sfc_dbc"] = [{"text":"impl<F, K, V> Sync for SpaceFillingCurve<F, K, V> where
    F: Sync,
    K: Sync,
    V: Sync
","synthetic":true,"types":["ironsea_index_sfc_dbc::sfc::SpaceFillingCurve"]}]; +implementors["log"] = [{"text":"impl<'a> !Sync for Record<'a>","synthetic":true,"types":["log::Record"]},{"text":"impl<'a> !Sync for RecordBuilder<'a>","synthetic":true,"types":["log::RecordBuilder"]},{"text":"impl<'a> Sync for Metadata<'a>","synthetic":true,"types":["log::Metadata"]},{"text":"impl<'a> Sync for MetadataBuilder<'a>","synthetic":true,"types":["log::MetadataBuilder"]},{"text":"impl Sync for SetLoggerError","synthetic":true,"types":["log::SetLoggerError"]},{"text":"impl Sync for ParseLevelError","synthetic":true,"types":["log::ParseLevelError"]},{"text":"impl Sync for Level","synthetic":true,"types":["log::Level"]},{"text":"impl Sync for LevelFilter","synthetic":true,"types":["log::LevelFilter"]}]; +implementors["proc_macro2"] = [{"text":"impl !Sync for TokenStream","synthetic":true,"types":["proc_macro2::TokenStream"]},{"text":"impl !Sync for LexError","synthetic":true,"types":["proc_macro2::LexError"]},{"text":"impl !Sync for Span","synthetic":true,"types":["proc_macro2::Span"]},{"text":"impl !Sync for Group","synthetic":true,"types":["proc_macro2::Group"]},{"text":"impl !Sync for Punct","synthetic":true,"types":["proc_macro2::Punct"]},{"text":"impl !Sync for Ident","synthetic":true,"types":["proc_macro2::Ident"]},{"text":"impl !Sync for Literal","synthetic":true,"types":["proc_macro2::Literal"]},{"text":"impl !Sync for TokenTree","synthetic":true,"types":["proc_macro2::TokenTree"]},{"text":"impl Sync for Delimiter","synthetic":true,"types":["proc_macro2::Delimiter"]},{"text":"impl Sync for Spacing","synthetic":true,"types":["proc_macro2::Spacing"]},{"text":"impl !Sync for IntoIter","synthetic":true,"types":["proc_macro2::token_stream::IntoIter"]}]; +implementors["serde"] = [{"text":"impl Sync for IgnoredAny","synthetic":true,"types":["serde::de::ignored_any::IgnoredAny"]},{"text":"impl<'a> Sync for Unexpected<'a>","synthetic":true,"types":["serde::de::Unexpected"]},{"text":"impl Sync for Error","synthetic":true,"types":["serde::de::value::Error"]},{"text":"impl<E> Sync for UnitDeserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::UnitDeserializer"]},{"text":"impl<E> Sync for BoolDeserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::BoolDeserializer"]},{"text":"impl<E> Sync for I8Deserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::I8Deserializer"]},{"text":"impl<E> Sync for I16Deserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::I16Deserializer"]},{"text":"impl<E> Sync for I32Deserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::I32Deserializer"]},{"text":"impl<E> Sync for I64Deserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::I64Deserializer"]},{"text":"impl<E> Sync for IsizeDeserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::IsizeDeserializer"]},{"text":"impl<E> Sync for U8Deserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::U8Deserializer"]},{"text":"impl<E> Sync for U16Deserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::U16Deserializer"]},{"text":"impl<E> Sync for U64Deserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::U64Deserializer"]},{"text":"impl<E> Sync for UsizeDeserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::UsizeDeserializer"]},{"text":"impl<E> Sync for F32Deserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::F32Deserializer"]},{"text":"impl<E> Sync for F64Deserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::F64Deserializer"]},{"text":"impl<E> Sync for CharDeserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::CharDeserializer"]},{"text":"impl<E> Sync for I128Deserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::I128Deserializer"]},{"text":"impl<E> Sync for U128Deserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::U128Deserializer"]},{"text":"impl<E> Sync for U32Deserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::U32Deserializer"]},{"text":"impl<'a, E> Sync for StrDeserializer<'a, E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::StrDeserializer"]},{"text":"impl<'de, E> Sync for BorrowedStrDeserializer<'de, E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::BorrowedStrDeserializer"]},{"text":"impl<E> Sync for StringDeserializer<E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::StringDeserializer"]},{"text":"impl<'a, E> Sync for CowStrDeserializer<'a, E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::CowStrDeserializer"]},{"text":"impl<'de, E> Sync for BorrowedBytesDeserializer<'de, E> where
    E: Sync
","synthetic":true,"types":["serde::de::value::BorrowedBytesDeserializer"]},{"text":"impl<I, E> Sync for SeqDeserializer<I, E> where
    E: Sync,
    I: Sync
","synthetic":true,"types":["serde::de::value::SeqDeserializer"]},{"text":"impl<A> Sync for SeqAccessDeserializer<A> where
    A: Sync
","synthetic":true,"types":["serde::de::value::SeqAccessDeserializer"]},{"text":"impl<'de, I, E> Sync for MapDeserializer<'de, I, E> where
    E: Sync,
    I: Sync,
    <<I as Iterator>::Item as Pair>::Second: Sync
","synthetic":true,"types":["serde::de::value::MapDeserializer"]},{"text":"impl<A> Sync for MapAccessDeserializer<A> where
    A: Sync
","synthetic":true,"types":["serde::de::value::MapAccessDeserializer"]},{"text":"impl<Ok, Error> Sync for Impossible<Ok, Error> where
    Error: Sync,
    Ok: Sync
","synthetic":true,"types":["serde::ser::impossible::Impossible"]}]; +implementors["syn"] = [{"text":"impl !Sync for Attribute","synthetic":true,"types":["syn::attr::Attribute"]},{"text":"impl !Sync for MetaList","synthetic":true,"types":["syn::attr::MetaList"]},{"text":"impl !Sync for MetaNameValue","synthetic":true,"types":["syn::attr::MetaNameValue"]},{"text":"impl !Sync for Field","synthetic":true,"types":["syn::data::Field"]},{"text":"impl !Sync for FieldsNamed","synthetic":true,"types":["syn::data::FieldsNamed"]},{"text":"impl !Sync for FieldsUnnamed","synthetic":true,"types":["syn::data::FieldsUnnamed"]},{"text":"impl !Sync for Variant","synthetic":true,"types":["syn::data::Variant"]},{"text":"impl !Sync for VisCrate","synthetic":true,"types":["syn::data::VisCrate"]},{"text":"impl !Sync for VisPublic","synthetic":true,"types":["syn::data::VisPublic"]},{"text":"impl !Sync for VisRestricted","synthetic":true,"types":["syn::data::VisRestricted"]},{"text":"impl Sync for ExprArray","synthetic":true,"types":["syn::expr::ExprArray"]},{"text":"impl Sync for ExprAssign","synthetic":true,"types":["syn::expr::ExprAssign"]},{"text":"impl Sync for ExprAssignOp","synthetic":true,"types":["syn::expr::ExprAssignOp"]},{"text":"impl Sync for ExprAsync","synthetic":true,"types":["syn::expr::ExprAsync"]},{"text":"impl Sync for ExprAwait","synthetic":true,"types":["syn::expr::ExprAwait"]},{"text":"impl !Sync for ExprBinary","synthetic":true,"types":["syn::expr::ExprBinary"]},{"text":"impl Sync for ExprBlock","synthetic":true,"types":["syn::expr::ExprBlock"]},{"text":"impl Sync for ExprBox","synthetic":true,"types":["syn::expr::ExprBox"]},{"text":"impl Sync for ExprBreak","synthetic":true,"types":["syn::expr::ExprBreak"]},{"text":"impl !Sync for ExprCall","synthetic":true,"types":["syn::expr::ExprCall"]},{"text":"impl !Sync for ExprCast","synthetic":true,"types":["syn::expr::ExprCast"]},{"text":"impl Sync for ExprClosure","synthetic":true,"types":["syn::expr::ExprClosure"]},{"text":"impl Sync for ExprContinue","synthetic":true,"types":["syn::expr::ExprContinue"]},{"text":"impl !Sync for ExprField","synthetic":true,"types":["syn::expr::ExprField"]},{"text":"impl Sync for ExprForLoop","synthetic":true,"types":["syn::expr::ExprForLoop"]},{"text":"impl Sync for ExprGroup","synthetic":true,"types":["syn::expr::ExprGroup"]},{"text":"impl Sync for ExprIf","synthetic":true,"types":["syn::expr::ExprIf"]},{"text":"impl !Sync for ExprIndex","synthetic":true,"types":["syn::expr::ExprIndex"]},{"text":"impl Sync for ExprLet","synthetic":true,"types":["syn::expr::ExprLet"]},{"text":"impl !Sync for ExprLit","synthetic":true,"types":["syn::expr::ExprLit"]},{"text":"impl Sync for ExprLoop","synthetic":true,"types":["syn::expr::ExprLoop"]},{"text":"impl Sync for ExprMacro","synthetic":true,"types":["syn::expr::ExprMacro"]},{"text":"impl Sync for ExprMatch","synthetic":true,"types":["syn::expr::ExprMatch"]},{"text":"impl Sync for ExprMethodCall","synthetic":true,"types":["syn::expr::ExprMethodCall"]},{"text":"impl !Sync for ExprParen","synthetic":true,"types":["syn::expr::ExprParen"]},{"text":"impl !Sync for ExprPath","synthetic":true,"types":["syn::expr::ExprPath"]},{"text":"impl Sync for ExprRange","synthetic":true,"types":["syn::expr::ExprRange"]},{"text":"impl Sync for ExprReference","synthetic":true,"types":["syn::expr::ExprReference"]},{"text":"impl Sync for ExprRepeat","synthetic":true,"types":["syn::expr::ExprRepeat"]},{"text":"impl Sync for ExprReturn","synthetic":true,"types":["syn::expr::ExprReturn"]},{"text":"impl Sync for ExprStruct","synthetic":true,"types":["syn::expr::ExprStruct"]},{"text":"impl Sync for ExprTry","synthetic":true,"types":["syn::expr::ExprTry"]},{"text":"impl Sync for ExprTryBlock","synthetic":true,"types":["syn::expr::ExprTryBlock"]},{"text":"impl Sync for ExprTuple","synthetic":true,"types":["syn::expr::ExprTuple"]},{"text":"impl Sync for ExprType","synthetic":true,"types":["syn::expr::ExprType"]},{"text":"impl !Sync for ExprUnary","synthetic":true,"types":["syn::expr::ExprUnary"]},{"text":"impl Sync for ExprUnsafe","synthetic":true,"types":["syn::expr::ExprUnsafe"]},{"text":"impl Sync for ExprWhile","synthetic":true,"types":["syn::expr::ExprWhile"]},{"text":"impl Sync for ExprYield","synthetic":true,"types":["syn::expr::ExprYield"]},{"text":"impl !Sync for Index","synthetic":true,"types":["syn::expr::Index"]},{"text":"impl !Sync for BoundLifetimes","synthetic":true,"types":["syn::generics::BoundLifetimes"]},{"text":"impl !Sync for ConstParam","synthetic":true,"types":["syn::generics::ConstParam"]},{"text":"impl !Sync for Generics","synthetic":true,"types":["syn::generics::Generics"]},{"text":"impl !Sync for LifetimeDef","synthetic":true,"types":["syn::generics::LifetimeDef"]},{"text":"impl !Sync for PredicateEq","synthetic":true,"types":["syn::generics::PredicateEq"]},{"text":"impl !Sync for PredicateLifetime","synthetic":true,"types":["syn::generics::PredicateLifetime"]},{"text":"impl !Sync for PredicateType","synthetic":true,"types":["syn::generics::PredicateType"]},{"text":"impl !Sync for TraitBound","synthetic":true,"types":["syn::generics::TraitBound"]},{"text":"impl !Sync for TypeParam","synthetic":true,"types":["syn::generics::TypeParam"]},{"text":"impl !Sync for WhereClause","synthetic":true,"types":["syn::generics::WhereClause"]},{"text":"impl<'a> !Sync for ImplGenerics<'a>","synthetic":true,"types":["syn::generics::ImplGenerics"]},{"text":"impl<'a> !Sync for Turbofish<'a>","synthetic":true,"types":["syn::generics::Turbofish"]},{"text":"impl<'a> !Sync for TypeGenerics<'a>","synthetic":true,"types":["syn::generics::TypeGenerics"]},{"text":"impl !Sync for Lifetime","synthetic":true,"types":["syn::lifetime::Lifetime"]},{"text":"impl !Sync for LitBool","synthetic":true,"types":["syn::lit::LitBool"]},{"text":"impl !Sync for LitByte","synthetic":true,"types":["syn::lit::LitByte"]},{"text":"impl !Sync for LitByteStr","synthetic":true,"types":["syn::lit::LitByteStr"]},{"text":"impl !Sync for LitChar","synthetic":true,"types":["syn::lit::LitChar"]},{"text":"impl !Sync for LitFloat","synthetic":true,"types":["syn::lit::LitFloat"]},{"text":"impl !Sync for LitInt","synthetic":true,"types":["syn::lit::LitInt"]},{"text":"impl !Sync for LitStr","synthetic":true,"types":["syn::lit::LitStr"]},{"text":"impl !Sync for Macro","synthetic":true,"types":["syn::mac::Macro"]},{"text":"impl !Sync for DataEnum","synthetic":true,"types":["syn::derive::DataEnum"]},{"text":"impl !Sync for DataStruct","synthetic":true,"types":["syn::derive::DataStruct"]},{"text":"impl !Sync for DataUnion","synthetic":true,"types":["syn::derive::DataUnion"]},{"text":"impl !Sync for DeriveInput","synthetic":true,"types":["syn::derive::DeriveInput"]},{"text":"impl !Sync for Abi","synthetic":true,"types":["syn::ty::Abi"]},{"text":"impl !Sync for BareFnArg","synthetic":true,"types":["syn::ty::BareFnArg"]},{"text":"impl !Sync for TypeArray","synthetic":true,"types":["syn::ty::TypeArray"]},{"text":"impl !Sync for TypeBareFn","synthetic":true,"types":["syn::ty::TypeBareFn"]},{"text":"impl !Sync for TypeGroup","synthetic":true,"types":["syn::ty::TypeGroup"]},{"text":"impl !Sync for TypeImplTrait","synthetic":true,"types":["syn::ty::TypeImplTrait"]},{"text":"impl !Sync for TypeInfer","synthetic":true,"types":["syn::ty::TypeInfer"]},{"text":"impl !Sync for TypeMacro","synthetic":true,"types":["syn::ty::TypeMacro"]},{"text":"impl !Sync for TypeNever","synthetic":true,"types":["syn::ty::TypeNever"]},{"text":"impl !Sync for TypeParen","synthetic":true,"types":["syn::ty::TypeParen"]},{"text":"impl !Sync for TypePath","synthetic":true,"types":["syn::ty::TypePath"]},{"text":"impl !Sync for TypePtr","synthetic":true,"types":["syn::ty::TypePtr"]},{"text":"impl !Sync for TypeReference","synthetic":true,"types":["syn::ty::TypeReference"]},{"text":"impl !Sync for TypeSlice","synthetic":true,"types":["syn::ty::TypeSlice"]},{"text":"impl !Sync for TypeTraitObject","synthetic":true,"types":["syn::ty::TypeTraitObject"]},{"text":"impl !Sync for TypeTuple","synthetic":true,"types":["syn::ty::TypeTuple"]},{"text":"impl !Sync for Variadic","synthetic":true,"types":["syn::ty::Variadic"]},{"text":"impl !Sync for AngleBracketedGenericArguments","synthetic":true,"types":["syn::path::AngleBracketedGenericArguments"]},{"text":"impl !Sync for Binding","synthetic":true,"types":["syn::path::Binding"]},{"text":"impl !Sync for Constraint","synthetic":true,"types":["syn::path::Constraint"]},{"text":"impl !Sync for ParenthesizedGenericArguments","synthetic":true,"types":["syn::path::ParenthesizedGenericArguments"]},{"text":"impl !Sync for Path","synthetic":true,"types":["syn::path::Path"]},{"text":"impl !Sync for PathSegment","synthetic":true,"types":["syn::path::PathSegment"]},{"text":"impl !Sync for QSelf","synthetic":true,"types":["syn::path::QSelf"]},{"text":"impl Sync for Error","synthetic":true,"types":["syn::error::Error"]},{"text":"impl !Sync for AttrStyle","synthetic":true,"types":["syn::attr::AttrStyle"]},{"text":"impl !Sync for Meta","synthetic":true,"types":["syn::attr::Meta"]},{"text":"impl !Sync for NestedMeta","synthetic":true,"types":["syn::attr::NestedMeta"]},{"text":"impl !Sync for Fields","synthetic":true,"types":["syn::data::Fields"]},{"text":"impl !Sync for Visibility","synthetic":true,"types":["syn::data::Visibility"]},{"text":"impl !Sync for Expr","synthetic":true,"types":["syn::expr::Expr"]},{"text":"impl !Sync for Member","synthetic":true,"types":["syn::expr::Member"]},{"text":"impl !Sync for GenericParam","synthetic":true,"types":["syn::generics::GenericParam"]},{"text":"impl !Sync for TraitBoundModifier","synthetic":true,"types":["syn::generics::TraitBoundModifier"]},{"text":"impl !Sync for TypeParamBound","synthetic":true,"types":["syn::generics::TypeParamBound"]},{"text":"impl !Sync for WherePredicate","synthetic":true,"types":["syn::generics::WherePredicate"]},{"text":"impl !Sync for Lit","synthetic":true,"types":["syn::lit::Lit"]},{"text":"impl Sync for StrStyle","synthetic":true,"types":["syn::lit::StrStyle"]},{"text":"impl !Sync for MacroDelimiter","synthetic":true,"types":["syn::mac::MacroDelimiter"]},{"text":"impl !Sync for Data","synthetic":true,"types":["syn::derive::Data"]},{"text":"impl !Sync for BinOp","synthetic":true,"types":["syn::op::BinOp"]},{"text":"impl !Sync for UnOp","synthetic":true,"types":["syn::op::UnOp"]},{"text":"impl !Sync for ReturnType","synthetic":true,"types":["syn::ty::ReturnType"]},{"text":"impl !Sync for Type","synthetic":true,"types":["syn::ty::Type"]},{"text":"impl !Sync for GenericArgument","synthetic":true,"types":["syn::path::GenericArgument"]},{"text":"impl !Sync for PathArguments","synthetic":true,"types":["syn::path::PathArguments"]},{"text":"impl !Sync for Underscore","synthetic":true,"types":["syn::token::Underscore"]},{"text":"impl !Sync for Abstract","synthetic":true,"types":["syn::token::Abstract"]},{"text":"impl !Sync for As","synthetic":true,"types":["syn::token::As"]},{"text":"impl !Sync for Async","synthetic":true,"types":["syn::token::Async"]},{"text":"impl !Sync for Auto","synthetic":true,"types":["syn::token::Auto"]},{"text":"impl !Sync for Await","synthetic":true,"types":["syn::token::Await"]},{"text":"impl !Sync for Become","synthetic":true,"types":["syn::token::Become"]},{"text":"impl !Sync for Box","synthetic":true,"types":["syn::token::Box"]},{"text":"impl !Sync for Break","synthetic":true,"types":["syn::token::Break"]},{"text":"impl !Sync for Const","synthetic":true,"types":["syn::token::Const"]},{"text":"impl !Sync for Continue","synthetic":true,"types":["syn::token::Continue"]},{"text":"impl !Sync for Crate","synthetic":true,"types":["syn::token::Crate"]},{"text":"impl !Sync for Default","synthetic":true,"types":["syn::token::Default"]},{"text":"impl !Sync for Do","synthetic":true,"types":["syn::token::Do"]},{"text":"impl !Sync for Dyn","synthetic":true,"types":["syn::token::Dyn"]},{"text":"impl !Sync for Else","synthetic":true,"types":["syn::token::Else"]},{"text":"impl !Sync for Enum","synthetic":true,"types":["syn::token::Enum"]},{"text":"impl !Sync for Extern","synthetic":true,"types":["syn::token::Extern"]},{"text":"impl !Sync for Final","synthetic":true,"types":["syn::token::Final"]},{"text":"impl !Sync for Fn","synthetic":true,"types":["syn::token::Fn"]},{"text":"impl !Sync for For","synthetic":true,"types":["syn::token::For"]},{"text":"impl !Sync for If","synthetic":true,"types":["syn::token::If"]},{"text":"impl !Sync for Impl","synthetic":true,"types":["syn::token::Impl"]},{"text":"impl !Sync for In","synthetic":true,"types":["syn::token::In"]},{"text":"impl !Sync for Let","synthetic":true,"types":["syn::token::Let"]},{"text":"impl !Sync for Loop","synthetic":true,"types":["syn::token::Loop"]},{"text":"impl !Sync for Macro","synthetic":true,"types":["syn::token::Macro"]},{"text":"impl !Sync for Match","synthetic":true,"types":["syn::token::Match"]},{"text":"impl !Sync for Mod","synthetic":true,"types":["syn::token::Mod"]},{"text":"impl !Sync for Move","synthetic":true,"types":["syn::token::Move"]},{"text":"impl !Sync for Mut","synthetic":true,"types":["syn::token::Mut"]},{"text":"impl !Sync for Override","synthetic":true,"types":["syn::token::Override"]},{"text":"impl !Sync for Priv","synthetic":true,"types":["syn::token::Priv"]},{"text":"impl !Sync for Pub","synthetic":true,"types":["syn::token::Pub"]},{"text":"impl !Sync for Ref","synthetic":true,"types":["syn::token::Ref"]},{"text":"impl !Sync for Return","synthetic":true,"types":["syn::token::Return"]},{"text":"impl !Sync for SelfType","synthetic":true,"types":["syn::token::SelfType"]},{"text":"impl !Sync for SelfValue","synthetic":true,"types":["syn::token::SelfValue"]},{"text":"impl !Sync for Static","synthetic":true,"types":["syn::token::Static"]},{"text":"impl !Sync for Struct","synthetic":true,"types":["syn::token::Struct"]},{"text":"impl !Sync for Super","synthetic":true,"types":["syn::token::Super"]},{"text":"impl !Sync for Trait","synthetic":true,"types":["syn::token::Trait"]},{"text":"impl !Sync for Try","synthetic":true,"types":["syn::token::Try"]},{"text":"impl !Sync for Type","synthetic":true,"types":["syn::token::Type"]},{"text":"impl !Sync for Typeof","synthetic":true,"types":["syn::token::Typeof"]},{"text":"impl !Sync for Union","synthetic":true,"types":["syn::token::Union"]},{"text":"impl !Sync for Unsafe","synthetic":true,"types":["syn::token::Unsafe"]},{"text":"impl !Sync for Unsized","synthetic":true,"types":["syn::token::Unsized"]},{"text":"impl !Sync for Use","synthetic":true,"types":["syn::token::Use"]},{"text":"impl !Sync for Virtual","synthetic":true,"types":["syn::token::Virtual"]},{"text":"impl !Sync for Where","synthetic":true,"types":["syn::token::Where"]},{"text":"impl !Sync for While","synthetic":true,"types":["syn::token::While"]},{"text":"impl !Sync for Yield","synthetic":true,"types":["syn::token::Yield"]},{"text":"impl !Sync for Add","synthetic":true,"types":["syn::token::Add"]},{"text":"impl !Sync for AddEq","synthetic":true,"types":["syn::token::AddEq"]},{"text":"impl !Sync for And","synthetic":true,"types":["syn::token::And"]},{"text":"impl !Sync for AndAnd","synthetic":true,"types":["syn::token::AndAnd"]},{"text":"impl !Sync for AndEq","synthetic":true,"types":["syn::token::AndEq"]},{"text":"impl !Sync for At","synthetic":true,"types":["syn::token::At"]},{"text":"impl !Sync for Bang","synthetic":true,"types":["syn::token::Bang"]},{"text":"impl !Sync for Caret","synthetic":true,"types":["syn::token::Caret"]},{"text":"impl !Sync for CaretEq","synthetic":true,"types":["syn::token::CaretEq"]},{"text":"impl !Sync for Colon","synthetic":true,"types":["syn::token::Colon"]},{"text":"impl !Sync for Colon2","synthetic":true,"types":["syn::token::Colon2"]},{"text":"impl !Sync for Comma","synthetic":true,"types":["syn::token::Comma"]},{"text":"impl !Sync for Div","synthetic":true,"types":["syn::token::Div"]},{"text":"impl !Sync for DivEq","synthetic":true,"types":["syn::token::DivEq"]},{"text":"impl !Sync for Dollar","synthetic":true,"types":["syn::token::Dollar"]},{"text":"impl !Sync for Dot","synthetic":true,"types":["syn::token::Dot"]},{"text":"impl !Sync for Dot2","synthetic":true,"types":["syn::token::Dot2"]},{"text":"impl !Sync for Dot3","synthetic":true,"types":["syn::token::Dot3"]},{"text":"impl !Sync for DotDotEq","synthetic":true,"types":["syn::token::DotDotEq"]},{"text":"impl !Sync for Eq","synthetic":true,"types":["syn::token::Eq"]},{"text":"impl !Sync for EqEq","synthetic":true,"types":["syn::token::EqEq"]},{"text":"impl !Sync for Ge","synthetic":true,"types":["syn::token::Ge"]},{"text":"impl !Sync for Gt","synthetic":true,"types":["syn::token::Gt"]},{"text":"impl !Sync for Le","synthetic":true,"types":["syn::token::Le"]},{"text":"impl !Sync for Lt","synthetic":true,"types":["syn::token::Lt"]},{"text":"impl !Sync for MulEq","synthetic":true,"types":["syn::token::MulEq"]},{"text":"impl !Sync for Ne","synthetic":true,"types":["syn::token::Ne"]},{"text":"impl !Sync for Or","synthetic":true,"types":["syn::token::Or"]},{"text":"impl !Sync for OrEq","synthetic":true,"types":["syn::token::OrEq"]},{"text":"impl !Sync for OrOr","synthetic":true,"types":["syn::token::OrOr"]},{"text":"impl !Sync for Pound","synthetic":true,"types":["syn::token::Pound"]},{"text":"impl !Sync for Question","synthetic":true,"types":["syn::token::Question"]},{"text":"impl !Sync for RArrow","synthetic":true,"types":["syn::token::RArrow"]},{"text":"impl !Sync for LArrow","synthetic":true,"types":["syn::token::LArrow"]},{"text":"impl !Sync for Rem","synthetic":true,"types":["syn::token::Rem"]},{"text":"impl !Sync for RemEq","synthetic":true,"types":["syn::token::RemEq"]},{"text":"impl !Sync for FatArrow","synthetic":true,"types":["syn::token::FatArrow"]},{"text":"impl !Sync for Semi","synthetic":true,"types":["syn::token::Semi"]},{"text":"impl !Sync for Shl","synthetic":true,"types":["syn::token::Shl"]},{"text":"impl !Sync for ShlEq","synthetic":true,"types":["syn::token::ShlEq"]},{"text":"impl !Sync for Shr","synthetic":true,"types":["syn::token::Shr"]},{"text":"impl !Sync for ShrEq","synthetic":true,"types":["syn::token::ShrEq"]},{"text":"impl !Sync for Star","synthetic":true,"types":["syn::token::Star"]},{"text":"impl !Sync for Sub","synthetic":true,"types":["syn::token::Sub"]},{"text":"impl !Sync for SubEq","synthetic":true,"types":["syn::token::SubEq"]},{"text":"impl !Sync for Tilde","synthetic":true,"types":["syn::token::Tilde"]},{"text":"impl !Sync for Brace","synthetic":true,"types":["syn::token::Brace"]},{"text":"impl !Sync for Bracket","synthetic":true,"types":["syn::token::Bracket"]},{"text":"impl !Sync for Paren","synthetic":true,"types":["syn::token::Paren"]},{"text":"impl !Sync for Group","synthetic":true,"types":["syn::token::Group"]},{"text":"impl !Sync for TokenBuffer","synthetic":true,"types":["syn::buffer::TokenBuffer"]},{"text":"impl<'a> !Sync for Cursor<'a>","synthetic":true,"types":["syn::buffer::Cursor"]},{"text":"impl<T, P> Sync for Punctuated<T, P> where
    P: Sync,
    T: Sync
","synthetic":true,"types":["syn::punctuated::Punctuated"]},{"text":"impl<'a, T, P> Sync for Pairs<'a, T, P> where
    P: Sync,
    T: Sync
","synthetic":true,"types":["syn::punctuated::Pairs"]},{"text":"impl<'a, T, P> Sync for PairsMut<'a, T, P> where
    P: Sync,
    T: Sync
","synthetic":true,"types":["syn::punctuated::PairsMut"]},{"text":"impl<T, P> Sync for IntoPairs<T, P> where
    P: Sync,
    T: Sync
","synthetic":true,"types":["syn::punctuated::IntoPairs"]},{"text":"impl<T> Sync for IntoIter<T> where
    T: Sync
","synthetic":true,"types":["syn::punctuated::IntoIter"]},{"text":"impl<'a, T> !Sync for Iter<'a, T>","synthetic":true,"types":["syn::punctuated::Iter"]},{"text":"impl<'a, T> !Sync for IterMut<'a, T>","synthetic":true,"types":["syn::punctuated::IterMut"]},{"text":"impl<T, P> Sync for Pair<T, P> where
    P: Sync,
    T: Sync
","synthetic":true,"types":["syn::punctuated::Pair"]},{"text":"impl<'a> !Sync for Lookahead1<'a>","synthetic":true,"types":["syn::lookahead::Lookahead1"]},{"text":"impl<'a> !Sync for ParseBuffer<'a>","synthetic":true,"types":["syn::parse::ParseBuffer"]},{"text":"impl<'c, 'a> !Sync for StepCursor<'c, 'a>","synthetic":true,"types":["syn::parse::StepCursor"]},{"text":"impl Sync for Nothing","synthetic":true,"types":["syn::parse::Nothing"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/marker/trait.Unpin.js b/implementors/core/marker/trait.Unpin.js new file mode 100644 index 0000000..37f65df --- /dev/null +++ b/implementors/core/marker/trait.Unpin.js @@ -0,0 +1,9 @@ +(function() {var implementors = {}; +implementors["bincode"] = [{"text":"impl Unpin for Config","synthetic":true,"types":["bincode::config::Config"]},{"text":"impl Unpin for ErrorKind","synthetic":true,"types":["bincode::error::ErrorKind"]}]; +implementors["byteorder"] = [{"text":"impl Unpin for BigEndian","synthetic":true,"types":["byteorder::BigEndian"]},{"text":"impl Unpin for LittleEndian","synthetic":true,"types":["byteorder::LittleEndian"]}]; +implementors["ironsea_index_sfc_dbc"] = [{"text":"impl<F, K, V> Unpin for SpaceFillingCurve<F, K, V> where
    F: Unpin,
    K: Unpin,
    V: Unpin
","synthetic":true,"types":["ironsea_index_sfc_dbc::sfc::SpaceFillingCurve"]}]; +implementors["log"] = [{"text":"impl<'a> Unpin for Record<'a>","synthetic":true,"types":["log::Record"]},{"text":"impl<'a> Unpin for RecordBuilder<'a>","synthetic":true,"types":["log::RecordBuilder"]},{"text":"impl<'a> Unpin for Metadata<'a>","synthetic":true,"types":["log::Metadata"]},{"text":"impl<'a> Unpin for MetadataBuilder<'a>","synthetic":true,"types":["log::MetadataBuilder"]},{"text":"impl Unpin for SetLoggerError","synthetic":true,"types":["log::SetLoggerError"]},{"text":"impl Unpin for ParseLevelError","synthetic":true,"types":["log::ParseLevelError"]},{"text":"impl Unpin for Level","synthetic":true,"types":["log::Level"]},{"text":"impl Unpin for LevelFilter","synthetic":true,"types":["log::LevelFilter"]}]; +implementors["proc_macro2"] = [{"text":"impl Unpin for TokenStream","synthetic":true,"types":["proc_macro2::TokenStream"]},{"text":"impl Unpin for LexError","synthetic":true,"types":["proc_macro2::LexError"]},{"text":"impl Unpin for Span","synthetic":true,"types":["proc_macro2::Span"]},{"text":"impl Unpin for Group","synthetic":true,"types":["proc_macro2::Group"]},{"text":"impl Unpin for Punct","synthetic":true,"types":["proc_macro2::Punct"]},{"text":"impl Unpin for Ident","synthetic":true,"types":["proc_macro2::Ident"]},{"text":"impl Unpin for Literal","synthetic":true,"types":["proc_macro2::Literal"]},{"text":"impl Unpin for TokenTree","synthetic":true,"types":["proc_macro2::TokenTree"]},{"text":"impl Unpin for Delimiter","synthetic":true,"types":["proc_macro2::Delimiter"]},{"text":"impl Unpin for Spacing","synthetic":true,"types":["proc_macro2::Spacing"]},{"text":"impl Unpin for IntoIter","synthetic":true,"types":["proc_macro2::token_stream::IntoIter"]}]; +implementors["serde"] = [{"text":"impl Unpin for IgnoredAny","synthetic":true,"types":["serde::de::ignored_any::IgnoredAny"]},{"text":"impl<'a> Unpin for Unexpected<'a>","synthetic":true,"types":["serde::de::Unexpected"]},{"text":"impl Unpin for Error","synthetic":true,"types":["serde::de::value::Error"]},{"text":"impl<E> Unpin for UnitDeserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::UnitDeserializer"]},{"text":"impl<E> Unpin for BoolDeserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::BoolDeserializer"]},{"text":"impl<E> Unpin for I8Deserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::I8Deserializer"]},{"text":"impl<E> Unpin for I16Deserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::I16Deserializer"]},{"text":"impl<E> Unpin for I32Deserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::I32Deserializer"]},{"text":"impl<E> Unpin for I64Deserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::I64Deserializer"]},{"text":"impl<E> Unpin for IsizeDeserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::IsizeDeserializer"]},{"text":"impl<E> Unpin for U8Deserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::U8Deserializer"]},{"text":"impl<E> Unpin for U16Deserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::U16Deserializer"]},{"text":"impl<E> Unpin for U64Deserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::U64Deserializer"]},{"text":"impl<E> Unpin for UsizeDeserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::UsizeDeserializer"]},{"text":"impl<E> Unpin for F32Deserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::F32Deserializer"]},{"text":"impl<E> Unpin for F64Deserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::F64Deserializer"]},{"text":"impl<E> Unpin for CharDeserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::CharDeserializer"]},{"text":"impl<E> Unpin for I128Deserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::I128Deserializer"]},{"text":"impl<E> Unpin for U128Deserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::U128Deserializer"]},{"text":"impl<E> Unpin for U32Deserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::U32Deserializer"]},{"text":"impl<'a, E> Unpin for StrDeserializer<'a, E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::StrDeserializer"]},{"text":"impl<'de, E> Unpin for BorrowedStrDeserializer<'de, E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::BorrowedStrDeserializer"]},{"text":"impl<E> Unpin for StringDeserializer<E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::StringDeserializer"]},{"text":"impl<'a, E> Unpin for CowStrDeserializer<'a, E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::CowStrDeserializer"]},{"text":"impl<'de, E> Unpin for BorrowedBytesDeserializer<'de, E> where
    E: Unpin
","synthetic":true,"types":["serde::de::value::BorrowedBytesDeserializer"]},{"text":"impl<I, E> Unpin for SeqDeserializer<I, E> where
    E: Unpin,
    I: Unpin
","synthetic":true,"types":["serde::de::value::SeqDeserializer"]},{"text":"impl<A> Unpin for SeqAccessDeserializer<A> where
    A: Unpin
","synthetic":true,"types":["serde::de::value::SeqAccessDeserializer"]},{"text":"impl<'de, I, E> Unpin for MapDeserializer<'de, I, E> where
    E: Unpin,
    I: Unpin,
    <<I as Iterator>::Item as Pair>::Second: Unpin
","synthetic":true,"types":["serde::de::value::MapDeserializer"]},{"text":"impl<A> Unpin for MapAccessDeserializer<A> where
    A: Unpin
","synthetic":true,"types":["serde::de::value::MapAccessDeserializer"]},{"text":"impl<Ok, Error> Unpin for Impossible<Ok, Error> where
    Error: Unpin,
    Ok: Unpin
","synthetic":true,"types":["serde::ser::impossible::Impossible"]}]; +implementors["syn"] = [{"text":"impl Unpin for Attribute","synthetic":true,"types":["syn::attr::Attribute"]},{"text":"impl Unpin for MetaList","synthetic":true,"types":["syn::attr::MetaList"]},{"text":"impl Unpin for MetaNameValue","synthetic":true,"types":["syn::attr::MetaNameValue"]},{"text":"impl Unpin for Field","synthetic":true,"types":["syn::data::Field"]},{"text":"impl Unpin for FieldsNamed","synthetic":true,"types":["syn::data::FieldsNamed"]},{"text":"impl Unpin for FieldsUnnamed","synthetic":true,"types":["syn::data::FieldsUnnamed"]},{"text":"impl Unpin for Variant","synthetic":true,"types":["syn::data::Variant"]},{"text":"impl Unpin for VisCrate","synthetic":true,"types":["syn::data::VisCrate"]},{"text":"impl Unpin for VisPublic","synthetic":true,"types":["syn::data::VisPublic"]},{"text":"impl Unpin for VisRestricted","synthetic":true,"types":["syn::data::VisRestricted"]},{"text":"impl Unpin for ExprArray","synthetic":true,"types":["syn::expr::ExprArray"]},{"text":"impl Unpin for ExprAssign","synthetic":true,"types":["syn::expr::ExprAssign"]},{"text":"impl Unpin for ExprAssignOp","synthetic":true,"types":["syn::expr::ExprAssignOp"]},{"text":"impl Unpin for ExprAsync","synthetic":true,"types":["syn::expr::ExprAsync"]},{"text":"impl Unpin for ExprAwait","synthetic":true,"types":["syn::expr::ExprAwait"]},{"text":"impl Unpin for ExprBinary","synthetic":true,"types":["syn::expr::ExprBinary"]},{"text":"impl Unpin for ExprBlock","synthetic":true,"types":["syn::expr::ExprBlock"]},{"text":"impl Unpin for ExprBox","synthetic":true,"types":["syn::expr::ExprBox"]},{"text":"impl Unpin for ExprBreak","synthetic":true,"types":["syn::expr::ExprBreak"]},{"text":"impl Unpin for ExprCall","synthetic":true,"types":["syn::expr::ExprCall"]},{"text":"impl Unpin for ExprCast","synthetic":true,"types":["syn::expr::ExprCast"]},{"text":"impl Unpin for ExprClosure","synthetic":true,"types":["syn::expr::ExprClosure"]},{"text":"impl Unpin for ExprContinue","synthetic":true,"types":["syn::expr::ExprContinue"]},{"text":"impl Unpin for ExprField","synthetic":true,"types":["syn::expr::ExprField"]},{"text":"impl Unpin for ExprForLoop","synthetic":true,"types":["syn::expr::ExprForLoop"]},{"text":"impl Unpin for ExprGroup","synthetic":true,"types":["syn::expr::ExprGroup"]},{"text":"impl Unpin for ExprIf","synthetic":true,"types":["syn::expr::ExprIf"]},{"text":"impl Unpin for ExprIndex","synthetic":true,"types":["syn::expr::ExprIndex"]},{"text":"impl Unpin for ExprLet","synthetic":true,"types":["syn::expr::ExprLet"]},{"text":"impl Unpin for ExprLit","synthetic":true,"types":["syn::expr::ExprLit"]},{"text":"impl Unpin for ExprLoop","synthetic":true,"types":["syn::expr::ExprLoop"]},{"text":"impl Unpin for ExprMacro","synthetic":true,"types":["syn::expr::ExprMacro"]},{"text":"impl Unpin for ExprMatch","synthetic":true,"types":["syn::expr::ExprMatch"]},{"text":"impl Unpin for ExprMethodCall","synthetic":true,"types":["syn::expr::ExprMethodCall"]},{"text":"impl Unpin for ExprParen","synthetic":true,"types":["syn::expr::ExprParen"]},{"text":"impl Unpin for ExprPath","synthetic":true,"types":["syn::expr::ExprPath"]},{"text":"impl Unpin for ExprRange","synthetic":true,"types":["syn::expr::ExprRange"]},{"text":"impl Unpin for ExprReference","synthetic":true,"types":["syn::expr::ExprReference"]},{"text":"impl Unpin for ExprRepeat","synthetic":true,"types":["syn::expr::ExprRepeat"]},{"text":"impl Unpin for ExprReturn","synthetic":true,"types":["syn::expr::ExprReturn"]},{"text":"impl Unpin for ExprStruct","synthetic":true,"types":["syn::expr::ExprStruct"]},{"text":"impl Unpin for ExprTry","synthetic":true,"types":["syn::expr::ExprTry"]},{"text":"impl Unpin for ExprTryBlock","synthetic":true,"types":["syn::expr::ExprTryBlock"]},{"text":"impl Unpin for ExprTuple","synthetic":true,"types":["syn::expr::ExprTuple"]},{"text":"impl Unpin for ExprType","synthetic":true,"types":["syn::expr::ExprType"]},{"text":"impl Unpin for ExprUnary","synthetic":true,"types":["syn::expr::ExprUnary"]},{"text":"impl Unpin for ExprUnsafe","synthetic":true,"types":["syn::expr::ExprUnsafe"]},{"text":"impl Unpin for ExprWhile","synthetic":true,"types":["syn::expr::ExprWhile"]},{"text":"impl Unpin for ExprYield","synthetic":true,"types":["syn::expr::ExprYield"]},{"text":"impl Unpin for Index","synthetic":true,"types":["syn::expr::Index"]},{"text":"impl Unpin for BoundLifetimes","synthetic":true,"types":["syn::generics::BoundLifetimes"]},{"text":"impl Unpin for ConstParam","synthetic":true,"types":["syn::generics::ConstParam"]},{"text":"impl Unpin for Generics","synthetic":true,"types":["syn::generics::Generics"]},{"text":"impl Unpin for LifetimeDef","synthetic":true,"types":["syn::generics::LifetimeDef"]},{"text":"impl Unpin for PredicateEq","synthetic":true,"types":["syn::generics::PredicateEq"]},{"text":"impl Unpin for PredicateLifetime","synthetic":true,"types":["syn::generics::PredicateLifetime"]},{"text":"impl Unpin for PredicateType","synthetic":true,"types":["syn::generics::PredicateType"]},{"text":"impl Unpin for TraitBound","synthetic":true,"types":["syn::generics::TraitBound"]},{"text":"impl Unpin for TypeParam","synthetic":true,"types":["syn::generics::TypeParam"]},{"text":"impl Unpin for WhereClause","synthetic":true,"types":["syn::generics::WhereClause"]},{"text":"impl<'a> Unpin for ImplGenerics<'a>","synthetic":true,"types":["syn::generics::ImplGenerics"]},{"text":"impl<'a> Unpin for Turbofish<'a>","synthetic":true,"types":["syn::generics::Turbofish"]},{"text":"impl<'a> Unpin for TypeGenerics<'a>","synthetic":true,"types":["syn::generics::TypeGenerics"]},{"text":"impl Unpin for Lifetime","synthetic":true,"types":["syn::lifetime::Lifetime"]},{"text":"impl Unpin for LitBool","synthetic":true,"types":["syn::lit::LitBool"]},{"text":"impl Unpin for LitByte","synthetic":true,"types":["syn::lit::LitByte"]},{"text":"impl Unpin for LitByteStr","synthetic":true,"types":["syn::lit::LitByteStr"]},{"text":"impl Unpin for LitChar","synthetic":true,"types":["syn::lit::LitChar"]},{"text":"impl Unpin for LitFloat","synthetic":true,"types":["syn::lit::LitFloat"]},{"text":"impl Unpin for LitInt","synthetic":true,"types":["syn::lit::LitInt"]},{"text":"impl Unpin for LitStr","synthetic":true,"types":["syn::lit::LitStr"]},{"text":"impl Unpin for Macro","synthetic":true,"types":["syn::mac::Macro"]},{"text":"impl Unpin for DataEnum","synthetic":true,"types":["syn::derive::DataEnum"]},{"text":"impl Unpin for DataStruct","synthetic":true,"types":["syn::derive::DataStruct"]},{"text":"impl Unpin for DataUnion","synthetic":true,"types":["syn::derive::DataUnion"]},{"text":"impl Unpin for DeriveInput","synthetic":true,"types":["syn::derive::DeriveInput"]},{"text":"impl Unpin for Abi","synthetic":true,"types":["syn::ty::Abi"]},{"text":"impl Unpin for BareFnArg","synthetic":true,"types":["syn::ty::BareFnArg"]},{"text":"impl Unpin for TypeArray","synthetic":true,"types":["syn::ty::TypeArray"]},{"text":"impl Unpin for TypeBareFn","synthetic":true,"types":["syn::ty::TypeBareFn"]},{"text":"impl Unpin for TypeGroup","synthetic":true,"types":["syn::ty::TypeGroup"]},{"text":"impl Unpin for TypeImplTrait","synthetic":true,"types":["syn::ty::TypeImplTrait"]},{"text":"impl Unpin for TypeInfer","synthetic":true,"types":["syn::ty::TypeInfer"]},{"text":"impl Unpin for TypeMacro","synthetic":true,"types":["syn::ty::TypeMacro"]},{"text":"impl Unpin for TypeNever","synthetic":true,"types":["syn::ty::TypeNever"]},{"text":"impl Unpin for TypeParen","synthetic":true,"types":["syn::ty::TypeParen"]},{"text":"impl Unpin for TypePath","synthetic":true,"types":["syn::ty::TypePath"]},{"text":"impl Unpin for TypePtr","synthetic":true,"types":["syn::ty::TypePtr"]},{"text":"impl Unpin for TypeReference","synthetic":true,"types":["syn::ty::TypeReference"]},{"text":"impl Unpin for TypeSlice","synthetic":true,"types":["syn::ty::TypeSlice"]},{"text":"impl Unpin for TypeTraitObject","synthetic":true,"types":["syn::ty::TypeTraitObject"]},{"text":"impl Unpin for TypeTuple","synthetic":true,"types":["syn::ty::TypeTuple"]},{"text":"impl Unpin for Variadic","synthetic":true,"types":["syn::ty::Variadic"]},{"text":"impl Unpin for AngleBracketedGenericArguments","synthetic":true,"types":["syn::path::AngleBracketedGenericArguments"]},{"text":"impl Unpin for Binding","synthetic":true,"types":["syn::path::Binding"]},{"text":"impl Unpin for Constraint","synthetic":true,"types":["syn::path::Constraint"]},{"text":"impl Unpin for ParenthesizedGenericArguments","synthetic":true,"types":["syn::path::ParenthesizedGenericArguments"]},{"text":"impl Unpin for Path","synthetic":true,"types":["syn::path::Path"]},{"text":"impl Unpin for PathSegment","synthetic":true,"types":["syn::path::PathSegment"]},{"text":"impl Unpin for QSelf","synthetic":true,"types":["syn::path::QSelf"]},{"text":"impl Unpin for Error","synthetic":true,"types":["syn::error::Error"]},{"text":"impl Unpin for AttrStyle","synthetic":true,"types":["syn::attr::AttrStyle"]},{"text":"impl Unpin for Meta","synthetic":true,"types":["syn::attr::Meta"]},{"text":"impl Unpin for NestedMeta","synthetic":true,"types":["syn::attr::NestedMeta"]},{"text":"impl Unpin for Fields","synthetic":true,"types":["syn::data::Fields"]},{"text":"impl Unpin for Visibility","synthetic":true,"types":["syn::data::Visibility"]},{"text":"impl Unpin for Expr","synthetic":true,"types":["syn::expr::Expr"]},{"text":"impl Unpin for Member","synthetic":true,"types":["syn::expr::Member"]},{"text":"impl Unpin for GenericParam","synthetic":true,"types":["syn::generics::GenericParam"]},{"text":"impl Unpin for TraitBoundModifier","synthetic":true,"types":["syn::generics::TraitBoundModifier"]},{"text":"impl Unpin for TypeParamBound","synthetic":true,"types":["syn::generics::TypeParamBound"]},{"text":"impl Unpin for WherePredicate","synthetic":true,"types":["syn::generics::WherePredicate"]},{"text":"impl Unpin for Lit","synthetic":true,"types":["syn::lit::Lit"]},{"text":"impl Unpin for StrStyle","synthetic":true,"types":["syn::lit::StrStyle"]},{"text":"impl Unpin for MacroDelimiter","synthetic":true,"types":["syn::mac::MacroDelimiter"]},{"text":"impl Unpin for Data","synthetic":true,"types":["syn::derive::Data"]},{"text":"impl Unpin for BinOp","synthetic":true,"types":["syn::op::BinOp"]},{"text":"impl Unpin for UnOp","synthetic":true,"types":["syn::op::UnOp"]},{"text":"impl Unpin for ReturnType","synthetic":true,"types":["syn::ty::ReturnType"]},{"text":"impl Unpin for Type","synthetic":true,"types":["syn::ty::Type"]},{"text":"impl Unpin for GenericArgument","synthetic":true,"types":["syn::path::GenericArgument"]},{"text":"impl Unpin for PathArguments","synthetic":true,"types":["syn::path::PathArguments"]},{"text":"impl Unpin for Underscore","synthetic":true,"types":["syn::token::Underscore"]},{"text":"impl Unpin for Abstract","synthetic":true,"types":["syn::token::Abstract"]},{"text":"impl Unpin for As","synthetic":true,"types":["syn::token::As"]},{"text":"impl Unpin for Async","synthetic":true,"types":["syn::token::Async"]},{"text":"impl Unpin for Auto","synthetic":true,"types":["syn::token::Auto"]},{"text":"impl Unpin for Await","synthetic":true,"types":["syn::token::Await"]},{"text":"impl Unpin for Become","synthetic":true,"types":["syn::token::Become"]},{"text":"impl Unpin for Box","synthetic":true,"types":["syn::token::Box"]},{"text":"impl Unpin for Break","synthetic":true,"types":["syn::token::Break"]},{"text":"impl Unpin for Const","synthetic":true,"types":["syn::token::Const"]},{"text":"impl Unpin for Continue","synthetic":true,"types":["syn::token::Continue"]},{"text":"impl Unpin for Crate","synthetic":true,"types":["syn::token::Crate"]},{"text":"impl Unpin for Default","synthetic":true,"types":["syn::token::Default"]},{"text":"impl Unpin for Do","synthetic":true,"types":["syn::token::Do"]},{"text":"impl Unpin for Dyn","synthetic":true,"types":["syn::token::Dyn"]},{"text":"impl Unpin for Else","synthetic":true,"types":["syn::token::Else"]},{"text":"impl Unpin for Enum","synthetic":true,"types":["syn::token::Enum"]},{"text":"impl Unpin for Extern","synthetic":true,"types":["syn::token::Extern"]},{"text":"impl Unpin for Final","synthetic":true,"types":["syn::token::Final"]},{"text":"impl Unpin for Fn","synthetic":true,"types":["syn::token::Fn"]},{"text":"impl Unpin for For","synthetic":true,"types":["syn::token::For"]},{"text":"impl Unpin for If","synthetic":true,"types":["syn::token::If"]},{"text":"impl Unpin for Impl","synthetic":true,"types":["syn::token::Impl"]},{"text":"impl Unpin for In","synthetic":true,"types":["syn::token::In"]},{"text":"impl Unpin for Let","synthetic":true,"types":["syn::token::Let"]},{"text":"impl Unpin for Loop","synthetic":true,"types":["syn::token::Loop"]},{"text":"impl Unpin for Macro","synthetic":true,"types":["syn::token::Macro"]},{"text":"impl Unpin for Match","synthetic":true,"types":["syn::token::Match"]},{"text":"impl Unpin for Mod","synthetic":true,"types":["syn::token::Mod"]},{"text":"impl Unpin for Move","synthetic":true,"types":["syn::token::Move"]},{"text":"impl Unpin for Mut","synthetic":true,"types":["syn::token::Mut"]},{"text":"impl Unpin for Override","synthetic":true,"types":["syn::token::Override"]},{"text":"impl Unpin for Priv","synthetic":true,"types":["syn::token::Priv"]},{"text":"impl Unpin for Pub","synthetic":true,"types":["syn::token::Pub"]},{"text":"impl Unpin for Ref","synthetic":true,"types":["syn::token::Ref"]},{"text":"impl Unpin for Return","synthetic":true,"types":["syn::token::Return"]},{"text":"impl Unpin for SelfType","synthetic":true,"types":["syn::token::SelfType"]},{"text":"impl Unpin for SelfValue","synthetic":true,"types":["syn::token::SelfValue"]},{"text":"impl Unpin for Static","synthetic":true,"types":["syn::token::Static"]},{"text":"impl Unpin for Struct","synthetic":true,"types":["syn::token::Struct"]},{"text":"impl Unpin for Super","synthetic":true,"types":["syn::token::Super"]},{"text":"impl Unpin for Trait","synthetic":true,"types":["syn::token::Trait"]},{"text":"impl Unpin for Try","synthetic":true,"types":["syn::token::Try"]},{"text":"impl Unpin for Type","synthetic":true,"types":["syn::token::Type"]},{"text":"impl Unpin for Typeof","synthetic":true,"types":["syn::token::Typeof"]},{"text":"impl Unpin for Union","synthetic":true,"types":["syn::token::Union"]},{"text":"impl Unpin for Unsafe","synthetic":true,"types":["syn::token::Unsafe"]},{"text":"impl Unpin for Unsized","synthetic":true,"types":["syn::token::Unsized"]},{"text":"impl Unpin for Use","synthetic":true,"types":["syn::token::Use"]},{"text":"impl Unpin for Virtual","synthetic":true,"types":["syn::token::Virtual"]},{"text":"impl Unpin for Where","synthetic":true,"types":["syn::token::Where"]},{"text":"impl Unpin for While","synthetic":true,"types":["syn::token::While"]},{"text":"impl Unpin for Yield","synthetic":true,"types":["syn::token::Yield"]},{"text":"impl Unpin for Add","synthetic":true,"types":["syn::token::Add"]},{"text":"impl Unpin for AddEq","synthetic":true,"types":["syn::token::AddEq"]},{"text":"impl Unpin for And","synthetic":true,"types":["syn::token::And"]},{"text":"impl Unpin for AndAnd","synthetic":true,"types":["syn::token::AndAnd"]},{"text":"impl Unpin for AndEq","synthetic":true,"types":["syn::token::AndEq"]},{"text":"impl Unpin for At","synthetic":true,"types":["syn::token::At"]},{"text":"impl Unpin for Bang","synthetic":true,"types":["syn::token::Bang"]},{"text":"impl Unpin for Caret","synthetic":true,"types":["syn::token::Caret"]},{"text":"impl Unpin for CaretEq","synthetic":true,"types":["syn::token::CaretEq"]},{"text":"impl Unpin for Colon","synthetic":true,"types":["syn::token::Colon"]},{"text":"impl Unpin for Colon2","synthetic":true,"types":["syn::token::Colon2"]},{"text":"impl Unpin for Comma","synthetic":true,"types":["syn::token::Comma"]},{"text":"impl Unpin for Div","synthetic":true,"types":["syn::token::Div"]},{"text":"impl Unpin for DivEq","synthetic":true,"types":["syn::token::DivEq"]},{"text":"impl Unpin for Dollar","synthetic":true,"types":["syn::token::Dollar"]},{"text":"impl Unpin for Dot","synthetic":true,"types":["syn::token::Dot"]},{"text":"impl Unpin for Dot2","synthetic":true,"types":["syn::token::Dot2"]},{"text":"impl Unpin for Dot3","synthetic":true,"types":["syn::token::Dot3"]},{"text":"impl Unpin for DotDotEq","synthetic":true,"types":["syn::token::DotDotEq"]},{"text":"impl Unpin for Eq","synthetic":true,"types":["syn::token::Eq"]},{"text":"impl Unpin for EqEq","synthetic":true,"types":["syn::token::EqEq"]},{"text":"impl Unpin for Ge","synthetic":true,"types":["syn::token::Ge"]},{"text":"impl Unpin for Gt","synthetic":true,"types":["syn::token::Gt"]},{"text":"impl Unpin for Le","synthetic":true,"types":["syn::token::Le"]},{"text":"impl Unpin for Lt","synthetic":true,"types":["syn::token::Lt"]},{"text":"impl Unpin for MulEq","synthetic":true,"types":["syn::token::MulEq"]},{"text":"impl Unpin for Ne","synthetic":true,"types":["syn::token::Ne"]},{"text":"impl Unpin for Or","synthetic":true,"types":["syn::token::Or"]},{"text":"impl Unpin for OrEq","synthetic":true,"types":["syn::token::OrEq"]},{"text":"impl Unpin for OrOr","synthetic":true,"types":["syn::token::OrOr"]},{"text":"impl Unpin for Pound","synthetic":true,"types":["syn::token::Pound"]},{"text":"impl Unpin for Question","synthetic":true,"types":["syn::token::Question"]},{"text":"impl Unpin for RArrow","synthetic":true,"types":["syn::token::RArrow"]},{"text":"impl Unpin for LArrow","synthetic":true,"types":["syn::token::LArrow"]},{"text":"impl Unpin for Rem","synthetic":true,"types":["syn::token::Rem"]},{"text":"impl Unpin for RemEq","synthetic":true,"types":["syn::token::RemEq"]},{"text":"impl Unpin for FatArrow","synthetic":true,"types":["syn::token::FatArrow"]},{"text":"impl Unpin for Semi","synthetic":true,"types":["syn::token::Semi"]},{"text":"impl Unpin for Shl","synthetic":true,"types":["syn::token::Shl"]},{"text":"impl Unpin for ShlEq","synthetic":true,"types":["syn::token::ShlEq"]},{"text":"impl Unpin for Shr","synthetic":true,"types":["syn::token::Shr"]},{"text":"impl Unpin for ShrEq","synthetic":true,"types":["syn::token::ShrEq"]},{"text":"impl Unpin for Star","synthetic":true,"types":["syn::token::Star"]},{"text":"impl Unpin for Sub","synthetic":true,"types":["syn::token::Sub"]},{"text":"impl Unpin for SubEq","synthetic":true,"types":["syn::token::SubEq"]},{"text":"impl Unpin for Tilde","synthetic":true,"types":["syn::token::Tilde"]},{"text":"impl Unpin for Brace","synthetic":true,"types":["syn::token::Brace"]},{"text":"impl Unpin for Bracket","synthetic":true,"types":["syn::token::Bracket"]},{"text":"impl Unpin for Paren","synthetic":true,"types":["syn::token::Paren"]},{"text":"impl Unpin for Group","synthetic":true,"types":["syn::token::Group"]},{"text":"impl Unpin for TokenBuffer","synthetic":true,"types":["syn::buffer::TokenBuffer"]},{"text":"impl<'a> Unpin for Cursor<'a>","synthetic":true,"types":["syn::buffer::Cursor"]},{"text":"impl<T, P> Unpin for Punctuated<T, P> where
    P: Unpin,
    T: Unpin
","synthetic":true,"types":["syn::punctuated::Punctuated"]},{"text":"impl<'a, T, P> Unpin for Pairs<'a, T, P>","synthetic":true,"types":["syn::punctuated::Pairs"]},{"text":"impl<'a, T, P> Unpin for PairsMut<'a, T, P>","synthetic":true,"types":["syn::punctuated::PairsMut"]},{"text":"impl<T, P> Unpin for IntoPairs<T, P> where
    P: Unpin,
    T: Unpin
","synthetic":true,"types":["syn::punctuated::IntoPairs"]},{"text":"impl<T> Unpin for IntoIter<T> where
    T: Unpin
","synthetic":true,"types":["syn::punctuated::IntoIter"]},{"text":"impl<'a, T> Unpin for Iter<'a, T>","synthetic":true,"types":["syn::punctuated::Iter"]},{"text":"impl<'a, T> Unpin for IterMut<'a, T>","synthetic":true,"types":["syn::punctuated::IterMut"]},{"text":"impl<T, P> Unpin for Pair<T, P> where
    P: Unpin,
    T: Unpin
","synthetic":true,"types":["syn::punctuated::Pair"]},{"text":"impl<'a> Unpin for Lookahead1<'a>","synthetic":true,"types":["syn::lookahead::Lookahead1"]},{"text":"impl<'a> Unpin for ParseBuffer<'a>","synthetic":true,"types":["syn::parse::ParseBuffer"]},{"text":"impl<'c, 'a> Unpin for StepCursor<'c, 'a>","synthetic":true,"types":["syn::parse::StepCursor"]},{"text":"impl Unpin for Nothing","synthetic":true,"types":["syn::parse::Nothing"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/ops/deref/trait.Deref.js b/implementors/core/ops/deref/trait.Deref.js new file mode 100644 index 0000000..bc4a23e --- /dev/null +++ b/implementors/core/ops/deref/trait.Deref.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = [{"text":"impl Deref for Underscore","synthetic":false,"types":["syn::token::Underscore"]},{"text":"impl Deref for Add","synthetic":false,"types":["syn::token::Add"]},{"text":"impl Deref for And","synthetic":false,"types":["syn::token::And"]},{"text":"impl Deref for At","synthetic":false,"types":["syn::token::At"]},{"text":"impl Deref for Bang","synthetic":false,"types":["syn::token::Bang"]},{"text":"impl Deref for Caret","synthetic":false,"types":["syn::token::Caret"]},{"text":"impl Deref for Colon","synthetic":false,"types":["syn::token::Colon"]},{"text":"impl Deref for Comma","synthetic":false,"types":["syn::token::Comma"]},{"text":"impl Deref for Div","synthetic":false,"types":["syn::token::Div"]},{"text":"impl Deref for Dollar","synthetic":false,"types":["syn::token::Dollar"]},{"text":"impl Deref for Dot","synthetic":false,"types":["syn::token::Dot"]},{"text":"impl Deref for Eq","synthetic":false,"types":["syn::token::Eq"]},{"text":"impl Deref for Gt","synthetic":false,"types":["syn::token::Gt"]},{"text":"impl Deref for Lt","synthetic":false,"types":["syn::token::Lt"]},{"text":"impl Deref for Or","synthetic":false,"types":["syn::token::Or"]},{"text":"impl Deref for Pound","synthetic":false,"types":["syn::token::Pound"]},{"text":"impl Deref for Question","synthetic":false,"types":["syn::token::Question"]},{"text":"impl Deref for Rem","synthetic":false,"types":["syn::token::Rem"]},{"text":"impl Deref for Semi","synthetic":false,"types":["syn::token::Semi"]},{"text":"impl Deref for Star","synthetic":false,"types":["syn::token::Star"]},{"text":"impl Deref for Sub","synthetic":false,"types":["syn::token::Sub"]},{"text":"impl Deref for Tilde","synthetic":false,"types":["syn::token::Tilde"]},{"text":"impl<'c, 'a> Deref for StepCursor<'c, 'a>","synthetic":false,"types":["syn::parse::StepCursor"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/ops/deref/trait.DerefMut.js b/implementors/core/ops/deref/trait.DerefMut.js new file mode 100644 index 0000000..73d1a9d --- /dev/null +++ b/implementors/core/ops/deref/trait.DerefMut.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = [{"text":"impl DerefMut for Underscore","synthetic":false,"types":["syn::token::Underscore"]},{"text":"impl DerefMut for Add","synthetic":false,"types":["syn::token::Add"]},{"text":"impl DerefMut for And","synthetic":false,"types":["syn::token::And"]},{"text":"impl DerefMut for At","synthetic":false,"types":["syn::token::At"]},{"text":"impl DerefMut for Bang","synthetic":false,"types":["syn::token::Bang"]},{"text":"impl DerefMut for Caret","synthetic":false,"types":["syn::token::Caret"]},{"text":"impl DerefMut for Colon","synthetic":false,"types":["syn::token::Colon"]},{"text":"impl DerefMut for Comma","synthetic":false,"types":["syn::token::Comma"]},{"text":"impl DerefMut for Div","synthetic":false,"types":["syn::token::Div"]},{"text":"impl DerefMut for Dollar","synthetic":false,"types":["syn::token::Dollar"]},{"text":"impl DerefMut for Dot","synthetic":false,"types":["syn::token::Dot"]},{"text":"impl DerefMut for Eq","synthetic":false,"types":["syn::token::Eq"]},{"text":"impl DerefMut for Gt","synthetic":false,"types":["syn::token::Gt"]},{"text":"impl DerefMut for Lt","synthetic":false,"types":["syn::token::Lt"]},{"text":"impl DerefMut for Or","synthetic":false,"types":["syn::token::Or"]},{"text":"impl DerefMut for Pound","synthetic":false,"types":["syn::token::Pound"]},{"text":"impl DerefMut for Question","synthetic":false,"types":["syn::token::Question"]},{"text":"impl DerefMut for Rem","synthetic":false,"types":["syn::token::Rem"]},{"text":"impl DerefMut for Semi","synthetic":false,"types":["syn::token::Semi"]},{"text":"impl DerefMut for Star","synthetic":false,"types":["syn::token::Star"]},{"text":"impl DerefMut for Sub","synthetic":false,"types":["syn::token::Sub"]},{"text":"impl DerefMut for Tilde","synthetic":false,"types":["syn::token::Tilde"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/ops/drop/trait.Drop.js b/implementors/core/ops/drop/trait.Drop.js new file mode 100644 index 0000000..c0016b6 --- /dev/null +++ b/implementors/core/ops/drop/trait.Drop.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = [{"text":"impl<'a> Drop for ParseBuffer<'a>","synthetic":false,"types":["syn::parse::ParseBuffer"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/ops/index/trait.Index.js b/implementors/core/ops/index/trait.Index.js new file mode 100644 index 0000000..53a6664 --- /dev/null +++ b/implementors/core/ops/index/trait.Index.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = [{"text":"impl<T, P> Index<usize> for Punctuated<T, P>","synthetic":false,"types":["syn::punctuated::Punctuated"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/ops/index/trait.IndexMut.js b/implementors/core/ops/index/trait.IndexMut.js new file mode 100644 index 0000000..135bb27 --- /dev/null +++ b/implementors/core/ops/index/trait.IndexMut.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = [{"text":"impl<T, P> IndexMut<usize> for Punctuated<T, P>","synthetic":false,"types":["syn::punctuated::Punctuated"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/str/trait.FromStr.js b/implementors/core/str/trait.FromStr.js new file mode 100644 index 0000000..98a6240 --- /dev/null +++ b/implementors/core/str/trait.FromStr.js @@ -0,0 +1,4 @@ +(function() {var implementors = {}; +implementors["log"] = [{"text":"impl FromStr for Level","synthetic":false,"types":["log::Level"]},{"text":"impl FromStr for LevelFilter","synthetic":false,"types":["log::LevelFilter"]}]; +implementors["proc_macro2"] = [{"text":"impl FromStr for TokenStream","synthetic":false,"types":["proc_macro2::TokenStream"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/ironsea_index/trait.IndexedDestructured.js b/implementors/ironsea_index/trait.IndexedDestructured.js new file mode 100644 index 0000000..bc50d3c --- /dev/null +++ b/implementors/ironsea_index/trait.IndexedDestructured.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["ironsea_index_sfc_dbc"] = [{"text":"impl<F, K, V> IndexedDestructured<F, K> for SpaceFillingCurve<F, K, V> where
    F: PartialEq,
    K: Debug + FromIterator<V> + Index<usize, Output = V>,
    V: Clone + Debug + From<usize> + Hash + Ord
","synthetic":false,"types":["ironsea_index_sfc_dbc::sfc::SpaceFillingCurve"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/quote/ident_fragment/trait.IdentFragment.js b/implementors/quote/ident_fragment/trait.IdentFragment.js new file mode 100644 index 0000000..5335ee6 --- /dev/null +++ b/implementors/quote/ident_fragment/trait.IdentFragment.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = [{"text":"impl IdentFragment for Member","synthetic":false,"types":["syn::expr::Member"]},{"text":"impl IdentFragment for Index","synthetic":false,"types":["syn::expr::Index"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/quote/to_tokens/trait.ToTokens.js b/implementors/quote/to_tokens/trait.ToTokens.js new file mode 100644 index 0000000..56cb549 --- /dev/null +++ b/implementors/quote/to_tokens/trait.ToTokens.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = [{"text":"impl ToTokens for Underscore","synthetic":false,"types":["syn::token::Underscore"]},{"text":"impl ToTokens for Abstract","synthetic":false,"types":["syn::token::Abstract"]},{"text":"impl ToTokens for As","synthetic":false,"types":["syn::token::As"]},{"text":"impl ToTokens for Async","synthetic":false,"types":["syn::token::Async"]},{"text":"impl ToTokens for Auto","synthetic":false,"types":["syn::token::Auto"]},{"text":"impl ToTokens for Await","synthetic":false,"types":["syn::token::Await"]},{"text":"impl ToTokens for Become","synthetic":false,"types":["syn::token::Become"]},{"text":"impl ToTokens for Box","synthetic":false,"types":["syn::token::Box"]},{"text":"impl ToTokens for Break","synthetic":false,"types":["syn::token::Break"]},{"text":"impl ToTokens for Const","synthetic":false,"types":["syn::token::Const"]},{"text":"impl ToTokens for Continue","synthetic":false,"types":["syn::token::Continue"]},{"text":"impl ToTokens for Crate","synthetic":false,"types":["syn::token::Crate"]},{"text":"impl ToTokens for Default","synthetic":false,"types":["syn::token::Default"]},{"text":"impl ToTokens for Do","synthetic":false,"types":["syn::token::Do"]},{"text":"impl ToTokens for Dyn","synthetic":false,"types":["syn::token::Dyn"]},{"text":"impl ToTokens for Else","synthetic":false,"types":["syn::token::Else"]},{"text":"impl ToTokens for Enum","synthetic":false,"types":["syn::token::Enum"]},{"text":"impl ToTokens for Extern","synthetic":false,"types":["syn::token::Extern"]},{"text":"impl ToTokens for Final","synthetic":false,"types":["syn::token::Final"]},{"text":"impl ToTokens for Fn","synthetic":false,"types":["syn::token::Fn"]},{"text":"impl ToTokens for For","synthetic":false,"types":["syn::token::For"]},{"text":"impl ToTokens for If","synthetic":false,"types":["syn::token::If"]},{"text":"impl ToTokens for Impl","synthetic":false,"types":["syn::token::Impl"]},{"text":"impl ToTokens for In","synthetic":false,"types":["syn::token::In"]},{"text":"impl ToTokens for Let","synthetic":false,"types":["syn::token::Let"]},{"text":"impl ToTokens for Loop","synthetic":false,"types":["syn::token::Loop"]},{"text":"impl ToTokens for Macro","synthetic":false,"types":["syn::token::Macro"]},{"text":"impl ToTokens for Match","synthetic":false,"types":["syn::token::Match"]},{"text":"impl ToTokens for Mod","synthetic":false,"types":["syn::token::Mod"]},{"text":"impl ToTokens for Move","synthetic":false,"types":["syn::token::Move"]},{"text":"impl ToTokens for Mut","synthetic":false,"types":["syn::token::Mut"]},{"text":"impl ToTokens for Override","synthetic":false,"types":["syn::token::Override"]},{"text":"impl ToTokens for Priv","synthetic":false,"types":["syn::token::Priv"]},{"text":"impl ToTokens for Pub","synthetic":false,"types":["syn::token::Pub"]},{"text":"impl ToTokens for Ref","synthetic":false,"types":["syn::token::Ref"]},{"text":"impl ToTokens for Return","synthetic":false,"types":["syn::token::Return"]},{"text":"impl ToTokens for SelfType","synthetic":false,"types":["syn::token::SelfType"]},{"text":"impl ToTokens for SelfValue","synthetic":false,"types":["syn::token::SelfValue"]},{"text":"impl ToTokens for Static","synthetic":false,"types":["syn::token::Static"]},{"text":"impl ToTokens for Struct","synthetic":false,"types":["syn::token::Struct"]},{"text":"impl ToTokens for Super","synthetic":false,"types":["syn::token::Super"]},{"text":"impl ToTokens for Trait","synthetic":false,"types":["syn::token::Trait"]},{"text":"impl ToTokens for Try","synthetic":false,"types":["syn::token::Try"]},{"text":"impl ToTokens for Type","synthetic":false,"types":["syn::token::Type"]},{"text":"impl ToTokens for Typeof","synthetic":false,"types":["syn::token::Typeof"]},{"text":"impl ToTokens for Union","synthetic":false,"types":["syn::token::Union"]},{"text":"impl ToTokens for Unsafe","synthetic":false,"types":["syn::token::Unsafe"]},{"text":"impl ToTokens for Unsized","synthetic":false,"types":["syn::token::Unsized"]},{"text":"impl ToTokens for Use","synthetic":false,"types":["syn::token::Use"]},{"text":"impl ToTokens for Virtual","synthetic":false,"types":["syn::token::Virtual"]},{"text":"impl ToTokens for Where","synthetic":false,"types":["syn::token::Where"]},{"text":"impl ToTokens for While","synthetic":false,"types":["syn::token::While"]},{"text":"impl ToTokens for Yield","synthetic":false,"types":["syn::token::Yield"]},{"text":"impl ToTokens for Add","synthetic":false,"types":["syn::token::Add"]},{"text":"impl ToTokens for AddEq","synthetic":false,"types":["syn::token::AddEq"]},{"text":"impl ToTokens for And","synthetic":false,"types":["syn::token::And"]},{"text":"impl ToTokens for AndAnd","synthetic":false,"types":["syn::token::AndAnd"]},{"text":"impl ToTokens for AndEq","synthetic":false,"types":["syn::token::AndEq"]},{"text":"impl ToTokens for At","synthetic":false,"types":["syn::token::At"]},{"text":"impl ToTokens for Bang","synthetic":false,"types":["syn::token::Bang"]},{"text":"impl ToTokens for Caret","synthetic":false,"types":["syn::token::Caret"]},{"text":"impl ToTokens for CaretEq","synthetic":false,"types":["syn::token::CaretEq"]},{"text":"impl ToTokens for Colon","synthetic":false,"types":["syn::token::Colon"]},{"text":"impl ToTokens for Colon2","synthetic":false,"types":["syn::token::Colon2"]},{"text":"impl ToTokens for Comma","synthetic":false,"types":["syn::token::Comma"]},{"text":"impl ToTokens for Div","synthetic":false,"types":["syn::token::Div"]},{"text":"impl ToTokens for DivEq","synthetic":false,"types":["syn::token::DivEq"]},{"text":"impl ToTokens for Dollar","synthetic":false,"types":["syn::token::Dollar"]},{"text":"impl ToTokens for Dot","synthetic":false,"types":["syn::token::Dot"]},{"text":"impl ToTokens for Dot2","synthetic":false,"types":["syn::token::Dot2"]},{"text":"impl ToTokens for Dot3","synthetic":false,"types":["syn::token::Dot3"]},{"text":"impl ToTokens for DotDotEq","synthetic":false,"types":["syn::token::DotDotEq"]},{"text":"impl ToTokens for Eq","synthetic":false,"types":["syn::token::Eq"]},{"text":"impl ToTokens for EqEq","synthetic":false,"types":["syn::token::EqEq"]},{"text":"impl ToTokens for Ge","synthetic":false,"types":["syn::token::Ge"]},{"text":"impl ToTokens for Gt","synthetic":false,"types":["syn::token::Gt"]},{"text":"impl ToTokens for Le","synthetic":false,"types":["syn::token::Le"]},{"text":"impl ToTokens for Lt","synthetic":false,"types":["syn::token::Lt"]},{"text":"impl ToTokens for MulEq","synthetic":false,"types":["syn::token::MulEq"]},{"text":"impl ToTokens for Ne","synthetic":false,"types":["syn::token::Ne"]},{"text":"impl ToTokens for Or","synthetic":false,"types":["syn::token::Or"]},{"text":"impl ToTokens for OrEq","synthetic":false,"types":["syn::token::OrEq"]},{"text":"impl ToTokens for OrOr","synthetic":false,"types":["syn::token::OrOr"]},{"text":"impl ToTokens for Pound","synthetic":false,"types":["syn::token::Pound"]},{"text":"impl ToTokens for Question","synthetic":false,"types":["syn::token::Question"]},{"text":"impl ToTokens for RArrow","synthetic":false,"types":["syn::token::RArrow"]},{"text":"impl ToTokens for LArrow","synthetic":false,"types":["syn::token::LArrow"]},{"text":"impl ToTokens for Rem","synthetic":false,"types":["syn::token::Rem"]},{"text":"impl ToTokens for RemEq","synthetic":false,"types":["syn::token::RemEq"]},{"text":"impl ToTokens for FatArrow","synthetic":false,"types":["syn::token::FatArrow"]},{"text":"impl ToTokens for Semi","synthetic":false,"types":["syn::token::Semi"]},{"text":"impl ToTokens for Shl","synthetic":false,"types":["syn::token::Shl"]},{"text":"impl ToTokens for ShlEq","synthetic":false,"types":["syn::token::ShlEq"]},{"text":"impl ToTokens for Shr","synthetic":false,"types":["syn::token::Shr"]},{"text":"impl ToTokens for ShrEq","synthetic":false,"types":["syn::token::ShrEq"]},{"text":"impl ToTokens for Star","synthetic":false,"types":["syn::token::Star"]},{"text":"impl ToTokens for Sub","synthetic":false,"types":["syn::token::Sub"]},{"text":"impl ToTokens for SubEq","synthetic":false,"types":["syn::token::SubEq"]},{"text":"impl ToTokens for Tilde","synthetic":false,"types":["syn::token::Tilde"]},{"text":"impl ToTokens for Meta","synthetic":false,"types":["syn::attr::Meta"]},{"text":"impl ToTokens for NestedMeta","synthetic":false,"types":["syn::attr::NestedMeta"]},{"text":"impl ToTokens for Attribute","synthetic":false,"types":["syn::attr::Attribute"]},{"text":"impl ToTokens for MetaList","synthetic":false,"types":["syn::attr::MetaList"]},{"text":"impl ToTokens for MetaNameValue","synthetic":false,"types":["syn::attr::MetaNameValue"]},{"text":"impl ToTokens for Fields","synthetic":false,"types":["syn::data::Fields"]},{"text":"impl ToTokens for Visibility","synthetic":false,"types":["syn::data::Visibility"]},{"text":"impl ToTokens for Variant","synthetic":false,"types":["syn::data::Variant"]},{"text":"impl ToTokens for FieldsNamed","synthetic":false,"types":["syn::data::FieldsNamed"]},{"text":"impl ToTokens for FieldsUnnamed","synthetic":false,"types":["syn::data::FieldsUnnamed"]},{"text":"impl ToTokens for Field","synthetic":false,"types":["syn::data::Field"]},{"text":"impl ToTokens for VisPublic","synthetic":false,"types":["syn::data::VisPublic"]},{"text":"impl ToTokens for VisCrate","synthetic":false,"types":["syn::data::VisCrate"]},{"text":"impl ToTokens for VisRestricted","synthetic":false,"types":["syn::data::VisRestricted"]},{"text":"impl ToTokens for Expr","synthetic":false,"types":["syn::expr::Expr"]},{"text":"impl ToTokens for ExprArray","synthetic":false,"types":["syn::expr::ExprArray"]},{"text":"impl ToTokens for ExprAssign","synthetic":false,"types":["syn::expr::ExprAssign"]},{"text":"impl ToTokens for ExprAssignOp","synthetic":false,"types":["syn::expr::ExprAssignOp"]},{"text":"impl ToTokens for ExprAsync","synthetic":false,"types":["syn::expr::ExprAsync"]},{"text":"impl ToTokens for ExprAwait","synthetic":false,"types":["syn::expr::ExprAwait"]},{"text":"impl ToTokens for ExprBlock","synthetic":false,"types":["syn::expr::ExprBlock"]},{"text":"impl ToTokens for ExprBox","synthetic":false,"types":["syn::expr::ExprBox"]},{"text":"impl ToTokens for ExprBreak","synthetic":false,"types":["syn::expr::ExprBreak"]},{"text":"impl ToTokens for ExprClosure","synthetic":false,"types":["syn::expr::ExprClosure"]},{"text":"impl ToTokens for ExprContinue","synthetic":false,"types":["syn::expr::ExprContinue"]},{"text":"impl ToTokens for ExprForLoop","synthetic":false,"types":["syn::expr::ExprForLoop"]},{"text":"impl ToTokens for ExprGroup","synthetic":false,"types":["syn::expr::ExprGroup"]},{"text":"impl ToTokens for ExprIf","synthetic":false,"types":["syn::expr::ExprIf"]},{"text":"impl ToTokens for ExprLet","synthetic":false,"types":["syn::expr::ExprLet"]},{"text":"impl ToTokens for ExprLoop","synthetic":false,"types":["syn::expr::ExprLoop"]},{"text":"impl ToTokens for ExprMacro","synthetic":false,"types":["syn::expr::ExprMacro"]},{"text":"impl ToTokens for ExprMatch","synthetic":false,"types":["syn::expr::ExprMatch"]},{"text":"impl ToTokens for ExprMethodCall","synthetic":false,"types":["syn::expr::ExprMethodCall"]},{"text":"impl ToTokens for ExprRange","synthetic":false,"types":["syn::expr::ExprRange"]},{"text":"impl ToTokens for ExprReference","synthetic":false,"types":["syn::expr::ExprReference"]},{"text":"impl ToTokens for ExprRepeat","synthetic":false,"types":["syn::expr::ExprRepeat"]},{"text":"impl ToTokens for ExprReturn","synthetic":false,"types":["syn::expr::ExprReturn"]},{"text":"impl ToTokens for ExprStruct","synthetic":false,"types":["syn::expr::ExprStruct"]},{"text":"impl ToTokens for ExprTry","synthetic":false,"types":["syn::expr::ExprTry"]},{"text":"impl ToTokens for ExprTryBlock","synthetic":false,"types":["syn::expr::ExprTryBlock"]},{"text":"impl ToTokens for ExprTuple","synthetic":false,"types":["syn::expr::ExprTuple"]},{"text":"impl ToTokens for ExprType","synthetic":false,"types":["syn::expr::ExprType"]},{"text":"impl ToTokens for ExprUnsafe","synthetic":false,"types":["syn::expr::ExprUnsafe"]},{"text":"impl ToTokens for ExprWhile","synthetic":false,"types":["syn::expr::ExprWhile"]},{"text":"impl ToTokens for ExprYield","synthetic":false,"types":["syn::expr::ExprYield"]},{"text":"impl ToTokens for ExprCall","synthetic":false,"types":["syn::expr::ExprCall"]},{"text":"impl ToTokens for ExprBinary","synthetic":false,"types":["syn::expr::ExprBinary"]},{"text":"impl ToTokens for ExprUnary","synthetic":false,"types":["syn::expr::ExprUnary"]},{"text":"impl ToTokens for ExprLit","synthetic":false,"types":["syn::expr::ExprLit"]},{"text":"impl ToTokens for ExprCast","synthetic":false,"types":["syn::expr::ExprCast"]},{"text":"impl ToTokens for ExprField","synthetic":false,"types":["syn::expr::ExprField"]},{"text":"impl ToTokens for Member","synthetic":false,"types":["syn::expr::Member"]},{"text":"impl ToTokens for Index","synthetic":false,"types":["syn::expr::Index"]},{"text":"impl ToTokens for ExprIndex","synthetic":false,"types":["syn::expr::ExprIndex"]},{"text":"impl ToTokens for ExprPath","synthetic":false,"types":["syn::expr::ExprPath"]},{"text":"impl ToTokens for ExprParen","synthetic":false,"types":["syn::expr::ExprParen"]},{"text":"impl ToTokens for GenericParam","synthetic":false,"types":["syn::generics::GenericParam"]},{"text":"impl ToTokens for TypeParamBound","synthetic":false,"types":["syn::generics::TypeParamBound"]},{"text":"impl ToTokens for WherePredicate","synthetic":false,"types":["syn::generics::WherePredicate"]},{"text":"impl ToTokens for Generics","synthetic":false,"types":["syn::generics::Generics"]},{"text":"impl<'a> ToTokens for ImplGenerics<'a>","synthetic":false,"types":["syn::generics::ImplGenerics"]},{"text":"impl<'a> ToTokens for TypeGenerics<'a>","synthetic":false,"types":["syn::generics::TypeGenerics"]},{"text":"impl<'a> ToTokens for Turbofish<'a>","synthetic":false,"types":["syn::generics::Turbofish"]},{"text":"impl ToTokens for BoundLifetimes","synthetic":false,"types":["syn::generics::BoundLifetimes"]},{"text":"impl ToTokens for LifetimeDef","synthetic":false,"types":["syn::generics::LifetimeDef"]},{"text":"impl ToTokens for TypeParam","synthetic":false,"types":["syn::generics::TypeParam"]},{"text":"impl ToTokens for TraitBound","synthetic":false,"types":["syn::generics::TraitBound"]},{"text":"impl ToTokens for TraitBoundModifier","synthetic":false,"types":["syn::generics::TraitBoundModifier"]},{"text":"impl ToTokens for ConstParam","synthetic":false,"types":["syn::generics::ConstParam"]},{"text":"impl ToTokens for WhereClause","synthetic":false,"types":["syn::generics::WhereClause"]},{"text":"impl ToTokens for PredicateType","synthetic":false,"types":["syn::generics::PredicateType"]},{"text":"impl ToTokens for PredicateLifetime","synthetic":false,"types":["syn::generics::PredicateLifetime"]},{"text":"impl ToTokens for PredicateEq","synthetic":false,"types":["syn::generics::PredicateEq"]},{"text":"impl ToTokens for Lifetime","synthetic":false,"types":["syn::lifetime::Lifetime"]},{"text":"impl ToTokens for Lit","synthetic":false,"types":["syn::lit::Lit"]},{"text":"impl ToTokens for LitStr","synthetic":false,"types":["syn::lit::LitStr"]},{"text":"impl ToTokens for LitByteStr","synthetic":false,"types":["syn::lit::LitByteStr"]},{"text":"impl ToTokens for LitByte","synthetic":false,"types":["syn::lit::LitByte"]},{"text":"impl ToTokens for LitChar","synthetic":false,"types":["syn::lit::LitChar"]},{"text":"impl ToTokens for LitInt","synthetic":false,"types":["syn::lit::LitInt"]},{"text":"impl ToTokens for LitFloat","synthetic":false,"types":["syn::lit::LitFloat"]},{"text":"impl ToTokens for LitBool","synthetic":false,"types":["syn::lit::LitBool"]},{"text":"impl ToTokens for Macro","synthetic":false,"types":["syn::mac::Macro"]},{"text":"impl ToTokens for DeriveInput","synthetic":false,"types":["syn::derive::DeriveInput"]},{"text":"impl ToTokens for BinOp","synthetic":false,"types":["syn::op::BinOp"]},{"text":"impl ToTokens for UnOp","synthetic":false,"types":["syn::op::UnOp"]},{"text":"impl ToTokens for Type","synthetic":false,"types":["syn::ty::Type"]},{"text":"impl ToTokens for TypeSlice","synthetic":false,"types":["syn::ty::TypeSlice"]},{"text":"impl ToTokens for TypeArray","synthetic":false,"types":["syn::ty::TypeArray"]},{"text":"impl ToTokens for TypePtr","synthetic":false,"types":["syn::ty::TypePtr"]},{"text":"impl ToTokens for TypeReference","synthetic":false,"types":["syn::ty::TypeReference"]},{"text":"impl ToTokens for TypeBareFn","synthetic":false,"types":["syn::ty::TypeBareFn"]},{"text":"impl ToTokens for TypeNever","synthetic":false,"types":["syn::ty::TypeNever"]},{"text":"impl ToTokens for TypeTuple","synthetic":false,"types":["syn::ty::TypeTuple"]},{"text":"impl ToTokens for TypePath","synthetic":false,"types":["syn::ty::TypePath"]},{"text":"impl ToTokens for TypeTraitObject","synthetic":false,"types":["syn::ty::TypeTraitObject"]},{"text":"impl ToTokens for TypeImplTrait","synthetic":false,"types":["syn::ty::TypeImplTrait"]},{"text":"impl ToTokens for TypeGroup","synthetic":false,"types":["syn::ty::TypeGroup"]},{"text":"impl ToTokens for TypeParen","synthetic":false,"types":["syn::ty::TypeParen"]},{"text":"impl ToTokens for TypeInfer","synthetic":false,"types":["syn::ty::TypeInfer"]},{"text":"impl ToTokens for TypeMacro","synthetic":false,"types":["syn::ty::TypeMacro"]},{"text":"impl ToTokens for ReturnType","synthetic":false,"types":["syn::ty::ReturnType"]},{"text":"impl ToTokens for BareFnArg","synthetic":false,"types":["syn::ty::BareFnArg"]},{"text":"impl ToTokens for Variadic","synthetic":false,"types":["syn::ty::Variadic"]},{"text":"impl ToTokens for Abi","synthetic":false,"types":["syn::ty::Abi"]},{"text":"impl ToTokens for Path","synthetic":false,"types":["syn::path::Path"]},{"text":"impl ToTokens for PathSegment","synthetic":false,"types":["syn::path::PathSegment"]},{"text":"impl ToTokens for PathArguments","synthetic":false,"types":["syn::path::PathArguments"]},{"text":"impl ToTokens for GenericArgument","synthetic":false,"types":["syn::path::GenericArgument"]},{"text":"impl ToTokens for AngleBracketedGenericArguments","synthetic":false,"types":["syn::path::AngleBracketedGenericArguments"]},{"text":"impl ToTokens for Binding","synthetic":false,"types":["syn::path::Binding"]},{"text":"impl ToTokens for Constraint","synthetic":false,"types":["syn::path::Constraint"]},{"text":"impl ToTokens for ParenthesizedGenericArguments","synthetic":false,"types":["syn::path::ParenthesizedGenericArguments"]},{"text":"impl<T, P> ToTokens for Punctuated<T, P> where
    T: ToTokens,
    P: ToTokens
","synthetic":false,"types":["syn::punctuated::Punctuated"]},{"text":"impl<T, P> ToTokens for Pair<T, P> where
    T: ToTokens,
    P: ToTokens
","synthetic":false,"types":["syn::punctuated::Pair"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/quote/trait.IdentFragment.js b/implementors/quote/trait.IdentFragment.js new file mode 100644 index 0000000..fc16284 --- /dev/null +++ b/implementors/quote/trait.IdentFragment.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["quote"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/quote/trait.ToTokens.js b/implementors/quote/trait.ToTokens.js new file mode 100644 index 0000000..fc16284 --- /dev/null +++ b/implementors/quote/trait.ToTokens.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["quote"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/quote/trait.TokenStreamExt.js b/implementors/quote/trait.TokenStreamExt.js new file mode 100644 index 0000000..fc16284 --- /dev/null +++ b/implementors/quote/trait.TokenStreamExt.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["quote"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/de/trait.Deserialize.js b/implementors/serde/de/trait.Deserialize.js new file mode 100644 index 0000000..6b0de92 --- /dev/null +++ b/implementors/serde/de/trait.Deserialize.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["ironsea_index_sfc_dbc"] = [{"text":"impl<'de, F, K, V> Deserialize<'de> for SpaceFillingCurve<F, K, V> where
    F: PartialEq,
    K: Debug + FromIterator<V> + Index<usize, Output = V>,
    V: Clone + Debug + From<usize> + Ord,
    F: Deserialize<'de>,
    K: Deserialize<'de>,
    V: Deserialize<'de>, 
","synthetic":false,"types":["ironsea_index_sfc_dbc::sfc::SpaceFillingCurve"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/de/trait.DeserializeOwned.js b/implementors/serde/de/trait.DeserializeOwned.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/de/trait.DeserializeOwned.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/de/trait.DeserializeSeed.js b/implementors/serde/de/trait.DeserializeSeed.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/de/trait.DeserializeSeed.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/de/trait.EnumAccess.js b/implementors/serde/de/trait.EnumAccess.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/de/trait.EnumAccess.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/de/trait.Error.js b/implementors/serde/de/trait.Error.js new file mode 100644 index 0000000..953475c --- /dev/null +++ b/implementors/serde/de/trait.Error.js @@ -0,0 +1,4 @@ +(function() {var implementors = {}; +implementors["bincode"] = [{"text":"impl Error for Error","synthetic":false,"types":["bincode::error::Error"]}]; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/de/trait.Expected.js b/implementors/serde/de/trait.Expected.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/de/trait.Expected.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/de/trait.IntoDeserializer.js b/implementors/serde/de/trait.IntoDeserializer.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/de/trait.IntoDeserializer.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/de/trait.MapAccess.js b/implementors/serde/de/trait.MapAccess.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/de/trait.MapAccess.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/de/trait.SeqAccess.js b/implementors/serde/de/trait.SeqAccess.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/de/trait.SeqAccess.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/de/trait.Visitor.js b/implementors/serde/de/trait.Visitor.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/de/trait.Visitor.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/ser/trait.Error.js b/implementors/serde/ser/trait.Error.js new file mode 100644 index 0000000..76623bb --- /dev/null +++ b/implementors/serde/ser/trait.Error.js @@ -0,0 +1,4 @@ +(function() {var implementors = {}; +implementors["bincode"] = [{"text":"impl Error for Error","synthetic":false,"types":["bincode::error::Error"]}]; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/ser/trait.Serialize.js b/implementors/serde/ser/trait.Serialize.js new file mode 100644 index 0000000..46b7609 --- /dev/null +++ b/implementors/serde/ser/trait.Serialize.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["ironsea_index_sfc_dbc"] = [{"text":"impl<F, K, V> Serialize for SpaceFillingCurve<F, K, V> where
    F: PartialEq,
    K: Debug + FromIterator<V> + Index<usize, Output = V>,
    V: Clone + Debug + From<usize> + Ord,
    F: Serialize,
    K: Serialize,
    V: Serialize
","synthetic":false,"types":["ironsea_index_sfc_dbc::sfc::SpaceFillingCurve"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/ser/trait.SerializeMap.js b/implementors/serde/ser/trait.SerializeMap.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/ser/trait.SerializeMap.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/ser/trait.SerializeSeq.js b/implementors/serde/ser/trait.SerializeSeq.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/ser/trait.SerializeSeq.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/ser/trait.SerializeStruct.js b/implementors/serde/ser/trait.SerializeStruct.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/ser/trait.SerializeStruct.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/ser/trait.SerializeStructVariant.js b/implementors/serde/ser/trait.SerializeStructVariant.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/ser/trait.SerializeStructVariant.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/ser/trait.SerializeTuple.js b/implementors/serde/ser/trait.SerializeTuple.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/ser/trait.SerializeTuple.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/ser/trait.SerializeTupleStruct.js b/implementors/serde/ser/trait.SerializeTupleStruct.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/ser/trait.SerializeTupleStruct.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/ser/trait.SerializeTupleVariant.js b/implementors/serde/ser/trait.SerializeTupleVariant.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/ser/trait.SerializeTupleVariant.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/trait.Deserialize.js b/implementors/serde/trait.Deserialize.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/trait.Deserialize.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/trait.Deserializer.js b/implementors/serde/trait.Deserializer.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/trait.Deserializer.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/serde/trait.Serialize.js b/implementors/serde/trait.Serialize.js new file mode 100644 index 0000000..d8f5938 --- /dev/null +++ b/implementors/serde/trait.Serialize.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["serde"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/std/error/trait.Error.js b/implementors/std/error/trait.Error.js new file mode 100644 index 0000000..9ebdbd2 --- /dev/null +++ b/implementors/std/error/trait.Error.js @@ -0,0 +1,5 @@ +(function() {var implementors = {}; +implementors["bincode"] = [{"text":"impl Error for ErrorKind","synthetic":false,"types":["bincode::error::ErrorKind"]}]; +implementors["serde"] = [{"text":"impl Error for Error","synthetic":false,"types":["serde::de::value::Error"]}]; +implementors["syn"] = [{"text":"impl Error for Error","synthetic":false,"types":["syn::error::Error"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/std/panic/trait.RefUnwindSafe.js b/implementors/std/panic/trait.RefUnwindSafe.js new file mode 100644 index 0000000..e891e83 --- /dev/null +++ b/implementors/std/panic/trait.RefUnwindSafe.js @@ -0,0 +1,8 @@ +(function() {var implementors = {}; +implementors["bincode"] = [{"text":"impl RefUnwindSafe for Config","synthetic":true,"types":["bincode::config::Config"]},{"text":"impl !RefUnwindSafe for ErrorKind","synthetic":true,"types":["bincode::error::ErrorKind"]}]; +implementors["byteorder"] = [{"text":"impl RefUnwindSafe for BigEndian","synthetic":true,"types":["byteorder::BigEndian"]},{"text":"impl RefUnwindSafe for LittleEndian","synthetic":true,"types":["byteorder::LittleEndian"]}]; +implementors["ironsea_index_sfc_dbc"] = [{"text":"impl<F, K, V> RefUnwindSafe for SpaceFillingCurve<F, K, V> where
    F: RefUnwindSafe,
    K: RefUnwindSafe,
    V: RefUnwindSafe
","synthetic":true,"types":["ironsea_index_sfc_dbc::sfc::SpaceFillingCurve"]}]; +implementors["proc_macro2"] = [{"text":"impl !RefUnwindSafe for TokenStream","synthetic":true,"types":["proc_macro2::TokenStream"]},{"text":"impl !RefUnwindSafe for LexError","synthetic":true,"types":["proc_macro2::LexError"]},{"text":"impl !RefUnwindSafe for Span","synthetic":true,"types":["proc_macro2::Span"]},{"text":"impl !RefUnwindSafe for Group","synthetic":true,"types":["proc_macro2::Group"]},{"text":"impl !RefUnwindSafe for Punct","synthetic":true,"types":["proc_macro2::Punct"]},{"text":"impl !RefUnwindSafe for Ident","synthetic":true,"types":["proc_macro2::Ident"]},{"text":"impl !RefUnwindSafe for Literal","synthetic":true,"types":["proc_macro2::Literal"]},{"text":"impl !RefUnwindSafe for TokenTree","synthetic":true,"types":["proc_macro2::TokenTree"]},{"text":"impl RefUnwindSafe for Delimiter","synthetic":true,"types":["proc_macro2::Delimiter"]},{"text":"impl RefUnwindSafe for Spacing","synthetic":true,"types":["proc_macro2::Spacing"]},{"text":"impl !RefUnwindSafe for IntoIter","synthetic":true,"types":["proc_macro2::token_stream::IntoIter"]}]; +implementors["serde"] = [{"text":"impl RefUnwindSafe for IgnoredAny","synthetic":true,"types":["serde::de::ignored_any::IgnoredAny"]},{"text":"impl<'a> RefUnwindSafe for Unexpected<'a>","synthetic":true,"types":["serde::de::Unexpected"]},{"text":"impl RefUnwindSafe for Error","synthetic":true,"types":["serde::de::value::Error"]},{"text":"impl<E> RefUnwindSafe for UnitDeserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::UnitDeserializer"]},{"text":"impl<E> RefUnwindSafe for BoolDeserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::BoolDeserializer"]},{"text":"impl<E> RefUnwindSafe for I8Deserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::I8Deserializer"]},{"text":"impl<E> RefUnwindSafe for I16Deserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::I16Deserializer"]},{"text":"impl<E> RefUnwindSafe for I32Deserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::I32Deserializer"]},{"text":"impl<E> RefUnwindSafe for I64Deserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::I64Deserializer"]},{"text":"impl<E> RefUnwindSafe for IsizeDeserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::IsizeDeserializer"]},{"text":"impl<E> RefUnwindSafe for U8Deserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::U8Deserializer"]},{"text":"impl<E> RefUnwindSafe for U16Deserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::U16Deserializer"]},{"text":"impl<E> RefUnwindSafe for U64Deserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::U64Deserializer"]},{"text":"impl<E> RefUnwindSafe for UsizeDeserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::UsizeDeserializer"]},{"text":"impl<E> RefUnwindSafe for F32Deserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::F32Deserializer"]},{"text":"impl<E> RefUnwindSafe for F64Deserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::F64Deserializer"]},{"text":"impl<E> RefUnwindSafe for CharDeserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::CharDeserializer"]},{"text":"impl<E> RefUnwindSafe for I128Deserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::I128Deserializer"]},{"text":"impl<E> RefUnwindSafe for U128Deserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::U128Deserializer"]},{"text":"impl<E> RefUnwindSafe for U32Deserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::U32Deserializer"]},{"text":"impl<'a, E> RefUnwindSafe for StrDeserializer<'a, E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::StrDeserializer"]},{"text":"impl<'de, E> RefUnwindSafe for BorrowedStrDeserializer<'de, E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::BorrowedStrDeserializer"]},{"text":"impl<E> RefUnwindSafe for StringDeserializer<E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::StringDeserializer"]},{"text":"impl<'a, E> RefUnwindSafe for CowStrDeserializer<'a, E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::CowStrDeserializer"]},{"text":"impl<'de, E> RefUnwindSafe for BorrowedBytesDeserializer<'de, E> where
    E: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::BorrowedBytesDeserializer"]},{"text":"impl<I, E> RefUnwindSafe for SeqDeserializer<I, E> where
    E: RefUnwindSafe,
    I: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::SeqDeserializer"]},{"text":"impl<A> RefUnwindSafe for SeqAccessDeserializer<A> where
    A: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::SeqAccessDeserializer"]},{"text":"impl<'de, I, E> RefUnwindSafe for MapDeserializer<'de, I, E> where
    E: RefUnwindSafe,
    I: RefUnwindSafe,
    <<I as Iterator>::Item as Pair>::Second: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::MapDeserializer"]},{"text":"impl<A> RefUnwindSafe for MapAccessDeserializer<A> where
    A: RefUnwindSafe
","synthetic":true,"types":["serde::de::value::MapAccessDeserializer"]},{"text":"impl<Ok, Error> RefUnwindSafe for Impossible<Ok, Error> where
    Error: RefUnwindSafe,
    Ok: RefUnwindSafe
","synthetic":true,"types":["serde::ser::impossible::Impossible"]}]; +implementors["syn"] = [{"text":"impl !RefUnwindSafe for Attribute","synthetic":true,"types":["syn::attr::Attribute"]},{"text":"impl !RefUnwindSafe for MetaList","synthetic":true,"types":["syn::attr::MetaList"]},{"text":"impl !RefUnwindSafe for MetaNameValue","synthetic":true,"types":["syn::attr::MetaNameValue"]},{"text":"impl !RefUnwindSafe for Field","synthetic":true,"types":["syn::data::Field"]},{"text":"impl !RefUnwindSafe for FieldsNamed","synthetic":true,"types":["syn::data::FieldsNamed"]},{"text":"impl !RefUnwindSafe for FieldsUnnamed","synthetic":true,"types":["syn::data::FieldsUnnamed"]},{"text":"impl !RefUnwindSafe for Variant","synthetic":true,"types":["syn::data::Variant"]},{"text":"impl !RefUnwindSafe for VisCrate","synthetic":true,"types":["syn::data::VisCrate"]},{"text":"impl !RefUnwindSafe for VisPublic","synthetic":true,"types":["syn::data::VisPublic"]},{"text":"impl !RefUnwindSafe for VisRestricted","synthetic":true,"types":["syn::data::VisRestricted"]},{"text":"impl RefUnwindSafe for ExprArray","synthetic":true,"types":["syn::expr::ExprArray"]},{"text":"impl RefUnwindSafe for ExprAssign","synthetic":true,"types":["syn::expr::ExprAssign"]},{"text":"impl RefUnwindSafe for ExprAssignOp","synthetic":true,"types":["syn::expr::ExprAssignOp"]},{"text":"impl RefUnwindSafe for ExprAsync","synthetic":true,"types":["syn::expr::ExprAsync"]},{"text":"impl RefUnwindSafe for ExprAwait","synthetic":true,"types":["syn::expr::ExprAwait"]},{"text":"impl !RefUnwindSafe for ExprBinary","synthetic":true,"types":["syn::expr::ExprBinary"]},{"text":"impl RefUnwindSafe for ExprBlock","synthetic":true,"types":["syn::expr::ExprBlock"]},{"text":"impl RefUnwindSafe for ExprBox","synthetic":true,"types":["syn::expr::ExprBox"]},{"text":"impl RefUnwindSafe for ExprBreak","synthetic":true,"types":["syn::expr::ExprBreak"]},{"text":"impl !RefUnwindSafe for ExprCall","synthetic":true,"types":["syn::expr::ExprCall"]},{"text":"impl !RefUnwindSafe for ExprCast","synthetic":true,"types":["syn::expr::ExprCast"]},{"text":"impl RefUnwindSafe for ExprClosure","synthetic":true,"types":["syn::expr::ExprClosure"]},{"text":"impl RefUnwindSafe for ExprContinue","synthetic":true,"types":["syn::expr::ExprContinue"]},{"text":"impl !RefUnwindSafe for ExprField","synthetic":true,"types":["syn::expr::ExprField"]},{"text":"impl RefUnwindSafe for ExprForLoop","synthetic":true,"types":["syn::expr::ExprForLoop"]},{"text":"impl RefUnwindSafe for ExprGroup","synthetic":true,"types":["syn::expr::ExprGroup"]},{"text":"impl RefUnwindSafe for ExprIf","synthetic":true,"types":["syn::expr::ExprIf"]},{"text":"impl !RefUnwindSafe for ExprIndex","synthetic":true,"types":["syn::expr::ExprIndex"]},{"text":"impl RefUnwindSafe for ExprLet","synthetic":true,"types":["syn::expr::ExprLet"]},{"text":"impl !RefUnwindSafe for ExprLit","synthetic":true,"types":["syn::expr::ExprLit"]},{"text":"impl RefUnwindSafe for ExprLoop","synthetic":true,"types":["syn::expr::ExprLoop"]},{"text":"impl RefUnwindSafe for ExprMacro","synthetic":true,"types":["syn::expr::ExprMacro"]},{"text":"impl RefUnwindSafe for ExprMatch","synthetic":true,"types":["syn::expr::ExprMatch"]},{"text":"impl RefUnwindSafe for ExprMethodCall","synthetic":true,"types":["syn::expr::ExprMethodCall"]},{"text":"impl !RefUnwindSafe for ExprParen","synthetic":true,"types":["syn::expr::ExprParen"]},{"text":"impl !RefUnwindSafe for ExprPath","synthetic":true,"types":["syn::expr::ExprPath"]},{"text":"impl RefUnwindSafe for ExprRange","synthetic":true,"types":["syn::expr::ExprRange"]},{"text":"impl RefUnwindSafe for ExprReference","synthetic":true,"types":["syn::expr::ExprReference"]},{"text":"impl RefUnwindSafe for ExprRepeat","synthetic":true,"types":["syn::expr::ExprRepeat"]},{"text":"impl RefUnwindSafe for ExprReturn","synthetic":true,"types":["syn::expr::ExprReturn"]},{"text":"impl RefUnwindSafe for ExprStruct","synthetic":true,"types":["syn::expr::ExprStruct"]},{"text":"impl RefUnwindSafe for ExprTry","synthetic":true,"types":["syn::expr::ExprTry"]},{"text":"impl RefUnwindSafe for ExprTryBlock","synthetic":true,"types":["syn::expr::ExprTryBlock"]},{"text":"impl RefUnwindSafe for ExprTuple","synthetic":true,"types":["syn::expr::ExprTuple"]},{"text":"impl RefUnwindSafe for ExprType","synthetic":true,"types":["syn::expr::ExprType"]},{"text":"impl !RefUnwindSafe for ExprUnary","synthetic":true,"types":["syn::expr::ExprUnary"]},{"text":"impl RefUnwindSafe for ExprUnsafe","synthetic":true,"types":["syn::expr::ExprUnsafe"]},{"text":"impl RefUnwindSafe for ExprWhile","synthetic":true,"types":["syn::expr::ExprWhile"]},{"text":"impl RefUnwindSafe for ExprYield","synthetic":true,"types":["syn::expr::ExprYield"]},{"text":"impl !RefUnwindSafe for Index","synthetic":true,"types":["syn::expr::Index"]},{"text":"impl !RefUnwindSafe for BoundLifetimes","synthetic":true,"types":["syn::generics::BoundLifetimes"]},{"text":"impl !RefUnwindSafe for ConstParam","synthetic":true,"types":["syn::generics::ConstParam"]},{"text":"impl !RefUnwindSafe for Generics","synthetic":true,"types":["syn::generics::Generics"]},{"text":"impl !RefUnwindSafe for LifetimeDef","synthetic":true,"types":["syn::generics::LifetimeDef"]},{"text":"impl !RefUnwindSafe for PredicateEq","synthetic":true,"types":["syn::generics::PredicateEq"]},{"text":"impl !RefUnwindSafe for PredicateLifetime","synthetic":true,"types":["syn::generics::PredicateLifetime"]},{"text":"impl !RefUnwindSafe for PredicateType","synthetic":true,"types":["syn::generics::PredicateType"]},{"text":"impl !RefUnwindSafe for TraitBound","synthetic":true,"types":["syn::generics::TraitBound"]},{"text":"impl !RefUnwindSafe for TypeParam","synthetic":true,"types":["syn::generics::TypeParam"]},{"text":"impl !RefUnwindSafe for WhereClause","synthetic":true,"types":["syn::generics::WhereClause"]},{"text":"impl<'a> !RefUnwindSafe for ImplGenerics<'a>","synthetic":true,"types":["syn::generics::ImplGenerics"]},{"text":"impl<'a> !RefUnwindSafe for Turbofish<'a>","synthetic":true,"types":["syn::generics::Turbofish"]},{"text":"impl<'a> !RefUnwindSafe for TypeGenerics<'a>","synthetic":true,"types":["syn::generics::TypeGenerics"]},{"text":"impl !RefUnwindSafe for Lifetime","synthetic":true,"types":["syn::lifetime::Lifetime"]},{"text":"impl !RefUnwindSafe for LitBool","synthetic":true,"types":["syn::lit::LitBool"]},{"text":"impl !RefUnwindSafe for LitByte","synthetic":true,"types":["syn::lit::LitByte"]},{"text":"impl !RefUnwindSafe for LitByteStr","synthetic":true,"types":["syn::lit::LitByteStr"]},{"text":"impl !RefUnwindSafe for LitChar","synthetic":true,"types":["syn::lit::LitChar"]},{"text":"impl !RefUnwindSafe for LitFloat","synthetic":true,"types":["syn::lit::LitFloat"]},{"text":"impl !RefUnwindSafe for LitInt","synthetic":true,"types":["syn::lit::LitInt"]},{"text":"impl !RefUnwindSafe for LitStr","synthetic":true,"types":["syn::lit::LitStr"]},{"text":"impl !RefUnwindSafe for Macro","synthetic":true,"types":["syn::mac::Macro"]},{"text":"impl !RefUnwindSafe for DataEnum","synthetic":true,"types":["syn::derive::DataEnum"]},{"text":"impl !RefUnwindSafe for DataStruct","synthetic":true,"types":["syn::derive::DataStruct"]},{"text":"impl !RefUnwindSafe for DataUnion","synthetic":true,"types":["syn::derive::DataUnion"]},{"text":"impl !RefUnwindSafe for DeriveInput","synthetic":true,"types":["syn::derive::DeriveInput"]},{"text":"impl !RefUnwindSafe for Abi","synthetic":true,"types":["syn::ty::Abi"]},{"text":"impl !RefUnwindSafe for BareFnArg","synthetic":true,"types":["syn::ty::BareFnArg"]},{"text":"impl !RefUnwindSafe for TypeArray","synthetic":true,"types":["syn::ty::TypeArray"]},{"text":"impl !RefUnwindSafe for TypeBareFn","synthetic":true,"types":["syn::ty::TypeBareFn"]},{"text":"impl !RefUnwindSafe for TypeGroup","synthetic":true,"types":["syn::ty::TypeGroup"]},{"text":"impl !RefUnwindSafe for TypeImplTrait","synthetic":true,"types":["syn::ty::TypeImplTrait"]},{"text":"impl !RefUnwindSafe for TypeInfer","synthetic":true,"types":["syn::ty::TypeInfer"]},{"text":"impl !RefUnwindSafe for TypeMacro","synthetic":true,"types":["syn::ty::TypeMacro"]},{"text":"impl !RefUnwindSafe for TypeNever","synthetic":true,"types":["syn::ty::TypeNever"]},{"text":"impl !RefUnwindSafe for TypeParen","synthetic":true,"types":["syn::ty::TypeParen"]},{"text":"impl !RefUnwindSafe for TypePath","synthetic":true,"types":["syn::ty::TypePath"]},{"text":"impl !RefUnwindSafe for TypePtr","synthetic":true,"types":["syn::ty::TypePtr"]},{"text":"impl !RefUnwindSafe for TypeReference","synthetic":true,"types":["syn::ty::TypeReference"]},{"text":"impl !RefUnwindSafe for TypeSlice","synthetic":true,"types":["syn::ty::TypeSlice"]},{"text":"impl !RefUnwindSafe for TypeTraitObject","synthetic":true,"types":["syn::ty::TypeTraitObject"]},{"text":"impl !RefUnwindSafe for TypeTuple","synthetic":true,"types":["syn::ty::TypeTuple"]},{"text":"impl !RefUnwindSafe for Variadic","synthetic":true,"types":["syn::ty::Variadic"]},{"text":"impl !RefUnwindSafe for AngleBracketedGenericArguments","synthetic":true,"types":["syn::path::AngleBracketedGenericArguments"]},{"text":"impl !RefUnwindSafe for Binding","synthetic":true,"types":["syn::path::Binding"]},{"text":"impl !RefUnwindSafe for Constraint","synthetic":true,"types":["syn::path::Constraint"]},{"text":"impl !RefUnwindSafe for ParenthesizedGenericArguments","synthetic":true,"types":["syn::path::ParenthesizedGenericArguments"]},{"text":"impl !RefUnwindSafe for Path","synthetic":true,"types":["syn::path::Path"]},{"text":"impl !RefUnwindSafe for PathSegment","synthetic":true,"types":["syn::path::PathSegment"]},{"text":"impl !RefUnwindSafe for QSelf","synthetic":true,"types":["syn::path::QSelf"]},{"text":"impl !RefUnwindSafe for Error","synthetic":true,"types":["syn::error::Error"]},{"text":"impl !RefUnwindSafe for AttrStyle","synthetic":true,"types":["syn::attr::AttrStyle"]},{"text":"impl !RefUnwindSafe for Meta","synthetic":true,"types":["syn::attr::Meta"]},{"text":"impl !RefUnwindSafe for NestedMeta","synthetic":true,"types":["syn::attr::NestedMeta"]},{"text":"impl !RefUnwindSafe for Fields","synthetic":true,"types":["syn::data::Fields"]},{"text":"impl !RefUnwindSafe for Visibility","synthetic":true,"types":["syn::data::Visibility"]},{"text":"impl !RefUnwindSafe for Expr","synthetic":true,"types":["syn::expr::Expr"]},{"text":"impl !RefUnwindSafe for Member","synthetic":true,"types":["syn::expr::Member"]},{"text":"impl !RefUnwindSafe for GenericParam","synthetic":true,"types":["syn::generics::GenericParam"]},{"text":"impl !RefUnwindSafe for TraitBoundModifier","synthetic":true,"types":["syn::generics::TraitBoundModifier"]},{"text":"impl !RefUnwindSafe for TypeParamBound","synthetic":true,"types":["syn::generics::TypeParamBound"]},{"text":"impl !RefUnwindSafe for WherePredicate","synthetic":true,"types":["syn::generics::WherePredicate"]},{"text":"impl !RefUnwindSafe for Lit","synthetic":true,"types":["syn::lit::Lit"]},{"text":"impl RefUnwindSafe for StrStyle","synthetic":true,"types":["syn::lit::StrStyle"]},{"text":"impl !RefUnwindSafe for MacroDelimiter","synthetic":true,"types":["syn::mac::MacroDelimiter"]},{"text":"impl !RefUnwindSafe for Data","synthetic":true,"types":["syn::derive::Data"]},{"text":"impl !RefUnwindSafe for BinOp","synthetic":true,"types":["syn::op::BinOp"]},{"text":"impl !RefUnwindSafe for UnOp","synthetic":true,"types":["syn::op::UnOp"]},{"text":"impl !RefUnwindSafe for ReturnType","synthetic":true,"types":["syn::ty::ReturnType"]},{"text":"impl !RefUnwindSafe for Type","synthetic":true,"types":["syn::ty::Type"]},{"text":"impl !RefUnwindSafe for GenericArgument","synthetic":true,"types":["syn::path::GenericArgument"]},{"text":"impl !RefUnwindSafe for PathArguments","synthetic":true,"types":["syn::path::PathArguments"]},{"text":"impl !RefUnwindSafe for Underscore","synthetic":true,"types":["syn::token::Underscore"]},{"text":"impl !RefUnwindSafe for Abstract","synthetic":true,"types":["syn::token::Abstract"]},{"text":"impl !RefUnwindSafe for As","synthetic":true,"types":["syn::token::As"]},{"text":"impl !RefUnwindSafe for Async","synthetic":true,"types":["syn::token::Async"]},{"text":"impl !RefUnwindSafe for Auto","synthetic":true,"types":["syn::token::Auto"]},{"text":"impl !RefUnwindSafe for Await","synthetic":true,"types":["syn::token::Await"]},{"text":"impl !RefUnwindSafe for Become","synthetic":true,"types":["syn::token::Become"]},{"text":"impl !RefUnwindSafe for Box","synthetic":true,"types":["syn::token::Box"]},{"text":"impl !RefUnwindSafe for Break","synthetic":true,"types":["syn::token::Break"]},{"text":"impl !RefUnwindSafe for Const","synthetic":true,"types":["syn::token::Const"]},{"text":"impl !RefUnwindSafe for Continue","synthetic":true,"types":["syn::token::Continue"]},{"text":"impl !RefUnwindSafe for Crate","synthetic":true,"types":["syn::token::Crate"]},{"text":"impl !RefUnwindSafe for Default","synthetic":true,"types":["syn::token::Default"]},{"text":"impl !RefUnwindSafe for Do","synthetic":true,"types":["syn::token::Do"]},{"text":"impl !RefUnwindSafe for Dyn","synthetic":true,"types":["syn::token::Dyn"]},{"text":"impl !RefUnwindSafe for Else","synthetic":true,"types":["syn::token::Else"]},{"text":"impl !RefUnwindSafe for Enum","synthetic":true,"types":["syn::token::Enum"]},{"text":"impl !RefUnwindSafe for Extern","synthetic":true,"types":["syn::token::Extern"]},{"text":"impl !RefUnwindSafe for Final","synthetic":true,"types":["syn::token::Final"]},{"text":"impl !RefUnwindSafe for Fn","synthetic":true,"types":["syn::token::Fn"]},{"text":"impl !RefUnwindSafe for For","synthetic":true,"types":["syn::token::For"]},{"text":"impl !RefUnwindSafe for If","synthetic":true,"types":["syn::token::If"]},{"text":"impl !RefUnwindSafe for Impl","synthetic":true,"types":["syn::token::Impl"]},{"text":"impl !RefUnwindSafe for In","synthetic":true,"types":["syn::token::In"]},{"text":"impl !RefUnwindSafe for Let","synthetic":true,"types":["syn::token::Let"]},{"text":"impl !RefUnwindSafe for Loop","synthetic":true,"types":["syn::token::Loop"]},{"text":"impl !RefUnwindSafe for Macro","synthetic":true,"types":["syn::token::Macro"]},{"text":"impl !RefUnwindSafe for Match","synthetic":true,"types":["syn::token::Match"]},{"text":"impl !RefUnwindSafe for Mod","synthetic":true,"types":["syn::token::Mod"]},{"text":"impl !RefUnwindSafe for Move","synthetic":true,"types":["syn::token::Move"]},{"text":"impl !RefUnwindSafe for Mut","synthetic":true,"types":["syn::token::Mut"]},{"text":"impl !RefUnwindSafe for Override","synthetic":true,"types":["syn::token::Override"]},{"text":"impl !RefUnwindSafe for Priv","synthetic":true,"types":["syn::token::Priv"]},{"text":"impl !RefUnwindSafe for Pub","synthetic":true,"types":["syn::token::Pub"]},{"text":"impl !RefUnwindSafe for Ref","synthetic":true,"types":["syn::token::Ref"]},{"text":"impl !RefUnwindSafe for Return","synthetic":true,"types":["syn::token::Return"]},{"text":"impl !RefUnwindSafe for SelfType","synthetic":true,"types":["syn::token::SelfType"]},{"text":"impl !RefUnwindSafe for SelfValue","synthetic":true,"types":["syn::token::SelfValue"]},{"text":"impl !RefUnwindSafe for Static","synthetic":true,"types":["syn::token::Static"]},{"text":"impl !RefUnwindSafe for Struct","synthetic":true,"types":["syn::token::Struct"]},{"text":"impl !RefUnwindSafe for Super","synthetic":true,"types":["syn::token::Super"]},{"text":"impl !RefUnwindSafe for Trait","synthetic":true,"types":["syn::token::Trait"]},{"text":"impl !RefUnwindSafe for Try","synthetic":true,"types":["syn::token::Try"]},{"text":"impl !RefUnwindSafe for Type","synthetic":true,"types":["syn::token::Type"]},{"text":"impl !RefUnwindSafe for Typeof","synthetic":true,"types":["syn::token::Typeof"]},{"text":"impl !RefUnwindSafe for Union","synthetic":true,"types":["syn::token::Union"]},{"text":"impl !RefUnwindSafe for Unsafe","synthetic":true,"types":["syn::token::Unsafe"]},{"text":"impl !RefUnwindSafe for Unsized","synthetic":true,"types":["syn::token::Unsized"]},{"text":"impl !RefUnwindSafe for Use","synthetic":true,"types":["syn::token::Use"]},{"text":"impl !RefUnwindSafe for Virtual","synthetic":true,"types":["syn::token::Virtual"]},{"text":"impl !RefUnwindSafe for Where","synthetic":true,"types":["syn::token::Where"]},{"text":"impl !RefUnwindSafe for While","synthetic":true,"types":["syn::token::While"]},{"text":"impl !RefUnwindSafe for Yield","synthetic":true,"types":["syn::token::Yield"]},{"text":"impl !RefUnwindSafe for Add","synthetic":true,"types":["syn::token::Add"]},{"text":"impl !RefUnwindSafe for AddEq","synthetic":true,"types":["syn::token::AddEq"]},{"text":"impl !RefUnwindSafe for And","synthetic":true,"types":["syn::token::And"]},{"text":"impl !RefUnwindSafe for AndAnd","synthetic":true,"types":["syn::token::AndAnd"]},{"text":"impl !RefUnwindSafe for AndEq","synthetic":true,"types":["syn::token::AndEq"]},{"text":"impl !RefUnwindSafe for At","synthetic":true,"types":["syn::token::At"]},{"text":"impl !RefUnwindSafe for Bang","synthetic":true,"types":["syn::token::Bang"]},{"text":"impl !RefUnwindSafe for Caret","synthetic":true,"types":["syn::token::Caret"]},{"text":"impl !RefUnwindSafe for CaretEq","synthetic":true,"types":["syn::token::CaretEq"]},{"text":"impl !RefUnwindSafe for Colon","synthetic":true,"types":["syn::token::Colon"]},{"text":"impl !RefUnwindSafe for Colon2","synthetic":true,"types":["syn::token::Colon2"]},{"text":"impl !RefUnwindSafe for Comma","synthetic":true,"types":["syn::token::Comma"]},{"text":"impl !RefUnwindSafe for Div","synthetic":true,"types":["syn::token::Div"]},{"text":"impl !RefUnwindSafe for DivEq","synthetic":true,"types":["syn::token::DivEq"]},{"text":"impl !RefUnwindSafe for Dollar","synthetic":true,"types":["syn::token::Dollar"]},{"text":"impl !RefUnwindSafe for Dot","synthetic":true,"types":["syn::token::Dot"]},{"text":"impl !RefUnwindSafe for Dot2","synthetic":true,"types":["syn::token::Dot2"]},{"text":"impl !RefUnwindSafe for Dot3","synthetic":true,"types":["syn::token::Dot3"]},{"text":"impl !RefUnwindSafe for DotDotEq","synthetic":true,"types":["syn::token::DotDotEq"]},{"text":"impl !RefUnwindSafe for Eq","synthetic":true,"types":["syn::token::Eq"]},{"text":"impl !RefUnwindSafe for EqEq","synthetic":true,"types":["syn::token::EqEq"]},{"text":"impl !RefUnwindSafe for Ge","synthetic":true,"types":["syn::token::Ge"]},{"text":"impl !RefUnwindSafe for Gt","synthetic":true,"types":["syn::token::Gt"]},{"text":"impl !RefUnwindSafe for Le","synthetic":true,"types":["syn::token::Le"]},{"text":"impl !RefUnwindSafe for Lt","synthetic":true,"types":["syn::token::Lt"]},{"text":"impl !RefUnwindSafe for MulEq","synthetic":true,"types":["syn::token::MulEq"]},{"text":"impl !RefUnwindSafe for Ne","synthetic":true,"types":["syn::token::Ne"]},{"text":"impl !RefUnwindSafe for Or","synthetic":true,"types":["syn::token::Or"]},{"text":"impl !RefUnwindSafe for OrEq","synthetic":true,"types":["syn::token::OrEq"]},{"text":"impl !RefUnwindSafe for OrOr","synthetic":true,"types":["syn::token::OrOr"]},{"text":"impl !RefUnwindSafe for Pound","synthetic":true,"types":["syn::token::Pound"]},{"text":"impl !RefUnwindSafe for Question","synthetic":true,"types":["syn::token::Question"]},{"text":"impl !RefUnwindSafe for RArrow","synthetic":true,"types":["syn::token::RArrow"]},{"text":"impl !RefUnwindSafe for LArrow","synthetic":true,"types":["syn::token::LArrow"]},{"text":"impl !RefUnwindSafe for Rem","synthetic":true,"types":["syn::token::Rem"]},{"text":"impl !RefUnwindSafe for RemEq","synthetic":true,"types":["syn::token::RemEq"]},{"text":"impl !RefUnwindSafe for FatArrow","synthetic":true,"types":["syn::token::FatArrow"]},{"text":"impl !RefUnwindSafe for Semi","synthetic":true,"types":["syn::token::Semi"]},{"text":"impl !RefUnwindSafe for Shl","synthetic":true,"types":["syn::token::Shl"]},{"text":"impl !RefUnwindSafe for ShlEq","synthetic":true,"types":["syn::token::ShlEq"]},{"text":"impl !RefUnwindSafe for Shr","synthetic":true,"types":["syn::token::Shr"]},{"text":"impl !RefUnwindSafe for ShrEq","synthetic":true,"types":["syn::token::ShrEq"]},{"text":"impl !RefUnwindSafe for Star","synthetic":true,"types":["syn::token::Star"]},{"text":"impl !RefUnwindSafe for Sub","synthetic":true,"types":["syn::token::Sub"]},{"text":"impl !RefUnwindSafe for SubEq","synthetic":true,"types":["syn::token::SubEq"]},{"text":"impl !RefUnwindSafe for Tilde","synthetic":true,"types":["syn::token::Tilde"]},{"text":"impl !RefUnwindSafe for Brace","synthetic":true,"types":["syn::token::Brace"]},{"text":"impl !RefUnwindSafe for Bracket","synthetic":true,"types":["syn::token::Bracket"]},{"text":"impl !RefUnwindSafe for Paren","synthetic":true,"types":["syn::token::Paren"]},{"text":"impl !RefUnwindSafe for Group","synthetic":true,"types":["syn::token::Group"]},{"text":"impl !RefUnwindSafe for TokenBuffer","synthetic":true,"types":["syn::buffer::TokenBuffer"]},{"text":"impl<'a> !RefUnwindSafe for Cursor<'a>","synthetic":true,"types":["syn::buffer::Cursor"]},{"text":"impl<T, P> RefUnwindSafe for Punctuated<T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe
","synthetic":true,"types":["syn::punctuated::Punctuated"]},{"text":"impl<'a, T, P> RefUnwindSafe for Pairs<'a, T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe
","synthetic":true,"types":["syn::punctuated::Pairs"]},{"text":"impl<'a, T, P> RefUnwindSafe for PairsMut<'a, T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe
","synthetic":true,"types":["syn::punctuated::PairsMut"]},{"text":"impl<T, P> RefUnwindSafe for IntoPairs<T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe
","synthetic":true,"types":["syn::punctuated::IntoPairs"]},{"text":"impl<T> RefUnwindSafe for IntoIter<T> where
    T: RefUnwindSafe
","synthetic":true,"types":["syn::punctuated::IntoIter"]},{"text":"impl<'a, T> !RefUnwindSafe for Iter<'a, T>","synthetic":true,"types":["syn::punctuated::Iter"]},{"text":"impl<'a, T> !RefUnwindSafe for IterMut<'a, T>","synthetic":true,"types":["syn::punctuated::IterMut"]},{"text":"impl<T, P> RefUnwindSafe for Pair<T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe
","synthetic":true,"types":["syn::punctuated::Pair"]},{"text":"impl<'a> !RefUnwindSafe for Lookahead1<'a>","synthetic":true,"types":["syn::lookahead::Lookahead1"]},{"text":"impl<'a> !RefUnwindSafe for ParseBuffer<'a>","synthetic":true,"types":["syn::parse::ParseBuffer"]},{"text":"impl<'c, 'a> !RefUnwindSafe for StepCursor<'c, 'a>","synthetic":true,"types":["syn::parse::StepCursor"]},{"text":"impl RefUnwindSafe for Nothing","synthetic":true,"types":["syn::parse::Nothing"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/std/panic/trait.UnwindSafe.js b/implementors/std/panic/trait.UnwindSafe.js new file mode 100644 index 0000000..f0ded4b --- /dev/null +++ b/implementors/std/panic/trait.UnwindSafe.js @@ -0,0 +1,8 @@ +(function() {var implementors = {}; +implementors["bincode"] = [{"text":"impl UnwindSafe for Config","synthetic":true,"types":["bincode::config::Config"]},{"text":"impl !UnwindSafe for ErrorKind","synthetic":true,"types":["bincode::error::ErrorKind"]}]; +implementors["byteorder"] = [{"text":"impl UnwindSafe for BigEndian","synthetic":true,"types":["byteorder::BigEndian"]},{"text":"impl UnwindSafe for LittleEndian","synthetic":true,"types":["byteorder::LittleEndian"]}]; +implementors["ironsea_index_sfc_dbc"] = [{"text":"impl<F, K, V> UnwindSafe for SpaceFillingCurve<F, K, V> where
    F: UnwindSafe,
    K: UnwindSafe,
    V: UnwindSafe
","synthetic":true,"types":["ironsea_index_sfc_dbc::sfc::SpaceFillingCurve"]}]; +implementors["proc_macro2"] = [{"text":"impl UnwindSafe for TokenStream","synthetic":true,"types":["proc_macro2::TokenStream"]},{"text":"impl UnwindSafe for LexError","synthetic":true,"types":["proc_macro2::LexError"]},{"text":"impl UnwindSafe for Span","synthetic":true,"types":["proc_macro2::Span"]},{"text":"impl UnwindSafe for Group","synthetic":true,"types":["proc_macro2::Group"]},{"text":"impl UnwindSafe for Punct","synthetic":true,"types":["proc_macro2::Punct"]},{"text":"impl UnwindSafe for Ident","synthetic":true,"types":["proc_macro2::Ident"]},{"text":"impl UnwindSafe for Literal","synthetic":true,"types":["proc_macro2::Literal"]},{"text":"impl UnwindSafe for TokenTree","synthetic":true,"types":["proc_macro2::TokenTree"]},{"text":"impl UnwindSafe for Delimiter","synthetic":true,"types":["proc_macro2::Delimiter"]},{"text":"impl UnwindSafe for Spacing","synthetic":true,"types":["proc_macro2::Spacing"]},{"text":"impl !UnwindSafe for IntoIter","synthetic":true,"types":["proc_macro2::token_stream::IntoIter"]}]; +implementors["serde"] = [{"text":"impl UnwindSafe for IgnoredAny","synthetic":true,"types":["serde::de::ignored_any::IgnoredAny"]},{"text":"impl<'a> UnwindSafe for Unexpected<'a>","synthetic":true,"types":["serde::de::Unexpected"]},{"text":"impl UnwindSafe for Error","synthetic":true,"types":["serde::de::value::Error"]},{"text":"impl<E> UnwindSafe for UnitDeserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::UnitDeserializer"]},{"text":"impl<E> UnwindSafe for BoolDeserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::BoolDeserializer"]},{"text":"impl<E> UnwindSafe for I8Deserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::I8Deserializer"]},{"text":"impl<E> UnwindSafe for I16Deserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::I16Deserializer"]},{"text":"impl<E> UnwindSafe for I32Deserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::I32Deserializer"]},{"text":"impl<E> UnwindSafe for I64Deserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::I64Deserializer"]},{"text":"impl<E> UnwindSafe for IsizeDeserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::IsizeDeserializer"]},{"text":"impl<E> UnwindSafe for U8Deserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::U8Deserializer"]},{"text":"impl<E> UnwindSafe for U16Deserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::U16Deserializer"]},{"text":"impl<E> UnwindSafe for U64Deserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::U64Deserializer"]},{"text":"impl<E> UnwindSafe for UsizeDeserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::UsizeDeserializer"]},{"text":"impl<E> UnwindSafe for F32Deserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::F32Deserializer"]},{"text":"impl<E> UnwindSafe for F64Deserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::F64Deserializer"]},{"text":"impl<E> UnwindSafe for CharDeserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::CharDeserializer"]},{"text":"impl<E> UnwindSafe for I128Deserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::I128Deserializer"]},{"text":"impl<E> UnwindSafe for U128Deserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::U128Deserializer"]},{"text":"impl<E> UnwindSafe for U32Deserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::U32Deserializer"]},{"text":"impl<'a, E> UnwindSafe for StrDeserializer<'a, E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::StrDeserializer"]},{"text":"impl<'de, E> UnwindSafe for BorrowedStrDeserializer<'de, E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::BorrowedStrDeserializer"]},{"text":"impl<E> UnwindSafe for StringDeserializer<E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::StringDeserializer"]},{"text":"impl<'a, E> UnwindSafe for CowStrDeserializer<'a, E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::CowStrDeserializer"]},{"text":"impl<'de, E> UnwindSafe for BorrowedBytesDeserializer<'de, E> where
    E: UnwindSafe
","synthetic":true,"types":["serde::de::value::BorrowedBytesDeserializer"]},{"text":"impl<I, E> UnwindSafe for SeqDeserializer<I, E> where
    E: UnwindSafe,
    I: UnwindSafe
","synthetic":true,"types":["serde::de::value::SeqDeserializer"]},{"text":"impl<A> UnwindSafe for SeqAccessDeserializer<A> where
    A: UnwindSafe
","synthetic":true,"types":["serde::de::value::SeqAccessDeserializer"]},{"text":"impl<'de, I, E> UnwindSafe for MapDeserializer<'de, I, E> where
    E: UnwindSafe,
    I: UnwindSafe,
    <<I as Iterator>::Item as Pair>::Second: UnwindSafe
","synthetic":true,"types":["serde::de::value::MapDeserializer"]},{"text":"impl<A> UnwindSafe for MapAccessDeserializer<A> where
    A: UnwindSafe
","synthetic":true,"types":["serde::de::value::MapAccessDeserializer"]},{"text":"impl<Ok, Error> UnwindSafe for Impossible<Ok, Error> where
    Error: UnwindSafe,
    Ok: UnwindSafe
","synthetic":true,"types":["serde::ser::impossible::Impossible"]}]; +implementors["syn"] = [{"text":"impl UnwindSafe for Attribute","synthetic":true,"types":["syn::attr::Attribute"]},{"text":"impl UnwindSafe for MetaList","synthetic":true,"types":["syn::attr::MetaList"]},{"text":"impl UnwindSafe for MetaNameValue","synthetic":true,"types":["syn::attr::MetaNameValue"]},{"text":"impl UnwindSafe for Field","synthetic":true,"types":["syn::data::Field"]},{"text":"impl UnwindSafe for FieldsNamed","synthetic":true,"types":["syn::data::FieldsNamed"]},{"text":"impl UnwindSafe for FieldsUnnamed","synthetic":true,"types":["syn::data::FieldsUnnamed"]},{"text":"impl UnwindSafe for Variant","synthetic":true,"types":["syn::data::Variant"]},{"text":"impl UnwindSafe for VisCrate","synthetic":true,"types":["syn::data::VisCrate"]},{"text":"impl UnwindSafe for VisPublic","synthetic":true,"types":["syn::data::VisPublic"]},{"text":"impl UnwindSafe for VisRestricted","synthetic":true,"types":["syn::data::VisRestricted"]},{"text":"impl UnwindSafe for ExprArray","synthetic":true,"types":["syn::expr::ExprArray"]},{"text":"impl UnwindSafe for ExprAssign","synthetic":true,"types":["syn::expr::ExprAssign"]},{"text":"impl UnwindSafe for ExprAssignOp","synthetic":true,"types":["syn::expr::ExprAssignOp"]},{"text":"impl UnwindSafe for ExprAsync","synthetic":true,"types":["syn::expr::ExprAsync"]},{"text":"impl UnwindSafe for ExprAwait","synthetic":true,"types":["syn::expr::ExprAwait"]},{"text":"impl UnwindSafe for ExprBinary","synthetic":true,"types":["syn::expr::ExprBinary"]},{"text":"impl UnwindSafe for ExprBlock","synthetic":true,"types":["syn::expr::ExprBlock"]},{"text":"impl UnwindSafe for ExprBox","synthetic":true,"types":["syn::expr::ExprBox"]},{"text":"impl UnwindSafe for ExprBreak","synthetic":true,"types":["syn::expr::ExprBreak"]},{"text":"impl UnwindSafe for ExprCall","synthetic":true,"types":["syn::expr::ExprCall"]},{"text":"impl UnwindSafe for ExprCast","synthetic":true,"types":["syn::expr::ExprCast"]},{"text":"impl UnwindSafe for ExprClosure","synthetic":true,"types":["syn::expr::ExprClosure"]},{"text":"impl UnwindSafe for ExprContinue","synthetic":true,"types":["syn::expr::ExprContinue"]},{"text":"impl UnwindSafe for ExprField","synthetic":true,"types":["syn::expr::ExprField"]},{"text":"impl UnwindSafe for ExprForLoop","synthetic":true,"types":["syn::expr::ExprForLoop"]},{"text":"impl UnwindSafe for ExprGroup","synthetic":true,"types":["syn::expr::ExprGroup"]},{"text":"impl UnwindSafe for ExprIf","synthetic":true,"types":["syn::expr::ExprIf"]},{"text":"impl UnwindSafe for ExprIndex","synthetic":true,"types":["syn::expr::ExprIndex"]},{"text":"impl UnwindSafe for ExprLet","synthetic":true,"types":["syn::expr::ExprLet"]},{"text":"impl UnwindSafe for ExprLit","synthetic":true,"types":["syn::expr::ExprLit"]},{"text":"impl UnwindSafe for ExprLoop","synthetic":true,"types":["syn::expr::ExprLoop"]},{"text":"impl UnwindSafe for ExprMacro","synthetic":true,"types":["syn::expr::ExprMacro"]},{"text":"impl UnwindSafe for ExprMatch","synthetic":true,"types":["syn::expr::ExprMatch"]},{"text":"impl UnwindSafe for ExprMethodCall","synthetic":true,"types":["syn::expr::ExprMethodCall"]},{"text":"impl UnwindSafe for ExprParen","synthetic":true,"types":["syn::expr::ExprParen"]},{"text":"impl UnwindSafe for ExprPath","synthetic":true,"types":["syn::expr::ExprPath"]},{"text":"impl UnwindSafe for ExprRange","synthetic":true,"types":["syn::expr::ExprRange"]},{"text":"impl UnwindSafe for ExprReference","synthetic":true,"types":["syn::expr::ExprReference"]},{"text":"impl UnwindSafe for ExprRepeat","synthetic":true,"types":["syn::expr::ExprRepeat"]},{"text":"impl UnwindSafe for ExprReturn","synthetic":true,"types":["syn::expr::ExprReturn"]},{"text":"impl UnwindSafe for ExprStruct","synthetic":true,"types":["syn::expr::ExprStruct"]},{"text":"impl UnwindSafe for ExprTry","synthetic":true,"types":["syn::expr::ExprTry"]},{"text":"impl UnwindSafe for ExprTryBlock","synthetic":true,"types":["syn::expr::ExprTryBlock"]},{"text":"impl UnwindSafe for ExprTuple","synthetic":true,"types":["syn::expr::ExprTuple"]},{"text":"impl UnwindSafe for ExprType","synthetic":true,"types":["syn::expr::ExprType"]},{"text":"impl UnwindSafe for ExprUnary","synthetic":true,"types":["syn::expr::ExprUnary"]},{"text":"impl UnwindSafe for ExprUnsafe","synthetic":true,"types":["syn::expr::ExprUnsafe"]},{"text":"impl UnwindSafe for ExprWhile","synthetic":true,"types":["syn::expr::ExprWhile"]},{"text":"impl UnwindSafe for ExprYield","synthetic":true,"types":["syn::expr::ExprYield"]},{"text":"impl UnwindSafe for Index","synthetic":true,"types":["syn::expr::Index"]},{"text":"impl UnwindSafe for BoundLifetimes","synthetic":true,"types":["syn::generics::BoundLifetimes"]},{"text":"impl UnwindSafe for ConstParam","synthetic":true,"types":["syn::generics::ConstParam"]},{"text":"impl UnwindSafe for Generics","synthetic":true,"types":["syn::generics::Generics"]},{"text":"impl UnwindSafe for LifetimeDef","synthetic":true,"types":["syn::generics::LifetimeDef"]},{"text":"impl UnwindSafe for PredicateEq","synthetic":true,"types":["syn::generics::PredicateEq"]},{"text":"impl UnwindSafe for PredicateLifetime","synthetic":true,"types":["syn::generics::PredicateLifetime"]},{"text":"impl UnwindSafe for PredicateType","synthetic":true,"types":["syn::generics::PredicateType"]},{"text":"impl UnwindSafe for TraitBound","synthetic":true,"types":["syn::generics::TraitBound"]},{"text":"impl UnwindSafe for TypeParam","synthetic":true,"types":["syn::generics::TypeParam"]},{"text":"impl UnwindSafe for WhereClause","synthetic":true,"types":["syn::generics::WhereClause"]},{"text":"impl<'a> !UnwindSafe for ImplGenerics<'a>","synthetic":true,"types":["syn::generics::ImplGenerics"]},{"text":"impl<'a> !UnwindSafe for Turbofish<'a>","synthetic":true,"types":["syn::generics::Turbofish"]},{"text":"impl<'a> !UnwindSafe for TypeGenerics<'a>","synthetic":true,"types":["syn::generics::TypeGenerics"]},{"text":"impl UnwindSafe for Lifetime","synthetic":true,"types":["syn::lifetime::Lifetime"]},{"text":"impl UnwindSafe for LitBool","synthetic":true,"types":["syn::lit::LitBool"]},{"text":"impl UnwindSafe for LitByte","synthetic":true,"types":["syn::lit::LitByte"]},{"text":"impl UnwindSafe for LitByteStr","synthetic":true,"types":["syn::lit::LitByteStr"]},{"text":"impl UnwindSafe for LitChar","synthetic":true,"types":["syn::lit::LitChar"]},{"text":"impl UnwindSafe for LitFloat","synthetic":true,"types":["syn::lit::LitFloat"]},{"text":"impl UnwindSafe for LitInt","synthetic":true,"types":["syn::lit::LitInt"]},{"text":"impl UnwindSafe for LitStr","synthetic":true,"types":["syn::lit::LitStr"]},{"text":"impl UnwindSafe for Macro","synthetic":true,"types":["syn::mac::Macro"]},{"text":"impl UnwindSafe for DataEnum","synthetic":true,"types":["syn::derive::DataEnum"]},{"text":"impl UnwindSafe for DataStruct","synthetic":true,"types":["syn::derive::DataStruct"]},{"text":"impl UnwindSafe for DataUnion","synthetic":true,"types":["syn::derive::DataUnion"]},{"text":"impl UnwindSafe for DeriveInput","synthetic":true,"types":["syn::derive::DeriveInput"]},{"text":"impl UnwindSafe for Abi","synthetic":true,"types":["syn::ty::Abi"]},{"text":"impl UnwindSafe for BareFnArg","synthetic":true,"types":["syn::ty::BareFnArg"]},{"text":"impl UnwindSafe for TypeArray","synthetic":true,"types":["syn::ty::TypeArray"]},{"text":"impl UnwindSafe for TypeBareFn","synthetic":true,"types":["syn::ty::TypeBareFn"]},{"text":"impl UnwindSafe for TypeGroup","synthetic":true,"types":["syn::ty::TypeGroup"]},{"text":"impl UnwindSafe for TypeImplTrait","synthetic":true,"types":["syn::ty::TypeImplTrait"]},{"text":"impl UnwindSafe for TypeInfer","synthetic":true,"types":["syn::ty::TypeInfer"]},{"text":"impl UnwindSafe for TypeMacro","synthetic":true,"types":["syn::ty::TypeMacro"]},{"text":"impl UnwindSafe for TypeNever","synthetic":true,"types":["syn::ty::TypeNever"]},{"text":"impl UnwindSafe for TypeParen","synthetic":true,"types":["syn::ty::TypeParen"]},{"text":"impl UnwindSafe for TypePath","synthetic":true,"types":["syn::ty::TypePath"]},{"text":"impl UnwindSafe for TypePtr","synthetic":true,"types":["syn::ty::TypePtr"]},{"text":"impl UnwindSafe for TypeReference","synthetic":true,"types":["syn::ty::TypeReference"]},{"text":"impl UnwindSafe for TypeSlice","synthetic":true,"types":["syn::ty::TypeSlice"]},{"text":"impl UnwindSafe for TypeTraitObject","synthetic":true,"types":["syn::ty::TypeTraitObject"]},{"text":"impl UnwindSafe for TypeTuple","synthetic":true,"types":["syn::ty::TypeTuple"]},{"text":"impl UnwindSafe for Variadic","synthetic":true,"types":["syn::ty::Variadic"]},{"text":"impl UnwindSafe for AngleBracketedGenericArguments","synthetic":true,"types":["syn::path::AngleBracketedGenericArguments"]},{"text":"impl UnwindSafe for Binding","synthetic":true,"types":["syn::path::Binding"]},{"text":"impl UnwindSafe for Constraint","synthetic":true,"types":["syn::path::Constraint"]},{"text":"impl UnwindSafe for ParenthesizedGenericArguments","synthetic":true,"types":["syn::path::ParenthesizedGenericArguments"]},{"text":"impl UnwindSafe for Path","synthetic":true,"types":["syn::path::Path"]},{"text":"impl UnwindSafe for PathSegment","synthetic":true,"types":["syn::path::PathSegment"]},{"text":"impl UnwindSafe for QSelf","synthetic":true,"types":["syn::path::QSelf"]},{"text":"impl UnwindSafe for Error","synthetic":true,"types":["syn::error::Error"]},{"text":"impl UnwindSafe for AttrStyle","synthetic":true,"types":["syn::attr::AttrStyle"]},{"text":"impl UnwindSafe for Meta","synthetic":true,"types":["syn::attr::Meta"]},{"text":"impl UnwindSafe for NestedMeta","synthetic":true,"types":["syn::attr::NestedMeta"]},{"text":"impl UnwindSafe for Fields","synthetic":true,"types":["syn::data::Fields"]},{"text":"impl UnwindSafe for Visibility","synthetic":true,"types":["syn::data::Visibility"]},{"text":"impl UnwindSafe for Expr","synthetic":true,"types":["syn::expr::Expr"]},{"text":"impl UnwindSafe for Member","synthetic":true,"types":["syn::expr::Member"]},{"text":"impl UnwindSafe for GenericParam","synthetic":true,"types":["syn::generics::GenericParam"]},{"text":"impl UnwindSafe for TraitBoundModifier","synthetic":true,"types":["syn::generics::TraitBoundModifier"]},{"text":"impl UnwindSafe for TypeParamBound","synthetic":true,"types":["syn::generics::TypeParamBound"]},{"text":"impl UnwindSafe for WherePredicate","synthetic":true,"types":["syn::generics::WherePredicate"]},{"text":"impl UnwindSafe for Lit","synthetic":true,"types":["syn::lit::Lit"]},{"text":"impl UnwindSafe for StrStyle","synthetic":true,"types":["syn::lit::StrStyle"]},{"text":"impl UnwindSafe for MacroDelimiter","synthetic":true,"types":["syn::mac::MacroDelimiter"]},{"text":"impl UnwindSafe for Data","synthetic":true,"types":["syn::derive::Data"]},{"text":"impl UnwindSafe for BinOp","synthetic":true,"types":["syn::op::BinOp"]},{"text":"impl UnwindSafe for UnOp","synthetic":true,"types":["syn::op::UnOp"]},{"text":"impl UnwindSafe for ReturnType","synthetic":true,"types":["syn::ty::ReturnType"]},{"text":"impl UnwindSafe for Type","synthetic":true,"types":["syn::ty::Type"]},{"text":"impl UnwindSafe for GenericArgument","synthetic":true,"types":["syn::path::GenericArgument"]},{"text":"impl UnwindSafe for PathArguments","synthetic":true,"types":["syn::path::PathArguments"]},{"text":"impl UnwindSafe for Underscore","synthetic":true,"types":["syn::token::Underscore"]},{"text":"impl UnwindSafe for Abstract","synthetic":true,"types":["syn::token::Abstract"]},{"text":"impl UnwindSafe for As","synthetic":true,"types":["syn::token::As"]},{"text":"impl UnwindSafe for Async","synthetic":true,"types":["syn::token::Async"]},{"text":"impl UnwindSafe for Auto","synthetic":true,"types":["syn::token::Auto"]},{"text":"impl UnwindSafe for Await","synthetic":true,"types":["syn::token::Await"]},{"text":"impl UnwindSafe for Become","synthetic":true,"types":["syn::token::Become"]},{"text":"impl UnwindSafe for Box","synthetic":true,"types":["syn::token::Box"]},{"text":"impl UnwindSafe for Break","synthetic":true,"types":["syn::token::Break"]},{"text":"impl UnwindSafe for Const","synthetic":true,"types":["syn::token::Const"]},{"text":"impl UnwindSafe for Continue","synthetic":true,"types":["syn::token::Continue"]},{"text":"impl UnwindSafe for Crate","synthetic":true,"types":["syn::token::Crate"]},{"text":"impl UnwindSafe for Default","synthetic":true,"types":["syn::token::Default"]},{"text":"impl UnwindSafe for Do","synthetic":true,"types":["syn::token::Do"]},{"text":"impl UnwindSafe for Dyn","synthetic":true,"types":["syn::token::Dyn"]},{"text":"impl UnwindSafe for Else","synthetic":true,"types":["syn::token::Else"]},{"text":"impl UnwindSafe for Enum","synthetic":true,"types":["syn::token::Enum"]},{"text":"impl UnwindSafe for Extern","synthetic":true,"types":["syn::token::Extern"]},{"text":"impl UnwindSafe for Final","synthetic":true,"types":["syn::token::Final"]},{"text":"impl UnwindSafe for Fn","synthetic":true,"types":["syn::token::Fn"]},{"text":"impl UnwindSafe for For","synthetic":true,"types":["syn::token::For"]},{"text":"impl UnwindSafe for If","synthetic":true,"types":["syn::token::If"]},{"text":"impl UnwindSafe for Impl","synthetic":true,"types":["syn::token::Impl"]},{"text":"impl UnwindSafe for In","synthetic":true,"types":["syn::token::In"]},{"text":"impl UnwindSafe for Let","synthetic":true,"types":["syn::token::Let"]},{"text":"impl UnwindSafe for Loop","synthetic":true,"types":["syn::token::Loop"]},{"text":"impl UnwindSafe for Macro","synthetic":true,"types":["syn::token::Macro"]},{"text":"impl UnwindSafe for Match","synthetic":true,"types":["syn::token::Match"]},{"text":"impl UnwindSafe for Mod","synthetic":true,"types":["syn::token::Mod"]},{"text":"impl UnwindSafe for Move","synthetic":true,"types":["syn::token::Move"]},{"text":"impl UnwindSafe for Mut","synthetic":true,"types":["syn::token::Mut"]},{"text":"impl UnwindSafe for Override","synthetic":true,"types":["syn::token::Override"]},{"text":"impl UnwindSafe for Priv","synthetic":true,"types":["syn::token::Priv"]},{"text":"impl UnwindSafe for Pub","synthetic":true,"types":["syn::token::Pub"]},{"text":"impl UnwindSafe for Ref","synthetic":true,"types":["syn::token::Ref"]},{"text":"impl UnwindSafe for Return","synthetic":true,"types":["syn::token::Return"]},{"text":"impl UnwindSafe for SelfType","synthetic":true,"types":["syn::token::SelfType"]},{"text":"impl UnwindSafe for SelfValue","synthetic":true,"types":["syn::token::SelfValue"]},{"text":"impl UnwindSafe for Static","synthetic":true,"types":["syn::token::Static"]},{"text":"impl UnwindSafe for Struct","synthetic":true,"types":["syn::token::Struct"]},{"text":"impl UnwindSafe for Super","synthetic":true,"types":["syn::token::Super"]},{"text":"impl UnwindSafe for Trait","synthetic":true,"types":["syn::token::Trait"]},{"text":"impl UnwindSafe for Try","synthetic":true,"types":["syn::token::Try"]},{"text":"impl UnwindSafe for Type","synthetic":true,"types":["syn::token::Type"]},{"text":"impl UnwindSafe for Typeof","synthetic":true,"types":["syn::token::Typeof"]},{"text":"impl UnwindSafe for Union","synthetic":true,"types":["syn::token::Union"]},{"text":"impl UnwindSafe for Unsafe","synthetic":true,"types":["syn::token::Unsafe"]},{"text":"impl UnwindSafe for Unsized","synthetic":true,"types":["syn::token::Unsized"]},{"text":"impl UnwindSafe for Use","synthetic":true,"types":["syn::token::Use"]},{"text":"impl UnwindSafe for Virtual","synthetic":true,"types":["syn::token::Virtual"]},{"text":"impl UnwindSafe for Where","synthetic":true,"types":["syn::token::Where"]},{"text":"impl UnwindSafe for While","synthetic":true,"types":["syn::token::While"]},{"text":"impl UnwindSafe for Yield","synthetic":true,"types":["syn::token::Yield"]},{"text":"impl UnwindSafe for Add","synthetic":true,"types":["syn::token::Add"]},{"text":"impl UnwindSafe for AddEq","synthetic":true,"types":["syn::token::AddEq"]},{"text":"impl UnwindSafe for And","synthetic":true,"types":["syn::token::And"]},{"text":"impl UnwindSafe for AndAnd","synthetic":true,"types":["syn::token::AndAnd"]},{"text":"impl UnwindSafe for AndEq","synthetic":true,"types":["syn::token::AndEq"]},{"text":"impl UnwindSafe for At","synthetic":true,"types":["syn::token::At"]},{"text":"impl UnwindSafe for Bang","synthetic":true,"types":["syn::token::Bang"]},{"text":"impl UnwindSafe for Caret","synthetic":true,"types":["syn::token::Caret"]},{"text":"impl UnwindSafe for CaretEq","synthetic":true,"types":["syn::token::CaretEq"]},{"text":"impl UnwindSafe for Colon","synthetic":true,"types":["syn::token::Colon"]},{"text":"impl UnwindSafe for Colon2","synthetic":true,"types":["syn::token::Colon2"]},{"text":"impl UnwindSafe for Comma","synthetic":true,"types":["syn::token::Comma"]},{"text":"impl UnwindSafe for Div","synthetic":true,"types":["syn::token::Div"]},{"text":"impl UnwindSafe for DivEq","synthetic":true,"types":["syn::token::DivEq"]},{"text":"impl UnwindSafe for Dollar","synthetic":true,"types":["syn::token::Dollar"]},{"text":"impl UnwindSafe for Dot","synthetic":true,"types":["syn::token::Dot"]},{"text":"impl UnwindSafe for Dot2","synthetic":true,"types":["syn::token::Dot2"]},{"text":"impl UnwindSafe for Dot3","synthetic":true,"types":["syn::token::Dot3"]},{"text":"impl UnwindSafe for DotDotEq","synthetic":true,"types":["syn::token::DotDotEq"]},{"text":"impl UnwindSafe for Eq","synthetic":true,"types":["syn::token::Eq"]},{"text":"impl UnwindSafe for EqEq","synthetic":true,"types":["syn::token::EqEq"]},{"text":"impl UnwindSafe for Ge","synthetic":true,"types":["syn::token::Ge"]},{"text":"impl UnwindSafe for Gt","synthetic":true,"types":["syn::token::Gt"]},{"text":"impl UnwindSafe for Le","synthetic":true,"types":["syn::token::Le"]},{"text":"impl UnwindSafe for Lt","synthetic":true,"types":["syn::token::Lt"]},{"text":"impl UnwindSafe for MulEq","synthetic":true,"types":["syn::token::MulEq"]},{"text":"impl UnwindSafe for Ne","synthetic":true,"types":["syn::token::Ne"]},{"text":"impl UnwindSafe for Or","synthetic":true,"types":["syn::token::Or"]},{"text":"impl UnwindSafe for OrEq","synthetic":true,"types":["syn::token::OrEq"]},{"text":"impl UnwindSafe for OrOr","synthetic":true,"types":["syn::token::OrOr"]},{"text":"impl UnwindSafe for Pound","synthetic":true,"types":["syn::token::Pound"]},{"text":"impl UnwindSafe for Question","synthetic":true,"types":["syn::token::Question"]},{"text":"impl UnwindSafe for RArrow","synthetic":true,"types":["syn::token::RArrow"]},{"text":"impl UnwindSafe for LArrow","synthetic":true,"types":["syn::token::LArrow"]},{"text":"impl UnwindSafe for Rem","synthetic":true,"types":["syn::token::Rem"]},{"text":"impl UnwindSafe for RemEq","synthetic":true,"types":["syn::token::RemEq"]},{"text":"impl UnwindSafe for FatArrow","synthetic":true,"types":["syn::token::FatArrow"]},{"text":"impl UnwindSafe for Semi","synthetic":true,"types":["syn::token::Semi"]},{"text":"impl UnwindSafe for Shl","synthetic":true,"types":["syn::token::Shl"]},{"text":"impl UnwindSafe for ShlEq","synthetic":true,"types":["syn::token::ShlEq"]},{"text":"impl UnwindSafe for Shr","synthetic":true,"types":["syn::token::Shr"]},{"text":"impl UnwindSafe for ShrEq","synthetic":true,"types":["syn::token::ShrEq"]},{"text":"impl UnwindSafe for Star","synthetic":true,"types":["syn::token::Star"]},{"text":"impl UnwindSafe for Sub","synthetic":true,"types":["syn::token::Sub"]},{"text":"impl UnwindSafe for SubEq","synthetic":true,"types":["syn::token::SubEq"]},{"text":"impl UnwindSafe for Tilde","synthetic":true,"types":["syn::token::Tilde"]},{"text":"impl UnwindSafe for Brace","synthetic":true,"types":["syn::token::Brace"]},{"text":"impl UnwindSafe for Bracket","synthetic":true,"types":["syn::token::Bracket"]},{"text":"impl UnwindSafe for Paren","synthetic":true,"types":["syn::token::Paren"]},{"text":"impl UnwindSafe for Group","synthetic":true,"types":["syn::token::Group"]},{"text":"impl !UnwindSafe for TokenBuffer","synthetic":true,"types":["syn::buffer::TokenBuffer"]},{"text":"impl<'a> !UnwindSafe for Cursor<'a>","synthetic":true,"types":["syn::buffer::Cursor"]},{"text":"impl<T, P> UnwindSafe for Punctuated<T, P> where
    P: UnwindSafe,
    T: UnwindSafe
","synthetic":true,"types":["syn::punctuated::Punctuated"]},{"text":"impl<'a, T, P> UnwindSafe for Pairs<'a, T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe
","synthetic":true,"types":["syn::punctuated::Pairs"]},{"text":"impl<'a, T, P> !UnwindSafe for PairsMut<'a, T, P>","synthetic":true,"types":["syn::punctuated::PairsMut"]},{"text":"impl<T, P> UnwindSafe for IntoPairs<T, P> where
    P: RefUnwindSafe + UnwindSafe,
    T: RefUnwindSafe + UnwindSafe
","synthetic":true,"types":["syn::punctuated::IntoPairs"]},{"text":"impl<T> UnwindSafe for IntoIter<T> where
    T: RefUnwindSafe + UnwindSafe
","synthetic":true,"types":["syn::punctuated::IntoIter"]},{"text":"impl<'a, T> !UnwindSafe for Iter<'a, T>","synthetic":true,"types":["syn::punctuated::Iter"]},{"text":"impl<'a, T> !UnwindSafe for IterMut<'a, T>","synthetic":true,"types":["syn::punctuated::IterMut"]},{"text":"impl<T, P> UnwindSafe for Pair<T, P> where
    P: UnwindSafe,
    T: UnwindSafe
","synthetic":true,"types":["syn::punctuated::Pair"]},{"text":"impl<'a> !UnwindSafe for Lookahead1<'a>","synthetic":true,"types":["syn::lookahead::Lookahead1"]},{"text":"impl<'a> !UnwindSafe for ParseBuffer<'a>","synthetic":true,"types":["syn::parse::ParseBuffer"]},{"text":"impl<'c, 'a> !UnwindSafe for StepCursor<'c, 'a>","synthetic":true,"types":["syn::parse::StepCursor"]},{"text":"impl UnwindSafe for Nothing","synthetic":true,"types":["syn::parse::Nothing"]}]; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/syn/ext/trait.IdentExt.js b/implementors/syn/ext/trait.IdentExt.js new file mode 100644 index 0000000..65fd345 --- /dev/null +++ b/implementors/syn/ext/trait.IdentExt.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/syn/parse/discouraged/trait.Speculative.js b/implementors/syn/parse/discouraged/trait.Speculative.js new file mode 100644 index 0000000..65fd345 --- /dev/null +++ b/implementors/syn/parse/discouraged/trait.Speculative.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/syn/parse/trait.Parse.js b/implementors/syn/parse/trait.Parse.js new file mode 100644 index 0000000..65fd345 --- /dev/null +++ b/implementors/syn/parse/trait.Parse.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/syn/parse/trait.Parser.js b/implementors/syn/parse/trait.Parser.js new file mode 100644 index 0000000..65fd345 --- /dev/null +++ b/implementors/syn/parse/trait.Parser.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/syn/parse/trait.Peek.js b/implementors/syn/parse/trait.Peek.js new file mode 100644 index 0000000..65fd345 --- /dev/null +++ b/implementors/syn/parse/trait.Peek.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/syn/spanned/trait.Spanned.js b/implementors/syn/spanned/trait.Spanned.js new file mode 100644 index 0000000..65fd345 --- /dev/null +++ b/implementors/syn/spanned/trait.Spanned.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/syn/token/trait.Token.js b/implementors/syn/token/trait.Token.js new file mode 100644 index 0000000..65fd345 --- /dev/null +++ b/implementors/syn/token/trait.Token.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["syn"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/unicode_xid/trait.UnicodeXID.js b/implementors/unicode_xid/trait.UnicodeXID.js new file mode 100644 index 0000000..bde1c01 --- /dev/null +++ b/implementors/unicode_xid/trait.UnicodeXID.js @@ -0,0 +1,3 @@ +(function() {var implementors = {}; +implementors["unicode_xid"] = []; +if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..8423503 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ + diff --git a/ironsea_index/all.html b/ironsea_index/all.html new file mode 100644 index 0000000..66dae55 --- /dev/null +++ b/ironsea_index/all.html @@ -0,0 +1,3 @@ +List of all items in this crate

[] + + List of all items

Traits

\ No newline at end of file diff --git a/ironsea_index/index.html b/ironsea_index/index.html new file mode 100644 index 0000000..2594d2a --- /dev/null +++ b/ironsea_index/index.html @@ -0,0 +1,18 @@ +ironsea_index - Rust

[][src]Crate ironsea_index

Iron Sea - Index

+

This repository contains the traits definitions for the Iron Sea +database toolkit indices.

+

Iron Sea: Database Toolkit

+

Iron Sea provides a set of database engine bricks, which can be +combined and applied on arbitrary data structures.

+

Unlike a traditional database, it does not assume a specific +physical structure for the tables nor the records, but relies on the +developer to provide a set of extractor functions which are used by +the specific indices provided.

+

This enables the index implementations to be agnostic from the +underlying data structure, and re-used.

+

Traits

+
Indexed

Methods provided by indices.

+
IndexedDestructured

Methods provided by destructuring indices.

+
Record

Record behavior used by Indexed implementations.

+
RecordFields

Record behavior used by IndexedDestructured implementations.

+
\ No newline at end of file diff --git a/ironsea_index/sidebar-items.js b/ironsea_index/sidebar-items.js new file mode 100644 index 0000000..7a40739 --- /dev/null +++ b/ironsea_index/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"trait":[["Indexed","Methods provided by indices."],["IndexedDestructured","Methods provided by destructuring indices."],["Record","Record behavior used by Indexed implementations."],["RecordFields","Record behavior used by IndexedDestructured implementations."]]}); \ No newline at end of file diff --git a/ironsea_index/trait.Indexed.html b/ironsea_index/trait.Indexed.html new file mode 100644 index 0000000..2a5b710 --- /dev/null +++ b/ironsea_index/trait.Indexed.html @@ -0,0 +1,20 @@ +ironsea_index::Indexed - Rust

[][src]Trait ironsea_index::Indexed

pub trait Indexed<R, K> {
+    fn find(&self, key: &K) -> Vec<&R>;
+
fn find_range(&self, start: &K, end: &K) -> Vec<&R>; +}

Methods provided by indices.

+

This kind of indices can work on references to the original vector +or take ownership of the records, based on the type given for the +records.

+
    +
  • R: Type of the records
  • +
  • K: Type of the keys
  • +
+
+

Required methods

fn find(&self, key: &K) -> Vec<&R>

Retrieve all records matching the key.

+

fn find_range(&self, start: &K, end: &K) -> Vec<&R>

Retrieve all records matching in the key range defined by +start and end.

+
    +
  • start is included
  • +
+
Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/ironsea_index/trait.IndexedDestructured.html b/ironsea_index/trait.IndexedDestructured.html new file mode 100644 index 0000000..f18518f --- /dev/null +++ b/ironsea_index/trait.IndexedDestructured.html @@ -0,0 +1,19 @@ +ironsea_index::IndexedDestructured - Rust

[][src]Trait ironsea_index::IndexedDestructured

pub trait IndexedDestructured<F, K> {
+    fn find(&self, key: &K) -> Vec<&F>;
+
fn find_range(&self, start: &K, end: &K) -> Vec<(K, &F)>; +}

Methods provided by destructuring indices.

+

This kind of indices store inside the index both keys and values, +meaning the original records can be freed.

+
    +
  • F: Type of the struct containing the remaining fields
  • +
  • K: Type of the keys
  • +
+
+

Required methods

fn find(&self, key: &K) -> Vec<&F>

Retrieve all records matching the key.

+

fn find_range(&self, start: &K, end: &K) -> Vec<(K, &F)>

Retrieve all records matching in the key range defined by +start and end.

+
    +
  • start is included
  • +
+
Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/ironsea_index/trait.Record.html b/ironsea_index/trait.Record.html new file mode 100644 index 0000000..bb97bc1 --- /dev/null +++ b/ironsea_index/trait.Record.html @@ -0,0 +1,53 @@ +ironsea_index::Record - Rust

[][src]Trait ironsea_index::Record

pub trait Record<K> {
+    fn key(&self) -> K;
+}

Record behavior used by Indexed implementations.

+

This trait provides common methods used by index implementations to +retrieve information about a single record. This is provided by the +users of indices, for each of their struct they wish to index.

+

Multiple implementation can be provided, as long as their types are +different.

+

Examples

+
+use ironsea_index::Record;
+
+#[derive(Clone, Debug)]
+pub struct MyPair {
+    a: i64,
+    b: i64,
+}
+
+impl Record<String> for MyPair {
+   fn key(&self) -> String {
+       format!("{}", self.a)
+   }
+}
+
+impl Record<i64> for MyPair {
+   fn key(&self) -> i64 {
+       self.a
+   }
+}
+
+fn main() {
+
+   let table = vec![MyPair{ a: 10, b:34}, MyPair{ a: 1, b:56}, MyPair{ a: 2, b:23}];
+
+   // Example without using an actual index crate, we will simply use
+   // the Record<K> trait to sort the array of pairs.
+   let mut lex_sort = table.clone();
+   lex_sort.sort_unstable_by_key(|e| {let k: String = e.key(); k});
+
+   let mut num_sort = table.clone();
+   num_sort.sort_unstable_by_key(|e| {let k: i64 = e.key(); k});
+
+   assert_eq!(format!("unsorted {:?}", table),
+        "unsorted [MyPair { a: 10, b: 34 }, MyPair { a: 1, b: 56 }, MyPair { a: 2, b: 23 }]");
+   assert_eq!(format!("lex sort {:?}", lex_sort),
+        "lex sort [MyPair { a: 1, b: 56 }, MyPair { a: 10, b: 34 }, MyPair { a: 2, b: 23 }]");
+   assert_eq!(format!("num sort {:?}", num_sort),
+        "num sort [MyPair { a: 1, b: 56 }, MyPair { a: 2, b: 23 }, MyPair { a: 10, b: 34 }]");
+}
+
+

Required methods

fn key(&self) -> K

Extract the key from the record.

+
Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/ironsea_index/trait.RecordFields.html b/ironsea_index/trait.RecordFields.html new file mode 100644 index 0000000..25c5770 --- /dev/null +++ b/ironsea_index/trait.RecordFields.html @@ -0,0 +1,11 @@ +ironsea_index::RecordFields - Rust

[][src]Trait ironsea_index::RecordFields

pub trait RecordFields<F> {
+    fn fields(&self) -> F;
+}

Record behavior used by IndexedDestructured implementations.

+

RecordFields is used by indices which de-structure records into two +components, the key and the fields associated to that unique key. +This is provided by the users of indices, for each of their struct +they wish to index.

+
+

Required methods

fn fields(&self) -> F

Extract the fields of the record

+
Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/ironsea_index_sfc_dbc/all.html b/ironsea_index_sfc_dbc/all.html new file mode 100644 index 0000000..2e29694 --- /dev/null +++ b/ironsea_index_sfc_dbc/all.html @@ -0,0 +1,3 @@ +List of all items in this crate

[] + + List of all items

Structs

Traits

\ No newline at end of file diff --git a/ironsea_index_sfc_dbc/index.html b/ironsea_index_sfc_dbc/index.html new file mode 100644 index 0000000..0fe6b7c --- /dev/null +++ b/ironsea_index_sfc_dbc/index.html @@ -0,0 +1,21 @@ +ironsea_index_sfc_dbc - Rust

[][src]Crate ironsea_index_sfc_dbc

Iron Sea - Index SFC DBC

+

Index for the Iron Sea toolkit, based on a Space Filling Curve (SFC), +over Dictionary-Based Compression (DBC), which offers great +performances for both range queries over point cloud data and at the +same time uses a storage-efficient index.

+

More details in the paper.

+

Iron Sea: Database Toolkit

+

Iron Sea provides a set of database engine bricks, which can be +combined and applied on arbitrary data structures.

+

Unlike a traditional database, it does not assume a specific +physical structure for the tables nor the records, but relies on the +developer to provide a set of extractor functions which are used by +the specific indices provided.

+

This enables the index implementations to be agnostic from the +underlying data structure, and re-used.

+

Structs

+
IndexOwned

Space Filling Curve-based index.

+

Traits

+
Record

Record behavior used by Indexed implementations.

+
RecordFields

Record behavior used by IndexedDestructured implementations.

+
\ No newline at end of file diff --git a/ironsea_index_sfc_dbc/sfc/struct.SpaceFillingCurve.html b/ironsea_index_sfc_dbc/sfc/struct.SpaceFillingCurve.html new file mode 100644 index 0000000..4a7aa95 --- /dev/null +++ b/ironsea_index_sfc_dbc/sfc/struct.SpaceFillingCurve.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../ironsea_index_sfc_dbc/struct.IndexOwned.html...

+ + + \ No newline at end of file diff --git a/ironsea_index_sfc_dbc/sfc/trait.Record.html b/ironsea_index_sfc_dbc/sfc/trait.Record.html new file mode 100644 index 0000000..71da8dd --- /dev/null +++ b/ironsea_index_sfc_dbc/sfc/trait.Record.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../ironsea_index_sfc_dbc/trait.Record.html...

+ + + \ No newline at end of file diff --git a/ironsea_index_sfc_dbc/sfc/trait.RecordFields.html b/ironsea_index_sfc_dbc/sfc/trait.RecordFields.html new file mode 100644 index 0000000..dccebaa --- /dev/null +++ b/ironsea_index_sfc_dbc/sfc/trait.RecordFields.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../ironsea_index_sfc_dbc/trait.RecordFields.html...

+ + + \ No newline at end of file diff --git a/ironsea_index_sfc_dbc/sidebar-items.js b/ironsea_index_sfc_dbc/sidebar-items.js new file mode 100644 index 0000000..5634576 --- /dev/null +++ b/ironsea_index_sfc_dbc/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["IndexOwned","Space Filling Curve-based index."]],"trait":[["Record","Record behavior used by Indexed implementations."],["RecordFields","Record behavior used by IndexedDestructured implementations."]]}); \ No newline at end of file diff --git a/ironsea_index_sfc_dbc/struct.IndexOwned.html b/ironsea_index_sfc_dbc/struct.IndexOwned.html new file mode 100644 index 0000000..f9ca91e --- /dev/null +++ b/ironsea_index_sfc_dbc/struct.IndexOwned.html @@ -0,0 +1,34 @@ +ironsea_index_sfc_dbc::IndexOwned - Rust

[][src]Struct ironsea_index_sfc_dbc::IndexOwned

pub struct IndexOwned<F, K, V> where
    F: PartialEq,
    K: Debug + FromIterator<V> + Index<usize, Output = V>,
    V: Clone + Debug + From<usize> + Ord
{ /* fields omitted */ }

Space Filling Curve-based index.

+

This structure retains the state of the index.

+

Methods

impl<F, K, V> SpaceFillingCurve<F, K, V> where
    F: PartialEq,
    K: Debug + FromIterator<V> + Index<usize, Output = V>,
    V: Clone + Debug + From<usize> + Hash + Ord
[src]

pub fn new<I, R>(iter: I, dimensions: usize, cell_bits: usize) -> Self where
    I: Clone + Iterator<Item = R>,
    R: Debug + Record<K> + RecordFields<F>, 
[src]

Creates a new Index from the provided iterator.

+
    +
  • dimensions: The number of dimensions of the space, a.k.a the +length of the vector representing a single +position.
  • +
  • cell_bits: The number of bits to reserve for the grid we +build on top of the coordinate dictionaries. +We generate 2^cell_bits Cells per dimension.
  • +
+

pub fn find_by_value(&self, value: &F) -> Vec<K>[src]

Returns a vector of keys which have stored values in the index +equal to value.

+

Trait Implementations

impl<F: Clone, K: Clone, V: Clone> Clone for SpaceFillingCurve<F, K, V> where
    F: PartialEq,
    K: Debug + FromIterator<V> + Index<usize, Output = V>,
    V: Clone + Debug + From<usize> + Ord
[src]

impl<F: Debug, K: Debug, V: Debug> Debug for SpaceFillingCurve<F, K, V> where
    F: PartialEq,
    K: Debug + FromIterator<V> + Index<usize, Output = V>,
    V: Clone + Debug + From<usize> + Ord
[src]

impl<'de, F, K, V> Deserialize<'de> for SpaceFillingCurve<F, K, V> where
    F: PartialEq,
    K: Debug + FromIterator<V> + Index<usize, Output = V>,
    V: Clone + Debug + From<usize> + Ord,
    F: Deserialize<'de>,
    K: Deserialize<'de>,
    V: Deserialize<'de>, 
[src]

impl<F, K, V> IndexedDestructured<F, K> for SpaceFillingCurve<F, K, V> where
    F: PartialEq,
    K: Debug + FromIterator<V> + Index<usize, Output = V>,
    V: Clone + Debug + From<usize> + Hash + Ord
[src]

impl<F, K, V> Serialize for SpaceFillingCurve<F, K, V> where
    F: PartialEq,
    K: Debug + FromIterator<V> + Index<usize, Output = V>,
    V: Clone + Debug + From<usize> + Ord,
    F: Serialize,
    K: Serialize,
    V: Serialize
[src]

Auto Trait Implementations

impl<F, K, V> RefUnwindSafe for SpaceFillingCurve<F, K, V> where
    F: RefUnwindSafe,
    K: RefUnwindSafe,
    V: RefUnwindSafe

impl<F, K, V> Send for SpaceFillingCurve<F, K, V> where
    F: Send,
    K: Send,
    V: Send

impl<F, K, V> Sync for SpaceFillingCurve<F, K, V> where
    F: Sync,
    K: Sync,
    V: Sync

impl<F, K, V> Unpin for SpaceFillingCurve<F, K, V> where
    F: Unpin,
    K: Unpin,
    V: Unpin

impl<F, K, V> UnwindSafe for SpaceFillingCurve<F, K, V> where
    F: UnwindSafe,
    K: UnwindSafe,
    V: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/ironsea_index_sfc_dbc/trait.Record.html b/ironsea_index_sfc_dbc/trait.Record.html new file mode 100644 index 0000000..b729fc9 --- /dev/null +++ b/ironsea_index_sfc_dbc/trait.Record.html @@ -0,0 +1,53 @@ +ironsea_index_sfc_dbc::Record - Rust

[][src]Trait ironsea_index_sfc_dbc::Record

pub trait Record<K> {
+    fn key(&self) -> K;
+}

Record behavior used by Indexed implementations.

+

This trait provides common methods used by index implementations to +retrieve information about a single record. This is provided by the +users of indices, for each of their struct they wish to index.

+

Multiple implementation can be provided, as long as their types are +different.

+

Examples

+
+use ironsea_index::Record;
+
+#[derive(Clone, Debug)]
+pub struct MyPair {
+    a: i64,
+    b: i64,
+}
+
+impl Record<String> for MyPair {
+   fn key(&self) -> String {
+       format!("{}", self.a)
+   }
+}
+
+impl Record<i64> for MyPair {
+   fn key(&self) -> i64 {
+       self.a
+   }
+}
+
+fn main() {
+
+   let table = vec![MyPair{ a: 10, b:34}, MyPair{ a: 1, b:56}, MyPair{ a: 2, b:23}];
+
+   // Example without using an actual index crate, we will simply use
+   // the Record<K> trait to sort the array of pairs.
+   let mut lex_sort = table.clone();
+   lex_sort.sort_unstable_by_key(|e| {let k: String = e.key(); k});
+
+   let mut num_sort = table.clone();
+   num_sort.sort_unstable_by_key(|e| {let k: i64 = e.key(); k});
+
+   assert_eq!(format!("unsorted {:?}", table),
+        "unsorted [MyPair { a: 10, b: 34 }, MyPair { a: 1, b: 56 }, MyPair { a: 2, b: 23 }]");
+   assert_eq!(format!("lex sort {:?}", lex_sort),
+        "lex sort [MyPair { a: 1, b: 56 }, MyPair { a: 10, b: 34 }, MyPair { a: 2, b: 23 }]");
+   assert_eq!(format!("num sort {:?}", num_sort),
+        "num sort [MyPair { a: 1, b: 56 }, MyPair { a: 2, b: 23 }, MyPair { a: 10, b: 34 }]");
+}
+
+

Required methods

fn key(&self) -> K

Extract the key from the record.

+
Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/ironsea_index_sfc_dbc/trait.RecordFields.html b/ironsea_index_sfc_dbc/trait.RecordFields.html new file mode 100644 index 0000000..dfb4e90 --- /dev/null +++ b/ironsea_index_sfc_dbc/trait.RecordFields.html @@ -0,0 +1,11 @@ +ironsea_index_sfc_dbc::RecordFields - Rust

[][src]Trait ironsea_index_sfc_dbc::RecordFields

pub trait RecordFields<F> {
+    fn fields(&self) -> F;
+}

Record behavior used by IndexedDestructured implementations.

+

RecordFields is used by indices which de-structure records into two +components, the key and the fields associated to that unique key. +This is provided by the users of indices, for each of their struct +they wish to index.

+
+

Required methods

fn fields(&self) -> F

Extract the fields of the record

+
Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/light.css b/light.css new file mode 100644 index 0000000..78ed8dd --- /dev/null +++ b/light.css @@ -0,0 +1 @@ + body{background-color:white;color:black;}h1,h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){color:black;}h1.fqn{border-bottom-color:#D5D5D5;}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod){border-bottom-color:#DDDDDD;}.in-band{background-color:white;}.invisible{background:rgba(0,0,0,0);}.docblock code,.docblock-short code{background-color:#F5F5F5;}pre{background-color:#F5F5F5;}.sidebar{background-color:#F1F1F1;}.sidebar .current{background-color:#fff;}.source .sidebar{background-color:#fff;}.sidebar .location{border-color:#000;background-color:#fff;color:#333;}.sidebar .version{border-bottom-color:#DDD;}.sidebar-title{border-top-color:#777;border-bottom-color:#777;}.block a:hover{background:#F5F5F5;}.line-numbers span{color:#c67e2d;}.line-numbers .line-highlighted{background-color:#f6fdb0 !important;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom-color:#ddd;}.docblock table,.docblock table td,.docblock table th{border-color:#ddd;}.content .method .where,.content .fn .where,.content .where.fmt-newline{color:#4E4C4C;}.content .highlighted{color:#000 !important;background-color:#ccc;}.content .highlighted a,.content .highlighted span{color:#000 !important;}.content .highlighted.trait{background-color:#c7b6ff;}.content .highlighted.traitalias{background-color:#c7b6ff;}.content .highlighted.mod,.content .highlighted.externcrate{background-color:#afc6e4;}.content .highlighted.enum{background-color:#b4d1b9;}.content .highlighted.struct{background-color:#e7b1a0;}.content .highlighted.union{background-color:#b7bd49;}.content .highlighted.fn,.content .highlighted.method,.content .highlighted.tymethod{background-color:#c6afb3;}.content .highlighted.type{background-color:#ffc891;}.content .highlighted.foreigntype{background-color:#f5c4ff;}.content .highlighted.attr,.content .highlighted.derive,.content .highlighted.macro{background-color:#8ce488;}.content .highlighted.constant,.content .highlighted.static{background-color:#c3e0ff;}.content .highlighted.primitive{background-color:#9aecff;}.content .highlighted.keyword{background-color:#f99650;}.content .stability::before{color:#ccc;}.content span.enum,.content a.enum,.block a.current.enum{color:#508157;}.content span.struct,.content a.struct,.block a.current.struct{color:#ad448e;}.content span.type,.content a.type,.block a.current.type{color:#ba5d00;}.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype{color:#cd00e2;}.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro{color:#068000;}.content span.union,.content a.union,.block a.current.union{color:#767b27;}.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static{color:#546e8a;}.content span.primitive,.content a.primitive,.block a.current.primitive{color:#2c8093;}.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod{color:#4d76ae;}.content span.trait,.content a.trait,.block a.current.trait{color:#7c5af3;}.content span.traitalias,.content a.traitalias,.block a.current.traitalias{color:#6841f1;}.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname{color:#9a6e31;}.content span.keyword,.content a.keyword,.block a.current.keyword{color:#de5249;}pre.rust .comment{color:#8E908C;}pre.rust .doccomment{color:#4D4D4C;}nav:not(.sidebar){border-bottom-color:#e0e0e0;}nav.main .current{border-top-color:#000;border-bottom-color:#000;}nav.main .separator{border:1px solid #000;}a{color:#000;}.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),.docblock-short a:not(.srclink):not(.test-arrow),.stability a{color:#3873AD;}.stab.internal a{color:#304FFE;}a.test-arrow{color:#f5f5f5;}.collapse-toggle{color:#999;}#crate-search{color:#555;background-color:white;border-color:#e0e0e0;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input{color:#555;background-color:white;box-shadow:0 0 0 1px #e0e0e0,0 0 0 2px transparent;}.search-input:focus{border-color:#66afe9;}.search-focus:disabled{background-color:#e6e6e6;}#crate-search+.search-input:focus{box-shadow:0 0 8px #078dd8;}.module-item .stab{color:#000;}.stab.unstable{background:#FFF5D6;border-color:#FFC600;}.stab.internal{background:#FFB9B3;border-color:#B71C1C;}.stab.deprecated{background:#F3DFFF;border-color:#7F0087;}.stab.portability{background:#C4ECFF;border-color:#7BA5DB;}.stab.portability>code{color:#000;}#help>div{background:#e9e9e9;border-color:#bfbfbf;}.since{color:grey;}tr.result span.primitive::after,tr.result span.keyword::after{color:black;}.line-numbers :target{background-color:transparent;}pre.rust .kw{color:#8959A8;}pre.rust .kw-2,pre.rust .prelude-ty{color:#4271AE;}pre.rust .number,pre.rust .string{color:#718C00;}pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident{color:#C82829;}pre.rust .macro,pre.rust .macro-nonterminal{color:#3E999F;}pre.rust .lifetime{color:#B76514;}pre.rust .question-mark{color:#ff9011;}.example-wrap>pre.line-number{border-color:#c7c7c7;}a.test-arrow{background-color:rgba(78,139,202,0.2);}a.test-arrow:hover{background-color:#4e8bca;}.toggle-label{color:#999;}:target>code,:target>.in-band{background:#FDFFD3;}pre.compile_fail{border-left:2px solid rgba(255,0,0,.4);}pre.compile_fail:hover,.information:hover+pre.compile_fail{border-left:2px solid #f00;}pre.ignore{border-left:2px solid rgba(255,142,0,.4);}pre.ignore:hover,.information:hover+pre.ignore{border-left:2px solid #ff9200;}.tooltip.compile_fail{color:rgba(255,0,0,.3);}.information>.compile_fail:hover{color:#f00;}.tooltip.ignore{color:rgba(255,142,0,.3);}.information>.ignore:hover{color:rgba(255,142,0,1);}.search-failed a{color:#0089ff;}.tooltip .tooltiptext{background-color:black;color:#fff;}.tooltip .tooltiptext::after{border-color:transparent black transparent transparent;}#titles>div:not(.selected){background-color:#e6e6e6;border-top-color:#e6e6e6;}#titles>div:hover,#titles>div.selected{border-top-color:#0089ff;}#titles>div>div.count{color:#888;}@media (max-width:700px){.sidebar-menu{background-color:#F1F1F1;border-bottom-color:#e0e0e0;border-right-color:#e0e0e0;}.sidebar-elems{background-color:#F1F1F1;border-right-color:#000;}#sidebar-filler{background-color:#F1F1F1;border-bottom-color:#e0e0e0;}}kbd{color:#000;background-color:#fafbfc;border-color:#d1d5da;border-bottom-color:#c6cbd1;box-shadow-color:#c6cbd1;}#theme-picker,#settings-menu{border-color:#e0e0e0;background-color:#fff;}#theme-picker:hover,#theme-picker:focus,#settings-menu:hover,#settings-menu:focus{border-color:#717171;}#theme-choices{border-color:#ccc;background-color:#fff;}#theme-choices>button:not(:first-child){border-top-color:#e0e0e0;}#theme-choices>button:hover,#theme-choices>button:focus{background-color:#eee;}@media (max-width:700px){#theme-picker{background:#fff;}}#all-types{background-color:#fff;}#all-types:hover{background-color:#f9f9f9;}.search-results td span.alias{color:#000;}.search-results td span.grey{color:#999;}#sidebar-toggle{background-color:#F1F1F1;}#sidebar-toggle:hover{background-color:#E0E0E0;}#source-sidebar{background-color:#F1F1F1;}#source-sidebar>.title{border-bottom-color:#ccc;}div.files>a:hover,div.name:hover{background-color:#E0E0E0;}div.files>.selected{background-color:#fff;}.setting-line>.title{border-bottom-color:#D5D5D5;} \ No newline at end of file diff --git a/log/all.html b/log/all.html new file mode 100644 index 0000000..e6ee693 --- /dev/null +++ b/log/all.html @@ -0,0 +1,3 @@ +List of all items in this crate

[] + + List of all items

Structs

Enums

Traits

Macros

Functions

Constants

\ No newline at end of file diff --git a/log/constant.STATIC_MAX_LEVEL.html b/log/constant.STATIC_MAX_LEVEL.html new file mode 100644 index 0000000..336d92a --- /dev/null +++ b/log/constant.STATIC_MAX_LEVEL.html @@ -0,0 +1,6 @@ +log::STATIC_MAX_LEVEL - Rust

[][src]Constant log::STATIC_MAX_LEVEL

pub const STATIC_MAX_LEVEL: LevelFilter;

The statically resolved maximum log level.

+

See the crate level documentation for information on how to configure this.

+

This value is checked by the log macros, but not by the Logger returned by +the logger function. Code that manually calls functions on that value +should compare the level against this value.

+
\ No newline at end of file diff --git a/log/enum.Level.html b/log/enum.Level.html new file mode 100644 index 0000000..563f7df --- /dev/null +++ b/log/enum.Level.html @@ -0,0 +1,75 @@ +log::Level - Rust

[][src]Enum log::Level

#[repr(usize)]
+pub enum Level {
+    Error,
+    Warn,
+    Info,
+    Debug,
+    Trace,
+}

An enum representing the available verbosity levels of the logger.

+

Typical usage includes: checking if a certain Level is enabled with +log_enabled!, specifying the Level of +log!, and comparing a Level directly to a +LevelFilter.

+

+ Variants

+
Error

The "error" level.

+

Designates very serious errors.

+
Warn

The "warn" level.

+

Designates hazardous situations.

+
Info

The "info" level.

+

Designates useful information.

+
Debug

The "debug" level.

+

Designates lower priority information.

+
Trace

The "trace" level.

+

Designates very low priority, often extremely verbose, information.

+

Methods

impl Level[src]

pub fn max() -> Level[src]

Returns the most verbose logging level.

+

pub fn to_level_filter(&self) -> LevelFilter[src]

Converts the Level to the equivalent LevelFilter.

+

Trait Implementations

impl Clone for Level[src]

impl Copy for Level[src]

impl Debug for Level[src]

impl Display for Level[src]

impl Eq for Level[src]

impl FromStr for Level[src]

type Err = ParseLevelError

The associated error which can be returned from parsing.

+

impl Hash for Level[src]

impl Ord for Level[src]

impl PartialEq<Level> for Level[src]

impl PartialEq<Level> for LevelFilter[src]

impl PartialEq<LevelFilter> for Level[src]

impl PartialOrd<Level> for Level[src]

impl PartialOrd<Level> for LevelFilter[src]

impl PartialOrd<LevelFilter> for Level[src]

impl StructuralEq for Level[src]

Auto Trait Implementations

impl Send for Level

impl Sync for Level

impl Unpin for Level

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/log/enum.LevelFilter.html b/log/enum.LevelFilter.html new file mode 100644 index 0000000..3622e3f --- /dev/null +++ b/log/enum.LevelFilter.html @@ -0,0 +1,71 @@ +log::LevelFilter - Rust

[][src]Enum log::LevelFilter

#[repr(usize)]
+pub enum LevelFilter {
+    Off,
+    Error,
+    Warn,
+    Info,
+    Debug,
+    Trace,
+}

An enum representing the available verbosity level filters of the logger.

+

A LevelFilter may be compared directly to a Level. Use this type +to get and set the maximum log level with max_level() and set_max_level.

+

+ Variants

+
Off

A level lower than all log levels.

+
Error

Corresponds to the Error log level.

+
Warn

Corresponds to the Warn log level.

+
Info

Corresponds to the Info log level.

+
Debug

Corresponds to the Debug log level.

+
Trace

Corresponds to the Trace log level.

+

Methods

impl LevelFilter[src]

pub fn max() -> LevelFilter[src]

Returns the most verbose logging level filter.

+

pub fn to_level(&self) -> Option<Level>[src]

Converts self to the equivalent Level.

+

Returns None if self is LevelFilter::Off.

+

Trait Implementations

impl Clone for LevelFilter[src]

impl Copy for LevelFilter[src]

impl Debug for LevelFilter[src]

impl Display for LevelFilter[src]

impl Eq for LevelFilter[src]

impl FromStr for LevelFilter[src]

type Err = ParseLevelError

The associated error which can be returned from parsing.

+

impl Hash for LevelFilter[src]

impl Ord for LevelFilter[src]

impl PartialEq<Level> for LevelFilter[src]

impl PartialEq<LevelFilter> for Level[src]

impl PartialEq<LevelFilter> for LevelFilter[src]

impl PartialOrd<Level> for LevelFilter[src]

impl PartialOrd<LevelFilter> for Level[src]

impl PartialOrd<LevelFilter> for LevelFilter[src]

impl StructuralEq for LevelFilter[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/log/fn.logger.html b/log/fn.logger.html new file mode 100644 index 0000000..c8e31f0 --- /dev/null +++ b/log/fn.logger.html @@ -0,0 +1,3 @@ +log::logger - Rust

[][src]Function log::logger

pub fn logger() -> &'static dyn Log

Returns a reference to the logger.

+

If a logger has not been set, a no-op implementation is returned.

+
\ No newline at end of file diff --git a/log/fn.max_level.html b/log/fn.max_level.html new file mode 100644 index 0000000..126255a --- /dev/null +++ b/log/fn.max_level.html @@ -0,0 +1,5 @@ +log::max_level - Rust

[][src]Function log::max_level

pub fn max_level() -> LevelFilter

Returns the current maximum log level.

+

The log!, error!, warn!, info!, debug!, and trace! macros check +this value and discard any message logged at a higher level. The maximum +log level is set by the set_max_level function.

+
\ No newline at end of file diff --git a/log/fn.set_logger.html b/log/fn.set_logger.html new file mode 100644 index 0000000..0796d3d --- /dev/null +++ b/log/fn.set_logger.html @@ -0,0 +1,41 @@ +log::set_logger - Rust

[][src]Function log::set_logger

pub fn set_logger(logger: &'static dyn Log) -> Result<(), SetLoggerError>

Sets the global logger to a &'static Log.

+

This function may only be called once in the lifetime of a program. Any log +events that occur before the call to set_logger completes will be ignored.

+

This function does not typically need to be called manually. Logger +implementations should provide an initialization method that installs the +logger internally.

+

Availability

+

This method is available even when the std feature is disabled. However, +it is currently unavailable on thumbv6 targets, which lack support for +some atomic operations which are used by this function. Even on those +targets, set_logger_racy will be available.

+

Errors

+

An error is returned if a logger has already been set.

+

Examples

+
This code runs with edition 2018
+use log::{error, info, warn, Record, Level, Metadata, LevelFilter};
+
+static MY_LOGGER: MyLogger = MyLogger;
+
+struct MyLogger;
+
+impl log::Log for MyLogger {
+    fn enabled(&self, metadata: &Metadata) -> bool {
+        metadata.level() <= Level::Info
+    }
+
+    fn log(&self, record: &Record) {
+        if self.enabled(record.metadata()) {
+            println!("{} - {}", record.level(), record.args());
+        }
+    }
+    fn flush(&self) {}
+}
+
+log::set_logger(&MY_LOGGER).unwrap();
+log::set_max_level(LevelFilter::Info);
+
+info!("hello log");
+warn!("warning");
+error!("oops");
+
\ No newline at end of file diff --git a/log/fn.set_logger_racy.html b/log/fn.set_logger_racy.html new file mode 100644 index 0000000..5f1da2b --- /dev/null +++ b/log/fn.set_logger_racy.html @@ -0,0 +1,12 @@ +log::set_logger_racy - Rust

[][src]Function log::set_logger_racy

pub unsafe fn set_logger_racy(
    logger: &'static dyn Log
) -> Result<(), SetLoggerError>

A thread-unsafe version of set_logger.

+

This function is available on all platforms, even those that do not have +support for atomics that is needed by set_logger.

+

In almost all cases, set_logger should be preferred.

+

Safety

+

This function is only safe to call when no other logger initialization +function is called while this function still executes.

+

This can be upheld by (for example) making sure that there are no other +threads, and (on embedded) that interrupts are disabled.

+

It is safe to use other logging functions while this function runs +(including all logging macros).

+
\ No newline at end of file diff --git a/log/fn.set_max_level.html b/log/fn.set_max_level.html new file mode 100644 index 0000000..0eac088 --- /dev/null +++ b/log/fn.set_max_level.html @@ -0,0 +1,3 @@ +log::set_max_level - Rust

[][src]Function log::set_max_level

pub fn set_max_level(level: LevelFilter)

Sets the global maximum log level.

+

Generally, this should only be called by the active logging implementation.

+
\ No newline at end of file diff --git a/log/index.html b/log/index.html new file mode 100644 index 0000000..74e7528 --- /dev/null +++ b/log/index.html @@ -0,0 +1,211 @@ +log - Rust

[][src]Crate log

A lightweight logging facade.

+

The log crate provides a single logging API that abstracts over the +actual logging implementation. Libraries can use the logging API provided +by this crate, and the consumer of those libraries can choose the logging +implementation that is most suitable for its use case.

+

If no logging implementation is selected, the facade falls back to a "noop" +implementation that ignores all log messages. The overhead in this case +is very small - just an integer load, comparison and jump.

+

A log request consists of a target, a level, and a body. A target is a +string which defaults to the module path of the location of the log request, +though that default may be overridden. Logger implementations typically use +the target to filter requests based on some user configuration.

+

Use

+

The basic use of the log crate is through the five logging macros: error!, +warn!, info!, debug! and trace! +where error! represents the highest-priority log messages +and trace! the lowest. The log messages are filtered by configuring +the log level to exclude messages with a lower priority. +Each of these macros accept format strings similarly to println!.

+

In libraries

+

Libraries should link only to the log crate, and use the provided +macros to log whatever information will be useful to downstream consumers.

+

Examples

+
This code runs with edition 2018
+use log::{info, warn};
+
+pub fn shave_the_yak(yak: &mut Yak) {
+    info!(target: "yak_events", "Commencing yak shaving for {:?}", yak);
+
+    loop {
+        match find_a_razor() {
+            Ok(razor) => {
+                info!("Razor located: {}", razor);
+                yak.shave(razor);
+                break;
+            }
+            Err(err) => {
+                warn!("Unable to locate a razor: {}, retrying", err);
+            }
+        }
+    }
+}
+

In executables

+

Executables should choose a logging implementation and initialize it early in the +runtime of the program. Logging implementations will typically include a +function to do this. Any log messages generated before +the implementation is initialized will be ignored.

+

The executable itself may use the log crate to log as well.

+

Warning

+

The logging system may only be initialized once.

+

Available logging implementations

+

In order to produce log output executables have to use +a logger implementation compatible with the facade. +There are many available implementations to choose from, +here are some of the most popular ones:

+ +

Implementing a Logger

+

Loggers implement the Log trait. Here's a very basic example that simply +logs all messages at the Error, Warn or +Info levels to stdout:

+ +
This code runs with edition 2018
+use log::{Record, Level, Metadata};
+
+struct SimpleLogger;
+
+impl log::Log for SimpleLogger {
+    fn enabled(&self, metadata: &Metadata) -> bool {
+        metadata.level() <= Level::Info
+    }
+
+    fn log(&self, record: &Record) {
+        if self.enabled(record.metadata()) {
+            println!("{} - {}", record.level(), record.args());
+        }
+    }
+
+    fn flush(&self) {}
+}
+
+

Loggers are installed by calling the set_logger function. The maximum +log level also needs to be adjusted via the set_max_level function. The +logging facade uses this as an optimization to improve performance of log +messages at levels that are disabled. It's important to set it, as it +defaults to Off, so no log messages will ever be captured! +In the case of our example logger, we'll want to set the maximum log level +to Info, since we ignore any Debug or +Trace level log messages. A logging implementation should +provide a function that wraps a call to set_logger and +set_max_level, handling initialization of the logger:

+ +
This code runs with edition 2018
+use log::{SetLoggerError, LevelFilter};
+
+static LOGGER: SimpleLogger = SimpleLogger;
+
+pub fn init() -> Result<(), SetLoggerError> {
+    log::set_logger(&LOGGER)
+        .map(|()| log::set_max_level(LevelFilter::Info))
+}
+

Implementations that adjust their configurations at runtime should take care +to adjust the maximum log level as well.

+

Use with std

+

set_logger requires you to provide a &'static Log, which can be hard to +obtain if your logger depends on some runtime configuration. The +set_boxed_logger function is available with the std Cargo feature. It is +identical to set_logger except that it takes a Box<Log> rather than a +&'static Log:

+ +
This code runs with edition 2018
+pub fn init() -> Result<(), SetLoggerError> {
+    log::set_boxed_logger(Box::new(SimpleLogger))
+        .map(|()| log::set_max_level(LevelFilter::Info))
+}
+

Compile time filters

+

Log levels can be statically disabled at compile time via Cargo features. Log invocations at +disabled levels will be skipped and will not even be present in the resulting binary unless the +log level is specified dynamically. This level is configured separately for release and debug +builds. The features are:

+
    +
  • max_level_off
  • +
  • max_level_error
  • +
  • max_level_warn
  • +
  • max_level_info
  • +
  • max_level_debug
  • +
  • max_level_trace
  • +
  • release_max_level_off
  • +
  • release_max_level_error
  • +
  • release_max_level_warn
  • +
  • release_max_level_info
  • +
  • release_max_level_debug
  • +
  • release_max_level_trace
  • +
+

These features control the value of the STATIC_MAX_LEVEL constant. The logging macros check +this value before logging a message. By default, no levels are disabled.

+

Libraries should avoid using the max level features because they're global and can't be changed +once they're set.

+

For example, a crate can disable trace level logs in debug builds and trace, debug, and info +level logs in release builds with the following configuration:

+
[dependencies]
+log = { version = "0.4", features = ["max_level_debug", "release_max_level_warn"] }
+
+

Crate Feature Flags

+

The following crate feature flags are avaliable in addition to the filters. They are +configured in your Cargo.toml.

+
    +
  • std allows use of std crate instead of the default core. Enables using std::error and +set_boxed_logger functionality.
  • +
  • serde enables support for serialization and deserialization of Level and LevelFilter.
  • +
+
[dependencies]
+log = { version = "0.4", features = ["std", "serde"] }
+
+

Version compatibility

+

The 0.3 and 0.4 versions of the log crate are almost entirely compatible. Log messages +made using log 0.3 will forward transparently to a logger implementation using log 0.4. Log +messages made using log 0.4 will forward to a logger implementation using log 0.3, but the +module path and file name information associated with the message will unfortunately be lost.

+

Macros

+
debug

Logs a message at the debug level.

+
error

Logs a message at the error level.

+
info

Logs a message at the info level.

+
log

The standard logging macro.

+
log_enabled

Determines if a message logged at the specified level in that module will +be logged.

+
trace

Logs a message at the trace level.

+
warn

Logs a message at the warn level.

+

Structs

+
Metadata

Metadata about a log message.

+
MetadataBuilder

Builder for Metadata.

+
ParseLevelError

The type returned by from_str when the string doesn't match any of the log levels.

+
Record

The "payload" of a log message.

+
RecordBuilder

Builder for Record.

+
SetLoggerError

The type returned by set_logger if set_logger has already been called.

+

Enums

+
Level

An enum representing the available verbosity levels of the logger.

+
LevelFilter

An enum representing the available verbosity level filters of the logger.

+

Constants

+
STATIC_MAX_LEVEL

The statically resolved maximum log level.

+

Traits

+
Log

A trait encapsulating the operations required of a logger.

+

Functions

+
logger

Returns a reference to the logger.

+
max_level

Returns the current maximum log level.

+
set_logger

Sets the global logger to a &'static Log.

+
set_logger_racy

A thread-unsafe version of set_logger.

+
set_max_level

Sets the global maximum log level.

+
\ No newline at end of file diff --git a/log/macro.debug!.html b/log/macro.debug!.html new file mode 100644 index 0000000..faa474c --- /dev/null +++ b/log/macro.debug!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.debug.html...

+ + + \ No newline at end of file diff --git a/log/macro.debug.html b/log/macro.debug.html new file mode 100644 index 0000000..4a6d25d --- /dev/null +++ b/log/macro.debug.html @@ -0,0 +1,15 @@ +log::debug - Rust

[][src]Macro log::debug

+macro_rules! debug {
+    (target: $target:expr, $($arg:tt)+) => { ... };
+    ($($arg:tt)+) => { ... };
+}
+

Logs a message at the debug level.

+

Examples

+
This code runs with edition 2018
+use log::debug;
+
+let pos = Position { x: 3.234, y: -1.223 };
+
+debug!("New position: x: {}, y: {}", pos.x, pos.y);
+debug!(target: "app_events", "New position: x: {}, y: {}", pos.x, pos.y);
+
\ No newline at end of file diff --git a/log/macro.error!.html b/log/macro.error!.html new file mode 100644 index 0000000..e24b748 --- /dev/null +++ b/log/macro.error!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.error.html...

+ + + \ No newline at end of file diff --git a/log/macro.error.html b/log/macro.error.html new file mode 100644 index 0000000..396f045 --- /dev/null +++ b/log/macro.error.html @@ -0,0 +1,15 @@ +log::error - Rust

[][src]Macro log::error

+macro_rules! error {
+    (target: $target:expr, $($arg:tt)+) => { ... };
+    ($($arg:tt)+) => { ... };
+}
+

Logs a message at the error level.

+

Examples

+
This code runs with edition 2018
+use log::error;
+
+let (err_info, port) = ("No connection", 22);
+
+error!("Error: {} on port {}", err_info, port);
+error!(target: "app_events", "App Error: {}, Port: {}", err_info, 22);
+
\ No newline at end of file diff --git a/log/macro.info!.html b/log/macro.info!.html new file mode 100644 index 0000000..5bad5c4 --- /dev/null +++ b/log/macro.info!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.info.html...

+ + + \ No newline at end of file diff --git a/log/macro.info.html b/log/macro.info.html new file mode 100644 index 0000000..d775ece --- /dev/null +++ b/log/macro.info.html @@ -0,0 +1,16 @@ +log::info - Rust

[][src]Macro log::info

+macro_rules! info {
+    (target: $target:expr, $($arg:tt)+) => { ... };
+    ($($arg:tt)+) => { ... };
+}
+

Logs a message at the info level.

+

Examples

+
This code runs with edition 2018
+use log::info;
+
+let conn_info = Connection { port: 40, speed: 3.20 };
+
+info!("Connected to port {} at {} Mb/s", conn_info.port, conn_info.speed);
+info!(target: "connection_events", "Successfull connection, port: {}, speed: {}",
+      conn_info.port, conn_info.speed);
+
\ No newline at end of file diff --git a/log/macro.log!.html b/log/macro.log!.html new file mode 100644 index 0000000..7ff1ced --- /dev/null +++ b/log/macro.log!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.log.html...

+ + + \ No newline at end of file diff --git a/log/macro.log.html b/log/macro.log.html new file mode 100644 index 0000000..5c282ff --- /dev/null +++ b/log/macro.log.html @@ -0,0 +1,19 @@ +log::log - Rust

[][src]Macro log::log

+macro_rules! log {
+    (target: $target:expr, $lvl:expr, $($arg:tt)+) => { ... };
+    ($lvl:expr, $($arg:tt)+) => { ... };
+}
+

The standard logging macro.

+

This macro will generically log with the specified Level and format! +based argument list.

+

Examples

+
This code runs with edition 2018
+use log::{log, Level};
+
+let data = (42, "Forty-two");
+let private_data = "private";
+
+log!(Level::Error, "Received errors: {}, {}", data.0, data.1);
+log!(target: "app_events", Level::Warn, "App warning: {}, {}, {}",
+    data.0, data.1, private_data);
+
\ No newline at end of file diff --git a/log/macro.log_enabled!.html b/log/macro.log_enabled!.html new file mode 100644 index 0000000..2731fd3 --- /dev/null +++ b/log/macro.log_enabled!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.log_enabled.html...

+ + + \ No newline at end of file diff --git a/log/macro.log_enabled.html b/log/macro.log_enabled.html new file mode 100644 index 0000000..2ae1a73 --- /dev/null +++ b/log/macro.log_enabled.html @@ -0,0 +1,23 @@ +log::log_enabled - Rust

[][src]Macro log::log_enabled

+macro_rules! log_enabled {
+    (target: $target:expr, $lvl:expr) => { ... };
+    ($lvl:expr) => { ... };
+}
+

Determines if a message logged at the specified level in that module will +be logged.

+

This can be used to avoid expensive computation of log message arguments if +the message would be ignored anyway.

+

Examples

+
This code runs with edition 2018
+use log::Level::Debug;
+use log::{debug, log_enabled};
+
+if log_enabled!(Debug) {
+    let data = expensive_call();
+    debug!("expensive debug data: {} {}", data.x, data.y);
+}
+if log_enabled!(target: "Global", Debug) {
+   let data = expensive_call();
+   debug!(target: "Global", "expensive debug data: {} {}", data.x, data.y);
+}
+
\ No newline at end of file diff --git a/log/macro.trace!.html b/log/macro.trace!.html new file mode 100644 index 0000000..68417a7 --- /dev/null +++ b/log/macro.trace!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.trace.html...

+ + + \ No newline at end of file diff --git a/log/macro.trace.html b/log/macro.trace.html new file mode 100644 index 0000000..9a39a96 --- /dev/null +++ b/log/macro.trace.html @@ -0,0 +1,17 @@ +log::trace - Rust

[][src]Macro log::trace

+macro_rules! trace {
+    (target: $target:expr, $($arg:tt)+) => { ... };
+    ($($arg:tt)+) => { ... };
+}
+

Logs a message at the trace level.

+

Examples

+
This code runs with edition 2018
+use log::trace;
+
+let pos = Position { x: 3.234, y: -1.223 };
+
+trace!("Position is: x: {}, y: {}", pos.x, pos.y);
+trace!(target: "app_events", "x is {} and y is {}",
+       if pos.x >= 0.0 { "positive" } else { "negative" },
+       if pos.y >= 0.0 { "positive" } else { "negative" });
+
\ No newline at end of file diff --git a/log/macro.warn!.html b/log/macro.warn!.html new file mode 100644 index 0000000..70d3235 --- /dev/null +++ b/log/macro.warn!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.warn.html...

+ + + \ No newline at end of file diff --git a/log/macro.warn.html b/log/macro.warn.html new file mode 100644 index 0000000..4f691cb --- /dev/null +++ b/log/macro.warn.html @@ -0,0 +1,15 @@ +log::warn - Rust

[][src]Macro log::warn

+macro_rules! warn {
+    (target: $target:expr, $($arg:tt)+) => { ... };
+    ($($arg:tt)+) => { ... };
+}
+

Logs a message at the warn level.

+

Examples

+
This code runs with edition 2018
+use log::warn;
+
+let warn_description = "Invalid Input";
+
+warn!("Warning! {}!", warn_description);
+warn!(target: "input_events", "App received warning: {}", warn_description);
+
\ No newline at end of file diff --git a/log/sidebar-items.js b/log/sidebar-items.js new file mode 100644 index 0000000..8f24e1a --- /dev/null +++ b/log/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"constant":[["STATIC_MAX_LEVEL","The statically resolved maximum log level."]],"enum":[["Level","An enum representing the available verbosity levels of the logger."],["LevelFilter","An enum representing the available verbosity level filters of the logger."]],"fn":[["logger","Returns a reference to the logger."],["max_level","Returns the current maximum log level."],["set_logger","Sets the global logger to a `&'static Log`."],["set_logger_racy","A thread-unsafe version of [`set_logger`]."],["set_max_level","Sets the global maximum log level."]],"macro":[["debug","Logs a message at the debug level."],["error","Logs a message at the error level."],["info","Logs a message at the info level."],["log","The standard logging macro."],["log_enabled","Determines if a message logged at the specified level in that module will be logged."],["trace","Logs a message at the trace level."],["warn","Logs a message at the warn level."]],"struct":[["Metadata","Metadata about a log message."],["MetadataBuilder","Builder for `Metadata`."],["ParseLevelError","The type returned by [`from_str`] when the string doesn't match any of the log levels."],["Record","The \"payload\" of a log message."],["RecordBuilder","Builder for `Record`."],["SetLoggerError","The type returned by [`set_logger`] if [`set_logger`] has already been called."]],"trait":[["Log","A trait encapsulating the operations required of a logger."]]}); \ No newline at end of file diff --git a/log/struct.Metadata.html b/log/struct.Metadata.html new file mode 100644 index 0000000..3c8adb4 --- /dev/null +++ b/log/struct.Metadata.html @@ -0,0 +1,61 @@ +log::Metadata - Rust

[][src]Struct log::Metadata

pub struct Metadata<'a> { /* fields omitted */ }

Metadata about a log message.

+

Use

+

Metadata structs are created when users of the library use +logging macros.

+

They are consumed by implementations of the Log trait in the +enabled method.

+

Records use Metadata to determine the log message's severity +and target.

+

Users should use the log_enabled! macro in their code to avoid +constructing expensive log messages.

+

Examples

+
This code runs with edition 2018
+use log::{Record, Level, Metadata};
+
+struct MyLogger;
+
+impl log::Log for MyLogger {
+    fn enabled(&self, metadata: &Metadata) -> bool {
+        metadata.level() <= Level::Info
+    }
+
+    fn log(&self, record: &Record) {
+        if self.enabled(record.metadata()) {
+            println!("{} - {}", record.level(), record.args());
+        }
+    }
+    fn flush(&self) {}
+}
+
+

Methods

impl<'a> Metadata<'a>[src]

pub fn builder() -> MetadataBuilder<'a>[src]

Returns a new builder.

+

pub fn level(&self) -> Level[src]

The verbosity level of the message.

+

pub fn target(&self) -> &'a str[src]

The name of the target of the directive.

+

Trait Implementations

impl<'a> Clone for Metadata<'a>[src]

impl<'a> Debug for Metadata<'a>[src]

impl<'a> Eq for Metadata<'a>[src]

impl<'a> Hash for Metadata<'a>[src]

impl<'a> Ord for Metadata<'a>[src]

impl<'a> PartialEq<Metadata<'a>> for Metadata<'a>[src]

impl<'a> PartialOrd<Metadata<'a>> for Metadata<'a>[src]

impl<'a> StructuralEq for Metadata<'a>[src]

impl<'a> StructuralPartialEq for Metadata<'a>[src]

Auto Trait Implementations

impl<'a> Send for Metadata<'a>

impl<'a> Sync for Metadata<'a>

impl<'a> Unpin for Metadata<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/log/struct.MetadataBuilder.html b/log/struct.MetadataBuilder.html new file mode 100644 index 0000000..fda6263 --- /dev/null +++ b/log/struct.MetadataBuilder.html @@ -0,0 +1,48 @@ +log::MetadataBuilder - Rust

[][src]Struct log::MetadataBuilder

pub struct MetadataBuilder<'a> { /* fields omitted */ }

Builder for Metadata.

+

Typically should only be used by log library creators or for testing and "shim loggers". +The MetadataBuilder can set the different parameters of a Metadata object, and returns +the created object when build is called.

+

Example

+
This code runs with edition 2018
+let target = "myApp";
+use log::{Level, MetadataBuilder};
+let metadata = MetadataBuilder::new()
+                    .level(Level::Debug)
+                    .target(target)
+                    .build();
+

Methods

impl<'a> MetadataBuilder<'a>[src]

pub fn new() -> MetadataBuilder<'a>[src]

Construct a new MetadataBuilder.

+

The default options are:

+
    +
  • level: Level::Info
  • +
  • target: ""
  • +
+

pub fn level(&mut self, arg: Level) -> &mut MetadataBuilder<'a>[src]

Setter for level.

+

pub fn target(&mut self, target: &'a str) -> &mut MetadataBuilder<'a>[src]

Setter for target.

+

pub fn build(&self) -> Metadata<'a>[src]

Returns a Metadata object.

+

Trait Implementations

impl<'a> Debug for MetadataBuilder<'a>[src]

impl<'a> Eq for MetadataBuilder<'a>[src]

impl<'a> Hash for MetadataBuilder<'a>[src]

impl<'a> Ord for MetadataBuilder<'a>[src]

impl<'a> PartialEq<MetadataBuilder<'a>> for MetadataBuilder<'a>[src]

impl<'a> PartialOrd<MetadataBuilder<'a>> for MetadataBuilder<'a>[src]

impl<'a> StructuralEq for MetadataBuilder<'a>[src]

impl<'a> StructuralPartialEq for MetadataBuilder<'a>[src]

Auto Trait Implementations

impl<'a> Send for MetadataBuilder<'a>

impl<'a> Sync for MetadataBuilder<'a>

impl<'a> Unpin for MetadataBuilder<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/log/struct.ParseLevelError.html b/log/struct.ParseLevelError.html new file mode 100644 index 0000000..078e2a4 --- /dev/null +++ b/log/struct.ParseLevelError.html @@ -0,0 +1,15 @@ +log::ParseLevelError - Rust

[][src]Struct log::ParseLevelError

pub struct ParseLevelError(_);

The type returned by from_str when the string doesn't match any of the log levels.

+

Trait Implementations

impl Debug for ParseLevelError[src]

impl Display for ParseLevelError[src]

impl PartialEq<ParseLevelError> for ParseLevelError[src]

impl StructuralPartialEq for ParseLevelError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/log/struct.Record.html b/log/struct.Record.html new file mode 100644 index 0000000..3b6679d --- /dev/null +++ b/log/struct.Record.html @@ -0,0 +1,56 @@ +log::Record - Rust

[][src]Struct log::Record

pub struct Record<'a> { /* fields omitted */ }

The "payload" of a log message.

+

Use

+

Record structures are passed as parameters to the log +method of the Log trait. Logger implementors manipulate these +structures in order to display log messages. Records are automatically +created by the log! macro and so are not seen by log users.

+

Note that the level() and target() accessors are equivalent to +self.metadata().level() and self.metadata().target() respectively. +These methods are provided as a convenience for users of this structure.

+

Example

+

The following example shows a simple logger that displays the level, +module path, and message of any Record that is passed to it.

+ +
This code runs with edition 2018
+struct SimpleLogger;
+
+impl log::Log for SimpleLogger {
+   fn enabled(&self, metadata: &log::Metadata) -> bool {
+       true
+   }
+
+   fn log(&self, record: &log::Record) {
+       if !self.enabled(record.metadata()) {
+           return;
+       }
+
+       println!("{}:{} -- {}",
+                record.level(),
+                record.target(),
+                record.args());
+   }
+   fn flush(&self) {}
+}
+

Methods

impl<'a> Record<'a>[src]

pub fn builder() -> RecordBuilder<'a>[src]

Returns a new builder.

+

pub fn args(&self) -> &Arguments<'a>[src]

The message body.

+

pub fn metadata(&self) -> &Metadata<'a>[src]

Metadata about the log directive.

+

pub fn level(&self) -> Level[src]

The verbosity level of the message.

+

pub fn target(&self) -> &'a str[src]

The name of the target of the directive.

+

pub fn module_path(&self) -> Option<&'a str>[src]

The module path of the message.

+

pub fn module_path_static(&self) -> Option<&'static str>[src]

The module path of the message, if it is a 'static string.

+

pub fn file(&self) -> Option<&'a str>[src]

The source file containing the message.

+

pub fn file_static(&self) -> Option<&'static str>[src]

The module path of the message, if it is a 'static string.

+

pub fn line(&self) -> Option<u32>[src]

The line containing the message.

+

Trait Implementations

impl<'a> Clone for Record<'a>[src]

impl<'a> Debug for Record<'a>[src]

Auto Trait Implementations

impl<'a> !Send for Record<'a>

impl<'a> !Sync for Record<'a>

impl<'a> Unpin for Record<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/log/struct.RecordBuilder.html b/log/struct.RecordBuilder.html new file mode 100644 index 0000000..4409897 --- /dev/null +++ b/log/struct.RecordBuilder.html @@ -0,0 +1,63 @@ +log::RecordBuilder - Rust

[][src]Struct log::RecordBuilder

pub struct RecordBuilder<'a> { /* fields omitted */ }

Builder for Record.

+

Typically should only be used by log library creators or for testing and "shim loggers". +The RecordBuilder can set the different parameters of Record object, and returns +the created object when build is called.

+

Examples

+
This code runs with edition 2018
+use log::{Level, Record};
+
+let record = Record::builder()
+                .args(format_args!("Error!"))
+                .level(Level::Error)
+                .target("myApp")
+                .file(Some("server.rs"))
+                .line(Some(144))
+                .module_path(Some("server"))
+                .build();
+

Alternatively, use MetadataBuilder:

+ +
This code runs with edition 2018
+use log::{Record, Level, MetadataBuilder};
+
+let error_metadata = MetadataBuilder::new()
+                        .target("myApp")
+                        .level(Level::Error)
+                        .build();
+
+let record = Record::builder()
+                .metadata(error_metadata)
+                .args(format_args!("Error!"))
+                .line(Some(433))
+                .file(Some("app.rs"))
+                .module_path(Some("server"))
+                .build();
+

Methods

impl<'a> RecordBuilder<'a>[src]

pub fn new() -> RecordBuilder<'a>[src]

Construct new RecordBuilder.

+

The default options are:

+ +

pub fn args(&mut self, args: Arguments<'a>) -> &mut RecordBuilder<'a>[src]

Set args.

+

pub fn metadata(&mut self, metadata: Metadata<'a>) -> &mut RecordBuilder<'a>[src]

Set metadata. Construct a Metadata object with MetadataBuilder.

+

pub fn level(&mut self, level: Level) -> &mut RecordBuilder<'a>[src]

pub fn target(&mut self, target: &'a str) -> &mut RecordBuilder<'a>[src]

pub fn module_path(&mut self, path: Option<&'a str>) -> &mut RecordBuilder<'a>[src]

pub fn module_path_static(
    &mut self,
    path: Option<&'static str>
) -> &mut RecordBuilder<'a>
[src]

Set module_path to a 'static string

+

pub fn file(&mut self, file: Option<&'a str>) -> &mut RecordBuilder<'a>[src]

Set file

+

pub fn file_static(
    &mut self,
    file: Option<&'static str>
) -> &mut RecordBuilder<'a>
[src]

Set file to a 'static string.

+

pub fn line(&mut self, line: Option<u32>) -> &mut RecordBuilder<'a>[src]

Set line

+

pub fn build(&self) -> Record<'a>[src]

Invoke the builder and return a Record

+

Trait Implementations

impl<'a> Debug for RecordBuilder<'a>[src]

Auto Trait Implementations

impl<'a> !Send for RecordBuilder<'a>

impl<'a> !Sync for RecordBuilder<'a>

impl<'a> Unpin for RecordBuilder<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/log/struct.SetLoggerError.html b/log/struct.SetLoggerError.html new file mode 100644 index 0000000..1714766 --- /dev/null +++ b/log/struct.SetLoggerError.html @@ -0,0 +1,13 @@ +log::SetLoggerError - Rust

[][src]Struct log::SetLoggerError

pub struct SetLoggerError(_);

The type returned by set_logger if set_logger has already been called.

+

Trait Implementations

impl Debug for SetLoggerError[src]

impl Display for SetLoggerError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/log/trait.Log.html b/log/trait.Log.html new file mode 100644 index 0000000..6fb708c --- /dev/null +++ b/log/trait.Log.html @@ -0,0 +1,18 @@ +log::Log - Rust

[][src]Trait log::Log

pub trait Log: Sync + Send {
+    fn enabled(&self, metadata: &Metadata) -> bool;
+
fn log(&self, record: &Record); +
fn flush(&self); +}

A trait encapsulating the operations required of a logger.

+
+

Required methods

fn enabled(&self, metadata: &Metadata) -> bool

Determines if a log message with the specified metadata would be +logged.

+

This is used by the log_enabled! macro to allow callers to avoid +expensive computation of log message arguments if the message would be +discarded anyway.

+

fn log(&self, record: &Record)

Logs the Record.

+

Note that enabled is not necessarily called before this method. +Implementations of log should perform all necessary filtering +internally.

+

fn flush(&self)

Flushes any buffered records.

+
Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/main.js b/main.js new file mode 100644 index 0000000..b912f0c --- /dev/null +++ b/main.js @@ -0,0 +1,7 @@ +if(!String.prototype.startsWith){String.prototype.startsWith=function(searchString,position){position=position||0;return this.indexOf(searchString,position)===position}}if(!String.prototype.endsWith){String.prototype.endsWith=function(suffix,length){var l=length||this.length;return this.indexOf(suffix,l-suffix.length)!==-1}}if(!DOMTokenList.prototype.add){DOMTokenList.prototype.add=function(className){if(className&&!hasClass(this,className)){if(this.className&&this.className.length>0){this.className+=" "+className}else{this.className=className}}}}if(!DOMTokenList.prototype.remove){DOMTokenList.prototype.remove=function(className){if(className&&this.className){this.className=(" "+this.className+" ").replace(" "+className+" "," ").trim()}}}function getSearchInput(){return document.getElementsByClassName("search-input")[0]}function getSearchElement(){return document.getElementById("search")}(function(){"use strict";var itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias"];var disableShortcuts=getCurrentValue("rustdoc-disable-shortcuts")==="true";var search_input=getSearchInput();var currentTab=0;var titleBeforeSearch=document.title;function getPageId(){var id=document.location.href.split("#")[1];if(id){return id.split("?")[0].split("&")[0]}return null}function showSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){addClass(elems,"show-it")}var sidebar=document.getElementsByClassName("sidebar")[0];if(sidebar){addClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(!filler){var div=document.createElement("div");div.id="sidebar-filler";sidebar.appendChild(div)}}var themePickers=document.getElementsByClassName("theme-picker");if(themePickers&&themePickers.length>0){themePickers[0].style.display="none"}}function hideSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){removeClass(elems,"show-it")}var sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(filler){filler.remove()}document.getElementsByTagName("body")[0].style.marginTop="";var themePickers=document.getElementsByClassName("theme-picker");if(themePickers&&themePickers.length>0){themePickers[0].style.display=null}}function showSearchResults(search){if(search===null||typeof search==='undefined'){search=getSearchElement()}addClass(main,"hidden");removeClass(search,"hidden")}function hideSearchResults(search){if(search===null||typeof search==='undefined'){search=getSearchElement()}addClass(search,"hidden");removeClass(main,"hidden")}var TY_PRIMITIVE=itemTypes.indexOf("primitive");var TY_KEYWORD=itemTypes.indexOf("keyword");function getQueryStringParams(){var params={};window.location.search.substring(1).split("&").map(function(s){var pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function isHidden(elem){return elem.offsetHeight===0}var main=document.getElementById("main");var savedHash="";function handleHashes(ev){var search=getSearchElement();if(ev!==null&&search&&!hasClass(search,"hidden")&&ev.newURL){hideSearchResults(search);var hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(hash,"","?search=#"+hash)}var elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}if(savedHash!==window.location.hash){savedHash=window.location.hash;if(savedHash.length===0){return}var elem=document.getElementById(savedHash.slice(1));if(!elem||!isHidden(elem)){return}var parent=elem.parentNode;if(parent&&hasClass(parent,"impl-items")){onEachLazy(parent.getElementsByClassName("collapsed"),function(e){if(e.parentNode===parent){e.click();return true}});if(isHidden(elem)){if(hasClass(parent.lastElementChild,"collapse-toggle")){parent.lastElementChild.click()}}}}}function highlightSourceLines(match,ev){if(typeof match==="undefined"){hideSidebar();match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/)}if(!match){return}var from=parseInt(match[1],10);var to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to0){collapseDocs(collapses[0],"show")}}}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!="undefined"){return ev.key}var c=ev.charCode||ev.keyCode;if(c==27){return"Escape"}return String.fromCharCode(c)}function getHelpElement(){return document.getElementById("help")}function displayHelp(display,ev,help){var help=help?help:getHelpElement();if(display===true){if(hasClass(help,"hidden")){ev.preventDefault();removeClass(help,"hidden");addClass(document.body,"blur")}}else if(hasClass(help,"hidden")===false){ev.preventDefault();addClass(help,"hidden");removeClass(document.body,"blur")}}function handleEscape(ev){var help=getHelpElement();var search=getSearchElement();if(hasClass(help,"hidden")===false){displayHelp(false,ev,help)}else if(hasClass(search,"hidden")===false){ev.preventDefault();hideSearchResults(search);document.title=titleBeforeSearch}defocusSearchBar()}function handleShortcut(ev){if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts===true){return}if(document.activeElement.tagName==="INPUT"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":displayHelp(false,ev);ev.preventDefault();focusSearchBar();break;case"+":case"-":ev.preventDefault();toggleAllDocs();break;case"?":if(ev.shiftKey){displayHelp(true,ev)}break}}}function findParentElement(elem,tagName){do{if(elem&&elem.tagName===tagName){return elem}elem=elem.parentNode}while(elem);return null}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);var handleSourceHighlight=(function(){var prev_line_id=0;var set_fragment=function(name){var x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSourceLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return function(ev){var cur_line_id=parseInt(ev.target.id,10);ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){var tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}})();document.addEventListener("click",function(ev){if(hasClass(ev.target,"collapse-toggle")){collapseDocs(ev.target,"toggle")}else if(hasClass(ev.target.parentNode,"collapse-toggle")){collapseDocs(ev.target.parentNode,"toggle")}else if(ev.target.tagName==="SPAN"&&hasClass(ev.target.parentNode,"line-numbers")){handleSourceHighlight(ev)}else if(hasClass(getHelpElement(),"hidden")===false){var help=getHelpElement();var is_inside_help_popup=ev.target!==help&&help.contains(ev.target);if(is_inside_help_popup===false){addClass(help,"hidden");removeClass(document.body,"blur")}}else{var a=findParentElement(ev.target,"A");if(a&&a.hash){expandSection(a.hash.replace(/^#/,""))}}});var x=document.getElementsByClassName("version-selector");if(x.length>0){x[0].onchange=function(){var i,match,url=document.location.href,stripped="",len=rootPath.match(/\.\.\//g).length+1;for(i=0;i-1){var obj=searchIndex[results[i].id];obj.lev=results[i].lev;if(isType!==true||obj.type){var res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}}return out}function sortResults(results,isType){var ar=[];for(var entry in results){if(results.hasOwnProperty(entry)){ar.push(results[entry])}}results=ar;var i;var nresults=results.length;for(i=0;ib?+1:-1)}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});var length=results.length;for(i=0;i"));return{name:val.substring(0,val.indexOf("<")),generics:values.split(/\s*,\s*/),}}return{name:val,generics:[],}}function checkGenerics(obj,val){var lev_distance=MAX_LEV_DISTANCE+1;if(val.generics.length>0){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>=val.generics.length){var elems=obj[GENERICS_DATA].slice(0);var total=0;var done=0;var vlength=val.generics.length;for(var y=0;yGENERICS_DATA&&obj[GENERICS_DATA].length>=val.generics.length){var elems=obj[GENERICS_DATA].slice(0);var allFound=true;for(var y=0;allFound===true&&yGENERICS_DATA&&obj[GENERICS_DATA].length!==0){var tmp_lev=checkGenerics(obj,val);if(tmp_lev<=MAX_LEV_DISTANCE){return tmp_lev}}else{return 0}}if(literalSearch===true){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>0){var length=obj[GENERICS_DATA].length;for(x=0;xGENERICS_DATA&&obj[GENERICS_DATA].length>0){var olength=obj[GENERICS_DATA].length;for(x=0;x0){var length=obj.type[INPUTS_DATA].length;for(var i=0;iOUTPUT_DATA){var ret=obj.type[OUTPUT_DATA];if(!obj.type[OUTPUT_DATA].length){ret=[ret]}for(var x=0;xlength){return MAX_LEV_DISTANCE+1}for(var i=0;ilength){break}var lev_total=0;var aborted=false;for(var x=0;xMAX_LEV_DISTANCE){aborted=true;break}lev_total+=lev}if(aborted===false){ret_lev=Math.min(ret_lev,Math.round(lev_total/clength))}}return ret_lev}function typePassesFilter(filter,type){if(filter<0)return true;if(filter===type)return true;var name=itemTypes[type];switch(itemTypes[filter]){case"constant":return(name=="associatedconstant");case"fn":return(name=="method"||name=="tymethod");case"type":return(name=="primitive"||name=="keyword")}return false}function generateId(ty){if(ty.parent&&ty.parent.name){return itemTypes[ty.ty]+ty.path+ty.parent.name+ty.name}return itemTypes[ty.ty]+ty.path+ty.name}var nSearchWords=searchWords.length;var i;var ty;var fullId;var returned;var in_args;if((val.charAt(0)==="\""||val.charAt(0)==="'")&&val.charAt(val.length-1)===val.charAt(0)){val=extractGenerics(val.substr(1,val.length-2));for(i=0;i")>-1){var trimmer=function(s){return s.trim()};var parts=val.split("->").map(trimmer);var input=parts[0];var inputs=input.split(",").map(trimmer).sort();for(i=0;iOUTPUT_DATA?type[OUTPUT_DATA].name:"";returned=checkReturned(ty,output,true);if(output.name==="*"||returned===true){in_args=false;var is_module=false;if(input==="*"){is_module=true}else{var allFound=true;for(var it=0;allFound===true&&it1?paths.length-1:1);var lev;var lev_distance;for(j=0;j1){lev=checkPath(contains,paths[paths.length-1],ty);if(lev>MAX_LEV_DISTANCE){continue}else if(lev>0){lev_add=lev/10}}returned=MAX_LEV_DISTANCE+1;in_args=MAX_LEV_DISTANCE+1;var index=-1;lev=MAX_LEV_DISTANCE+1;fullId=generateId(ty);if(searchWords[j].indexOf(split[i])>-1||searchWords[j].indexOf(val)>-1||searchWords[j].replace(/_/g,"").indexOf(val)>-1){if(typePassesFilter(typeFilter,ty.ty)&&results[fullId]===undefined){index=searchWords[j].replace(/_/g,"").indexOf(val)}}if((lev=levenshtein(searchWords[j],val))<=MAX_LEV_DISTANCE){if(typePassesFilter(typeFilter,ty.ty)===false){lev=MAX_LEV_DISTANCE+1}else{lev+=1}}if((in_args=findArg(ty,valGenerics))<=MAX_LEV_DISTANCE){if(typePassesFilter(typeFilter,ty.ty)===false){in_args=MAX_LEV_DISTANCE+1}}if((returned=checkReturned(ty,valGenerics))<=MAX_LEV_DISTANCE){if(typePassesFilter(typeFilter,ty.ty)===false){returned=MAX_LEV_DISTANCE+1}}lev+=lev_add;if(lev>0&&val.length>3&&searchWords[j].indexOf(val)>-1){if(val.length<6){lev-=1}else{lev=0}}if(in_args<=MAX_LEV_DISTANCE){if(results_in_args[fullId]===undefined){results_in_args[fullId]={id:j,index:index,lev:in_args,}}results_in_args[fullId].lev=Math.min(results_in_args[fullId].lev,in_args)}if(returned<=MAX_LEV_DISTANCE){if(results_returned[fullId]===undefined){results_returned[fullId]={id:j,index:index,lev:returned,}}results_returned[fullId].lev=Math.min(results_returned[fullId].lev,returned)}if(index!==-1||lev<=MAX_LEV_DISTANCE){if(index!==-1&&paths.length<2){lev=0}if(results[fullId]===undefined){results[fullId]={id:j,index:index,lev:lev,}}results[fullId].lev=Math.min(results[fullId].lev,lev)}}}var ret={"in_args":sortResults(results_in_args,true),"returned":sortResults(results_returned,true),"others":sortResults(results),};if(ALIASES&&ALIASES[window.currentCrate]&&ALIASES[window.currentCrate][query.raw]){var aliases=ALIASES[window.currentCrate][query.raw];for(i=0;iMAX_RESULTS){ret.others.pop()}}}return ret}function validateResult(name,path,keys,parent){for(var i=0;i-1||path.indexOf(keys[i])>-1||(parent!==undefined&&parent.name!==undefined&&parent.name.toLowerCase().indexOf(keys[i])>-1)||levenshtein(name,keys[i])<=MAX_LEV_DISTANCE)){return false}}return true}function getQuery(raw){var matches,type,query;query=raw;matches=query.match(/^(fn|mod|struct|enum|trait|type|const|macro)\s*:\s*/i);if(matches){type=matches[1].replace(/^const$/,"constant");query=query.substring(matches[0].length)}return{raw:raw,query:query,type:type,id:query+type}}function initSearchNav(){var hoverTimeout;var click_func=function(e){var el=e.target;while(el.tagName!=="TR"){el=el.parentNode}var dst=e.target.getElementsByTagName("a");if(dst.length<1){return}dst=dst[0];if(window.location.pathname===dst.pathname){hideSearchResults();document.location.href=dst.href}};var mouseover_func=function(e){var el=e.target;while(el.tagName!=="TR"){el=el.parentNode}clearTimeout(hoverTimeout);hoverTimeout=setTimeout(function(){onEachLazy(document.getElementsByClassName("search-results"),function(e){onEachLazy(e.getElementsByClassName("result"),function(i_e){removeClass(i_e,"highlighted")})});addClass(el,"highlighted")},20)};onEachLazy(document.getElementsByClassName("search-results"),function(e){onEachLazy(e.getElementsByClassName("result"),function(i_e){i_e.onclick=click_func;i_e.onmouseover=mouseover_func})});search_input.onkeydown=function(e){var actives=[[],[],[]];var current=0;onEachLazy(document.getElementById("results").childNodes,function(e){onEachLazy(e.getElementsByClassName("highlighted"),function(e){actives[current].push(e)});current+=1});if(e.which===38){if(!actives[currentTab].length||!actives[currentTab][0].previousElementSibling){return}addClass(actives[currentTab][0].previousElementSibling,"highlighted");removeClass(actives[currentTab][0],"highlighted")}else if(e.which===40){if(!actives[currentTab].length){var results=document.getElementById("results").childNodes;if(results.length>0){var res=results[currentTab].getElementsByClassName("result");if(res.length>0){addClass(res[0],"highlighted")}}}else if(actives[currentTab][0].nextElementSibling){addClass(actives[currentTab][0].nextElementSibling,"highlighted");removeClass(actives[currentTab][0],"highlighted")}}else if(e.which===13){if(actives[currentTab].length){document.location.href=actives[currentTab][0].getElementsByTagName("a")[0].href}}else if(e.which===9){if(e.shiftKey){printTab(currentTab>0?currentTab-1:2)}else{printTab(currentTab>1?0:currentTab+1)}e.preventDefault()}else if(e.which===16){}else if(actives[currentTab].length>0){removeClass(actives[currentTab][0],"highlighted")}}}function buildHrefAndPath(item){var displayPath;var href;var type=itemTypes[item.ty];var name=item.name;var path=item.path;if(type==="mod"){displayPath=path+"::";href=rootPath+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="primitive"||type==="keyword"){displayPath="";href=rootPath+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=rootPath+name+"/index.html"}else if(item.parent!==undefined){var myparent=item.parent;var anchor="#"+type+"."+name;var parentType=itemTypes[myparent.ty];var pageType=parentType;var pageName=myparent.name;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){var splitPath=item.path.split("::");var enumName=splitPath.pop();path=splitPath.join("::");displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="#variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}href=rootPath+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html"+anchor}else{displayPath=item.path+"::";href=rootPath+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href]}function escape(content){var h1=document.createElement("h1");h1.textContent=content;return h1.innerHTML}function pathSplitter(path){var tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){var extraStyle="";if(display===false){extraStyle=" style=\"display: none;\""}var output="";var duplicates={};var length=0;if(array.length>0){output="";array.forEach(function(item){var name,type;name=item.name;type=itemTypes[item.ty];if(item.is_alias!==true){if(duplicates[item.fullPath]){return}duplicates[item.fullPath]=true}length+=1;output+=""});output+="
"+""+(item.is_alias===true?(""+item.alias+"  - see "):"")+item.displayPath+""+name+""+""+""+escape(item.desc)+" 
"}else{output="
No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:
"}return[output,length]}function makeTabHeader(tabNb,text,nbElems){if(currentTab===tabNb){return"
"+text+"
("+nbElems+")
"}return"
"+text+"
("+nbElems+")
"}function showResults(results){if(results.others.length===1&&getCurrentValue("rustdoc-go-to-only-result")==="true"){var elem=document.createElement("a");elem.href=results.others[0].href;elem.style.display="none";document.body.appendChild(elem);elem.click()}var query=getQuery(search_input.value);currentResults=query.id;var ret_others=addTab(results.others,query);var ret_in_args=addTab(results.in_args,query,false);var ret_returned=addTab(results.returned,query,false);var output="

Results for "+escape(query.query)+(query.type?" (type: "+escape(query.type)+")":"")+"

"+"
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"+ret_others[0]+ret_in_args[0]+ret_returned[0]+"
";var search=getSearchElement();search.innerHTML=output;showSearchResults(search);var tds=search.getElementsByTagName("td");var td_width=0;if(tds.length>0){td_width=tds[0].offsetWidth}var width=search.offsetWidth-40-td_width;onEachLazy(search.getElementsByClassName("desc"),function(e){e.style.width=width+"px"});initSearchNav();var elems=document.getElementById("titles").childNodes;elems[0].onclick=function(){printTab(0)};elems[1].onclick=function(){printTab(1)};elems[2].onclick=function(){printTab(2)};printTab(currentTab)}function execSearch(query,searchWords,filterCrates){function getSmallest(arrays,positions,notDuplicates){var start=null;for(var it=0;itpositions[it]&&(start===null||start>arrays[it][positions[it]].lev)&&!notDuplicates[arrays[it][positions[it]].fullPath]){start=arrays[it][positions[it]].lev}}return start}function mergeArrays(arrays){var ret=[];var positions=[];var notDuplicates={};for(var x=0;xpositions[x]&&arrays[x][positions[x]].lev===smallest&&!notDuplicates[arrays[x][positions[x]].fullPath]){ret.push(arrays[x][positions[x]]);notDuplicates[arrays[x][positions[x]].fullPath]=true;positions[x]+=1}}}return ret}var queries=query.raw.split(",");var results={"in_args":[],"returned":[],"others":[],};for(var i=0;i1){return{"in_args":mergeArrays(results.in_args),"returned":mergeArrays(results.returned),"others":mergeArrays(results.others),}}else{return{"in_args":results.in_args[0],"returned":results.returned[0],"others":results.others[0],}}}function getFilterCrates(){var elem=document.getElementById("crate-search");if(elem&&elem.value!=="All crates"&&rawSearchIndex.hasOwnProperty(elem.value)){return elem.value}return undefined}function search(e,forced){var params=getQueryStringParams();var query=getQuery(search_input.value.trim());if(e){e.preventDefault()}if(query.query.length===0){return}if(forced!==true&&query.id===currentResults){if(query.query.length>0){putBackSearch(search_input)}return}document.title="Results for "+query.query+" - Rust";if(browserSupportsHistoryApi()){if(!history.state&&!params.search){history.pushState(query,"","?search="+encodeURIComponent(query.raw))}else{history.replaceState(query,"","?search="+encodeURIComponent(query.raw))}}var filterCrates=getFilterCrates();showResults(execSearch(query,index,filterCrates))}function buildIndex(rawSearchIndex){searchIndex=[];var searchWords=[];var i;for(var crate in rawSearchIndex){if(!rawSearchIndex.hasOwnProperty(crate)){continue}searchWords.push(crate);searchIndex.push({crate:crate,ty:1,name:crate,path:"",desc:rawSearchIndex[crate].doc,type:null,});var items=rawSearchIndex[crate].i;var paths=rawSearchIndex[crate].p;var len=paths.length;for(i=0;i0){search_input.value=params.search;search(e)}else{search_input.value="";hideSearchResults()}})}search()}index=buildIndex(rawSearchIndex);startSearch();if(rootPath==="../"||rootPath==="./"){var sidebar=document.getElementsByClassName("sidebar-elems")[0];if(sidebar){var div=document.createElement("div");div.className="block crate";div.innerHTML="

Crates

";var ul=document.createElement("ul");div.appendChild(ul);var crates=[];for(var crate in rawSearchIndex){if(!rawSearchIndex.hasOwnProperty(crate)){continue}crates.push(crate)}crates.sort();for(var i=0;i"+""+"
"+code.outerHTML+"
";list.appendChild(display)}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}function labelForToggleButton(sectionIsCollapsed){if(sectionIsCollapsed){return"+"}return"\u2212"}function onEveryMatchingChild(elem,className,func){if(elem&&className&&func){var length=elem.childNodes.length;var nodes=elem.childNodes;for(var i=0;i"+labelForToggleButton(sectionIsCollapsed)+"
]";return toggle}var toggle=createSimpleToggle(false);var hideMethodDocs=getCurrentValue("rustdoc-auto-hide-method-docs")==="true";var pageId=getPageId();var func=function(e){var next=e.nextElementSibling;if(!next){return}if(hasClass(next,"docblock")===true||(hasClass(next,"stability")===true&&hasClass(next.nextElementSibling,"docblock")===true)){var newToggle=toggle.cloneNode(true);insertAfter(newToggle,e.childNodes[e.childNodes.length-1]);if(hideMethodDocs===true&&hasClass(e,"method")===true){collapseDocs(newToggle,"hide",pageId)}}};var funcImpl=function(e){var next=e.nextElementSibling;if(next&&hasClass(next,"docblock")){next=next.nextElementSibling}if(!next){return}if(next.getElementsByClassName("method").length>0&&hasClass(e,"impl")){insertAfter(toggle.cloneNode(true),e.childNodes[e.childNodes.length-1])}};onEachLazy(document.getElementsByClassName("method"),func);onEachLazy(document.getElementsByClassName("associatedconstant"),func);onEachLazy(document.getElementsByClassName("impl"),funcImpl);var impl_call=function(){};if(hideMethodDocs===true){impl_call=function(e,newToggle,pageId){if(e.id.match(/^impl(?:-\d+)?$/)===null){if(hasClass(e,"impl")===true){collapseDocs(newToggle,"hide",pageId)}}}}var newToggle=document.createElement("a");newToggle.href="javascript:void(0)";newToggle.className="collapse-toggle hidden-default collapsed";newToggle.innerHTML="["+labelForToggleButton(true)+"] Show hidden undocumented items";function toggleClicked(){if(hasClass(this,"collapsed")){removeClass(this,"collapsed");onEachLazy(this.parentNode.getElementsByClassName("hidden"),function(x){if(hasClass(x,"content")===false){removeClass(x,"hidden");addClass(x,"x")}},true);this.innerHTML="["+labelForToggleButton(false)+"] Hide undocumented items"}else{addClass(this,"collapsed");onEachLazy(this.parentNode.getElementsByClassName("x"),function(x){if(hasClass(x,"content")===false){addClass(x,"hidden");removeClass(x,"x")}},true);this.innerHTML="["+labelForToggleButton(true)+"] Show hidden undocumented items"}}onEachLazy(document.getElementsByClassName("impl-items"),function(e){onEachLazy(e.getElementsByClassName("associatedconstant"),func);var hiddenElems=e.getElementsByClassName("hidden");var needToggle=false;var hlength=hiddenElems.length;for(var i=0;i0){inner[0].innerHTML="+"}}if(extraClass){addClass(wrapper,extraClass)}wrapper.appendChild(mainToggle);return wrapper}var currentType=document.getElementsByClassName("type-decl")[0];var className=null;if(currentType){currentType=currentType.getElementsByClassName("rust")[0];if(currentType){currentType.classList.forEach(function(item){if(item!=="main"){className=item;return true}})}}var showItemDeclarations=getCurrentValue("rustdoc-auto-hide-"+className);if(showItemDeclarations===null){if(className==="enum"||className==="macro"){showItemDeclarations="false"}else if(className==="struct"||className==="union"||className==="trait"){showItemDeclarations="true"}else{showItemDeclarations=getCurrentValue("rustdoc-auto-hide-declarations")}}showItemDeclarations=showItemDeclarations==="false";function buildToggleWrapper(e){if(hasClass(e,"autohide")){var wrap=e.previousElementSibling;if(wrap&&hasClass(wrap,"toggle-wrapper")){var inner_toggle=wrap.childNodes[0];var extra=e.childNodes[0].tagName==="H3";e.style.display="none";addClass(wrap,"collapsed");onEachLazy(inner_toggle.getElementsByClassName("inner"),function(e){e.innerHTML=labelForToggleButton(true)});onEachLazy(inner_toggle.getElementsByClassName("toggle-label"),function(e){e.style.display="inline-block";if(extra===true){i_e.innerHTML=" Show "+e.childNodes[0].innerHTML}})}}if(e.parentNode.id==="main"){var otherMessage="";var fontSize;var extraClass;if(hasClass(e,"type-decl")){fontSize="20px";otherMessage=" Show declaration";if(showItemDeclarations===false){extraClass="collapsed"}}else if(hasClass(e,"sub-variant")){otherMessage=" Show fields"}else if(hasClass(e,"non-exhaustive")){otherMessage=" This ";if(hasClass(e,"non-exhaustive-struct")){otherMessage+="struct"}else if(hasClass(e,"non-exhaustive-enum")){otherMessage+="enum"}else if(hasClass(e,"non-exhaustive-variant")){otherMessage+="enum variant"}else if(hasClass(e,"non-exhaustive-type")){otherMessage+="type"}otherMessage+=" is marked as non-exhaustive"}else if(hasClass(e.childNodes[0],"impl-items")){extraClass="marg-left"}e.parentNode.insertBefore(createToggle(otherMessage,fontSize,extraClass,hasClass(e,"type-decl")===false||showItemDeclarations===true),e);if(hasClass(e,"type-decl")===true&&showItemDeclarations===true){collapseDocs(e.previousSibling.childNodes[0],"toggle")}if(hasClass(e,"non-exhaustive")===true){collapseDocs(e.previousSibling.childNodes[0],"toggle")}}}onEachLazy(document.getElementsByClassName("docblock"),buildToggleWrapper);onEachLazy(document.getElementsByClassName("sub-variant"),buildToggleWrapper);function createToggleWrapper(tog){var span=document.createElement("span");span.className="toggle-label";span.style.display="none";span.innerHTML=" Expand attributes";tog.appendChild(span);var wrapper=document.createElement("div");wrapper.className="toggle-wrapper toggle-attributes";wrapper.appendChild(tog);return wrapper}var itemAttributesFunc=function(){};if(getCurrentValue("rustdoc-auto-hide-attributes")!=="false"){itemAttributesFunc=function(x){collapseDocs(x.previousSibling.childNodes[0],"toggle")}}var attributesToggle=createToggleWrapper(createSimpleToggle(false));onEachLazy(main.getElementsByClassName("attributes"),function(i_e){var attr_tog=attributesToggle.cloneNode(true);if(hasClass(i_e,"top-attr")===true){addClass(attr_tog,"top-attr")}i_e.parentNode.insertBefore(attr_tog,i_e);itemAttributesFunc(i_e)});var lineNumbersFunc=function(){};if(getCurrentValue("rustdoc-line-numbers")==="true"){lineNumbersFunc=function(x){var count=x.textContent.split("\n").length;var elems=[];for(var i=0;iLoading search results...";showSearchResults(search)}var sidebar_menu=document.getElementsByClassName("sidebar-menu")[0];if(sidebar_menu){sidebar_menu.onclick=function(){var sidebar=document.getElementsByClassName("sidebar")[0];if(hasClass(sidebar,"mobile")===true){hideSidebar()}else{showSidebar()}}}window.onresize=function(){hideSidebar()};autoCollapse(getPageId(),getCurrentValue("rustdoc-collapse")==="true");if(window.location.hash&&window.location.hash.length>0){expandSection(window.location.hash.replace(/^#/,""))}if(main){onEachLazy(main.getElementsByClassName("loading-content"),function(e){e.remove()});onEachLazy(main.childNodes,function(e){if(e.tagName==="H2"||e.tagName==="H3"){var nextTagName=e.nextElementSibling.tagName;if(nextTagName=="H2"||nextTagName=="H3"){e.nextElementSibling.style.display="flex"}else{e.nextElementSibling.style.display="block"}}})}function addSearchOptions(crates){var elem=document.getElementById("crate-search");if(!elem){return}var crates_text=[];if(Object.keys(crates).length>1){for(var crate in crates){if(crates.hasOwnProperty(crate)){crates_text.push(crate)}}}crates_text.sort(function(a,b){var lower_a=a.toLowerCase();var lower_b=b.toLowerCase();if(lower_alower_b){return 1}return 0});var savedCrate=getCurrentValue("rustdoc-saved-filter-crate");for(var i=0;i"
"+x[0]+"
"+x[1]+"
").join("");var div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";var infos=["Prefix searches with a type followed by a colon (e.g., fn:) to \ + restrict the search to a given type.","Accepted types are: fn, mod, struct, \ + enum, trait, type, macro, \ + and const.","Search functions by type signature (e.g., vec -> usize or \ + * -> vec)","Search multiple things at once by splitting your query with comma (e.g., \ + str,u8 or String,struct:Vec,test)","You can look for items with an exact name by putting double quotes around \ + your request: \"string\"","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");var div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;container.appendChild(div_shortcuts);container.appendChild(div_infos);popup.appendChild(container);insertAfter(popup,getSearchElement())}onHashChange(null);window.onhashchange=onHashChange;buildHelperPopup()}());function focusSearchBar(){getSearchInput().focus()}function defocusSearchBar(){getSearchInput().blur()} \ No newline at end of file diff --git a/normalize.css b/normalize.css new file mode 100644 index 0000000..45b6cb2 --- /dev/null +++ b/normalize.css @@ -0,0 +1,2 @@ +/*! normalize.css v3.0.0 | MIT License | git.io/normalize */ +html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0} \ No newline at end of file diff --git a/noscript.css b/noscript.css new file mode 100644 index 0000000..351b41c --- /dev/null +++ b/noscript.css @@ -0,0 +1 @@ +#main>h2+div,#main>h2+h3,#main>h3+div{display:block;}.loading-content{display:none;}#main>h2+div,#main>h3+div{display:block;}#main>h2+h3{display:flex;} \ No newline at end of file diff --git a/proc_macro2/all.html b/proc_macro2/all.html new file mode 100644 index 0000000..de2768a --- /dev/null +++ b/proc_macro2/all.html @@ -0,0 +1,3 @@ +List of all items in this crate

[] + + List of all items

Structs

Enums

\ No newline at end of file diff --git a/proc_macro2/enum.Delimiter.html b/proc_macro2/enum.Delimiter.html new file mode 100644 index 0000000..a7633e0 --- /dev/null +++ b/proc_macro2/enum.Delimiter.html @@ -0,0 +1,37 @@ +proc_macro2::Delimiter - Rust

[][src]Enum proc_macro2::Delimiter

pub enum Delimiter {
+    Parenthesis,
+    Brace,
+    Bracket,
+    None,
+}

Describes how a sequence of token trees is delimited.

+

+ Variants

+
Parenthesis

( ... )

+
Brace

{ ... }

+
Bracket

[ ... ]

+
None

Ø ... Ø

+

An implicit delimiter, that may, for example, appear around tokens +coming from a "macro variable" $var. It is important to preserve +operator priorities in cases like $var * 3 where $var is 1 + 2. +Implicit delimiters may not survive roundtrip of a token stream through +a string.

+

Trait Implementations

impl Clone for Delimiter[src]

impl Copy for Delimiter[src]

impl Debug for Delimiter[src]

impl Eq for Delimiter[src]

impl PartialEq<Delimiter> for Delimiter[src]

impl StructuralEq for Delimiter[src]

impl StructuralPartialEq for Delimiter[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/proc_macro2/enum.Spacing.html b/proc_macro2/enum.Spacing.html new file mode 100644 index 0000000..1b5398b --- /dev/null +++ b/proc_macro2/enum.Spacing.html @@ -0,0 +1,31 @@ +proc_macro2::Spacing - Rust

[][src]Enum proc_macro2::Spacing

pub enum Spacing {
+    Alone,
+    Joint,
+}

Whether an Punct is followed immediately by another Punct or followed by +another token or whitespace.

+

+ Variants

+
Alone

E.g. + is Alone in + =, +ident or +().

+
Joint

E.g. + is Joint in += or ' is Joint in '#.

+

Additionally, single quote ' can join with identifiers to form +lifetimes 'ident.

+

Trait Implementations

impl Clone for Spacing[src]

impl Copy for Spacing[src]

impl Debug for Spacing[src]

impl Eq for Spacing[src]

impl PartialEq<Spacing> for Spacing[src]

impl StructuralEq for Spacing[src]

impl StructuralPartialEq for Spacing[src]

Auto Trait Implementations

impl RefUnwindSafe for Spacing

impl Send for Spacing

impl Sync for Spacing

impl Unpin for Spacing

impl UnwindSafe for Spacing

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/proc_macro2/enum.TokenTree.html b/proc_macro2/enum.TokenTree.html new file mode 100644 index 0000000..2864369 --- /dev/null +++ b/proc_macro2/enum.TokenTree.html @@ -0,0 +1,50 @@ +proc_macro2::TokenTree - Rust

[][src]Enum proc_macro2::TokenTree

pub enum TokenTree {
+    Group(Group),
+    Ident(Ident),
+    Punct(Punct),
+    Literal(Literal),
+}

A single token or a delimited sequence of token trees (e.g. [1, (), ..]).

+

+ Variants

+
Group(Group)

A token stream surrounded by bracket delimiters.

+
Ident(Ident)

An identifier.

+
Punct(Punct)

A single punctuation character (+, ,, $, etc.).

+
Literal(Literal)

A literal character ('a'), string ("hello"), number (2.3), etc.

+

Methods

impl TokenTree[src]

pub fn span(&self) -> Span[src]

Returns the span of this tree, delegating to the span method of +the contained token or a delimited stream.

+

pub fn set_span(&mut self, span: Span)[src]

Configures the span for only this token.

+

Note that if this token is a Group then this method will not configure +the span of each of the internal tokens, this will simply delegate to +the set_span method of each variant.

+

Trait Implementations

impl Clone for TokenTree[src]

impl Debug for TokenTree[src]

Prints token tree in a form convenient for debugging.

+

impl Display for TokenTree[src]

Prints the token tree as a string that is supposed to be losslessly +convertible back into the same token tree (modulo spans), except for +possibly TokenTree::Groups with Delimiter::None delimiters and negative +numeric literals.

+

impl Extend<TokenTree> for TokenStream[src]

impl From<Group> for TokenTree[src]

impl From<Ident> for TokenTree[src]

impl From<Literal> for TokenTree[src]

impl From<Punct> for TokenTree[src]

impl From<TokenTree> for TokenStream[src]

impl FromIterator<TokenTree> for TokenStream[src]

Collects a number of token trees into a single stream.

+

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/proc_macro2/index.html b/proc_macro2/index.html new file mode 100644 index 0000000..2d5caaa --- /dev/null +++ b/proc_macro2/index.html @@ -0,0 +1,76 @@ +proc_macro2 - Rust

[][src]Crate proc_macro2

A wrapper around the procedural macro API of the compiler's proc_macro +crate. This library serves two purposes:

+
    +
  • +

    Bring proc-macro-like functionality to other contexts like build.rs and +main.rs. Types from proc_macro are entirely specific to procedural +macros and cannot ever exist in code outside of a procedural macro. +Meanwhile proc_macro2 types may exist anywhere including non-macro code. +By developing foundational libraries like syn and quote against +proc_macro2 rather than proc_macro, the procedural macro ecosystem +becomes easily applicable to many other use cases and we avoid +reimplementing non-macro equivalents of those libraries.

    +
  • +
  • +

    Make procedural macros unit testable. As a consequence of being +specific to procedural macros, nothing that uses proc_macro can be +executed from a unit test. In order for helper libraries or components of +a macro to be testable in isolation, they must be implemented using +proc_macro2.

    +
  • +
+

Usage

+

The skeleton of a typical procedural macro typically looks like this:

+ +
+extern crate proc_macro;
+
+#[proc_macro_derive(MyDerive)]
+pub fn my_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+    let input = proc_macro2::TokenStream::from(input);
+
+    let output: proc_macro2::TokenStream = {
+        /* transform input */
+    };
+
+    proc_macro::TokenStream::from(output)
+}
+

If parsing with Syn, you'll use parse_macro_input! instead to +propagate parse errors correctly back to the compiler when parsing fails.

+

Unstable features

+

The default feature set of proc-macro2 tracks the most recent stable +compiler API. Functionality in proc_macro that is not yet stable is not +exposed by proc-macro2 by default.

+

To opt into the additional APIs available in the most recent nightly +compiler, the procmacro2_semver_exempt config flag must be passed to +rustc. We will polyfill those nightly-only APIs back to Rust 1.31.0. As +these are unstable APIs that track the nightly compiler, minor versions of +proc-macro2 may make breaking changes to them at any time.

+
RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build
+
+

Note that this must not only be done for your crate, but for any crate that +depends on your crate. This infectious nature is intentional, as it serves +as a reminder that you are outside of the normal semver guarantees.

+

Semver exempt methods are marked as such in the proc-macro2 documentation.

+

Thread-Safety

+

Most types in this crate are !Sync because the underlying compiler +types make use of thread-local memory, meaning they cannot be accessed from +a different thread.

+

Modules

+
token_stream

Public implementation details for the TokenStream type, such as iterators.

+

Structs

+
Group

A delimited token stream.

+
Ident

A word of Rust code, which may be a keyword or legal variable name.

+
LexError

Error returned from TokenStream::from_str.

+
Literal

A literal string ("hello"), byte string (b"hello"), character ('a'), +byte character (b'a'), an integer or floating point number with or without +a suffix (1, 1u8, 2.3, 2.3f32).

+
Punct

An Punct is an single punctuation character like +, - or #.

+
Span

A region of source code, along with macro expansion information.

+
TokenStream

An abstract stream of tokens, or more concretely a sequence of token trees.

+

Enums

+
Delimiter

Describes how a sequence of token trees is delimited.

+
Spacing

Whether an Punct is followed immediately by another Punct or followed by +another token or whitespace.

+
TokenTree

A single token or a delimited sequence of token trees (e.g. [1, (), ..]).

+
\ No newline at end of file diff --git a/proc_macro2/sidebar-items.js b/proc_macro2/sidebar-items.js new file mode 100644 index 0000000..5667e02 --- /dev/null +++ b/proc_macro2/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["Delimiter","Describes how a sequence of token trees is delimited."],["Spacing","Whether an `Punct` is followed immediately by another `Punct` or followed by another token or whitespace."],["TokenTree","A single token or a delimited sequence of token trees (e.g. `[1, (), ..]`)."]],"mod":[["token_stream","Public implementation details for the `TokenStream` type, such as iterators."]],"struct":[["Group","A delimited token stream."],["Ident","A word of Rust code, which may be a keyword or legal variable name."],["LexError","Error returned from `TokenStream::from_str`."],["Literal","A literal string (`\"hello\"`), byte string (`b\"hello\"`), character (`'a'`), byte character (`b'a'`), an integer or floating point number with or without a suffix (`1`, `1u8`, `2.3`, `2.3f32`)."],["Punct","An `Punct` is an single punctuation character like `+`, `-` or `#`."],["Span","A region of source code, along with macro expansion information."],["TokenStream","An abstract stream of tokens, or more concretely a sequence of token trees."]]}); \ No newline at end of file diff --git a/proc_macro2/struct.Group.html b/proc_macro2/struct.Group.html new file mode 100644 index 0000000..a2e5173 --- /dev/null +++ b/proc_macro2/struct.Group.html @@ -0,0 +1,52 @@ +proc_macro2::Group - Rust

[][src]Struct proc_macro2::Group

pub struct Group { /* fields omitted */ }

A delimited token stream.

+

A Group internally contains a TokenStream which is surrounded by +Delimiters.

+

Methods

impl Group[src]

pub fn new(delimiter: Delimiter, stream: TokenStream) -> Group[src]

Creates a new Group with the given delimiter and token stream.

+

This constructor will set the span for this group to +Span::call_site(). To change the span you can use the set_span +method below.

+

pub fn delimiter(&self) -> Delimiter[src]

Returns the delimiter of this Group

+

pub fn stream(&self) -> TokenStream[src]

Returns the TokenStream of tokens that are delimited in this Group.

+

Note that the returned token stream does not include the delimiter +returned above.

+

pub fn span(&self) -> Span[src]

Returns the span for the delimiters of this token stream, spanning the +entire Group.

+
pub fn span(&self) -> Span {
+           ^^^^^^^
+
+

pub fn span_open(&self) -> Span[src]

Returns the span pointing to the opening delimiter of this group.

+
pub fn span_open(&self) -> Span {
+                ^
+
+

pub fn span_close(&self) -> Span[src]

Returns the span pointing to the closing delimiter of this group.

+
pub fn span_close(&self) -> Span {
+                       ^
+
+

pub fn set_span(&mut self, span: Span)[src]

Configures the span for this Group's delimiters, but not its internal +tokens.

+

This method will not set the span of all the internal tokens spanned +by this group, but rather it will only set the span of the delimiter +tokens at the level of the Group.

+

Trait Implementations

impl Clone for Group[src]

impl Debug for Group[src]

impl Display for Group[src]

Prints the group as a string that should be losslessly convertible back +into the same group (modulo spans), except for possibly TokenTree::Groups +with Delimiter::None delimiters.

+

impl From<Group> for TokenTree[src]

Auto Trait Implementations

impl !RefUnwindSafe for Group

impl !Send for Group

impl !Sync for Group

impl Unpin for Group

impl UnwindSafe for Group

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/proc_macro2/struct.Ident.html b/proc_macro2/struct.Ident.html new file mode 100644 index 0000000..5415d4f --- /dev/null +++ b/proc_macro2/struct.Ident.html @@ -0,0 +1,123 @@ +proc_macro2::Ident - Rust

[][src]Struct proc_macro2::Ident

pub struct Ident { /* fields omitted */ }

A word of Rust code, which may be a keyword or legal variable name.

+

An identifier consists of at least one Unicode code point, the first of +which has the XID_Start property and the rest of which have the XID_Continue +property.

+
    +
  • The empty string is not an identifier. Use Option<Ident>.
  • +
  • A lifetime is not an identifier. Use syn::Lifetime instead.
  • +
+

An identifier constructed with Ident::new is permitted to be a Rust +keyword, though parsing one through its Parse implementation rejects +Rust keywords. Use input.call(Ident::parse_any) when parsing to match the +behaviour of Ident::new.

+

Examples

+

A new ident can be created from a string using the Ident::new function. +A span must be provided explicitly which governs the name resolution +behavior of the resulting identifier.

+ +
+use proc_macro2::{Ident, Span};
+
+fn main() {
+    let call_ident = Ident::new("calligraphy", Span::call_site());
+
+    println!("{}", call_ident);
+}
+

An ident can be interpolated into a token stream using the quote! macro.

+ +
+use proc_macro2::{Ident, Span};
+use quote::quote;
+
+fn main() {
+    let ident = Ident::new("demo", Span::call_site());
+
+    // Create a variable binding whose name is this ident.
+    let expanded = quote! { let #ident = 10; };
+
+    // Create a variable binding with a slightly different name.
+    let temp_ident = Ident::new(&format!("new_{}", ident), Span::call_site());
+    let expanded = quote! { let #temp_ident = 10; };
+}
+

A string representation of the ident is available through the to_string() +method.

+ +
+// Examine the ident as a string.
+let ident_string = ident.to_string();
+if ident_string.len() > 60 {
+    println!("Very long identifier: {}", ident_string)
+}
+

Methods

impl Ident[src]

pub fn new(string: &str, span: Span) -> Ident[src]

Creates a new Ident with the given string as well as the specified +span.

+

The string argument must be a valid identifier permitted by the +language, otherwise the function will panic.

+

Note that span, currently in rustc, configures the hygiene information +for this identifier.

+

As of this time Span::call_site() explicitly opts-in to "call-site" +hygiene meaning that identifiers created with this span will be resolved +as if they were written directly at the location of the macro call, and +other code at the macro call site will be able to refer to them as well.

+

Later spans like Span::def_site() will allow to opt-in to +"definition-site" hygiene meaning that identifiers created with this +span will be resolved at the location of the macro definition and other +code at the macro call site will not be able to refer to them.

+

Due to the current importance of hygiene this constructor, unlike other +tokens, requires a Span to be specified at construction.

+

Panics

+

Panics if the input string is neither a keyword nor a legal variable +name. If you are not sure whether the string contains an identifier and +need to handle an error case, use +syn::parse_str::<Ident> +rather than Ident::new.

+

pub fn span(&self) -> Span[src]

Returns the span of this Ident.

+

pub fn set_span(&mut self, span: Span)[src]

Configures the span of this Ident, possibly changing its hygiene +context.

+

Trait Implementations

impl Clone for Ident[src]

impl Debug for Ident[src]

impl Display for Ident[src]

Prints the identifier as a string that should be losslessly convertible back +into the same identifier.

+

impl Eq for Ident[src]

impl From<Ident> for TokenTree[src]

impl Hash for Ident[src]

impl Ord for Ident[src]

impl PartialEq<Ident> for Ident[src]

impl<T: ?Sized> PartialEq<T> for Ident where
    T: AsRef<str>, 
[src]

impl PartialOrd<Ident> for Ident[src]

Auto Trait Implementations

impl !RefUnwindSafe for Ident

impl !Send for Ident

impl !Sync for Ident

impl Unpin for Ident

impl UnwindSafe for Ident

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/proc_macro2/struct.LexError.html b/proc_macro2/struct.LexError.html new file mode 100644 index 0000000..ddca877 --- /dev/null +++ b/proc_macro2/struct.LexError.html @@ -0,0 +1,12 @@ +proc_macro2::LexError - Rust

[][src]Struct proc_macro2::LexError

pub struct LexError { /* fields omitted */ }

Error returned from TokenStream::from_str.

+

Trait Implementations

impl Debug for LexError[src]

Auto Trait Implementations

impl !RefUnwindSafe for LexError

impl !Send for LexError

impl !Sync for LexError

impl Unpin for LexError

impl UnwindSafe for LexError

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/proc_macro2/struct.Literal.html b/proc_macro2/struct.Literal.html new file mode 100644 index 0000000..76a7594 --- /dev/null +++ b/proc_macro2/struct.Literal.html @@ -0,0 +1,316 @@ +proc_macro2::Literal - Rust

[][src]Struct proc_macro2::Literal

pub struct Literal { /* fields omitted */ }

A literal string ("hello"), byte string (b"hello"), character ('a'), +byte character (b'a'), an integer or floating point number with or without +a suffix (1, 1u8, 2.3, 2.3f32).

+

Boolean literals like true and false do not belong here, they are +Idents.

+

Methods

impl Literal[src]

pub fn u8_suffixed(n: u8) -> Literal[src]

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive rountrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn u16_suffixed(n: u16) -> Literal[src]

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive rountrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn u32_suffixed(n: u32) -> Literal[src]

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive rountrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn u64_suffixed(n: u64) -> Literal[src]

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive rountrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn u128_suffixed(n: u128) -> Literal[src]

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive rountrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn usize_suffixed(n: usize) -> Literal[src]

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive rountrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn i8_suffixed(n: i8) -> Literal[src]

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive rountrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn i16_suffixed(n: i16) -> Literal[src]

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive rountrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn i32_suffixed(n: i32) -> Literal[src]

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive rountrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn i64_suffixed(n: i64) -> Literal[src]

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive rountrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn i128_suffixed(n: i128) -> Literal[src]

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive rountrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn isize_suffixed(n: isize) -> Literal[src]

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive rountrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn u8_unsuffixed(n: u8) -> Literal[src]

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive rountrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn u16_unsuffixed(n: u16) -> Literal[src]

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive rountrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn u32_unsuffixed(n: u32) -> Literal[src]

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive rountrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn u64_unsuffixed(n: u64) -> Literal[src]

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive rountrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn u128_unsuffixed(n: u128) -> Literal[src]

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive rountrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn usize_unsuffixed(n: usize) -> Literal[src]

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive rountrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn i8_unsuffixed(n: i8) -> Literal[src]

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive rountrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn i16_unsuffixed(n: i16) -> Literal[src]

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive rountrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn i32_unsuffixed(n: i32) -> Literal[src]

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive rountrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn i64_unsuffixed(n: i64) -> Literal[src]

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive rountrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn i128_unsuffixed(n: i128) -> Literal[src]

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive rountrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn isize_unsuffixed(n: isize) -> Literal[src]

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive rountrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+

pub fn f64_unsuffixed(f: f64) -> Literal[src]

Creates a new unsuffixed floating-point literal.

+

This constructor is similar to those like Literal::i8_unsuffixed where +the float's value is emitted directly into the token but no suffix is +used, so it may be inferred to be a f64 later in the compiler. +Literals created from negative numbers may not survive rountrips through +TokenStream or strings and may be broken into two tokens (- and +positive literal).

+

Panics

+

This function requires that the specified float is finite, for example +if it is infinity or NaN this function will panic.

+

pub fn f64_suffixed(f: f64) -> Literal[src]

Creates a new suffixed floating-point literal.

+

This constructor will create a literal like 1.0f64 where the value +specified is the preceding part of the token and f64 is the suffix of +the token. This token will always be inferred to be an f64 in the +compiler. Literals created from negative numbers may not survive +rountrips through TokenStream or strings and may be broken into two +tokens (- and positive literal).

+

Panics

+

This function requires that the specified float is finite, for example +if it is infinity or NaN this function will panic.

+

pub fn f32_unsuffixed(f: f32) -> Literal[src]

Creates a new unsuffixed floating-point literal.

+

This constructor is similar to those like Literal::i8_unsuffixed where +the float's value is emitted directly into the token but no suffix is +used, so it may be inferred to be a f64 later in the compiler. +Literals created from negative numbers may not survive rountrips through +TokenStream or strings and may be broken into two tokens (- and +positive literal).

+

Panics

+

This function requires that the specified float is finite, for example +if it is infinity or NaN this function will panic.

+

pub fn f32_suffixed(f: f32) -> Literal[src]

Creates a new suffixed floating-point literal.

+

This constructor will create a literal like 1.0f32 where the value +specified is the preceding part of the token and f32 is the suffix of +the token. This token will always be inferred to be an f32 in the +compiler. Literals created from negative numbers may not survive +rountrips through TokenStream or strings and may be broken into two +tokens (- and positive literal).

+

Panics

+

This function requires that the specified float is finite, for example +if it is infinity or NaN this function will panic.

+

pub fn string(string: &str) -> Literal[src]

String literal.

+

pub fn character(ch: char) -> Literal[src]

Character literal.

+

pub fn byte_string(s: &[u8]) -> Literal[src]

Byte string literal.

+

pub fn span(&self) -> Span[src]

Returns the span encompassing this literal.

+

pub fn set_span(&mut self, span: Span)[src]

Configures the span associated for this literal.

+

pub fn subspan<R: RangeBounds<usize>>(&self, range: R) -> Option<Span>[src]

Returns a Span that is a subset of self.span() containing only +the source bytes in range range. Returns None if the would-be +trimmed span is outside the bounds of self.

+

Warning: the underlying proc_macro::Literal::subspan method is +nightly-only. When called from within a procedural macro not using a +nightly compiler, this method will always return None.

+

Trait Implementations

impl Clone for Literal[src]

impl Debug for Literal[src]

impl Display for Literal[src]

impl From<Literal> for TokenTree[src]

Auto Trait Implementations

impl !RefUnwindSafe for Literal

impl !Send for Literal

impl !Sync for Literal

impl Unpin for Literal

impl UnwindSafe for Literal

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/proc_macro2/struct.Punct.html b/proc_macro2/struct.Punct.html new file mode 100644 index 0000000..4cb4fe5 --- /dev/null +++ b/proc_macro2/struct.Punct.html @@ -0,0 +1,38 @@ +proc_macro2::Punct - Rust

[][src]Struct proc_macro2::Punct

pub struct Punct { /* fields omitted */ }

An Punct is an single punctuation character like +, - or #.

+

Multicharacter operators like += are represented as two instances of +Punct with different forms of Spacing returned.

+

Methods

impl Punct[src]

pub fn new(op: char, spacing: Spacing) -> Punct[src]

Creates a new Punct from the given character and spacing.

+

The ch argument must be a valid punctuation character permitted by the +language, otherwise the function will panic.

+

The returned Punct will have the default span of Span::call_site() +which can be further configured with the set_span method below.

+

pub fn as_char(&self) -> char[src]

Returns the value of this punctuation character as char.

+

pub fn spacing(&self) -> Spacing[src]

Returns the spacing of this punctuation character, indicating whether +it's immediately followed by another Punct in the token stream, so +they can potentially be combined into a multicharacter operator +(Joint), or it's followed by some other token or whitespace (Alone) +so the operator has certainly ended.

+

pub fn span(&self) -> Span[src]

Returns the span for this punctuation character.

+

pub fn set_span(&mut self, span: Span)[src]

Configure the span for this punctuation character.

+

Trait Implementations

impl Clone for Punct[src]

impl Debug for Punct[src]

impl Display for Punct[src]

Prints the punctuation character as a string that should be losslessly +convertible back into the same character.

+

impl From<Punct> for TokenTree[src]

Auto Trait Implementations

impl !RefUnwindSafe for Punct

impl !Send for Punct

impl !Sync for Punct

impl Unpin for Punct

impl UnwindSafe for Punct

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/proc_macro2/struct.Span.html b/proc_macro2/struct.Span.html new file mode 100644 index 0000000..48aa344 --- /dev/null +++ b/proc_macro2/struct.Span.html @@ -0,0 +1,36 @@ +proc_macro2::Span - Rust

[][src]Struct proc_macro2::Span

pub struct Span { /* fields omitted */ }

A region of source code, along with macro expansion information.

+

Methods

impl Span[src]

pub fn call_site() -> Span[src]

The span of the invocation of the current procedural macro.

+

Identifiers created with this span will be resolved as if they were +written directly at the macro call location (call-site hygiene) and +other code at the macro call site will be able to refer to them as well.

+

pub fn unwrap(self) -> Span[src]

Convert proc_macro2::Span to proc_macro::Span.

+

This method is available when building with a nightly compiler, or when +building with rustc 1.29+ without semver exempt features.

+

Panics

+

Panics if called from outside of a procedural macro. Unlike +proc_macro2::Span, the proc_macro::Span type can only exist within +the context of a procedural macro invocation.

+

pub fn join(&self, other: Span) -> Option<Span>[src]

Create a new span encompassing self and other.

+

Returns None if self and other are from different files.

+

Warning: the underlying proc_macro::Span::join method is +nightly-only. When called from within a procedural macro not using a +nightly compiler, this method will always return None.

+

Trait Implementations

impl Clone for Span[src]

impl Copy for Span[src]

impl Debug for Span[src]

Prints a span in a form convenient for debugging.

+

impl From<Span> for Span[src]

Auto Trait Implementations

impl !RefUnwindSafe for Span

impl !Send for Span

impl !Sync for Span

impl Unpin for Span

impl UnwindSafe for Span

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/proc_macro2/struct.TokenStream.html b/proc_macro2/struct.TokenStream.html new file mode 100644 index 0000000..40369c8 --- /dev/null +++ b/proc_macro2/struct.TokenStream.html @@ -0,0 +1,56 @@ +proc_macro2::TokenStream - Rust

[][src]Struct proc_macro2::TokenStream

pub struct TokenStream { /* fields omitted */ }

An abstract stream of tokens, or more concretely a sequence of token trees.

+

This type provides interfaces for iterating over token trees and for +collecting token trees into one stream.

+

Token stream is both the input and output of #[proc_macro], +#[proc_macro_attribute] and #[proc_macro_derive] definitions.

+

Methods

impl TokenStream[src]

pub fn new() -> TokenStream[src]

Returns an empty TokenStream containing no token trees.

+

pub fn is_empty(&self) -> bool[src]

Checks if this TokenStream is empty.

+

Trait Implementations

impl Clone for TokenStream[src]

impl Debug for TokenStream[src]

Prints token in a form convenient for debugging.

+

impl Default for TokenStream[src]

TokenStream::default() returns an empty stream, +i.e. this is equivalent with TokenStream::new().

+

impl Display for TokenStream[src]

Prints the token stream as a string that is supposed to be losslessly +convertible back into the same token stream (modulo spans), except for +possibly TokenTree::Groups with Delimiter::None delimiters and negative +numeric literals.

+

impl Extend<TokenStream> for TokenStream[src]

impl Extend<TokenTree> for TokenStream[src]

impl From<TokenStream> for TokenStream[src]

impl From<TokenStream> for TokenStream[src]

impl From<TokenTree> for TokenStream[src]

impl FromIterator<TokenStream> for TokenStream[src]

impl FromIterator<TokenTree> for TokenStream[src]

Collects a number of token trees into a single stream.

+

impl FromStr for TokenStream[src]

Attempts to break the string into tokens and parse those tokens into a token +stream.

+

May fail for a number of reasons, for example, if the string contains +unbalanced delimiters or characters not existing in the language.

+

NOTE: Some errors may cause panics instead of returning LexError. We +reserve the right to change these errors into LexErrors later.

+

type Err = LexError

The associated error which can be returned from parsing.

+

impl IntoIterator for TokenStream[src]

type Item = TokenTree

The type of the elements being iterated over.

+

type IntoIter = IntoIter

Which kind of iterator are we turning this into?

+

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

+

type IntoIter = I

Which kind of iterator are we turning this into?

+

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/proc_macro2/token_stream/index.html b/proc_macro2/token_stream/index.html new file mode 100644 index 0000000..1d83eba --- /dev/null +++ b/proc_macro2/token_stream/index.html @@ -0,0 +1,5 @@ +proc_macro2::token_stream - Rust

[][src]Module proc_macro2::token_stream

Public implementation details for the TokenStream type, such as iterators.

+

Re-exports

+
pub use crate::TokenStream;

Structs

+
IntoIter

An iterator over TokenStream's TokenTrees.

+
\ No newline at end of file diff --git a/proc_macro2/token_stream/sidebar-items.js b/proc_macro2/token_stream/sidebar-items.js new file mode 100644 index 0000000..c54420e --- /dev/null +++ b/proc_macro2/token_stream/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["IntoIter","An iterator over `TokenStream`'s `TokenTree`s."]]}); \ No newline at end of file diff --git a/proc_macro2/token_stream/struct.IntoIter.html b/proc_macro2/token_stream/struct.IntoIter.html new file mode 100644 index 0000000..031c8e5 --- /dev/null +++ b/proc_macro2/token_stream/struct.IntoIter.html @@ -0,0 +1,98 @@ +proc_macro2::token_stream::IntoIter - Rust

[][src]Struct proc_macro2::token_stream::IntoIter

pub struct IntoIter { /* fields omitted */ }

An iterator over TokenStream's TokenTrees.

+

The iteration is "shallow", e.g. the iterator doesn't recurse into +delimited groups, and returns whole groups as token trees.

+

Trait Implementations

impl Clone for IntoIter[src]

impl Debug for IntoIter[src]

impl Iterator for IntoIter[src]

type Item = TokenTree

The type of the elements being iterated over.

+

Auto Trait Implementations

impl !RefUnwindSafe for IntoIter

impl !Send for IntoIter

impl !Sync for IntoIter

impl Unpin for IntoIter

impl !UnwindSafe for IntoIter

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

+

type IntoIter = I

Which kind of iterator are we turning this into?

+

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/quote/all.html b/quote/all.html new file mode 100644 index 0000000..f0a1e08 --- /dev/null +++ b/quote/all.html @@ -0,0 +1,3 @@ +List of all items in this crate

[] + + List of all items

Traits

Macros

\ No newline at end of file diff --git a/quote/ext/trait.TokenStreamExt.html b/quote/ext/trait.TokenStreamExt.html new file mode 100644 index 0000000..076e9db --- /dev/null +++ b/quote/ext/trait.TokenStreamExt.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../quote/trait.TokenStreamExt.html...

+ + + \ No newline at end of file diff --git a/quote/ident_fragment/trait.IdentFragment.html b/quote/ident_fragment/trait.IdentFragment.html new file mode 100644 index 0000000..6452678 --- /dev/null +++ b/quote/ident_fragment/trait.IdentFragment.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../quote/trait.IdentFragment.html...

+ + + \ No newline at end of file diff --git a/quote/index.html b/quote/index.html new file mode 100644 index 0000000..e938634 --- /dev/null +++ b/quote/index.html @@ -0,0 +1,60 @@ +quote - Rust

[][src]Crate quote

This crate provides the quote! macro for turning Rust syntax tree data +structures into tokens of source code.

+

Procedural macros in Rust receive a stream of tokens as input, execute +arbitrary Rust code to determine how to manipulate those tokens, and produce +a stream of tokens to hand back to the compiler to compile into the caller's +crate. Quasi-quoting is a solution to one piece of that — producing +tokens to return to the compiler.

+

The idea of quasi-quoting is that we write code that we treat as data. +Within the quote! macro, we can write what looks like code to our text +editor or IDE. We get all the benefits of the editor's brace matching, +syntax highlighting, indentation, and maybe autocompletion. But rather than +compiling that as code into the current crate, we can treat it as data, pass +it around, mutate it, and eventually hand it back to the compiler as tokens +to compile into the macro caller's crate.

+

This crate is motivated by the procedural macro use case, but is a +general-purpose Rust quasi-quoting library and is not specific to procedural +macros.

+
[dependencies]
+quote = "1.0"
+
+
+

Example

+

The following quasi-quoted block of code is something you might find in a +procedural macro having to do with data structure serialization. The #var +syntax performs interpolation of runtime variables into the quoted tokens. +Check out the documentation of the quote! macro for more detail about +the syntax. See also the quote_spanned! macro which is important for +implementing hygienic procedural macros.

+ +
+let tokens = quote! {
+    struct SerializeWith #generics #where_clause {
+        value: &'a #field_ty,
+        phantom: core::marker::PhantomData<#item_ty>,
+    }
+
+    impl #generics serde::Serialize for SerializeWith #generics #where_clause {
+        fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+        where
+            S: serde::Serializer,
+        {
+            #path(self.value, serializer)
+        }
+    }
+
+    SerializeWith {
+        value: #value,
+        phantom: core::marker::PhantomData::<#item_ty>,
+    }
+};
+

Macros

+
format_ident

Formatting macro for constructing Idents.

+
quote

The whole point.

+
quote_spanned

Same as quote!, but applies a given span to all tokens originating within +the macro invocation.

+

Traits

+
IdentFragment

Specialized formatting trait used by format_ident!.

+
ToTokens

Types that can be interpolated inside a quote! invocation.

+
TokenStreamExt

TokenStream extension trait with methods for appending tokens.

+
\ No newline at end of file diff --git a/quote/macro.format_ident!.html b/quote/macro.format_ident!.html new file mode 100644 index 0000000..fee0102 --- /dev/null +++ b/quote/macro.format_ident!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.format_ident.html...

+ + + \ No newline at end of file diff --git a/quote/macro.format_ident.html b/quote/macro.format_ident.html new file mode 100644 index 0000000..1d5e0e7 --- /dev/null +++ b/quote/macro.format_ident.html @@ -0,0 +1,82 @@ +quote::format_ident - Rust

[][src]Macro quote::format_ident

+macro_rules! format_ident {
+    ($fmt:expr) => { ... };
+    ($fmt:expr, $($rest:tt)*) => { ... };
+}
+

Formatting macro for constructing Idents.

+
+

Syntax

+

Syntax is copied from the [format!] macro, supporting both positional and +named arguments.

+

Only a limited set of formatting traits are supported. The current mapping +of format types to traits is:

+ +

See [std::fmt] for more information.

+
+

IdentFragment

+

Unlike format!, this macro uses the [IdentFragment] formatting trait by +default. This trait is like Display, with a few differences:

+
    +
  • IdentFragment is only implemented for a limited set of types, such as +unsigned integers and strings.
  • +
  • Ident arguments will have their r# prefixes stripped, if present.
  • +
+
+

Hygiene

+

The Span of the first Ident argument is used as the span of the final +identifier, falling back to Span::call_site when no identifiers are +provided.

+ +
+// If `ident` is an Ident, the span of `my_ident` will be inherited from it.
+let my_ident = format_ident!("My{}{}", ident, "IsCool");
+assert_eq!(my_ident, "MyIdentIsCool");
+

Alternatively, the span can be overridden by passing the span named +argument.

+ +
+let my_span = /* ... */;
+format_ident!("MyIdent", span = my_span);
+


+

Panics

+

This method will panic if the resulting formatted string is not a valid +identifier.

+
+

Examples

+

Composing raw and non-raw identifiers:

+ +
+let my_ident = format_ident!("My{}", "Ident");
+assert_eq!(my_ident, "MyIdent");
+
+let raw = format_ident!("r#Raw");
+assert_eq!(raw, "r#Raw");
+
+let my_ident_raw = format_ident!("{}Is{}", my_ident, raw);
+assert_eq!(my_ident_raw, "MyIdentIsRaw");
+

Integer formatting options:

+ +
+let num: u32 = 10;
+
+let decimal = format_ident!("Id_{}", num);
+assert_eq!(decimal, "Id_10");
+
+let octal = format_ident!("Id_{:o}", num);
+assert_eq!(octal, "Id_12");
+
+let binary = format_ident!("Id_{:b}", num);
+assert_eq!(binary, "Id_1010");
+
+let lower_hex = format_ident!("Id_{:x}", num);
+assert_eq!(lower_hex, "Id_a");
+
+let upper_hex = format_ident!("Id_{:X}", num);
+assert_eq!(upper_hex, "Id_A");
+
\ No newline at end of file diff --git a/quote/macro.quote!.html b/quote/macro.quote!.html new file mode 100644 index 0000000..3259fc2 --- /dev/null +++ b/quote/macro.quote!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.quote.html...

+ + + \ No newline at end of file diff --git a/quote/macro.quote.html b/quote/macro.quote.html new file mode 100644 index 0000000..e8c6341 --- /dev/null +++ b/quote/macro.quote.html @@ -0,0 +1,210 @@ +quote::quote - Rust

[][src]Macro quote::quote

+macro_rules! quote {
+    ($($tt:tt)*) => { ... };
+}
+

The whole point.

+

Performs variable interpolation against the input and produces it as +[proc_macro2::TokenStream].

+

Note: for returning tokens to the compiler in a procedural macro, use +.into() on the result to convert to [proc_macro::TokenStream].

+
+

Interpolation

+

Variable interpolation is done with #var (similar to $var in +macro_rules! macros). This grabs the var variable that is currently in +scope and inserts it in that location in the output tokens. Any type +implementing the ToTokens trait can be interpolated. This includes most +Rust primitive types as well as most of the syntax tree types from the Syn +crate.

+

Repetition is done using #(...)* or #(...),* again similar to +macro_rules!. This iterates through the elements of any variable +interpolated within the repetition and inserts a copy of the repetition body +for each one. The variables in an interpolation may be a Vec, slice, +BTreeSet, or any Iterator.

+
    +
  • #(#var)* — no separators
  • +
  • #(#var),* — the character before the asterisk is used as a separator
  • +
  • #( struct #var; )* — the repetition can contain other tokens
  • +
  • #( #k => println!("{}", #v), )* — even multiple interpolations
  • +
+
+

Hygiene

+

Any interpolated tokens preserve the Span information provided by their +ToTokens implementation. Tokens that originate within the quote! +invocation are spanned with Span::call_site().

+

A different span can be provided through the quote_spanned! macro.

+
+

Return type

+

The macro evaluates to an expression of type proc_macro2::TokenStream. +Meanwhile Rust procedural macros are expected to return the type +proc_macro::TokenStream.

+

The difference between the two types is that proc_macro types are entirely +specific to procedural macros and cannot ever exist in code outside of a +procedural macro, while proc_macro2 types may exist anywhere including +tests and non-macro code like main.rs and build.rs. This is why even the +procedural macro ecosystem is largely built around proc_macro2, because +that ensures the libraries are unit testable and accessible in non-macro +contexts.

+

There is a From-conversion in both directions so returning the output of +quote! from a procedural macro usually looks like tokens.into() or +proc_macro::TokenStream::from(tokens).

+
+

Examples

Procedural macro

+

The structure of a basic procedural macro is as follows. Refer to the Syn +crate for further useful guidance on using quote! as part of a procedural +macro.

+ +
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+use quote::quote;
+
+#[proc_macro_derive(HeapSize)]
+pub fn derive_heap_size(input: TokenStream) -> TokenStream {
+    // Parse the input and figure out what implementation to generate...
+    let name = /* ... */;
+    let expr = /* ... */;
+
+    let expanded = quote! {
+        // The generated impl.
+        impl heapsize::HeapSize for #name {
+            fn heap_size_of_children(&self) -> usize {
+                #expr
+            }
+        }
+    };
+
+    // Hand the output tokens back to the compiler.
+    TokenStream::from(expanded)
+}
+


+

Combining quoted fragments

+

Usually you don't end up constructing an entire final TokenStream in one +piece. Different parts may come from different helper functions. The tokens +produced by quote! themselves implement ToTokens and so can be +interpolated into later quote! invocations to build up a final result.

+ +
+let type_definition = quote! {...};
+let methods = quote! {...};
+
+let tokens = quote! {
+    #type_definition
+    #methods
+};
+


+

Constructing identifiers

+

Suppose we have an identifier ident which came from somewhere in a macro +input and we need to modify it in some way for the macro output. Let's +consider prepending the identifier with an underscore.

+

Simply interpolating the identifier next to an underscore will not have the +behavior of concatenating them. The underscore and the identifier will +continue to be two separate tokens as if you had written _ x.

+ +
+// incorrect
+quote! {
+    let mut _#ident = 0;
+}
+

The solution is to build a new identifier token with the correct value. As +this is such a common case, the [format_ident!] macro provides a +convenient utility for doing so correctly.

+ +
+let varname = format_ident!("_{}", ident);
+quote! {
+    let mut #varname = 0;
+}
+

Alternatively, the APIs provided by Syn and proc-macro2 can be used to +directly build the identifier. This is roughly equivalent to the above, but +will not handle ident being a raw identifier.

+ +
+let concatenated = format!("_{}", ident);
+let varname = syn::Ident::new(&concatenated, ident.span());
+quote! {
+    let mut #varname = 0;
+}
+


+

Making method calls

+

Let's say our macro requires some type specified in the macro input to have +a constructor called new. We have the type in a variable called +field_type of type syn::Type and want to invoke the constructor.

+ +
+// incorrect
+quote! {
+    let value = #field_type::new();
+}
+

This works only sometimes. If field_type is String, the expanded code +contains String::new() which is fine. But if field_type is something +like Vec<i32> then the expanded code is Vec<i32>::new() which is invalid +syntax. Ordinarily in handwritten Rust we would write Vec::<i32>::new() +but for macros often the following is more convenient.

+ +
+quote! {
+    let value = <#field_type>::new();
+}
+

This expands to <Vec<i32>>::new() which behaves correctly.

+

A similar pattern is appropriate for trait methods.

+ +
+quote! {
+    let value = <#field_type as core::default::Default>::default();
+}
+


+

Interpolating text inside of doc comments

+

Neither doc comments nor string literals get interpolation behavior in +quote:

+ +
This example deliberately fails to compile
+quote! {
+    /// try to interpolate: #ident
+    ///
+    /// ...
+}
+ +
This example deliberately fails to compile
+quote! {
+    #[doc = "try to interpolate: #ident"]
+}
+

Macro calls in a doc attribute are not valid syntax:

+ +
This example deliberately fails to compile
+quote! {
+    #[doc = concat!("try to interpolate: ", stringify!(#ident))]
+}
+

Instead the best way to build doc comments that involve variables is by +formatting the doc string literal outside of quote.

+ +
+let msg = format!(...);
+quote! {
+    #[doc = #msg]
+    ///
+    /// ...
+}
+


+

Indexing into a tuple struct

+

When interpolating indices of a tuple or tuple struct, we need them not to +appears suffixed as integer literals by interpolating them as syn::Index +instead.

+ +
This example deliberately fails to compile
+let i = 0usize..self.fields.len();
+
+// expands to 0 + self.0usize.heap_size() + self.1usize.heap_size() + ...
+// which is not valid syntax
+quote! {
+    0 #( + self.#i.heap_size() )*
+}
+ +
+let i = (0..self.fields.len()).map(syn::Index::from);
+
+// expands to 0 + self.0.heap_size() + self.1.heap_size() + ...
+quote! {
+    0 #( + self.#i.heap_size() )*
+}
+
\ No newline at end of file diff --git a/quote/macro.quote_spanned!.html b/quote/macro.quote_spanned!.html new file mode 100644 index 0000000..958d8f1 --- /dev/null +++ b/quote/macro.quote_spanned!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.quote_spanned.html...

+ + + \ No newline at end of file diff --git a/quote/macro.quote_spanned.html b/quote/macro.quote_spanned.html new file mode 100644 index 0000000..0ff81a7 --- /dev/null +++ b/quote/macro.quote_spanned.html @@ -0,0 +1,56 @@ +quote::quote_spanned - Rust

[][src]Macro quote::quote_spanned

+macro_rules! quote_spanned {
+    ($span:expr=> $($tt:tt)*) => { ... };
+}
+

Same as quote!, but applies a given span to all tokens originating within +the macro invocation.

+
+

Syntax

+

A span expression of type Span, followed by =>, followed by the tokens +to quote. The span expression should be brief — use a variable for +anything more than a few characters. There should be no space before the +=> token.

+ +
+let span = /* ... */;
+
+// On one line, use parentheses.
+let tokens = quote_spanned!(span=> Box::into_raw(Box::new(#init)));
+
+// On multiple lines, place the span at the top and use braces.
+let tokens = quote_spanned! {span=>
+    Box::into_raw(Box::new(#init))
+};
+

The lack of space before the => should look jarring to Rust programmers +and this is intentional. The formatting is designed to be visibly +off-balance and draw the eye a particular way, due to the span expression +being evaluated in the context of the procedural macro and the remaining +tokens being evaluated in the generated code.

+
+

Hygiene

+

Any interpolated tokens preserve the Span information provided by their +ToTokens implementation. Tokens that originate within the quote_spanned! +invocation are spanned with the given span argument.

+
+

Example

+

The following procedural macro code uses quote_spanned! to assert that a +particular Rust type implements the Sync trait so that references can be +safely shared between threads.

+ +
+let ty_span = ty.span();
+let assert_sync = quote_spanned! {ty_span=>
+    struct _AssertSync where #ty: Sync;
+};
+

If the assertion fails, the user will see an error like the following. The +input span of their type is hightlighted in the error.

+
error[E0277]: the trait bound `*const (): std::marker::Sync` is not satisfied
+  --> src/main.rs:10:21
+   |
+10 |     static ref PTR: *const () = &();
+   |                     ^^^^^^^^^ `*const ()` cannot be shared between threads safely
+
+

In this example it is important for the where-clause to be spanned with the +line/column information of the user's input type so that error messages are +placed appropriately by the compiler.

+
\ No newline at end of file diff --git a/quote/sidebar-items.js b/quote/sidebar-items.js new file mode 100644 index 0000000..f0d1295 --- /dev/null +++ b/quote/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"macro":[["format_ident","Formatting macro for constructing `Ident`s."],["quote","The whole point."],["quote_spanned","Same as `quote!`, but applies a given span to all tokens originating within the macro invocation."]],"trait":[["IdentFragment","Specialized formatting trait used by `format_ident!`."],["ToTokens","Types that can be interpolated inside a `quote!` invocation."],["TokenStreamExt","TokenStream extension trait with methods for appending tokens."]]}); \ No newline at end of file diff --git a/quote/to_tokens/trait.ToTokens.html b/quote/to_tokens/trait.ToTokens.html new file mode 100644 index 0000000..38ea0d1 --- /dev/null +++ b/quote/to_tokens/trait.ToTokens.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../quote/trait.ToTokens.html...

+ + + \ No newline at end of file diff --git a/quote/trait.IdentFragment.html b/quote/trait.IdentFragment.html new file mode 100644 index 0000000..cb40b29 --- /dev/null +++ b/quote/trait.IdentFragment.html @@ -0,0 +1,16 @@ +quote::IdentFragment - Rust

[][src]Trait quote::IdentFragment

pub trait IdentFragment {
+    fn fmt(&self, f: &mut Formatter) -> Result;
+
+    fn span(&self) -> Option<Span> { ... }
+}

Specialized formatting trait used by format_ident!.

+

[Ident] arguments formatted using this trait will have their r# prefix +stripped, if present.

+

See [format_ident!] for more information.

+
+

Required methods

fn fmt(&self, f: &mut Formatter) -> Result

Format this value as an identifier fragment.

+
Loading content... +

Provided methods

fn span(&self) -> Option<Span>

Span associated with this IdentFragment.

+

If non-None, may be inherited by formatted identifiers.

+
Loading content... +

Implementations on Foreign Types

impl<'a, T: IdentFragment + ?Sized> IdentFragment for &'a T[src]

impl<'a, T: IdentFragment + ?Sized> IdentFragment for &'a mut T[src]

impl IdentFragment for Ident[src]

impl IdentFragment for bool[src]

impl IdentFragment for str[src]

impl IdentFragment for String[src]

impl IdentFragment for u8[src]

impl IdentFragment for u16[src]

impl IdentFragment for u32[src]

impl IdentFragment for u64[src]

impl IdentFragment for u128[src]

impl IdentFragment for usize[src]

Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/quote/trait.ToTokens.html b/quote/trait.ToTokens.html new file mode 100644 index 0000000..08faa73 --- /dev/null +++ b/quote/trait.ToTokens.html @@ -0,0 +1,46 @@ +quote::ToTokens - Rust

[][src]Trait quote::ToTokens

pub trait ToTokens {
+    fn to_tokens(&self, tokens: &mut TokenStream);
+
+    fn to_token_stream(&self) -> TokenStream { ... }
+
fn into_token_stream(self) -> TokenStream
    where
        Self: Sized
, + { ... } +}

Types that can be interpolated inside a quote! invocation.

+
+

Required methods

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream.

+

The token append methods provided by the TokenStreamExt extension +trait may be useful for implementing ToTokens.

+

Example

+

Example implementation for a struct representing Rust paths like +std::cmp::PartialEq:

+ +
+use proc_macro2::{TokenTree, Spacing, Span, Punct, TokenStream};
+use quote::{TokenStreamExt, ToTokens};
+
+pub struct Path {
+    pub global: bool,
+    pub segments: Vec<PathSegment>,
+}
+
+impl ToTokens for Path {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        for (i, segment) in self.segments.iter().enumerate() {
+            if i > 0 || self.global {
+                // Double colon `::`
+                tokens.append(Punct::new(':', Spacing::Joint));
+                tokens.append(Punct::new(':', Spacing::Alone));
+            }
+            segment.to_tokens(tokens);
+        }
+    }
+}
+
Loading content... +

Provided methods

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object.

+

This method is implicitly implemented using to_tokens, and acts as a +convenience method for consumers of the ToTokens trait.

+

fn into_token_stream(self) -> TokenStream where
    Self: Sized

Convert self directly into a TokenStream object.

+

This method is implicitly implemented using to_tokens, and acts as a +convenience method for consumers of the ToTokens trait.

+
Loading content... +

Implementations on Foreign Types

impl<'a, T: ?Sized + ToTokens> ToTokens for &'a T[src]

impl<'a, T: ?Sized + ToTokens> ToTokens for &'a mut T[src]

impl<'a, T: ?Sized + ToOwned + ToTokens> ToTokens for Cow<'a, T>[src]

impl<T: ?Sized + ToTokens> ToTokens for Box<T>[src]

impl<T: ?Sized + ToTokens> ToTokens for Rc<T>[src]

impl<T: ToTokens> ToTokens for Option<T>[src]

impl ToTokens for str[src]

impl ToTokens for String[src]

impl ToTokens for i8[src]

impl ToTokens for i16[src]

impl ToTokens for i32[src]

impl ToTokens for i64[src]

impl ToTokens for i128[src]

impl ToTokens for isize[src]

impl ToTokens for u8[src]

impl ToTokens for u16[src]

impl ToTokens for u32[src]

impl ToTokens for u64[src]

impl ToTokens for u128[src]

impl ToTokens for usize[src]

impl ToTokens for f32[src]

impl ToTokens for f64[src]

impl ToTokens for char[src]

impl ToTokens for bool[src]

impl ToTokens for Group[src]

impl ToTokens for Ident[src]

impl ToTokens for Punct[src]

impl ToTokens for Literal[src]

impl ToTokens for TokenTree[src]

impl ToTokens for TokenStream[src]

Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/quote/trait.TokenStreamExt.html b/quote/trait.TokenStreamExt.html new file mode 100644 index 0000000..f2a1418 --- /dev/null +++ b/quote/trait.TokenStreamExt.html @@ -0,0 +1,32 @@ +quote::TokenStreamExt - Rust

[][src]Trait quote::TokenStreamExt

pub trait TokenStreamExt: Sealed {
+    fn append<U>(&mut self, token: U)
    where
        U: Into<TokenTree>
; +
fn append_all<I>(&mut self, iter: I)
    where
        I: IntoIterator,
        I::Item: ToTokens
; +
fn append_separated<I, U>(&mut self, iter: I, op: U)
    where
        I: IntoIterator,
        I::Item: ToTokens,
        U: ToTokens
; +
fn append_terminated<I, U>(&mut self, iter: I, term: U)
    where
        I: IntoIterator,
        I::Item: ToTokens,
        U: ToTokens
; +}

TokenStream extension trait with methods for appending tokens.

+

This trait is sealed and cannot be implemented outside of the quote crate.

+
+

Required methods

fn append<U>(&mut self, token: U) where
    U: Into<TokenTree>, 

For use by ToTokens implementations.

+

Appends the token specified to this list of tokens.

+

fn append_all<I>(&mut self, iter: I) where
    I: IntoIterator,
    I::Item: ToTokens

For use by ToTokens implementations.

+ +
+struct X;
+
+impl ToTokens for X {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append_all(&[true, false]);
+    }
+}
+
+let tokens = quote!(#X);
+assert_eq!(tokens.to_string(), "true false");
+

fn append_separated<I, U>(&mut self, iter: I, op: U) where
    I: IntoIterator,
    I::Item: ToTokens,
    U: ToTokens

For use by ToTokens implementations.

+

Appends all of the items in the iterator I, separated by the tokens +U.

+

fn append_terminated<I, U>(&mut self, iter: I, term: U) where
    I: IntoIterator,
    I::Item: ToTokens,
    U: ToTokens

For use by ToTokens implementations.

+

Appends all tokens in the iterator I, appending U after each +element, including after the last element of the iterator.

+
Loading content... +

Implementations on Foreign Types

impl TokenStreamExt for TokenStream[src]

Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/rust-logo.png b/rust-logo.png new file mode 100644 index 0000000..74b4bd6 Binary files /dev/null and b/rust-logo.png differ diff --git a/rustdoc.css b/rustdoc.css new file mode 100644 index 0000000..7f04b79 --- /dev/null +++ b/rustdoc.css @@ -0,0 +1 @@ + @font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular.woff") format('woff');}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium.woff") format('woff');}@font-face {font-family:'Source Serif Pro';font-style:normal;font-weight:400;src:local('Source Serif Pro'),url("SourceSerifPro-Regular.ttf.woff") format('woff');}@font-face {font-family:'Source Serif Pro';font-style:italic;font-weight:400;src:local('Source Serif Pro Italic'),url("SourceSerifPro-It.ttf.woff") format('woff');}@font-face {font-family:'Source Serif Pro';font-style:normal;font-weight:700;src:local('Source Serif Pro Bold'),url("SourceSerifPro-Bold.ttf.woff") format('woff');}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular.woff") format('woff');}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold.woff") format('woff');}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}html{content:"";}@media (prefers-color-scheme:light){html{content:"light";}}@media (prefers-color-scheme:dark){html{content:"dark";}}body{font:16px/1.4 "Source Serif Pro",serif;margin:0;position:relative;padding:10px 15px 20px 15px;-webkit-font-feature-settings:"kern","liga";-moz-font-feature-settings:"kern","liga";font-feature-settings:"kern","liga";}h1{font-size:1.5em;}h2{font-size:1.4em;}h3{font-size:1.3em;}h1,h2,h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.important),h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant){font-weight:500;margin:20px 0 15px 0;padding-bottom:6px;}h1.fqn{border-bottom:1px dashed;margin-top:0;}h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant){border-bottom:1px solid;}h3.impl,h3.method,h4.method,h3.type,h4.type,h4.associatedconstant{flex-basis:100%;font-weight:600;margin-top:16px;margin-bottom:10px;position:relative;}h3.impl,h3.method,h3.type{padding-left:15px;}h1,h2,h3,h4,.sidebar,a.source,.search-input,.content table :not(code)>a,.collapse-toggle,div.item-list .out-of-band,#source-sidebar,#sidebar-toggle{font-family:"Fira Sans",sans-serif;}ol,ul{padding-left:25px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.6em;}p{margin:0 0 .6em 0;}summary{outline:none;}code,pre,a.test-arrow{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.1em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;}.source .content pre{padding:20px;}img{max-width:100%;}li{position:relative;}.source .content{margin-top:50px;max-width:none;overflow:visible;margin-left:0px;min-width:70em;}nav.sub{font-size:16px;text-transform:uppercase;}.sidebar{width:200px;position:fixed;left:0;top:0;bottom:0;overflow:auto;}.sidebar .block>ul>li{margin-right:-10px;}.content,nav{max-width:960px;}.hidden{display:none !important;}.logo-container{height:100px;width:100px;position:relative;margin:20px auto;display:block;margin-top:10px;}.logo-container>img{max-width:100px;max-height:100px;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;}.sidebar .location{border:1px solid;font-size:17px;margin:30px 10px 20px 10px;text-align:center;word-wrap:break-word;}.sidebar .version{font-size:15px;text-align:center;border-bottom:1px solid;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;}.location:empty{border:none;}.location a:first-child{font-weight:500;}.block{padding:0;margin-bottom:14px;}.block h2,.block h3{margin-top:0;margin-bottom:8px;text-align:center;}.block ul,.block li{margin:0 10px;padding:0;list-style:none;}.block a{display:block;text-overflow:ellipsis;overflow:hidden;line-height:15px;padding:7px 5px;font-size:14px;font-weight:300;transition:border 500ms ease-out;}.sidebar-title{border-top:1px solid;border-bottom:1px solid;text-align:center;font-size:17px;margin-bottom:5px;}.sidebar-links{margin-bottom:15px;}.sidebar-links>a{padding-left:10px;width:100%;}.sidebar-menu{display:none;}.content{padding:15px 0;}.source .content pre.rust{white-space:pre;overflow:auto;padding-left:0;}.rustdoc:not(.source) .example-wrap{display:inline-flex;margin-bottom:10px;position:relative;}.example-wrap{width:100%;}.example-wrap>pre.line-number{overflow:initial;border:1px solid;border-top-left-radius:5px;border-bottom-left-radius:5px;padding:13px 8px;text-align:right;}.rustdoc:not(.source) .example-wrap>pre.rust{width:100%;overflow-x:auto;}.rustdoc:not(.source) .example-wrap>pre{margin:0;}#search{margin-left:230px;position:relative;}#results{position:absolute;right:0;left:0;overflow:auto;}#results>table{width:100%;table-layout:fixed;}.content pre.line-numbers{float:left;border:none;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.line-numbers span{cursor:pointer;}.docblock-short p{display:inline;}.docblock-short.nowrap{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}.docblock-short p{overflow:hidden;text-overflow:ellipsis;margin:0;}.docblock code,.docblock-short code{white-space:pre-wrap;}.docblock h1,.docblock h2,.docblock h3,.docblock h4,.docblock h5{border-bottom:1px solid;}#main>.docblock h1{font-size:1.3em;}#main>.docblock h2{font-size:1.15em;}#main>.docblock h3,#main>.docblock h4,#main>.docblock h5{font-size:1em;}#main>h2+div,#main>h2+h3,#main>h3+div{display:none;flex-wrap:wrap;}.docblock h1{font-size:1em;}.docblock h2{font-size:0.95em;}.docblock h3,.docblock h4,.docblock h5{font-size:0.9em;}.docblock{margin-left:24px;position:relative;}.content .out-of-band{float:right;font-size:23px;margin:0px;padding:0px;font-weight:normal;}h3.impl>.out-of-band{font-size:21px;}h4.method>.out-of-band{font-size:19px;}h4>code,h3>code,.invisible>code{max-width:calc(100% - 41px);display:block;}.invisible{width:100%;display:inline-block;}.content .in-band{margin:0px;padding:0px;}.in-band>code{display:inline-block;}#main{position:relative;}#main>.since{top:inherit;font-family:"Fira Sans",sans-serif;}.content table:not(.table-display){border-spacing:0 5px;}.content td{vertical-align:top;}.content td:first-child{padding-right:20px;}.content td p:first-child{margin-top:0;}.content td h1,.content td h2{margin-left:0;font-size:1.1em;}.content tr:first-child td{border-top:0;}.docblock table{margin:.5em 0;width:calc(100% - 2px);border:1px dashed;}.docblock table td{padding:.5em;border:1px dashed;}.docblock table th{padding:.5em;text-align:left;border:1px solid;}.fields+table{margin-bottom:1em;}.content .item-list{list-style-type:none;padding:0;}.content .multi-column{-moz-column-count:5;-moz-column-gap:2.5em;-webkit-column-count:5;-webkit-column-gap:2.5em;column-count:5;column-gap:2.5em;}.content .multi-column li{width:100%;display:inline-block;}.content .method{font-size:1em;position:relative;}.content .method .where,.content .fn .where,.content .where.fmt-newline{display:block;font-size:0.8em;}.content .methods>div{margin-left:40px;margin-bottom:15px;}.content .docblock>.impl-items{margin-left:20px;margin-top:-34px;}.content .docblock>.impl-items>h4{border-bottom:0;}.content .docblock>.impl-items .table-display{margin:0;}.content .docblock>.impl-items table td{padding:0;}.toggle-wrapper.marg-left>.collapse-toggle{left:-24px;}.content .docblock>.impl-items .table-display,.impl-items table td{border:none;}.content .stability code{font-size:90%;}.content .stability{position:relative;margin-left:33px;margin-top:-13px;}.sub-variant>div>.stability{margin-top:initial;}.content .stability::before{content:'⬑';font-size:25px;position:absolute;top:-6px;left:-19px;}.content .impl-items .method,.content .impl-items>.type,.impl-items>.associatedconstant{margin-left:20px;}.content .impl-items .docblock,.content .impl-items .stability{margin-bottom:.6em;}.content .impl-items>.stability{margin-left:40px;}.methods>.stability,.content .impl-items>.stability{margin-top:-8px;}.impl-items{flex-basis:100%;}#main>.stability{margin-top:0;}nav:not(.sidebar){border-bottom:1px solid;padding-bottom:10px;margin-bottom:10px;}nav.main{padding:20px 0;text-align:center;}nav.main .current{border-top:1px solid;border-bottom:1px solid;}nav.main .separator{border:1px solid;display:inline-block;height:23px;margin:0 20px;}nav.sum{text-align:right;}nav.sub form{display:inline;}nav.sub,.content{margin-left:230px;}a{text-decoration:none;background:transparent;}.small-section-header:hover>.anchor{display:initial;}.in-band:hover>.anchor{display:inline-block;position:absolute;}.anchor{display:none;position:absolute;left:-7px;}.anchor.field{left:-5px;}.small-section-header>.anchor{left:-28px;padding-right:10px;}.anchor:before{content:'\2002\00a7\2002';}.docblock a:not(.srclink):not(.test-arrow):hover,.docblock-short a:not(.srclink):not(.test-arrow):hover,.stability a{text-decoration:underline;}.invisible>.srclink,h4>code+.srclink{position:absolute;top:0;right:0;font-size:17px;font-weight:normal;}.block a.current.crate{font-weight:500;}.search-container{position:relative;}.search-container>div{display:inline-flex;width:calc(100% - 34px);}#crate-search{margin-top:5px;padding:6px;padding-right:19px;flex:none;border:0;border-right:0;border-radius:4px 0 0 4px;outline:none;cursor:pointer;border-right:1px solid;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;text-overflow:"";background-repeat:no-repeat;background-color:transparent;background-size:20px;background-position:calc(100% - 1px) 56%;}.search-container>.top-button{position:absolute;right:0;top:10px;}.search-input{-moz-box-sizing:border-box !important;box-sizing:border-box !important;outline:none;border:none;border-radius:1px;margin-top:5px;padding:10px 16px;font-size:17px;transition:border-color 300ms ease;transition:border-radius 300ms ease-in-out;transition:box-shadow 300ms ease-in-out;width:100%;}#crate-search+.search-input{border-radius:0 1px 1px 0;width:calc(100% - 32px);}.search-input:focus{border-radius:2px;border:0;outline:0;}.search-results .desc{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;}.search-results a{display:block;}.content .search-results td:first-child{padding-right:0;width:50%;}.content .search-results td:first-child a{padding-right:10px;}.content .search-results td:first-child a:after{clear:both;content:"";display:block;}.content .search-results td:first-child a span{float:left;}tr.result span.primitive::after{content:' (primitive type)';font-style:italic;}tr.result span.keyword::after{content:' (keyword)';font-style:italic;}body.blur>:not(#help){filter:blur(8px);-webkit-filter:blur(8px);opacity:.7;}#help{width:100%;height:100vh;position:fixed;top:0;left:0;display:flex;justify-content:center;align-items:center;}#help>div{flex:0 0 auto;box-shadow:0 0 6px rgba(0,0,0,.2);width:550px;height:auto;border:1px solid;}#help dt{float:left;clear:left;display:block;}#help dd{margin:5px 35px;}#help .infos{padding-left:0;}#help h1,#help h2{margin-top:0;}#help>div div{width:50%;float:left;padding:20px;padding-left:17px;}.stab{display:table;border-width:1px;border-style:solid;padding:3px;margin-bottom:5px;font-size:90%;}.stab p{display:inline;}.stab summary{display:list-item;}.stab .emoji{font-size:1.5em;}.module-item .stab{border-radius:3px;display:inline-block;font-size:80%;line-height:1.2;margin-bottom:0;margin-right:.3em;padding:2px;vertical-align:text-bottom;}.module-item.unstable{opacity:0.65;}.since{font-weight:normal;font-size:initial;position:absolute;right:0;top:0;}.impl-items .since,.impl .since{flex-grow:0;padding-left:12px;padding-right:2px;position:initial;}.impl-items .srclink,.impl .srclink{flex-grow:0;font-size:17px;font-weight:normal;}.impl-items code,.impl code{flex-grow:1;}.impl-items h4,h4.impl,h3.impl{display:flex;flex-basis:100%;font-size:16px;margin-bottom:12px;justify-content:space-between;}.variants_table{width:100%;}.variants_table tbody tr td:first-child{width:1%;}td.summary-column{width:100%;}.summary{padding-right:0px;}pre.rust .question-mark{font-weight:bold;}a.test-arrow{display:inline-block;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:130%;top:5px;right:5px;z-index:1;}a.test-arrow:hover{text-decoration:none;}.section-header:hover a:before{position:absolute;left:-25px;padding-right:10px;content:'\2002\00a7\2002';}.section-header:hover a{text-decoration:none;}.section-header a{color:inherit;}.collapse-toggle{font-weight:300;position:absolute;left:-23px;top:0;}h3>.collapse-toggle,h4>.collapse-toggle{font-size:0.8em;top:5px;}.toggle-wrapper>.collapse-toggle{left:-24px;margin-top:0px;}.toggle-wrapper{position:relative;margin-top:0;}.toggle-wrapper.collapsed{height:25px;transition:height .2s;margin-bottom:.6em;}.collapse-toggle>.inner{display:inline-block;width:1.2ch;text-align:center;}.collapse-toggle.hidden-default{position:relative;margin-left:20px;}.since+.srclink{display:table-cell;padding-left:10px;}.item-spacer{width:100%;height:12px;}.out-of-band>span.since{position:initial;font-size:20px;margin-right:5px;}.toggle-wrapper>.collapse-toggle{left:0;}.variant+.toggle-wrapper+.docblock>p{margin-top:5px;}.sub-variant,.sub-variant>h3{margin-top:1px !important;}#main>.sub-variant>h3{font-size:15px;margin-left:25px;margin-bottom:5px;}.sub-variant>div{margin-left:20px;margin-bottom:10px;}.sub-variant>div>span{display:block;position:relative;}.toggle-label{display:inline-block;margin-left:4px;margin-top:3px;}.enum>.toggle-wrapper+.docblock,.struct>.toggle-wrapper+.docblock{margin-left:30px;margin-bottom:20px;margin-top:5px;}.docblock>.section-header:first-child{margin-left:15px;margin-top:0;}.docblock>.section-header:first-child:hover>a:before{left:-10px;}.enum>.collapsed,.struct>.collapsed{margin-bottom:25px;}#main>.variant,#main>.structfield{display:block;}.attributes{display:block;margin-top:0px !important;margin-right:0px;margin-bottom:0px !important;margin-left:30px;}.toggle-attributes.collapsed{margin-bottom:0;}.impl-items>.toggle-attributes{margin-left:20px;}.impl-items .attributes{font-weight:500;}:target>code{opacity:1;}.information{position:absolute;left:-20px;margin-top:7px;z-index:1;}.tooltip{position:relative;display:inline-block;cursor:pointer;}.tooltip .tooltiptext{width:120px;display:none;text-align:center;padding:5px 3px;border-radius:6px;margin-left:5px;top:-5px;left:105%;z-index:10;}.tooltip:hover .tooltiptext{display:inline;}.tooltip .tooltiptext::after{content:" ";position:absolute;top:50%;left:11px;margin-top:-5px;border-width:5px;border-style:solid;}.tooltip .tooltiptext{border:1px solid;}pre.rust{position:relative;tab-width:4;-moz-tab-width:4;}.search-failed{text-align:center;margin-top:20px;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#titles{height:35px;}#titles>div{float:left;width:33.3%;text-align:center;font-size:18px;cursor:pointer;border-top:2px solid;}#titles>div:not(:last-child){margin-right:1px;width:calc(33.3% - 1px);}#titles>div>div.count{display:inline-block;font-size:16px;}#all-types{text-align:center;border:1px solid;margin:0 10px;margin-bottom:10px;display:block;border-radius:7px;}#all-types>p{margin:5px 0;}#sidebar-toggle{position:fixed;top:30px;left:300px;z-index:10;padding:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;cursor:pointer;font-weight:bold;transition:left .5s;font-size:1.2em;border:1px solid;border-left:0;}#source-sidebar{position:fixed;top:0;bottom:0;left:0;width:300px;z-index:1;overflow:auto;transition:left .5s;border-right:1px solid;}#source-sidebar>.title{font-size:1.5em;text-align:center;border-bottom:1px solid;margin-bottom:6px;}.theme-picker{position:absolute;left:211px;top:19px;}.theme-picker button{outline:none;}#settings-menu{position:absolute;right:0;top:10px;outline:none;}#theme-picker,#settings-menu{padding:4px;width:27px;height:29px;border:1px solid;border-radius:3px;cursor:pointer;}#theme-choices{display:none;position:absolute;left:0;top:28px;border:1px solid;border-radius:3px;z-index:1;cursor:pointer;}#theme-choices>button{border:none;width:100%;padding:4px;text-align:center;background:rgba(0,0,0,0);}#theme-choices>button:not(:first-child){border-top:1px solid;}@media (max-width:700px){body{padding-top:0px;}.rustdoc>.sidebar{height:45px;min-height:40px;margin:0;margin-left:-15px;padding:0 15px;position:static;z-index:11;}.sidebar>.location{float:right;margin:0px;margin-top:2px;padding:3px 10px 1px 10px;min-height:39px;background:inherit;text-align:left;font-size:24px;}.sidebar .location:empty{padding:0;}.sidebar .logo-container{width:35px;height:35px;margin-top:5px;margin-bottom:5px;float:left;margin-left:50px;}.sidebar .logo-container>img{max-width:35px;max-height:35px;}.sidebar-menu{position:fixed;z-index:10;font-size:2rem;cursor:pointer;width:45px;left:0;text-align:center;display:block;border-bottom:1px solid;border-right:1px solid;height:45px;}.rustdoc.source>.sidebar>.sidebar-menu{display:none;}.sidebar-elems{position:fixed;z-index:1;left:0;top:45px;bottom:0;overflow-y:auto;border-right:1px solid;display:none;}.sidebar>.block.version{border-bottom:none;margin-top:12px;}nav.sub{width:calc(100% - 32px);float:right;}.content{margin-left:0px;}#main{margin-top:45px;padding:0;}.content .in-band{width:100%;}.content h4>.out-of-band{position:inherit;}.toggle-wrapper>.collapse-toggle{left:0px;}.toggle-wrapper{height:1.5em;}#search{margin-left:0;}.content .impl-items .method,.content .impl-items>.type,.impl-items>.associatedconstant{display:flex;}.anchor{display:none !important;}h1.fqn{overflow:initial;}.theme-picker{left:10px;top:54px;z-index:1;}#titles>div>div.count{float:left;width:100%;}#titles{height:50px;}.sidebar.mobile{position:fixed;width:100%;margin-left:0;background-color:rgba(0,0,0,0);height:100%;}.sidebar{width:calc(100% + 30px);}.show-it{display:block;width:246px;}.show-it>.block.items{margin:8px 0;}.show-it>.block.items>ul{margin:0;}.show-it>.block.items>ul>li{text-align:center;margin:2px 0;}.show-it>.block.items>ul>li>a{font-size:21px;}#sidebar-filler{position:fixed;left:45px;width:calc(100% - 45px);top:0;height:45px;z-index:-1;border-bottom:1px solid;}.collapse-toggle{left:-20px;}.impl>.collapse-toggle{left:-10px;}#all-types{margin:10px;}#sidebar-toggle{top:100px;width:30px;font-size:1.5rem;text-align:center;padding:0;}#source-sidebar{z-index:11;}#main>.line-numbers{margin-top:0;}}@media print{nav.sub,.content .out-of-band,.collapse-toggle{display:none;}}@media (max-width:416px){#titles{height:73px;}#titles>div{height:73px;}}h3.important{margin:0;margin-bottom:13px;font-size:19px;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px;border-radius:3px;box-shadow:inset 0 -1px 0;cursor:default;}.hidden-by-impl-hider,.hidden-by-usual-hider{display:none !important;}#implementations-list>h3>span.in-band{width:100%;}.table-display{width:100%;border:0;border-collapse:collapse;border-spacing:0;font-size:16px;}.table-display tr td:first-child{padding-right:0;}.table-display tr td:last-child{float:right;}.table-display .out-of-band{position:relative;font-size:19px;display:block;}#implementors-list>.impl-items .table-display .out-of-band{font-size:17px;}.table-display td:hover .anchor{display:block;top:2px;left:-5px;}#main>ul{padding-left:10px;}#main>ul>li{list-style:none;}.non-exhaustive{margin-bottom:1em;}div.children{padding-left:27px;display:none;}div.name{cursor:pointer;position:relative;margin-left:16px;}div.files>a{display:block;padding:0 3px;}div.files>a:hover,div.name:hover{background-color:#a14b4b;}div.name.expand+.children{display:block;}div.name::before{content:"\25B6";padding-left:4px;font-size:0.7em;position:absolute;left:-16px;top:4px;}div.name.expand::before{transform:rotate(90deg);left:-15px;top:2px;}.type-decl>pre>.toggle-wrapper.toggle-attributes.top-attr{margin-left:0 !important;}.type-decl>pre>.docblock.attributes.top-attr{margin-left:1.8em !important;}.type-decl>pre>.toggle-attributes{margin-left:2.2em;}.type-decl>pre>.docblock.attributes{margin-left:4em;} \ No newline at end of file diff --git a/search-index.js b/search-index.js new file mode 100644 index 0000000..48f5466 --- /dev/null +++ b/search-index.js @@ -0,0 +1,15 @@ +var searchIndex={}; +searchIndex["arrayref"] = {"doc":"This package contains just four macros, which enable the…","i":[[14,"array_ref","arrayref","You can use `array_ref` to generate an array reference to…",null,null],[14,"array_refs","","You can use `array_refs` to generate a series of array…",null,null],[14,"mut_array_refs","","You can use `mut_array_refs` to generate a series of…",null,null],[14,"array_mut_ref","","You can use `array_mut_ref` to generate a mutable array…",null,null]],"p":[]}; +searchIndex["bincode"] = {"doc":"Bincode is a crate for encoding and decoding using a tiny…","i":[[3,"Config","bincode","A configuration builder whose options Bincode will use…",null,null],[4,"ErrorKind","","The kind of error that can be produced during a…",null,null],[13,"Io","","If the error stems from the reader/writer that is being…",0,null],[13,"InvalidUtf8Encoding","","Returned if the deserializer attempts to deserialize a…",0,null],[13,"InvalidBoolEncoding","","Returned if the deserializer attempts to deserialize a…",0,null],[13,"InvalidCharEncoding","","Returned if the deserializer attempts to deserialize a…",0,null],[13,"InvalidTagEncoding","","Returned if the deserializer attempts to deserialize the…",0,null],[13,"DeserializeAnyNotSupported","","Serde has a deserialize_any method that lets the format…",0,null],[13,"SizeLimit","","If (de)serializing a message takes more than the provided…",0,null],[13,"SequenceMustHaveLength","","Bincode can not encode sequences of unknown length (like…",0,null],[13,"Custom","","A custom error message from Serde.",0,null],[5,"config","","Get a default configuration object.",null,[[],["config"]]],[5,"serialize_into","","Serializes an object directly into a `Writer` using the…",null,[[["w"],["t"]],["result"]]],[5,"serialize","","Serializes a serializable object into a `Vec` of bytes…",null,[[["t"]],[["result",["vec"]],["vec",["u8"]]]]],[5,"deserialize_from","","Deserializes an object directly from a `Read`er using the…",null,[[["r"]],["result"]]],[5,"deserialize_from_custom","","Deserializes an object from a custom `BincodeRead`er using…",null,[[["r"]],["result"]]],[5,"deserialize","","Deserializes a slice of bytes into an instance of `T`…",null,[[],["result"]]],[5,"serialized_size","","Returns the size that an object would be if serialized…",null,[[["t"]],[["result",["u64"]],["u64"]]]],[11,"no_limit","","Sets the byte limit to be unlimited. This is the default.",1,[[["self"]],["self"]]],[11,"limit","","Sets the byte limit to `limit`.",1,[[["self"],["u64"]],["self"]]],[11,"little_endian","","Sets the endianness to little-endian This is the default.",1,[[["self"]],["self"]]],[11,"big_endian","","Sets the endianness to big-endian",1,[[["self"]],["self"]]],[11,"native_endian","","Sets the endianness to the the machine-native endianness",1,[[["self"]],["self"]]],[11,"serialize","","Serializes a serializable object into a `Vec` of bytes…",1,[[["t"],["self"]],[["result",["vec"]],["vec",["u8"]]]]],[11,"serialized_size","","Returns the size that an object would be if serialized…",1,[[["t"],["self"]],[["result",["u64"]],["u64"]]]],[11,"serialize_into","","Serializes an object directly into a `Writer` using this…",1,[[["t"],["self"],["write"]],["result"]]],[11,"deserialize","","Deserializes a slice of bytes into an instance of `T`…",1,[[["self"]],[["result"],["deserialize"]]]],[11,"deserialize_seed","","Deserializes a slice of bytes with state `seed` using this…",1,[[["deserializeseed"],["self"]],["result"]]],[11,"deserialize_from","","Deserializes an object directly from a `Read`er using this…",1,[[["self"],["read"]],[["result"],["deserializeowned"]]]],[11,"deserialize_from_seed","","Deserializes an object directly from a `Read`er with state…",1,[[["deserializeseed"],["self"],["read"]],["result"]]],[11,"deserialize_from_custom","","Deserializes an object from a custom `BincodeRead`er using…",1,[[["self"],["bincoderead"]],[["result"],["deserializeowned"]]]],[11,"deserialize_from_custom_seed","","Deserializes an object from a custom `BincodeRead`er with…",1,[[["deserializeseed"],["self"],["bincoderead"]],["result"]]],[6,"Error","","An error that can be produced during (de)serializing.",null,null],[6,"Result","","The result of a serialization or deserialization operation.",null,null],[8,"BincodeRead","","An optional Read trait for advanced Bincode usage.",null,null],[10,"forward_read_str","","Forwards reading `length` bytes of a string on to the…",2,[[["self"],["usize"],["v"]],["result"]]],[10,"get_byte_buffer","","Return the first `length` bytes of the internal byte buffer.",2,[[["self"],["usize"]],[["result",["vec"]],["vec",["u8"]]]]],[10,"forward_read_bytes","","Forwards reading `length` bytes on to the serde reader.",2,[[["self"],["usize"],["v"]],["result"]]],[11,"from","","",1,[[["t"]],["t"]]],[11,"into","","",1,[[],["u"]]],[11,"to_owned","","",1,[[["self"]],["t"]]],[11,"clone_into","","",1,[[["self"],["t"]]]],[11,"try_from","","",1,[[["u"]],["result"]]],[11,"try_into","","",1,[[],["result"]]],[11,"borrow","","",1,[[["self"]],["t"]]],[11,"borrow_mut","","",1,[[["self"]],["t"]]],[11,"type_id","","",1,[[["self"]],["typeid"]]],[11,"from","","",0,[[["t"]],["t"]]],[11,"into","","",0,[[],["u"]]],[11,"to_string","","",0,[[["self"]],["string"]]],[11,"try_from","","",0,[[["u"]],["result"]]],[11,"try_into","","",0,[[],["result"]]],[11,"borrow","","",0,[[["self"]],["t"]]],[11,"borrow_mut","","",0,[[["self"]],["t"]]],[11,"type_id","","",0,[[["self"]],["typeid"]]],[11,"from","","",3,[[["error"]],["error"]]],[11,"clone","","",1,[[["self"]],["config"]]],[11,"fmt","","",0,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",0,[[["formatter"],["self"]],["result"]]],[11,"description","","",0,[[["self"]],["str"]]],[11,"cause","","",0,[[["self"]],[["error"],["option",["error"]]]]],[11,"custom","","",3,[[["display"]],["self"]]],[11,"custom","","",3,[[["display"]],["error"]]]],"p":[[4,"ErrorKind"],[3,"Config"],[8,"BincodeRead"],[6,"Error"]]}; +searchIndex["byteorder"] = {"doc":"This crate provides convenience methods for encoding and…","i":[[4,"BigEndian","byteorder","Defines big-endian serialization.",null,null],[4,"LittleEndian","","Defines little-endian serialization.",null,null],[6,"BE","","A type alias for [`BigEndian`].",null,null],[6,"LE","","A type alias for [`LittleEndian`].",null,null],[6,"NetworkEndian","","Defines network byte order serialization.",null,null],[6,"NativeEndian","","Defines system native-endian serialization.",null,null],[8,"ReadBytesExt","","Extends [`Read`] with methods for reading numbers. (For…",null,null],[11,"read_u8","","Reads an unsigned 8 bit integer from the underlying reader.",0,[[["self"]],[["result",["u8"]],["u8"]]]],[11,"read_i8","","Reads a signed 8 bit integer from the underlying reader.",0,[[["self"]],[["result",["i8"]],["i8"]]]],[11,"read_u16","","Reads an unsigned 16 bit integer from the underlying reader.",0,[[["self"]],[["u16"],["result",["u16"]]]]],[11,"read_i16","","Reads a signed 16 bit integer from the underlying reader.",0,[[["self"]],[["i16"],["result",["i16"]]]]],[11,"read_u24","","Reads an unsigned 24 bit integer from the underlying reader.",0,[[["self"]],[["result",["u32"]],["u32"]]]],[11,"read_i24","","Reads a signed 24 bit integer from the underlying reader.",0,[[["self"]],[["result",["i32"]],["i32"]]]],[11,"read_u32","","Reads an unsigned 32 bit integer from the underlying reader.",0,[[["self"]],[["result",["u32"]],["u32"]]]],[11,"read_i32","","Reads a signed 32 bit integer from the underlying reader.",0,[[["self"]],[["result",["i32"]],["i32"]]]],[11,"read_u48","","Reads an unsigned 48 bit integer from the underlying reader.",0,[[["self"]],[["u64"],["result",["u64"]]]]],[11,"read_i48","","Reads a signed 48 bit integer from the underlying reader.",0,[[["self"]],[["result",["i64"]],["i64"]]]],[11,"read_u64","","Reads an unsigned 64 bit integer from the underlying reader.",0,[[["self"]],[["u64"],["result",["u64"]]]]],[11,"read_i64","","Reads a signed 64 bit integer from the underlying reader.",0,[[["self"]],[["result",["i64"]],["i64"]]]],[11,"read_u128","","Reads an unsigned 128 bit integer from the underlying…",0,[[["self"]],[["u128"],["result",["u128"]]]]],[11,"read_i128","","Reads a signed 128 bit integer from the underlying reader.",0,[[["self"]],[["result",["i128"]],["i128"]]]],[11,"read_uint","","Reads an unsigned n-bytes integer from the underlying…",0,[[["self"],["usize"]],[["u64"],["result",["u64"]]]]],[11,"read_int","","Reads a signed n-bytes integer from the underlying reader.",0,[[["self"],["usize"]],[["result",["i64"]],["i64"]]]],[11,"read_uint128","","Reads an unsigned n-bytes integer from the underlying…",0,[[["self"],["usize"]],[["u128"],["result",["u128"]]]]],[11,"read_int128","","Reads a signed n-bytes integer from the underlying reader.",0,[[["self"],["usize"]],[["result",["i128"]],["i128"]]]],[11,"read_f32","","Reads a IEEE754 single-precision (4 bytes) floating point…",0,[[["self"]],[["f32"],["result",["f32"]]]]],[11,"read_f64","","Reads a IEEE754 double-precision (8 bytes) floating point…",0,[[["self"]],[["f64"],["result",["f64"]]]]],[11,"read_u16_into","","Reads a sequence of unsigned 16 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_u32_into","","Reads a sequence of unsigned 32 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_u64_into","","Reads a sequence of unsigned 64 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_u128_into","","Reads a sequence of unsigned 128 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_i8_into","","Reads a sequence of signed 8 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_i16_into","","Reads a sequence of signed 16 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_i32_into","","Reads a sequence of signed 32 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_i64_into","","Reads a sequence of signed 64 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_i128_into","","Reads a sequence of signed 128 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_f32_into","","Reads a sequence of IEEE754 single-precision (4 bytes)…",0,[[["self"]],["result"]]],[11,"read_f32_into_unchecked","","DEPRECATED.",0,[[["self"]],["result"]]],[11,"read_f64_into","","Reads a sequence of IEEE754 double-precision (8 bytes)…",0,[[["self"]],["result"]]],[11,"read_f64_into_unchecked","","DEPRECATED.",0,[[["self"]],["result"]]],[8,"WriteBytesExt","","Extends [`Write`] with methods for writing numbers. (For…",null,null],[11,"write_u8","","Writes an unsigned 8 bit integer to the underlying writer.",1,[[["self"],["u8"]],["result"]]],[11,"write_i8","","Writes a signed 8 bit integer to the underlying writer.",1,[[["self"],["i8"]],["result"]]],[11,"write_u16","","Writes an unsigned 16 bit integer to the underlying writer.",1,[[["u16"],["self"]],["result"]]],[11,"write_i16","","Writes a signed 16 bit integer to the underlying writer.",1,[[["self"],["i16"]],["result"]]],[11,"write_u24","","Writes an unsigned 24 bit integer to the underlying writer.",1,[[["self"],["u32"]],["result"]]],[11,"write_i24","","Writes a signed 24 bit integer to the underlying writer.",1,[[["self"],["i32"]],["result"]]],[11,"write_u32","","Writes an unsigned 32 bit integer to the underlying writer.",1,[[["self"],["u32"]],["result"]]],[11,"write_i32","","Writes a signed 32 bit integer to the underlying writer.",1,[[["self"],["i32"]],["result"]]],[11,"write_u48","","Writes an unsigned 48 bit integer to the underlying writer.",1,[[["self"],["u64"]],["result"]]],[11,"write_i48","","Writes a signed 48 bit integer to the underlying writer.",1,[[["i64"],["self"]],["result"]]],[11,"write_u64","","Writes an unsigned 64 bit integer to the underlying writer.",1,[[["self"],["u64"]],["result"]]],[11,"write_i64","","Writes a signed 64 bit integer to the underlying writer.",1,[[["i64"],["self"]],["result"]]],[11,"write_u128","","Writes an unsigned 128 bit integer to the underlying writer.",1,[[["self"],["u128"]],["result"]]],[11,"write_i128","","Writes a signed 128 bit integer to the underlying writer.",1,[[["self"],["i128"]],["result"]]],[11,"write_uint","","Writes an unsigned n-bytes integer to the underlying writer.",1,[[["self"],["u64"],["usize"]],["result"]]],[11,"write_int","","Writes a signed n-bytes integer to the underlying writer.",1,[[["i64"],["self"],["usize"]],["result"]]],[11,"write_uint128","","Writes an unsigned n-bytes integer to the underlying writer.",1,[[["self"],["usize"],["u128"]],["result"]]],[11,"write_int128","","Writes a signed n-bytes integer to the underlying writer.",1,[[["self"],["i128"],["usize"]],["result"]]],[11,"write_f32","","Writes a IEEE754 single-precision (4 bytes) floating point…",1,[[["f32"],["self"]],["result"]]],[11,"write_f64","","Writes a IEEE754 double-precision (8 bytes) floating point…",1,[[["self"],["f64"]],["result"]]],[8,"ByteOrder","","`ByteOrder` describes types that can serialize integers as…",null,null],[10,"read_u16","","Reads an unsigned 16 bit integer from `buf`.",2,[[],["u16"]]],[11,"read_u24","","Reads an unsigned 24 bit integer from `buf`, stored in u32.",2,[[],["u32"]]],[10,"read_u32","","Reads an unsigned 32 bit integer from `buf`.",2,[[],["u32"]]],[11,"read_u48","","Reads an unsigned 48 bit integer from `buf`, stored in u64.",2,[[],["u64"]]],[10,"read_u64","","Reads an unsigned 64 bit integer from `buf`.",2,[[],["u64"]]],[10,"read_u128","","Reads an unsigned 128 bit integer from `buf`.",2,[[],["u128"]]],[10,"read_uint","","Reads an unsigned n-bytes integer from `buf`.",2,[[["usize"]],["u64"]]],[10,"read_uint128","","Reads an unsigned n-bytes integer from `buf`.",2,[[["usize"]],["u128"]]],[10,"write_u16","","Writes an unsigned 16 bit integer `n` to `buf`.",2,[[["u16"]]]],[11,"write_u24","","Writes an unsigned 24 bit integer `n` to `buf`, stored in…",2,[[["u32"]]]],[10,"write_u32","","Writes an unsigned 32 bit integer `n` to `buf`.",2,[[["u32"]]]],[11,"write_u48","","Writes an unsigned 48 bit integer `n` to `buf`, stored in…",2,[[["u64"]]]],[10,"write_u64","","Writes an unsigned 64 bit integer `n` to `buf`.",2,[[["u64"]]]],[10,"write_u128","","Writes an unsigned 128 bit integer `n` to `buf`.",2,[[["u128"]]]],[10,"write_uint","","Writes an unsigned integer `n` to `buf` using only `nbytes`.",2,[[["usize"],["u64"]]]],[10,"write_uint128","","Writes an unsigned integer `n` to `buf` using only `nbytes`.",2,[[["usize"],["u128"]]]],[11,"read_i16","","Reads a signed 16 bit integer from `buf`.",2,[[],["i16"]]],[11,"read_i24","","Reads a signed 24 bit integer from `buf`, stored in i32.",2,[[],["i32"]]],[11,"read_i32","","Reads a signed 32 bit integer from `buf`.",2,[[],["i32"]]],[11,"read_i48","","Reads a signed 48 bit integer from `buf`, stored in i64.",2,[[],["i64"]]],[11,"read_i64","","Reads a signed 64 bit integer from `buf`.",2,[[],["i64"]]],[11,"read_i128","","Reads a signed 128 bit integer from `buf`.",2,[[],["i128"]]],[11,"read_int","","Reads a signed n-bytes integer from `buf`.",2,[[["usize"]],["i64"]]],[11,"read_int128","","Reads a signed n-bytes integer from `buf`.",2,[[["usize"]],["i128"]]],[11,"read_f32","","Reads a IEEE754 single-precision (4 bytes) floating point…",2,[[],["f32"]]],[11,"read_f64","","Reads a IEEE754 double-precision (8 bytes) floating point…",2,[[],["f64"]]],[11,"write_i16","","Writes a signed 16 bit integer `n` to `buf`.",2,[[["i16"]]]],[11,"write_i24","","Writes a signed 24 bit integer `n` to `buf`, stored in i32.",2,[[["i32"]]]],[11,"write_i32","","Writes a signed 32 bit integer `n` to `buf`.",2,[[["i32"]]]],[11,"write_i48","","Writes a signed 48 bit integer `n` to `buf`, stored in i64.",2,[[["i64"]]]],[11,"write_i64","","Writes a signed 64 bit integer `n` to `buf`.",2,[[["i64"]]]],[11,"write_i128","","Writes a signed 128 bit integer `n` to `buf`.",2,[[["i128"]]]],[11,"write_int","","Writes a signed integer `n` to `buf` using only `nbytes`.",2,[[["i64"],["usize"]]]],[11,"write_int128","","Writes a signed integer `n` to `buf` using only `nbytes`.",2,[[["i128"],["usize"]]]],[11,"write_f32","","Writes a IEEE754 single-precision (4 bytes) floating point…",2,[[["f32"]]]],[11,"write_f64","","Writes a IEEE754 double-precision (8 bytes) floating point…",2,[[["f64"]]]],[10,"read_u16_into","","Reads unsigned 16 bit integers from `src` into `dst`.",2,[[]]],[10,"read_u32_into","","Reads unsigned 32 bit integers from `src` into `dst`.",2,[[]]],[10,"read_u64_into","","Reads unsigned 64 bit integers from `src` into `dst`.",2,[[]]],[10,"read_u128_into","","Reads unsigned 128 bit integers from `src` into `dst`.",2,[[]]],[11,"read_i16_into","","Reads signed 16 bit integers from `src` to `dst`.",2,[[]]],[11,"read_i32_into","","Reads signed 32 bit integers from `src` into `dst`.",2,[[]]],[11,"read_i64_into","","Reads signed 64 bit integers from `src` into `dst`.",2,[[]]],[11,"read_i128_into","","Reads signed 128 bit integers from `src` into `dst`.",2,[[]]],[11,"read_f32_into","","Reads IEEE754 single-precision (4 bytes) floating point…",2,[[]]],[11,"read_f32_into_unchecked","","DEPRECATED.",2,[[]]],[11,"read_f64_into","","Reads IEEE754 single-precision (4 bytes) floating point…",2,[[]]],[11,"read_f64_into_unchecked","","DEPRECATED.",2,[[]]],[10,"write_u16_into","","Writes unsigned 16 bit integers from `src` into `dst`.",2,[[]]],[10,"write_u32_into","","Writes unsigned 32 bit integers from `src` into `dst`.",2,[[]]],[10,"write_u64_into","","Writes unsigned 64 bit integers from `src` into `dst`.",2,[[]]],[10,"write_u128_into","","Writes unsigned 128 bit integers from `src` into `dst`.",2,[[]]],[11,"write_i16_into","","Writes signed 16 bit integers from `src` into `dst`.",2,[[]]],[11,"write_i32_into","","Writes signed 32 bit integers from `src` into `dst`.",2,[[]]],[11,"write_i64_into","","Writes signed 64 bit integers from `src` into `dst`.",2,[[]]],[11,"write_i128_into","","Writes signed 128 bit integers from `src` into `dst`.",2,[[]]],[11,"write_f32_into","","Writes IEEE754 single-precision (4 bytes) floating point…",2,[[]]],[11,"write_f64_into","","Writes IEEE754 double-precision (8 bytes) floating point…",2,[[]]],[10,"from_slice_u16","","Converts the given slice of unsigned 16 bit integers to a…",2,[[]]],[10,"from_slice_u32","","Converts the given slice of unsigned 32 bit integers to a…",2,[[]]],[10,"from_slice_u64","","Converts the given slice of unsigned 64 bit integers to a…",2,[[]]],[10,"from_slice_u128","","Converts the given slice of unsigned 128 bit integers to a…",2,[[]]],[11,"from_slice_i16","","Converts the given slice of signed 16 bit integers to a…",2,[[]]],[11,"from_slice_i32","","Converts the given slice of signed 32 bit integers to a…",2,[[]]],[11,"from_slice_i64","","Converts the given slice of signed 64 bit integers to a…",2,[[]]],[11,"from_slice_i128","","Converts the given slice of signed 128 bit integers to a…",2,[[]]],[10,"from_slice_f32","","Converts the given slice of IEEE754 single-precision (4…",2,[[]]],[10,"from_slice_f64","","Converts the given slice of IEEE754 double-precision (8…",2,[[]]],[11,"from","","",3,[[["t"]],["t"]]],[11,"into","","",3,[[],["u"]]],[11,"to_owned","","",3,[[["self"]],["t"]]],[11,"clone_into","","",3,[[["self"],["t"]]]],[11,"try_from","","",3,[[["u"]],["result"]]],[11,"try_into","","",3,[[],["result"]]],[11,"borrow","","",3,[[["self"]],["t"]]],[11,"borrow_mut","","",3,[[["self"]],["t"]]],[11,"type_id","","",3,[[["self"]],["typeid"]]],[11,"from","","",4,[[["t"]],["t"]]],[11,"into","","",4,[[],["u"]]],[11,"to_owned","","",4,[[["self"]],["t"]]],[11,"clone_into","","",4,[[["self"],["t"]]]],[11,"try_from","","",4,[[["u"]],["result"]]],[11,"try_into","","",4,[[],["result"]]],[11,"borrow","","",4,[[["self"]],["t"]]],[11,"borrow_mut","","",4,[[["self"]],["t"]]],[11,"type_id","","",4,[[["self"]],["typeid"]]],[11,"read_u16","","",3,[[],["u16"]]],[11,"read_u32","","",3,[[],["u32"]]],[11,"read_u64","","",3,[[],["u64"]]],[11,"read_u128","","",3,[[],["u128"]]],[11,"read_uint","","",3,[[["usize"]],["u64"]]],[11,"read_uint128","","",3,[[["usize"]],["u128"]]],[11,"write_u16","","",3,[[["u16"]]]],[11,"write_u32","","",3,[[["u32"]]]],[11,"write_u64","","",3,[[["u64"]]]],[11,"write_u128","","",3,[[["u128"]]]],[11,"write_uint","","",3,[[["usize"],["u64"]]]],[11,"write_uint128","","",3,[[["usize"],["u128"]]]],[11,"read_u16_into","","",3,[[]]],[11,"read_u32_into","","",3,[[]]],[11,"read_u64_into","","",3,[[]]],[11,"read_u128_into","","",3,[[]]],[11,"write_u16_into","","",3,[[]]],[11,"write_u32_into","","",3,[[]]],[11,"write_u64_into","","",3,[[]]],[11,"write_u128_into","","",3,[[]]],[11,"from_slice_u16","","",3,[[]]],[11,"from_slice_u32","","",3,[[]]],[11,"from_slice_u64","","",3,[[]]],[11,"from_slice_u128","","",3,[[]]],[11,"from_slice_f32","","",3,[[]]],[11,"from_slice_f64","","",3,[[]]],[11,"read_u16","","",4,[[],["u16"]]],[11,"read_u32","","",4,[[],["u32"]]],[11,"read_u64","","",4,[[],["u64"]]],[11,"read_u128","","",4,[[],["u128"]]],[11,"read_uint","","",4,[[["usize"]],["u64"]]],[11,"read_uint128","","",4,[[["usize"]],["u128"]]],[11,"write_u16","","",4,[[["u16"]]]],[11,"write_u32","","",4,[[["u32"]]]],[11,"write_u64","","",4,[[["u64"]]]],[11,"write_u128","","",4,[[["u128"]]]],[11,"write_uint","","",4,[[["usize"],["u64"]]]],[11,"write_uint128","","",4,[[["usize"],["u128"]]]],[11,"read_u16_into","","",4,[[]]],[11,"read_u32_into","","",4,[[]]],[11,"read_u64_into","","",4,[[]]],[11,"read_u128_into","","",4,[[]]],[11,"write_u16_into","","",4,[[]]],[11,"write_u32_into","","",4,[[]]],[11,"write_u64_into","","",4,[[]]],[11,"write_u128_into","","",4,[[]]],[11,"from_slice_u16","","",4,[[]]],[11,"from_slice_u32","","",4,[[]]],[11,"from_slice_u64","","",4,[[]]],[11,"from_slice_u128","","",4,[[]]],[11,"from_slice_f32","","",4,[[]]],[11,"from_slice_f64","","",4,[[]]],[11,"clone","","",3,[[["self"]],["bigendian"]]],[11,"clone","","",4,[[["self"]],["littleendian"]]],[11,"default","","",3,[[],["bigendian"]]],[11,"default","","",4,[[],["littleendian"]]],[11,"cmp","","",3,[[["bigendian"],["self"]],["ordering"]]],[11,"cmp","","",4,[[["self"],["littleendian"]],["ordering"]]],[11,"eq","","",3,[[["bigendian"],["self"]],["bool"]]],[11,"eq","","",4,[[["self"],["littleendian"]],["bool"]]],[11,"partial_cmp","","",3,[[["bigendian"],["self"]],[["option",["ordering"]],["ordering"]]]],[11,"partial_cmp","","",4,[[["self"],["littleendian"]],[["option",["ordering"]],["ordering"]]]],[11,"fmt","","",3,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",4,[[["formatter"],["self"]],["result"]]],[11,"hash","","",3,[[["self"],["__h"]]]],[11,"hash","","",4,[[["self"],["__h"]]]],[11,"read_u8","","Reads an unsigned 8 bit integer from the underlying reader.",0,[[["self"]],[["result",["u8"]],["u8"]]]],[11,"read_i8","","Reads a signed 8 bit integer from the underlying reader.",0,[[["self"]],[["result",["i8"]],["i8"]]]],[11,"read_u16","","Reads an unsigned 16 bit integer from the underlying reader.",0,[[["self"]],[["u16"],["result",["u16"]]]]],[11,"read_i16","","Reads a signed 16 bit integer from the underlying reader.",0,[[["self"]],[["i16"],["result",["i16"]]]]],[11,"read_u24","","Reads an unsigned 24 bit integer from the underlying reader.",0,[[["self"]],[["result",["u32"]],["u32"]]]],[11,"read_i24","","Reads a signed 24 bit integer from the underlying reader.",0,[[["self"]],[["result",["i32"]],["i32"]]]],[11,"read_u32","","Reads an unsigned 32 bit integer from the underlying reader.",0,[[["self"]],[["result",["u32"]],["u32"]]]],[11,"read_i32","","Reads a signed 32 bit integer from the underlying reader.",0,[[["self"]],[["result",["i32"]],["i32"]]]],[11,"read_u48","","Reads an unsigned 48 bit integer from the underlying reader.",0,[[["self"]],[["u64"],["result",["u64"]]]]],[11,"read_i48","","Reads a signed 48 bit integer from the underlying reader.",0,[[["self"]],[["result",["i64"]],["i64"]]]],[11,"read_u64","","Reads an unsigned 64 bit integer from the underlying reader.",0,[[["self"]],[["u64"],["result",["u64"]]]]],[11,"read_i64","","Reads a signed 64 bit integer from the underlying reader.",0,[[["self"]],[["result",["i64"]],["i64"]]]],[11,"read_u128","","Reads an unsigned 128 bit integer from the underlying…",0,[[["self"]],[["u128"],["result",["u128"]]]]],[11,"read_i128","","Reads a signed 128 bit integer from the underlying reader.",0,[[["self"]],[["result",["i128"]],["i128"]]]],[11,"read_uint","","Reads an unsigned n-bytes integer from the underlying…",0,[[["self"],["usize"]],[["u64"],["result",["u64"]]]]],[11,"read_int","","Reads a signed n-bytes integer from the underlying reader.",0,[[["self"],["usize"]],[["result",["i64"]],["i64"]]]],[11,"read_uint128","","Reads an unsigned n-bytes integer from the underlying…",0,[[["self"],["usize"]],[["u128"],["result",["u128"]]]]],[11,"read_int128","","Reads a signed n-bytes integer from the underlying reader.",0,[[["self"],["usize"]],[["result",["i128"]],["i128"]]]],[11,"read_f32","","Reads a IEEE754 single-precision (4 bytes) floating point…",0,[[["self"]],[["f32"],["result",["f32"]]]]],[11,"read_f64","","Reads a IEEE754 double-precision (8 bytes) floating point…",0,[[["self"]],[["f64"],["result",["f64"]]]]],[11,"read_u16_into","","Reads a sequence of unsigned 16 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_u32_into","","Reads a sequence of unsigned 32 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_u64_into","","Reads a sequence of unsigned 64 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_u128_into","","Reads a sequence of unsigned 128 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_i8_into","","Reads a sequence of signed 8 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_i16_into","","Reads a sequence of signed 16 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_i32_into","","Reads a sequence of signed 32 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_i64_into","","Reads a sequence of signed 64 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_i128_into","","Reads a sequence of signed 128 bit integers from the…",0,[[["self"]],["result"]]],[11,"read_f32_into","","Reads a sequence of IEEE754 single-precision (4 bytes)…",0,[[["self"]],["result"]]],[11,"read_f32_into_unchecked","","DEPRECATED.",0,[[["self"]],["result"]]],[11,"read_f64_into","","Reads a sequence of IEEE754 double-precision (8 bytes)…",0,[[["self"]],["result"]]],[11,"read_f64_into_unchecked","","DEPRECATED.",0,[[["self"]],["result"]]],[11,"write_u8","","Writes an unsigned 8 bit integer to the underlying writer.",1,[[["self"],["u8"]],["result"]]],[11,"write_i8","","Writes a signed 8 bit integer to the underlying writer.",1,[[["self"],["i8"]],["result"]]],[11,"write_u16","","Writes an unsigned 16 bit integer to the underlying writer.",1,[[["u16"],["self"]],["result"]]],[11,"write_i16","","Writes a signed 16 bit integer to the underlying writer.",1,[[["self"],["i16"]],["result"]]],[11,"write_u24","","Writes an unsigned 24 bit integer to the underlying writer.",1,[[["self"],["u32"]],["result"]]],[11,"write_i24","","Writes a signed 24 bit integer to the underlying writer.",1,[[["self"],["i32"]],["result"]]],[11,"write_u32","","Writes an unsigned 32 bit integer to the underlying writer.",1,[[["self"],["u32"]],["result"]]],[11,"write_i32","","Writes a signed 32 bit integer to the underlying writer.",1,[[["self"],["i32"]],["result"]]],[11,"write_u48","","Writes an unsigned 48 bit integer to the underlying writer.",1,[[["self"],["u64"]],["result"]]],[11,"write_i48","","Writes a signed 48 bit integer to the underlying writer.",1,[[["i64"],["self"]],["result"]]],[11,"write_u64","","Writes an unsigned 64 bit integer to the underlying writer.",1,[[["self"],["u64"]],["result"]]],[11,"write_i64","","Writes a signed 64 bit integer to the underlying writer.",1,[[["i64"],["self"]],["result"]]],[11,"write_u128","","Writes an unsigned 128 bit integer to the underlying writer.",1,[[["self"],["u128"]],["result"]]],[11,"write_i128","","Writes a signed 128 bit integer to the underlying writer.",1,[[["self"],["i128"]],["result"]]],[11,"write_uint","","Writes an unsigned n-bytes integer to the underlying writer.",1,[[["self"],["u64"],["usize"]],["result"]]],[11,"write_int","","Writes a signed n-bytes integer to the underlying writer.",1,[[["i64"],["self"],["usize"]],["result"]]],[11,"write_uint128","","Writes an unsigned n-bytes integer to the underlying writer.",1,[[["self"],["usize"],["u128"]],["result"]]],[11,"write_int128","","Writes a signed n-bytes integer to the underlying writer.",1,[[["self"],["i128"],["usize"]],["result"]]],[11,"write_f32","","Writes a IEEE754 single-precision (4 bytes) floating point…",1,[[["f32"],["self"]],["result"]]],[11,"write_f64","","Writes a IEEE754 double-precision (8 bytes) floating point…",1,[[["self"],["f64"]],["result"]]]],"p":[[8,"ReadBytesExt"],[8,"WriteBytesExt"],[8,"ByteOrder"],[4,"BigEndian"],[4,"LittleEndian"]]}; +searchIndex["cfg_if"] = {"doc":"A macro for defining `#[cfg]` if-else statements.","i":[[14,"cfg_if","cfg_if","The main macro provided by this crate. See crate…",null,null]],"p":[]}; +searchIndex["ironsea_index"] = {"doc":"Iron Sea - Index","i":[[8,"Record","ironsea_index","Record behavior used by Indexed implementations.",null,null],[10,"key","","Extract the key from the record.",0,[[["self"]],["k"]]],[8,"RecordFields","","Record behavior used by IndexedDestructured implementations.",null,null],[10,"fields","","Extract the fields of the record",1,[[["self"]],["f"]]],[8,"Indexed","","Methods provided by indices.",null,null],[10,"find","","Retrieve all records matching the key.",2,[[["k"],["self"]],[["vec"],["r"]]]],[10,"find_range","","Retrieve all records matching in the key range defined by…",2,[[["k"],["self"]],[["vec"],["r"]]]],[8,"IndexedDestructured","","Methods provided by destructuring indices.",null,null],[10,"find","","Retrieve all records matching the key.",3,[[["k"],["self"]],[["f"],["vec"]]]],[10,"find_range","","Retrieve all records matching in the key range defined by…",3,[[["k"],["self"]],["vec"]]]],"p":[[8,"Record"],[8,"RecordFields"],[8,"Indexed"],[8,"IndexedDestructured"]]}; +searchIndex["ironsea_index_sfc_dbc"] = {"doc":"Iron Sea - Index SFC DBC","i":[[8,"Record","ironsea_index_sfc_dbc","Record behavior used by Indexed implementations.",null,null],[10,"key","","Extract the key from the record.",0,[[["self"]],["k"]]],[8,"RecordFields","","Record behavior used by IndexedDestructured implementations.",null,null],[10,"fields","","Extract the fields of the record",1,[[["self"]],["f"]]],[3,"IndexOwned","","Space Filling Curve-based index.",null,null],[11,"new","","Creates a new Index from the provided iterator.",2,[[["i"],["usize"]],["self"]]],[11,"find_by_value","","Returns a vector of keys which have stored values in the…",2,[[["f"],["self"]],["vec"]]],[11,"from","","",2,[[["t"]],["t"]]],[11,"into","","",2,[[],["u"]]],[11,"to_owned","","",2,[[["self"]],["t"]]],[11,"clone_into","","",2,[[["self"],["t"]]]],[11,"try_from","","",2,[[["u"]],["result"]]],[11,"try_into","","",2,[[],["result"]]],[11,"borrow","","",2,[[["self"]],["t"]]],[11,"borrow_mut","","",2,[[["self"]],["t"]]],[11,"type_id","","",2,[[["self"]],["typeid"]]],[11,"clone","","",2,[[["self"]],["spacefillingcurve"]]],[11,"fmt","","",2,[[["formatter"],["self"]],["result"]]],[11,"find","","",2,[[["k"],["self"]],[["f"],["vec"]]]],[11,"find_range","","",2,[[["k"],["self"]],["vec"]]],[11,"serialize","","",2,[[["self"],["__s"]],["result"]]],[11,"deserialize","","",2,[[["__d"]],["result"]]]],"p":[[8,"Record"],[8,"RecordFields"],[3,"IndexOwned"]]}; +searchIndex["log"] = {"doc":"A lightweight logging facade.","i":[[3,"Record","log","The \"payload\" of a log message.",null,null],[3,"RecordBuilder","","Builder for `Record`.",null,null],[3,"Metadata","","Metadata about a log message.",null,null],[3,"MetadataBuilder","","Builder for `Metadata`.",null,null],[3,"SetLoggerError","","The type returned by [`set_logger`] if [`set_logger`] has…",null,null],[3,"ParseLevelError","","The type returned by [`from_str`] when the string doesn't…",null,null],[4,"Level","","An enum representing the available verbosity levels of the…",null,null],[13,"Error","","The \"error\" level.",0,null],[13,"Warn","","The \"warn\" level.",0,null],[13,"Info","","The \"info\" level.",0,null],[13,"Debug","","The \"debug\" level.",0,null],[13,"Trace","","The \"trace\" level.",0,null],[4,"LevelFilter","","An enum representing the available verbosity level filters…",null,null],[13,"Off","","A level lower than all log levels.",1,null],[13,"Error","","Corresponds to the `Error` log level.",1,null],[13,"Warn","","Corresponds to the `Warn` log level.",1,null],[13,"Info","","Corresponds to the `Info` log level.",1,null],[13,"Debug","","Corresponds to the `Debug` log level.",1,null],[13,"Trace","","Corresponds to the `Trace` log level.",1,null],[5,"set_max_level","","Sets the global maximum log level.",null,[[["levelfilter"]]]],[5,"max_level","","Returns the current maximum log level.",null,[[],["levelfilter"]]],[5,"set_logger","","Sets the global logger to a `&'static Log`.",null,[[["log"]],[["result",["setloggererror"]],["setloggererror"]]]],[5,"set_logger_racy","","A thread-unsafe version of [`set_logger`].",null,[[["log"]],[["result",["setloggererror"]],["setloggererror"]]]],[5,"logger","","Returns a reference to the logger.",null,[[],["log"]]],[17,"STATIC_MAX_LEVEL","","The statically resolved maximum log level.",null,null],[8,"Log","","A trait encapsulating the operations required of a logger.",null,null],[10,"enabled","","Determines if a log message with the specified metadata…",2,[[["self"],["metadata"]],["bool"]]],[10,"log","","Logs the `Record`.",2,[[["record"],["self"]]]],[10,"flush","","Flushes any buffered records.",2,[[["self"]]]],[11,"max","","Returns the most verbose logging level.",0,[[],["level"]]],[11,"to_level_filter","","Converts the `Level` to the equivalent `LevelFilter`.",0,[[["self"]],["levelfilter"]]],[11,"max","","Returns the most verbose logging level filter.",1,[[],["levelfilter"]]],[11,"to_level","","Converts `self` to the equivalent `Level`.",1,[[["self"]],[["option",["level"]],["level"]]]],[11,"builder","","Returns a new builder.",3,[[],["recordbuilder"]]],[11,"args","","The message body.",3,[[["self"]],["arguments"]]],[11,"metadata","","Metadata about the log directive.",3,[[["self"]],["metadata"]]],[11,"level","","The verbosity level of the message.",3,[[["self"]],["level"]]],[11,"target","","The name of the target of the directive.",3,[[["self"]],["str"]]],[11,"module_path","","The module path of the message.",3,[[["self"]],[["option",["str"]],["str"]]]],[11,"module_path_static","","The module path of the message, if it is a `'static` string.",3,[[["self"]],[["option",["str"]],["str"]]]],[11,"file","","The source file containing the message.",3,[[["self"]],[["option",["str"]],["str"]]]],[11,"file_static","","The module path of the message, if it is a `'static` string.",3,[[["self"]],[["option",["str"]],["str"]]]],[11,"line","","The line containing the message.",3,[[["self"]],[["u32"],["option",["u32"]]]]],[11,"new","","Construct new `RecordBuilder`.",4,[[],["recordbuilder"]]],[11,"args","","Set `args`.",4,[[["arguments"],["self"]],["recordbuilder"]]],[11,"metadata","","Set `metadata`. Construct a `Metadata` object with…",4,[[["self"],["metadata"]],["recordbuilder"]]],[11,"level","","Set `Metadata::level`.",4,[[["self"],["level"]],["recordbuilder"]]],[11,"target","","Set `Metadata::target`",4,[[["self"],["str"]],["recordbuilder"]]],[11,"module_path","","Set `module_path`",4,[[["self"],["option",["str"]],["str"]],["recordbuilder"]]],[11,"module_path_static","","Set `module_path` to a `'static` string",4,[[["option",["str"]],["self"],["str"]],["recordbuilder"]]],[11,"file","","Set `file`",4,[[["self"],["option",["str"]],["str"]],["recordbuilder"]]],[11,"file_static","","Set `file` to a `'static` string.",4,[[["option",["str"]],["self"],["str"]],["recordbuilder"]]],[11,"line","","Set `line`",4,[[["self"],["u32"],["option",["u32"]]],["recordbuilder"]]],[11,"build","","Invoke the builder and return a `Record`",4,[[["self"]],["record"]]],[11,"builder","","Returns a new builder.",5,[[],["metadatabuilder"]]],[11,"level","","The verbosity level of the message.",5,[[["self"]],["level"]]],[11,"target","","The name of the target of the directive.",5,[[["self"]],["str"]]],[11,"new","","Construct a new `MetadataBuilder`.",6,[[],["metadatabuilder"]]],[11,"level","","Setter for `level`.",6,[[["self"],["level"]],["metadatabuilder"]]],[11,"target","","Setter for `target`.",6,[[["self"],["str"]],["metadatabuilder"]]],[11,"build","","Returns a `Metadata` object.",6,[[["self"]],["metadata"]]],[14,"log","","The standard logging macro.",null,null],[14,"error","","Logs a message at the error level.",null,null],[14,"warn","","Logs a message at the warn level.",null,null],[14,"info","","Logs a message at the info level.",null,null],[14,"debug","","Logs a message at the debug level.",null,null],[14,"trace","","Logs a message at the trace level.",null,null],[14,"log_enabled","","Determines if a message logged at the specified level in…",null,null],[11,"from","","",3,[[["t"]],["t"]]],[11,"try_from","","",3,[[["u"]],["result"]]],[11,"into","","",3,[[],["u"]]],[11,"try_into","","",3,[[],["result"]]],[11,"borrow","","",3,[[["self"]],["t"]]],[11,"borrow_mut","","",3,[[["self"]],["t"]]],[11,"type_id","","",3,[[["self"]],["typeid"]]],[11,"from","","",4,[[["t"]],["t"]]],[11,"try_from","","",4,[[["u"]],["result"]]],[11,"into","","",4,[[],["u"]]],[11,"try_into","","",4,[[],["result"]]],[11,"borrow","","",4,[[["self"]],["t"]]],[11,"borrow_mut","","",4,[[["self"]],["t"]]],[11,"type_id","","",4,[[["self"]],["typeid"]]],[11,"from","","",5,[[["t"]],["t"]]],[11,"try_from","","",5,[[["u"]],["result"]]],[11,"into","","",5,[[],["u"]]],[11,"try_into","","",5,[[],["result"]]],[11,"borrow","","",5,[[["self"]],["t"]]],[11,"borrow_mut","","",5,[[["self"]],["t"]]],[11,"type_id","","",5,[[["self"]],["typeid"]]],[11,"from","","",6,[[["t"]],["t"]]],[11,"try_from","","",6,[[["u"]],["result"]]],[11,"into","","",6,[[],["u"]]],[11,"try_into","","",6,[[],["result"]]],[11,"borrow","","",6,[[["self"]],["t"]]],[11,"borrow_mut","","",6,[[["self"]],["t"]]],[11,"type_id","","",6,[[["self"]],["typeid"]]],[11,"from","","",7,[[["t"]],["t"]]],[11,"try_from","","",7,[[["u"]],["result"]]],[11,"into","","",7,[[],["u"]]],[11,"try_into","","",7,[[],["result"]]],[11,"borrow","","",7,[[["self"]],["t"]]],[11,"borrow_mut","","",7,[[["self"]],["t"]]],[11,"type_id","","",7,[[["self"]],["typeid"]]],[11,"from","","",8,[[["t"]],["t"]]],[11,"try_from","","",8,[[["u"]],["result"]]],[11,"into","","",8,[[],["u"]]],[11,"try_into","","",8,[[],["result"]]],[11,"borrow","","",8,[[["self"]],["t"]]],[11,"borrow_mut","","",8,[[["self"]],["t"]]],[11,"type_id","","",8,[[["self"]],["typeid"]]],[11,"from","","",0,[[["t"]],["t"]]],[11,"try_from","","",0,[[["u"]],["result"]]],[11,"into","","",0,[[],["u"]]],[11,"try_into","","",0,[[],["result"]]],[11,"borrow","","",0,[[["self"]],["t"]]],[11,"borrow_mut","","",0,[[["self"]],["t"]]],[11,"type_id","","",0,[[["self"]],["typeid"]]],[11,"from","","",1,[[["t"]],["t"]]],[11,"try_from","","",1,[[["u"]],["result"]]],[11,"into","","",1,[[],["u"]]],[11,"try_into","","",1,[[],["result"]]],[11,"borrow","","",1,[[["self"]],["t"]]],[11,"borrow_mut","","",1,[[["self"]],["t"]]],[11,"type_id","","",1,[[["self"]],["typeid"]]],[11,"fmt","","",0,[[["self"],["formatter"]],["result"]]],[11,"fmt","","",1,[[["self"],["formatter"]],["result"]]],[11,"fmt","","",3,[[["self"],["formatter"]],["result"]]],[11,"fmt","","",4,[[["self"],["formatter"]],["result"]]],[11,"fmt","","",5,[[["self"],["formatter"]],["result"]]],[11,"fmt","","",6,[[["self"],["formatter"]],["result"]]],[11,"fmt","","",7,[[["self"],["formatter"]],["result"]]],[11,"fmt","","",8,[[["self"],["formatter"]],["result"]]],[11,"fmt","","",0,[[["self"],["formatter"]],["result"]]],[11,"fmt","","",1,[[["self"],["formatter"]],["result"]]],[11,"fmt","","",7,[[["self"],["formatter"]],["result"]]],[11,"fmt","","",8,[[["self"],["formatter"]],["result"]]],[11,"eq","","",0,[[["level"],["self"]],["bool"]]],[11,"eq","","",0,[[["self"],["levelfilter"]],["bool"]]],[11,"eq","","",1,[[["self"],["levelfilter"]],["bool"]]],[11,"eq","","",1,[[["level"],["self"]],["bool"]]],[11,"eq","","",5,[[["self"],["metadata"]],["bool"]]],[11,"ne","","",5,[[["self"],["metadata"]],["bool"]]],[11,"eq","","",6,[[["self"],["metadatabuilder"]],["bool"]]],[11,"ne","","",6,[[["self"],["metadatabuilder"]],["bool"]]],[11,"eq","","",8,[[["parselevelerror"],["self"]],["bool"]]],[11,"ne","","",8,[[["parselevelerror"],["self"]],["bool"]]],[11,"cmp","","",0,[[["level"],["self"]],["ordering"]]],[11,"cmp","","",1,[[["self"],["levelfilter"]],["ordering"]]],[11,"cmp","","",5,[[["self"],["metadata"]],["ordering"]]],[11,"cmp","","",6,[[["self"],["metadatabuilder"]],["ordering"]]],[11,"partial_cmp","","",0,[[["level"],["self"]],[["option",["ordering"]],["ordering"]]]],[11,"lt","","",0,[[["level"],["self"]],["bool"]]],[11,"le","","",0,[[["level"],["self"]],["bool"]]],[11,"gt","","",0,[[["level"],["self"]],["bool"]]],[11,"ge","","",0,[[["level"],["self"]],["bool"]]],[11,"partial_cmp","","",0,[[["self"],["levelfilter"]],[["option",["ordering"]],["ordering"]]]],[11,"lt","","",0,[[["self"],["levelfilter"]],["bool"]]],[11,"le","","",0,[[["self"],["levelfilter"]],["bool"]]],[11,"gt","","",0,[[["self"],["levelfilter"]],["bool"]]],[11,"ge","","",0,[[["self"],["levelfilter"]],["bool"]]],[11,"partial_cmp","","",1,[[["self"],["levelfilter"]],[["option",["ordering"]],["ordering"]]]],[11,"lt","","",1,[[["self"],["levelfilter"]],["bool"]]],[11,"le","","",1,[[["self"],["levelfilter"]],["bool"]]],[11,"gt","","",1,[[["self"],["levelfilter"]],["bool"]]],[11,"ge","","",1,[[["self"],["levelfilter"]],["bool"]]],[11,"partial_cmp","","",1,[[["level"],["self"]],[["option",["ordering"]],["ordering"]]]],[11,"lt","","",1,[[["level"],["self"]],["bool"]]],[11,"le","","",1,[[["level"],["self"]],["bool"]]],[11,"gt","","",1,[[["level"],["self"]],["bool"]]],[11,"ge","","",1,[[["level"],["self"]],["bool"]]],[11,"partial_cmp","","",5,[[["self"],["metadata"]],[["ordering"],["option",["ordering"]]]]],[11,"lt","","",5,[[["self"],["metadata"]],["bool"]]],[11,"le","","",5,[[["self"],["metadata"]],["bool"]]],[11,"gt","","",5,[[["self"],["metadata"]],["bool"]]],[11,"ge","","",5,[[["self"],["metadata"]],["bool"]]],[11,"partial_cmp","","",6,[[["self"],["metadatabuilder"]],[["ordering"],["option",["ordering"]]]]],[11,"lt","","",6,[[["self"],["metadatabuilder"]],["bool"]]],[11,"le","","",6,[[["self"],["metadatabuilder"]],["bool"]]],[11,"gt","","",6,[[["self"],["metadatabuilder"]],["bool"]]],[11,"ge","","",6,[[["self"],["metadatabuilder"]],["bool"]]],[11,"hash","","",0,[[["self"],["__h"]]]],[11,"hash","","",1,[[["self"],["__h"]]]],[11,"hash","","",5,[[["self"],["__h"]]]],[11,"hash","","",6,[[["self"],["__h"]]]],[11,"from_str","","",0,[[["str"]],[["level"],["result",["level"]]]]],[11,"from_str","","",1,[[["str"]],[["result",["levelfilter"]],["levelfilter"]]]],[11,"clone","","",0,[[["self"]],["level"]]],[11,"clone","","",1,[[["self"]],["levelfilter"]]],[11,"clone","","",3,[[["self"]],["record"]]],[11,"clone","","",5,[[["self"]],["metadata"]]]],"p":[[4,"Level"],[4,"LevelFilter"],[8,"Log"],[3,"Record"],[3,"RecordBuilder"],[3,"Metadata"],[3,"MetadataBuilder"],[3,"SetLoggerError"],[3,"ParseLevelError"]]}; +searchIndex["proc_macro2"] = {"doc":"A wrapper around the procedural macro API of the…","i":[[3,"TokenStream","proc_macro2","An abstract stream of tokens, or more concretely a…",null,null],[3,"LexError","","Error returned from `TokenStream::from_str`.",null,null],[3,"Span","","A region of source code, along with macro expansion…",null,null],[3,"Group","","A delimited token stream.",null,null],[3,"Punct","","An `Punct` is an single punctuation character like `+`,…",null,null],[3,"Ident","","A word of Rust code, which may be a keyword or legal…",null,null],[3,"Literal","","A literal string (`\"hello\"`), byte string (`b\"hello\"`),…",null,null],[4,"TokenTree","","A single token or a delimited sequence of token trees…",null,null],[13,"Group","","A token stream surrounded by bracket delimiters.",0,null],[13,"Ident","","An identifier.",0,null],[13,"Punct","","A single punctuation character (`+`, `,`, `$`, etc.).",0,null],[13,"Literal","","A literal character (`'a'`), string (`\"hello\"`), number…",0,null],[4,"Delimiter","","Describes how a sequence of token trees is delimited.",null,null],[13,"Parenthesis","","`( ... )`",1,null],[13,"Brace","","`{ ... }`",1,null],[13,"Bracket","","`[ ... ]`",1,null],[13,"None","","`Ø ... Ø`",1,null],[4,"Spacing","","Whether an `Punct` is followed immediately by another…",null,null],[13,"Alone","","E.g. `+` is `Alone` in `+ =`, `+ident` or `+()`.",2,null],[13,"Joint","","E.g. `+` is `Joint` in `+=` or `'` is `Joint` in `'#`.",2,null],[0,"token_stream","","Public implementation details for the `TokenStream` type,…",null,null],[3,"IntoIter","proc_macro2::token_stream","An iterator over `TokenStream`'s `TokenTree`s.",null,null],[11,"new","proc_macro2","Returns an empty `TokenStream` containing no token trees.",3,[[],["tokenstream"]]],[11,"is_empty","","Checks if this `TokenStream` is empty.",3,[[["self"]],["bool"]]],[11,"call_site","","The span of the invocation of the current procedural macro.",4,[[],["span"]]],[11,"unwrap","","Convert `proc_macro2::Span` to `proc_macro::Span`.",4,[[],["span"]]],[11,"join","","Create a new span encompassing `self` and `other`.",4,[[["self"],["span"]],[["span"],["option",["span"]]]]],[11,"span","","Returns the span of this tree, delegating to the `span`…",0,[[["self"]],["span"]]],[11,"set_span","","Configures the span for only this token.",0,[[["self"],["span"]]]],[11,"new","","Creates a new `Group` with the given delimiter and token…",5,[[["delimiter"],["tokenstream"]],["group"]]],[11,"delimiter","","Returns the delimiter of this `Group`",5,[[["self"]],["delimiter"]]],[11,"stream","","Returns the `TokenStream` of tokens that are delimited in…",5,[[["self"]],["tokenstream"]]],[11,"span","","Returns the span for the delimiters of this token stream,…",5,[[["self"]],["span"]]],[11,"span_open","","Returns the span pointing to the opening delimiter of this…",5,[[["self"]],["span"]]],[11,"span_close","","Returns the span pointing to the closing delimiter of this…",5,[[["self"]],["span"]]],[11,"set_span","","Configures the span for this `Group`'s delimiters, but not…",5,[[["self"],["span"]]]],[11,"new","","Creates a new `Punct` from the given character and spacing.",6,[[["spacing"],["char"]],["punct"]]],[11,"as_char","","Returns the value of this punctuation character as `char`.",6,[[["self"]],["char"]]],[11,"spacing","","Returns the spacing of this punctuation character,…",6,[[["self"]],["spacing"]]],[11,"span","","Returns the span for this punctuation character.",6,[[["self"]],["span"]]],[11,"set_span","","Configure the span for this punctuation character.",6,[[["self"],["span"]]]],[11,"new","","Creates a new `Ident` with the given `string` as well as…",7,[[["str"],["span"]],["ident"]]],[11,"span","","Returns the span of this `Ident`.",7,[[["self"]],["span"]]],[11,"set_span","","Configures the span of this `Ident`, possibly changing its…",7,[[["self"],["span"]]]],[11,"u8_suffixed","","Creates a new suffixed integer literal with the specified…",8,[[["u8"]],["literal"]]],[11,"u16_suffixed","","Creates a new suffixed integer literal with the specified…",8,[[["u16"]],["literal"]]],[11,"u32_suffixed","","Creates a new suffixed integer literal with the specified…",8,[[["u32"]],["literal"]]],[11,"u64_suffixed","","Creates a new suffixed integer literal with the specified…",8,[[["u64"]],["literal"]]],[11,"u128_suffixed","","Creates a new suffixed integer literal with the specified…",8,[[["u128"]],["literal"]]],[11,"usize_suffixed","","Creates a new suffixed integer literal with the specified…",8,[[["usize"]],["literal"]]],[11,"i8_suffixed","","Creates a new suffixed integer literal with the specified…",8,[[["i8"]],["literal"]]],[11,"i16_suffixed","","Creates a new suffixed integer literal with the specified…",8,[[["i16"]],["literal"]]],[11,"i32_suffixed","","Creates a new suffixed integer literal with the specified…",8,[[["i32"]],["literal"]]],[11,"i64_suffixed","","Creates a new suffixed integer literal with the specified…",8,[[["i64"]],["literal"]]],[11,"i128_suffixed","","Creates a new suffixed integer literal with the specified…",8,[[["i128"]],["literal"]]],[11,"isize_suffixed","","Creates a new suffixed integer literal with the specified…",8,[[["isize"]],["literal"]]],[11,"u8_unsuffixed","","Creates a new unsuffixed integer literal with the…",8,[[["u8"]],["literal"]]],[11,"u16_unsuffixed","","Creates a new unsuffixed integer literal with the…",8,[[["u16"]],["literal"]]],[11,"u32_unsuffixed","","Creates a new unsuffixed integer literal with the…",8,[[["u32"]],["literal"]]],[11,"u64_unsuffixed","","Creates a new unsuffixed integer literal with the…",8,[[["u64"]],["literal"]]],[11,"u128_unsuffixed","","Creates a new unsuffixed integer literal with the…",8,[[["u128"]],["literal"]]],[11,"usize_unsuffixed","","Creates a new unsuffixed integer literal with the…",8,[[["usize"]],["literal"]]],[11,"i8_unsuffixed","","Creates a new unsuffixed integer literal with the…",8,[[["i8"]],["literal"]]],[11,"i16_unsuffixed","","Creates a new unsuffixed integer literal with the…",8,[[["i16"]],["literal"]]],[11,"i32_unsuffixed","","Creates a new unsuffixed integer literal with the…",8,[[["i32"]],["literal"]]],[11,"i64_unsuffixed","","Creates a new unsuffixed integer literal with the…",8,[[["i64"]],["literal"]]],[11,"i128_unsuffixed","","Creates a new unsuffixed integer literal with the…",8,[[["i128"]],["literal"]]],[11,"isize_unsuffixed","","Creates a new unsuffixed integer literal with the…",8,[[["isize"]],["literal"]]],[11,"f64_unsuffixed","","Creates a new unsuffixed floating-point literal.",8,[[["f64"]],["literal"]]],[11,"f64_suffixed","","Creates a new suffixed floating-point literal.",8,[[["f64"]],["literal"]]],[11,"f32_unsuffixed","","Creates a new unsuffixed floating-point literal.",8,[[["f32"]],["literal"]]],[11,"f32_suffixed","","Creates a new suffixed floating-point literal.",8,[[["f32"]],["literal"]]],[11,"string","","String literal.",8,[[["str"]],["literal"]]],[11,"character","","Character literal.",8,[[["char"]],["literal"]]],[11,"byte_string","","Byte string literal.",8,[[],["literal"]]],[11,"span","","Returns the span encompassing this literal.",8,[[["self"]],["span"]]],[11,"set_span","","Configures the span associated for this literal.",8,[[["self"],["span"]]]],[11,"subspan","","Returns a `Span` that is a subset of `self.span()`…",8,[[["rangebounds",["usize"]],["self"],["usize"]],[["span"],["option",["span"]]]]],[11,"from","","",3,[[["t"]],["t"]]],[11,"into","","",3,[[],["u"]]],[11,"into_iter","","",3,[[],["i"]]],[11,"to_owned","","",3,[[["self"]],["t"]]],[11,"clone_into","","",3,[[["self"],["t"]]]],[11,"to_string","","",3,[[["self"]],["string"]]],[11,"try_from","","",3,[[["u"]],["result"]]],[11,"try_into","","",3,[[],["result"]]],[11,"borrow","","",3,[[["self"]],["t"]]],[11,"borrow_mut","","",3,[[["self"]],["t"]]],[11,"type_id","","",3,[[["self"]],["typeid"]]],[11,"from","","",9,[[["t"]],["t"]]],[11,"into","","",9,[[],["u"]]],[11,"try_from","","",9,[[["u"]],["result"]]],[11,"try_into","","",9,[[],["result"]]],[11,"borrow","","",9,[[["self"]],["t"]]],[11,"borrow_mut","","",9,[[["self"]],["t"]]],[11,"type_id","","",9,[[["self"]],["typeid"]]],[11,"from","","",4,[[["t"]],["t"]]],[11,"into","","",4,[[],["u"]]],[11,"to_owned","","",4,[[["self"]],["t"]]],[11,"clone_into","","",4,[[["self"],["t"]]]],[11,"try_from","","",4,[[["u"]],["result"]]],[11,"try_into","","",4,[[],["result"]]],[11,"borrow","","",4,[[["self"]],["t"]]],[11,"borrow_mut","","",4,[[["self"]],["t"]]],[11,"type_id","","",4,[[["self"]],["typeid"]]],[11,"from","","",5,[[["t"]],["t"]]],[11,"into","","",5,[[],["u"]]],[11,"to_owned","","",5,[[["self"]],["t"]]],[11,"clone_into","","",5,[[["self"],["t"]]]],[11,"to_string","","",5,[[["self"]],["string"]]],[11,"try_from","","",5,[[["u"]],["result"]]],[11,"try_into","","",5,[[],["result"]]],[11,"borrow","","",5,[[["self"]],["t"]]],[11,"borrow_mut","","",5,[[["self"]],["t"]]],[11,"type_id","","",5,[[["self"]],["typeid"]]],[11,"from","","",6,[[["t"]],["t"]]],[11,"into","","",6,[[],["u"]]],[11,"to_owned","","",6,[[["self"]],["t"]]],[11,"clone_into","","",6,[[["self"],["t"]]]],[11,"to_string","","",6,[[["self"]],["string"]]],[11,"try_from","","",6,[[["u"]],["result"]]],[11,"try_into","","",6,[[],["result"]]],[11,"borrow","","",6,[[["self"]],["t"]]],[11,"borrow_mut","","",6,[[["self"]],["t"]]],[11,"type_id","","",6,[[["self"]],["typeid"]]],[11,"from","","",7,[[["t"]],["t"]]],[11,"into","","",7,[[],["u"]]],[11,"to_owned","","",7,[[["self"]],["t"]]],[11,"clone_into","","",7,[[["self"],["t"]]]],[11,"to_string","","",7,[[["self"]],["string"]]],[11,"try_from","","",7,[[["u"]],["result"]]],[11,"try_into","","",7,[[],["result"]]],[11,"borrow","","",7,[[["self"]],["t"]]],[11,"borrow_mut","","",7,[[["self"]],["t"]]],[11,"type_id","","",7,[[["self"]],["typeid"]]],[11,"from","","",8,[[["t"]],["t"]]],[11,"into","","",8,[[],["u"]]],[11,"to_owned","","",8,[[["self"]],["t"]]],[11,"clone_into","","",8,[[["self"],["t"]]]],[11,"to_string","","",8,[[["self"]],["string"]]],[11,"try_from","","",8,[[["u"]],["result"]]],[11,"try_into","","",8,[[],["result"]]],[11,"borrow","","",8,[[["self"]],["t"]]],[11,"borrow_mut","","",8,[[["self"]],["t"]]],[11,"type_id","","",8,[[["self"]],["typeid"]]],[11,"from","","",0,[[["t"]],["t"]]],[11,"into","","",0,[[],["u"]]],[11,"to_owned","","",0,[[["self"]],["t"]]],[11,"clone_into","","",0,[[["self"],["t"]]]],[11,"to_string","","",0,[[["self"]],["string"]]],[11,"try_from","","",0,[[["u"]],["result"]]],[11,"try_into","","",0,[[],["result"]]],[11,"borrow","","",0,[[["self"]],["t"]]],[11,"borrow_mut","","",0,[[["self"]],["t"]]],[11,"type_id","","",0,[[["self"]],["typeid"]]],[11,"from","","",1,[[["t"]],["t"]]],[11,"into","","",1,[[],["u"]]],[11,"to_owned","","",1,[[["self"]],["t"]]],[11,"clone_into","","",1,[[["self"],["t"]]]],[11,"try_from","","",1,[[["u"]],["result"]]],[11,"try_into","","",1,[[],["result"]]],[11,"borrow","","",1,[[["self"]],["t"]]],[11,"borrow_mut","","",1,[[["self"]],["t"]]],[11,"type_id","","",1,[[["self"]],["typeid"]]],[11,"from","","",2,[[["t"]],["t"]]],[11,"into","","",2,[[],["u"]]],[11,"to_owned","","",2,[[["self"]],["t"]]],[11,"clone_into","","",2,[[["self"],["t"]]]],[11,"try_from","","",2,[[["u"]],["result"]]],[11,"try_into","","",2,[[],["result"]]],[11,"borrow","","",2,[[["self"]],["t"]]],[11,"borrow_mut","","",2,[[["self"]],["t"]]],[11,"type_id","","",2,[[["self"]],["typeid"]]],[11,"from","proc_macro2::token_stream","",10,[[["t"]],["t"]]],[11,"into","","",10,[[],["u"]]],[11,"into_iter","","",10,[[],["i"]]],[11,"to_owned","","",10,[[["self"]],["t"]]],[11,"clone_into","","",10,[[["self"],["t"]]]],[11,"try_from","","",10,[[["u"]],["result"]]],[11,"try_into","","",10,[[],["result"]]],[11,"borrow","","",10,[[["self"]],["t"]]],[11,"borrow_mut","","",10,[[["self"]],["t"]]],[11,"type_id","","",10,[[["self"]],["typeid"]]],[11,"from","proc_macro2","",4,[[["span"]],["span"]]],[11,"from","","",3,[[["tokenstream"]],["tokenstream"]]],[11,"from","","",3,[[["tokentree"]],["self"]]],[11,"from","","",0,[[["group"]],["tokentree"]]],[11,"from","","",0,[[["ident"]],["tokentree"]]],[11,"from","","",0,[[["punct"]],["tokentree"]]],[11,"from","","",0,[[["literal"]],["tokentree"]]],[11,"extend","","",3,[[["self"],["intoiterator"]]]],[11,"extend","","",3,[[["self"],["intoiterator"]]]],[11,"into_iter","","",3,[[],["intoiter"]]],[11,"next","proc_macro2::token_stream","",10,[[["self"]],[["option",["tokentree"]],["tokentree"]]]],[11,"clone","proc_macro2","",3,[[["self"]],["tokenstream"]]],[11,"clone","","",4,[[["self"]],["span"]]],[11,"clone","","",0,[[["self"]],["tokentree"]]],[11,"clone","","",5,[[["self"]],["group"]]],[11,"clone","","",1,[[["self"]],["delimiter"]]],[11,"clone","","",6,[[["self"]],["punct"]]],[11,"clone","","",2,[[["self"]],["spacing"]]],[11,"clone","","",7,[[["self"]],["ident"]]],[11,"clone","","",8,[[["self"]],["literal"]]],[11,"clone","proc_macro2::token_stream","",10,[[["self"]],["intoiter"]]],[11,"default","proc_macro2","",3,[[],["self"]]],[11,"cmp","","",7,[[["ident"],["self"]],["ordering"]]],[11,"eq","","",1,[[["delimiter"],["self"]],["bool"]]],[11,"eq","","",2,[[["self"],["spacing"]],["bool"]]],[11,"eq","","",7,[[["ident"],["self"]],["bool"]]],[11,"eq","","",7,[[["t"],["self"]],["bool"]]],[11,"partial_cmp","","",7,[[["ident"],["self"]],[["option",["ordering"]],["ordering"]]]],[11,"fmt","","",3,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",9,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",4,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",0,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",1,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",5,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",2,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",6,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",7,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",8,[[["formatter"],["self"]],["result"]]],[11,"fmt","proc_macro2::token_stream","",10,[[["formatter"],["self"]],["result"]]],[11,"fmt","proc_macro2","",3,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",0,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",5,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",6,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",7,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",8,[[["formatter"],["self"]],["result"]]],[11,"hash","","",7,[[["self"],["h"]]]],[11,"from_iter","","",3,[[["intoiterator"]],["self"]]],[11,"from_iter","","",3,[[["intoiterator"]],["self"]]],[11,"from_str","","",3,[[["str"]],[["tokenstream"],["lexerror"],["result",["tokenstream","lexerror"]]]]]],"p":[[4,"TokenTree"],[4,"Delimiter"],[4,"Spacing"],[3,"TokenStream"],[3,"Span"],[3,"Group"],[3,"Punct"],[3,"Ident"],[3,"Literal"],[3,"LexError"],[3,"IntoIter"]]}; +searchIndex["quote"] = {"doc":"This crate provides the [`quote!`] macro for turning Rust…","i":[[8,"TokenStreamExt","quote","TokenStream extension trait with methods for appending…",null,null],[10,"append","","For use by `ToTokens` implementations.",0,[[["u"],["self"]]]],[10,"append_all","","For use by `ToTokens` implementations.",0,[[["self"],["i"]]]],[10,"append_separated","","For use by `ToTokens` implementations.",0,[[["u"],["self"],["i"]]]],[10,"append_terminated","","For use by `ToTokens` implementations.",0,[[["u"],["self"],["i"]]]],[8,"IdentFragment","","Specialized formatting trait used by `format_ident!`.",null,null],[10,"fmt","","Format this value as an identifier fragment.",1,[[["formatter"],["self"]],["result"]]],[11,"span","","Span associated with this `IdentFragment`.",1,[[["self"]],[["option",["span"]],["span"]]]],[8,"ToTokens","","Types that can be interpolated inside a `quote!` invocation.",null,null],[10,"to_tokens","","Write `self` to the given `TokenStream`.",2,[[["tokenstream"],["self"]]]],[11,"to_token_stream","","Convert `self` directly into a `TokenStream` object.",2,[[["self"]],["tokenstream"]]],[11,"into_token_stream","","Convert `self` directly into a `TokenStream` object.",2,[[],["tokenstream"]]],[14,"format_ident","","Formatting macro for constructing `Ident`s.",null,null],[14,"quote","","The whole point.",null,null],[14,"quote_spanned","","Same as `quote!`, but applies a given span to all tokens…",null,null],[11,"span","","Span associated with this `IdentFragment`.",1,[[["self"]],[["option",["span"]],["span"]]]],[11,"to_token_stream","","Convert `self` directly into a `TokenStream` object.",2,[[["self"]],["tokenstream"]]],[11,"into_token_stream","","Convert `self` directly into a `TokenStream` object.",2,[[],["tokenstream"]]]],"p":[[8,"TokenStreamExt"],[8,"IdentFragment"],[8,"ToTokens"]]}; +searchIndex["serde"] = {"doc":"Serde","i":[[0,"de","serde","Generic data structure deserialization framework.",null,null],[3,"IgnoredAny","serde::de","An efficient way of discarding data from a deserializer.",null,null],[4,"Unexpected","","`Unexpected` represents an unexpected invocation of any…",null,null],[13,"Bool","","The input contained a boolean value that was not expected.",0,null],[13,"Unsigned","","The input contained an unsigned integer `u8`, `u16`, `u32`…",0,null],[13,"Signed","","The input contained a signed integer `i8`, `i16`, `i32` or…",0,null],[13,"Float","","The input contained a floating point `f32` or `f64` that…",0,null],[13,"Char","","The input contained a `char` that was not expected.",0,null],[13,"Str","","The input contained a `&str` or `String` that was not…",0,null],[13,"Bytes","","The input contained a `&[u8]` or `Vec` that was not…",0,null],[13,"Unit","","The input contained a unit `()` that was not expected.",0,null],[13,"Option","","The input contained an `Option` that was not expected.",0,null],[13,"NewtypeStruct","","The input contained a newtype struct that was not expected.",0,null],[13,"Seq","","The input contained a sequence that was not expected.",0,null],[13,"Map","","The input contained a map that was not expected.",0,null],[13,"Enum","","The input contained an enum that was not expected.",0,null],[13,"UnitVariant","","The input contained a unit variant that was not expected.",0,null],[13,"NewtypeVariant","","The input contained a newtype variant that was not expected.",0,null],[13,"TupleVariant","","The input contained a tuple variant that was not expected.",0,null],[13,"StructVariant","","The input contained a struct variant that was not expected.",0,null],[13,"Other","","A message stating what uncategorized thing the input…",0,null],[0,"value","","Building blocks for deserializing basic values using the…",null,null],[3,"Error","serde::de::value","A minimal representation of all possible errors that can…",null,null],[3,"UnitDeserializer","","A deserializer holding a `()`.",null,null],[3,"BoolDeserializer","","A deserializer holding a `bool`.",null,null],[3,"I8Deserializer","","A deserializer holding an `i8`.",null,null],[3,"I16Deserializer","","A deserializer holding an `i16`.",null,null],[3,"I32Deserializer","","A deserializer holding an `i32`.",null,null],[3,"I64Deserializer","","A deserializer holding an `i64`.",null,null],[3,"IsizeDeserializer","","A deserializer holding an `isize`.",null,null],[3,"U8Deserializer","","A deserializer holding a `u8`.",null,null],[3,"U16Deserializer","","A deserializer holding a `u16`.",null,null],[3,"U64Deserializer","","A deserializer holding a `u64`.",null,null],[3,"UsizeDeserializer","","A deserializer holding a `usize`.",null,null],[3,"F32Deserializer","","A deserializer holding an `f32`.",null,null],[3,"F64Deserializer","","A deserializer holding an `f64`.",null,null],[3,"CharDeserializer","","A deserializer holding a `char`.",null,null],[3,"I128Deserializer","","A deserializer holding an `i128`.",null,null],[3,"U128Deserializer","","A deserializer holding a `u128`.",null,null],[3,"U32Deserializer","","A deserializer holding a `u32`.",null,null],[3,"StrDeserializer","","A deserializer holding a `&str`.",null,null],[3,"BorrowedStrDeserializer","","A deserializer holding a `&str` with a lifetime tied to…",null,null],[3,"StringDeserializer","","A deserializer holding a `String`.",null,null],[3,"CowStrDeserializer","","A deserializer holding a `Cow`.",null,null],[3,"BorrowedBytesDeserializer","","A deserializer holding a `&[u8]` with a lifetime tied to…",null,null],[3,"SeqDeserializer","","A deserializer that iterates over a sequence.",null,null],[3,"SeqAccessDeserializer","","A deserializer holding a `SeqAccess`.",null,null],[3,"MapDeserializer","","A deserializer that iterates over a map.",null,null],[3,"MapAccessDeserializer","","A deserializer holding a `MapAccess`.",null,null],[11,"new","","Create a new borrowed deserializer from the given string.",1,[[["str"]],["borrowedstrdeserializer"]]],[11,"new","","Create a new borrowed deserializer from the given byte…",2,[[],["borrowedbytesdeserializer"]]],[11,"new","","Construct a new `SeqDeserializer`.",3,[[["i"]],["self"]]],[11,"end","","Check for remaining elements after passing a…",3,[[],["result"]]],[11,"new","","Construct a new `SeqAccessDeserializer`.",4,[[["a"]],["self"]]],[11,"new","","Construct a new `MapDeserializer`.",5,[[["i"]],["self"]]],[11,"end","","Check for remaining elements after passing a…",5,[[],["result"]]],[11,"new","","Construct a new `MapAccessDeserializer`.",6,[[["a"]],["self"]]],[8,"Error","serde::de","The `Error` trait allows `Deserialize` implementations to…",null,null],[10,"custom","","Raised when there is general error when deserializing a…",7,[[["t"]],["self"]]],[11,"invalid_type","","Raised when a `Deserialize` receives a type different from…",7,[[["unexpected"],["expected"]],["self"]]],[11,"invalid_value","","Raised when a `Deserialize` receives a value of the right…",7,[[["unexpected"],["expected"]],["self"]]],[11,"invalid_length","","Raised when deserializing a sequence or map and the input…",7,[[["usize"],["expected"]],["self"]]],[11,"unknown_variant","","Raised when a `Deserialize` enum type received a variant…",7,[[["str"]],["self"]]],[11,"unknown_field","","Raised when a `Deserialize` struct type received a field…",7,[[["str"]],["self"]]],[11,"missing_field","","Raised when a `Deserialize` struct type expected to…",7,[[["str"]],["self"]]],[11,"duplicate_field","","Raised when a `Deserialize` struct type received more than…",7,[[["str"]],["self"]]],[8,"Expected","","`Expected` represents an explanation of what data a…",null,null],[10,"fmt","","Format an explanation of what data was being expected.…",8,[[["formatter"],["self"]],["result"]]],[8,"Deserialize","","A data structure that can be deserialized from any data…",null,null],[10,"deserialize","","Deserialize this value from the given Serde deserializer.",9,[[["d"]],["result"]]],[8,"DeserializeOwned","","A data structure that can be deserialized without…",null,null],[8,"DeserializeSeed","","`DeserializeSeed` is the stateful form of the…",null,null],[16,"Value","","The type produced by using this seed.",10,null],[10,"deserialize","","Equivalent to the more common `Deserialize::deserialize`…",10,[[["d"]],["result"]]],[8,"Deserializer","","A data format that can deserialize any data structure…",null,null],[16,"Error","","The error type that can be returned if some error occurs…",11,null],[10,"deserialize_any","","Require the `Deserializer` to figure out how to drive the…",11,[[["v"]],["result"]]],[10,"deserialize_bool","","Hint that the `Deserialize` type is expecting a `bool`…",11,[[["v"]],["result"]]],[10,"deserialize_i8","","Hint that the `Deserialize` type is expecting an `i8` value.",11,[[["v"]],["result"]]],[10,"deserialize_i16","","Hint that the `Deserialize` type is expecting an `i16`…",11,[[["v"]],["result"]]],[10,"deserialize_i32","","Hint that the `Deserialize` type is expecting an `i32`…",11,[[["v"]],["result"]]],[10,"deserialize_i64","","Hint that the `Deserialize` type is expecting an `i64`…",11,[[["v"]],["result"]]],[11,"deserialize_i128","","Hint that the `Deserialize` type is expecting an `i128`…",11,[[["v"]],["result"]]],[10,"deserialize_u8","","Hint that the `Deserialize` type is expecting a `u8` value.",11,[[["v"]],["result"]]],[10,"deserialize_u16","","Hint that the `Deserialize` type is expecting a `u16` value.",11,[[["v"]],["result"]]],[10,"deserialize_u32","","Hint that the `Deserialize` type is expecting a `u32` value.",11,[[["v"]],["result"]]],[10,"deserialize_u64","","Hint that the `Deserialize` type is expecting a `u64` value.",11,[[["v"]],["result"]]],[11,"deserialize_u128","","Hint that the `Deserialize` type is expecting an `u128`…",11,[[["v"]],["result"]]],[10,"deserialize_f32","","Hint that the `Deserialize` type is expecting a `f32` value.",11,[[["v"]],["result"]]],[10,"deserialize_f64","","Hint that the `Deserialize` type is expecting a `f64` value.",11,[[["v"]],["result"]]],[10,"deserialize_char","","Hint that the `Deserialize` type is expecting a `char`…",11,[[["v"]],["result"]]],[10,"deserialize_str","","Hint that the `Deserialize` type is expecting a string…",11,[[["v"]],["result"]]],[10,"deserialize_string","","Hint that the `Deserialize` type is expecting a string…",11,[[["v"]],["result"]]],[10,"deserialize_bytes","","Hint that the `Deserialize` type is expecting a byte array…",11,[[["v"]],["result"]]],[10,"deserialize_byte_buf","","Hint that the `Deserialize` type is expecting a byte array…",11,[[["v"]],["result"]]],[10,"deserialize_option","","Hint that the `Deserialize` type is expecting an optional…",11,[[["v"]],["result"]]],[10,"deserialize_unit","","Hint that the `Deserialize` type is expecting a unit value.",11,[[["v"]],["result"]]],[10,"deserialize_unit_struct","","Hint that the `Deserialize` type is expecting a unit…",11,[[["str"],["v"]],["result"]]],[10,"deserialize_newtype_struct","","Hint that the `Deserialize` type is expecting a newtype…",11,[[["str"],["v"]],["result"]]],[10,"deserialize_seq","","Hint that the `Deserialize` type is expecting a sequence…",11,[[["v"]],["result"]]],[10,"deserialize_tuple","","Hint that the `Deserialize` type is expecting a sequence…",11,[[["usize"],["v"]],["result"]]],[10,"deserialize_tuple_struct","","Hint that the `Deserialize` type is expecting a tuple…",11,[[["str"],["usize"],["v"]],["result"]]],[10,"deserialize_map","","Hint that the `Deserialize` type is expecting a map of…",11,[[["v"]],["result"]]],[10,"deserialize_struct","","Hint that the `Deserialize` type is expecting a struct…",11,[[["str"],["v"]],["result"]]],[10,"deserialize_enum","","Hint that the `Deserialize` type is expecting an enum…",11,[[["str"],["v"]],["result"]]],[10,"deserialize_identifier","","Hint that the `Deserialize` type is expecting the name of…",11,[[["v"]],["result"]]],[10,"deserialize_ignored_any","","Hint that the `Deserialize` type needs to deserialize a…",11,[[["v"]],["result"]]],[11,"is_human_readable","","Determine whether `Deserialize` implementations should…",11,[[["self"]],["bool"]]],[8,"Visitor","","This trait represents a visitor that walks through a…",null,null],[16,"Value","","The value produced by this visitor.",12,null],[10,"expecting","","Format a message stating what data this Visitor expects to…",12,[[["formatter"],["self"]],["result"]]],[11,"visit_bool","","The input contains a boolean.",12,[[["bool"]],["result"]]],[11,"visit_i8","","The input contains an `i8`.",12,[[["i8"]],["result"]]],[11,"visit_i16","","The input contains an `i16`.",12,[[["i16"]],["result"]]],[11,"visit_i32","","The input contains an `i32`.",12,[[["i32"]],["result"]]],[11,"visit_i64","","The input contains an `i64`.",12,[[["i64"]],["result"]]],[11,"visit_i128","","The input contains a `i128`.",12,[[["i128"]],["result"]]],[11,"visit_u8","","The input contains a `u8`.",12,[[["u8"]],["result"]]],[11,"visit_u16","","The input contains a `u16`.",12,[[["u16"]],["result"]]],[11,"visit_u32","","The input contains a `u32`.",12,[[["u32"]],["result"]]],[11,"visit_u64","","The input contains a `u64`.",12,[[["u64"]],["result"]]],[11,"visit_u128","","The input contains a `u128`.",12,[[["u128"]],["result"]]],[11,"visit_f32","","The input contains an `f32`.",12,[[["f32"]],["result"]]],[11,"visit_f64","","The input contains an `f64`.",12,[[["f64"]],["result"]]],[11,"visit_char","","The input contains a `char`.",12,[[["char"]],["result"]]],[11,"visit_str","","The input contains a string. The lifetime of the string is…",12,[[["str"]],["result"]]],[11,"visit_borrowed_str","","The input contains a string that lives at least as long as…",12,[[["str"]],["result"]]],[11,"visit_string","","The input contains a string and ownership of the string is…",12,[[["string"]],["result"]]],[11,"visit_bytes","","The input contains a byte array. The lifetime of the byte…",12,[[],["result"]]],[11,"visit_borrowed_bytes","","The input contains a byte array that lives at least as…",12,[[],["result"]]],[11,"visit_byte_buf","","The input contains a byte array and ownership of the byte…",12,[[["vec",["u8"]],["u8"]],["result"]]],[11,"visit_none","","The input contains an optional that is absent.",12,[[],["result"]]],[11,"visit_some","","The input contains an optional that is present.",12,[[["d"]],["result"]]],[11,"visit_unit","","The input contains a unit `()`.",12,[[],["result"]]],[11,"visit_newtype_struct","","The input contains a newtype struct.",12,[[["d"]],["result"]]],[11,"visit_seq","","The input contains a sequence of elements.",12,[[["a"]],["result"]]],[11,"visit_map","","The input contains a key-value map.",12,[[["a"]],["result"]]],[11,"visit_enum","","The input contains an enum.",12,[[["a"]],["result"]]],[8,"SeqAccess","","Provides a `Visitor` access to each element of a sequence…",null,null],[16,"Error","","The error type that can be returned if some error occurs…",13,null],[10,"next_element_seed","","This returns `Ok(Some(value))` for the next value in the…",13,[[["self"],["t"]],[["option"],["result",["option"]]]]],[11,"next_element","","This returns `Ok(Some(value))` for the next value in the…",13,[[["self"]],[["result",["option"]],["option"]]]],[11,"size_hint","","Returns the number of elements remaining in the sequence,…",13,[[["self"]],[["usize"],["option",["usize"]]]]],[8,"MapAccess","","Provides a `Visitor` access to each entry of a map in the…",null,null],[16,"Error","","The error type that can be returned if some error occurs…",14,null],[10,"next_key_seed","","This returns `Ok(Some(key))` for the next key in the map,…",14,[[["self"],["k"]],[["result",["option"]],["option"]]]],[10,"next_value_seed","","This returns a `Ok(value)` for the next value in the map.",14,[[["self"],["v"]],["result"]]],[11,"next_entry_seed","","This returns `Ok(Some((key, value)))` for the next…",14,[[["self"],["k"],["v"]],[["result",["option"]],["option"]]]],[11,"next_key","","This returns `Ok(Some(key))` for the next key in the map,…",14,[[["self"]],[["result",["option"]],["option"]]]],[11,"next_value","","This returns a `Ok(value)` for the next value in the map.",14,[[["self"]],["result"]]],[11,"next_entry","","This returns `Ok(Some((key, value)))` for the next…",14,[[["self"]],[["option"],["result",["option"]]]]],[11,"size_hint","","Returns the number of entries remaining in the map, if…",14,[[["self"]],[["usize"],["option",["usize"]]]]],[8,"EnumAccess","","Provides a `Visitor` access to the data of an enum in the…",null,null],[16,"Error","","The error type that can be returned if some error occurs…",15,null],[16,"Variant","","The `Visitor` that will be used to deserialize the content…",15,null],[10,"variant_seed","","`variant` is called to identify which variant to…",15,[[["v"]],["result"]]],[11,"variant","","`variant` is called to identify which variant to…",15,[[],["result"]]],[8,"VariantAccess","","`VariantAccess` is a visitor that is created by the…",null,null],[16,"Error","","The error type that can be returned if some error occurs…",16,null],[10,"unit_variant","","Called when deserializing a variant with no values.",16,[[],["result"]]],[10,"newtype_variant_seed","","Called when deserializing a variant with a single value.",16,[[["t"]],["result"]]],[11,"newtype_variant","","Called when deserializing a variant with a single value.",16,[[],["result"]]],[10,"tuple_variant","","Called when deserializing a tuple-like variant.",16,[[["usize"],["v"]],["result"]]],[10,"struct_variant","","Called when deserializing a struct-like variant.",16,[[["v"]],["result"]]],[8,"IntoDeserializer","","Converts an existing value into a `Deserializer` from…",null,null],[16,"Deserializer","","The type of the deserializer being converted into.",17,null],[10,"into_deserializer","","Convert this value into a deserializer.",17,[[]]],[0,"ser","serde","Generic data structure serialization framework.",null,null],[3,"Impossible","serde::ser","Helper type for implementing a `Serializer` that does not…",null,null],[8,"Error","","Trait used by `Serialize` implementations to generically…",null,null],[10,"custom","","Used when a [`Serialize`] implementation encounters any…",18,[[["t"]],["self"]]],[8,"Serialize","","A data structure that can be serialized into any data…",null,null],[10,"serialize","","Serialize this value into the given Serde serializer.",19,[[["s"],["self"]],["result"]]],[8,"Serializer","","A data format that can serialize any data structure…",null,null],[16,"Ok","","The output type produced by this `Serializer` during…",20,null],[16,"Error","","The error type when some error occurs during serialization.",20,null],[16,"SerializeSeq","","Type returned from [`serialize_seq`] for serializing the…",20,null],[16,"SerializeTuple","","Type returned from [`serialize_tuple`] for serializing the…",20,null],[16,"SerializeTupleStruct","","Type returned from [`serialize_tuple_struct`] for…",20,null],[16,"SerializeTupleVariant","","Type returned from [`serialize_tuple_variant`] for…",20,null],[16,"SerializeMap","","Type returned from [`serialize_map`] for serializing the…",20,null],[16,"SerializeStruct","","Type returned from [`serialize_struct`] for serializing…",20,null],[16,"SerializeStructVariant","","Type returned from [`serialize_struct_variant`] for…",20,null],[10,"serialize_bool","","Serialize a `bool` value.",20,[[["bool"]],["result"]]],[10,"serialize_i8","","Serialize an `i8` value.",20,[[["i8"]],["result"]]],[10,"serialize_i16","","Serialize an `i16` value.",20,[[["i16"]],["result"]]],[10,"serialize_i32","","Serialize an `i32` value.",20,[[["i32"]],["result"]]],[10,"serialize_i64","","Serialize an `i64` value.",20,[[["i64"]],["result"]]],[11,"serialize_i128","","Serialize an `i128` value.",20,[[["i128"]],["result"]]],[10,"serialize_u8","","Serialize a `u8` value.",20,[[["u8"]],["result"]]],[10,"serialize_u16","","Serialize a `u16` value.",20,[[["u16"]],["result"]]],[10,"serialize_u32","","Serialize a `u32` value.",20,[[["u32"]],["result"]]],[10,"serialize_u64","","Serialize a `u64` value.",20,[[["u64"]],["result"]]],[11,"serialize_u128","","Serialize a `u128` value.",20,[[["u128"]],["result"]]],[10,"serialize_f32","","Serialize an `f32` value.",20,[[["f32"]],["result"]]],[10,"serialize_f64","","Serialize an `f64` value.",20,[[["f64"]],["result"]]],[10,"serialize_char","","Serialize a character.",20,[[["char"]],["result"]]],[10,"serialize_str","","Serialize a `&str`.",20,[[["str"]],["result"]]],[10,"serialize_bytes","","Serialize a chunk of raw byte data.",20,[[],["result"]]],[10,"serialize_none","","Serialize a [`None`] value.",20,[[],["result"]]],[10,"serialize_some","","Serialize a [`Some(T)`] value.",20,[[["t"]],["result"]]],[10,"serialize_unit","","Serialize a `()` value.",20,[[],["result"]]],[10,"serialize_unit_struct","","Serialize a unit struct like `struct Unit` or…",20,[[["str"]],["result"]]],[10,"serialize_unit_variant","","Serialize a unit variant like `E::A` in `enum E { A, B }`.",20,[[["str"],["u32"]],["result"]]],[10,"serialize_newtype_struct","","Serialize a newtype struct like `struct Millimeters(u8)`.",20,[[["str"],["t"]],["result"]]],[10,"serialize_newtype_variant","","Serialize a newtype variant like `E::N` in `enum E { N(u8)…",20,[[["str"],["u32"],["t"]],["result"]]],[10,"serialize_seq","","Begin to serialize a variably sized sequence. This call…",20,[[["usize"],["option",["usize"]]],["result"]]],[10,"serialize_tuple","","Begin to serialize a statically sized sequence whose…",20,[[["usize"]],["result"]]],[10,"serialize_tuple_struct","","Begin to serialize a tuple struct like `struct Rgb(u8, u8,…",20,[[["str"],["usize"]],["result"]]],[10,"serialize_tuple_variant","","Begin to serialize a tuple variant like `E::T` in `enum E…",20,[[["str"],["u32"],["usize"]],["result"]]],[10,"serialize_map","","Begin to serialize a map. This call must be followed by…",20,[[["usize"],["option",["usize"]]],["result"]]],[10,"serialize_struct","","Begin to serialize a struct like `struct Rgb { r: u8, g:…",20,[[["str"],["usize"]],["result"]]],[10,"serialize_struct_variant","","Begin to serialize a struct variant like `E::S` in `enum E…",20,[[["str"],["u32"],["usize"]],["result"]]],[11,"collect_seq","","Collect an iterator as a sequence.",20,[[["i"]],["result"]]],[11,"collect_map","","Collect an iterator as a map.",20,[[["i"]],["result"]]],[11,"collect_str","","Serialize a string produced by an implementation of…",20,[[["t"]],["result"]]],[11,"is_human_readable","","Determine whether `Serialize` implementations should…",20,[[["self"]],["bool"]]],[8,"SerializeSeq","","Returned from `Serializer::serialize_seq`.",null,null],[16,"Ok","","Must match the `Ok` type of our `Serializer`.",21,null],[16,"Error","","Must match the `Error` type of our `Serializer`.",21,null],[10,"serialize_element","","Serialize a sequence element.",21,[[["self"],["t"]],["result"]]],[10,"end","","Finish serializing a sequence.",21,[[],["result"]]],[8,"SerializeTuple","","Returned from `Serializer::serialize_tuple`.",null,null],[16,"Ok","","Must match the `Ok` type of our `Serializer`.",22,null],[16,"Error","","Must match the `Error` type of our `Serializer`.",22,null],[10,"serialize_element","","Serialize a tuple element.",22,[[["self"],["t"]],["result"]]],[10,"end","","Finish serializing a tuple.",22,[[],["result"]]],[8,"SerializeTupleStruct","","Returned from `Serializer::serialize_tuple_struct`.",null,null],[16,"Ok","","Must match the `Ok` type of our `Serializer`.",23,null],[16,"Error","","Must match the `Error` type of our `Serializer`.",23,null],[10,"serialize_field","","Serialize a tuple struct field.",23,[[["self"],["t"]],["result"]]],[10,"end","","Finish serializing a tuple struct.",23,[[],["result"]]],[8,"SerializeTupleVariant","","Returned from `Serializer::serialize_tuple_variant`.",null,null],[16,"Ok","","Must match the `Ok` type of our `Serializer`.",24,null],[16,"Error","","Must match the `Error` type of our `Serializer`.",24,null],[10,"serialize_field","","Serialize a tuple variant field.",24,[[["self"],["t"]],["result"]]],[10,"end","","Finish serializing a tuple variant.",24,[[],["result"]]],[8,"SerializeMap","","Returned from `Serializer::serialize_map`.",null,null],[16,"Ok","","Must match the `Ok` type of our `Serializer`.",25,null],[16,"Error","","Must match the `Error` type of our `Serializer`.",25,null],[10,"serialize_key","","Serialize a map key.",25,[[["self"],["t"]],["result"]]],[10,"serialize_value","","Serialize a map value.",25,[[["self"],["t"]],["result"]]],[11,"serialize_entry","","Serialize a map entry consisting of a key and a value.",25,[[["k"],["self"],["v"]],["result"]]],[10,"end","","Finish serializing a map.",25,[[],["result"]]],[8,"SerializeStruct","","Returned from `Serializer::serialize_struct`.",null,null],[16,"Ok","","Must match the `Ok` type of our `Serializer`.",26,null],[16,"Error","","Must match the `Error` type of our `Serializer`.",26,null],[10,"serialize_field","","Serialize a struct field.",26,[[["self"],["str"],["t"]],["result"]]],[11,"skip_field","","Indicate that a struct field has been skipped.",26,[[["self"],["str"]],["result"]]],[10,"end","","Finish serializing a struct.",26,[[],["result"]]],[8,"SerializeStructVariant","","Returned from `Serializer::serialize_struct_variant`.",null,null],[16,"Ok","","Must match the `Ok` type of our `Serializer`.",27,null],[16,"Error","","Must match the `Error` type of our `Serializer`.",27,null],[10,"serialize_field","","Serialize a struct variant field.",27,[[["self"],["str"],["t"]],["result"]]],[11,"skip_field","","Indicate that a struct variant field has been skipped.",27,[[["self"],["str"]],["result"]]],[10,"end","","Finish serializing a struct variant.",27,[[],["result"]]],[8,"Deserialize","serde","A data structure that can be deserialized from any data…",null,null],[10,"deserialize","","Deserialize this value from the given Serde deserializer.",9,[[["d"]],["result"]]],[8,"Deserializer","","A data format that can deserialize any data structure…",null,null],[16,"Error","","The error type that can be returned if some error occurs…",11,null],[10,"deserialize_any","","Require the `Deserializer` to figure out how to drive the…",11,[[["v"]],["result"]]],[10,"deserialize_bool","","Hint that the `Deserialize` type is expecting a `bool`…",11,[[["v"]],["result"]]],[10,"deserialize_i8","","Hint that the `Deserialize` type is expecting an `i8` value.",11,[[["v"]],["result"]]],[10,"deserialize_i16","","Hint that the `Deserialize` type is expecting an `i16`…",11,[[["v"]],["result"]]],[10,"deserialize_i32","","Hint that the `Deserialize` type is expecting an `i32`…",11,[[["v"]],["result"]]],[10,"deserialize_i64","","Hint that the `Deserialize` type is expecting an `i64`…",11,[[["v"]],["result"]]],[11,"deserialize_i128","","Hint that the `Deserialize` type is expecting an `i128`…",11,[[["v"]],["result"]]],[10,"deserialize_u8","","Hint that the `Deserialize` type is expecting a `u8` value.",11,[[["v"]],["result"]]],[10,"deserialize_u16","","Hint that the `Deserialize` type is expecting a `u16` value.",11,[[["v"]],["result"]]],[10,"deserialize_u32","","Hint that the `Deserialize` type is expecting a `u32` value.",11,[[["v"]],["result"]]],[10,"deserialize_u64","","Hint that the `Deserialize` type is expecting a `u64` value.",11,[[["v"]],["result"]]],[11,"deserialize_u128","","Hint that the `Deserialize` type is expecting an `u128`…",11,[[["v"]],["result"]]],[10,"deserialize_f32","","Hint that the `Deserialize` type is expecting a `f32` value.",11,[[["v"]],["result"]]],[10,"deserialize_f64","","Hint that the `Deserialize` type is expecting a `f64` value.",11,[[["v"]],["result"]]],[10,"deserialize_char","","Hint that the `Deserialize` type is expecting a `char`…",11,[[["v"]],["result"]]],[10,"deserialize_str","","Hint that the `Deserialize` type is expecting a string…",11,[[["v"]],["result"]]],[10,"deserialize_string","","Hint that the `Deserialize` type is expecting a string…",11,[[["v"]],["result"]]],[10,"deserialize_bytes","","Hint that the `Deserialize` type is expecting a byte array…",11,[[["v"]],["result"]]],[10,"deserialize_byte_buf","","Hint that the `Deserialize` type is expecting a byte array…",11,[[["v"]],["result"]]],[10,"deserialize_option","","Hint that the `Deserialize` type is expecting an optional…",11,[[["v"]],["result"]]],[10,"deserialize_unit","","Hint that the `Deserialize` type is expecting a unit value.",11,[[["v"]],["result"]]],[10,"deserialize_unit_struct","","Hint that the `Deserialize` type is expecting a unit…",11,[[["str"],["v"]],["result"]]],[10,"deserialize_newtype_struct","","Hint that the `Deserialize` type is expecting a newtype…",11,[[["str"],["v"]],["result"]]],[10,"deserialize_seq","","Hint that the `Deserialize` type is expecting a sequence…",11,[[["v"]],["result"]]],[10,"deserialize_tuple","","Hint that the `Deserialize` type is expecting a sequence…",11,[[["usize"],["v"]],["result"]]],[10,"deserialize_tuple_struct","","Hint that the `Deserialize` type is expecting a tuple…",11,[[["str"],["usize"],["v"]],["result"]]],[10,"deserialize_map","","Hint that the `Deserialize` type is expecting a map of…",11,[[["v"]],["result"]]],[10,"deserialize_struct","","Hint that the `Deserialize` type is expecting a struct…",11,[[["str"],["v"]],["result"]]],[10,"deserialize_enum","","Hint that the `Deserialize` type is expecting an enum…",11,[[["str"],["v"]],["result"]]],[10,"deserialize_identifier","","Hint that the `Deserialize` type is expecting the name of…",11,[[["v"]],["result"]]],[10,"deserialize_ignored_any","","Hint that the `Deserialize` type needs to deserialize a…",11,[[["v"]],["result"]]],[11,"is_human_readable","","Determine whether `Deserialize` implementations should…",11,[[["self"]],["bool"]]],[8,"Serialize","","A data structure that can be serialized into any data…",null,null],[10,"serialize","","Serialize this value into the given Serde serializer.",19,[[["s"],["self"]],["result"]]],[8,"Serializer","","A data format that can serialize any data structure…",null,null],[16,"Ok","","The output type produced by this `Serializer` during…",20,null],[16,"Error","","The error type when some error occurs during serialization.",20,null],[16,"SerializeSeq","","Type returned from [`serialize_seq`] for serializing the…",20,null],[16,"SerializeTuple","","Type returned from [`serialize_tuple`] for serializing the…",20,null],[16,"SerializeTupleStruct","","Type returned from [`serialize_tuple_struct`] for…",20,null],[16,"SerializeTupleVariant","","Type returned from [`serialize_tuple_variant`] for…",20,null],[16,"SerializeMap","","Type returned from [`serialize_map`] for serializing the…",20,null],[16,"SerializeStruct","","Type returned from [`serialize_struct`] for serializing…",20,null],[16,"SerializeStructVariant","","Type returned from [`serialize_struct_variant`] for…",20,null],[10,"serialize_bool","","Serialize a `bool` value.",20,[[["bool"]],["result"]]],[10,"serialize_i8","","Serialize an `i8` value.",20,[[["i8"]],["result"]]],[10,"serialize_i16","","Serialize an `i16` value.",20,[[["i16"]],["result"]]],[10,"serialize_i32","","Serialize an `i32` value.",20,[[["i32"]],["result"]]],[10,"serialize_i64","","Serialize an `i64` value.",20,[[["i64"]],["result"]]],[11,"serialize_i128","","Serialize an `i128` value.",20,[[["i128"]],["result"]]],[10,"serialize_u8","","Serialize a `u8` value.",20,[[["u8"]],["result"]]],[10,"serialize_u16","","Serialize a `u16` value.",20,[[["u16"]],["result"]]],[10,"serialize_u32","","Serialize a `u32` value.",20,[[["u32"]],["result"]]],[10,"serialize_u64","","Serialize a `u64` value.",20,[[["u64"]],["result"]]],[11,"serialize_u128","","Serialize a `u128` value.",20,[[["u128"]],["result"]]],[10,"serialize_f32","","Serialize an `f32` value.",20,[[["f32"]],["result"]]],[10,"serialize_f64","","Serialize an `f64` value.",20,[[["f64"]],["result"]]],[10,"serialize_char","","Serialize a character.",20,[[["char"]],["result"]]],[10,"serialize_str","","Serialize a `&str`.",20,[[["str"]],["result"]]],[10,"serialize_bytes","","Serialize a chunk of raw byte data.",20,[[],["result"]]],[10,"serialize_none","","Serialize a [`None`] value.",20,[[],["result"]]],[10,"serialize_some","","Serialize a [`Some(T)`] value.",20,[[["t"]],["result"]]],[10,"serialize_unit","","Serialize a `()` value.",20,[[],["result"]]],[10,"serialize_unit_struct","","Serialize a unit struct like `struct Unit` or…",20,[[["str"]],["result"]]],[10,"serialize_unit_variant","","Serialize a unit variant like `E::A` in `enum E { A, B }`.",20,[[["str"],["u32"]],["result"]]],[10,"serialize_newtype_struct","","Serialize a newtype struct like `struct Millimeters(u8)`.",20,[[["str"],["t"]],["result"]]],[10,"serialize_newtype_variant","","Serialize a newtype variant like `E::N` in `enum E { N(u8)…",20,[[["str"],["u32"],["t"]],["result"]]],[10,"serialize_seq","","Begin to serialize a variably sized sequence. This call…",20,[[["usize"],["option",["usize"]]],["result"]]],[10,"serialize_tuple","","Begin to serialize a statically sized sequence whose…",20,[[["usize"]],["result"]]],[10,"serialize_tuple_struct","","Begin to serialize a tuple struct like `struct Rgb(u8, u8,…",20,[[["str"],["usize"]],["result"]]],[10,"serialize_tuple_variant","","Begin to serialize a tuple variant like `E::T` in `enum E…",20,[[["str"],["u32"],["usize"]],["result"]]],[10,"serialize_map","","Begin to serialize a map. This call must be followed by…",20,[[["usize"],["option",["usize"]]],["result"]]],[10,"serialize_struct","","Begin to serialize a struct like `struct Rgb { r: u8, g:…",20,[[["str"],["usize"]],["result"]]],[10,"serialize_struct_variant","","Begin to serialize a struct variant like `E::S` in `enum E…",20,[[["str"],["u32"],["usize"]],["result"]]],[11,"collect_seq","","Collect an iterator as a sequence.",20,[[["i"]],["result"]]],[11,"collect_map","","Collect an iterator as a map.",20,[[["i"]],["result"]]],[11,"collect_str","","Serialize a string produced by an implementation of…",20,[[["t"]],["result"]]],[11,"is_human_readable","","Determine whether `Serialize` implementations should…",20,[[["self"]],["bool"]]],[14,"forward_to_deserialize_any","","Helper macro when implementing the `Deserializer` part of…",null,null],[14,"serde_if_integer128","","Conditional compilation depending on whether Serde is…",null,null],[11,"fmt","serde::de","",28,[[["formatter"],["self"]],[["error"],["result",["error"]]]]],[11,"from","","",28,[[["t"]],["t"]]],[11,"into","","",28,[[],["u"]]],[11,"to_owned","","",28,[[["self"]],["t"]]],[11,"clone_into","","",28,[[["self"],["t"]]]],[11,"try_from","","",28,[[["u"]],["result"]]],[11,"try_into","","",28,[[],["result"]]],[11,"borrow","","",28,[[["self"]],["t"]]],[11,"borrow_mut","","",28,[[["self"]],["t"]]],[11,"type_id","","",28,[[["self"]],["typeid"]]],[11,"from","","",0,[[["t"]],["t"]]],[11,"into","","",0,[[],["u"]]],[11,"to_owned","","",0,[[["self"]],["t"]]],[11,"clone_into","","",0,[[["self"],["t"]]]],[11,"to_string","","",0,[[["self"]],["string"]]],[11,"try_from","","",0,[[["u"]],["result"]]],[11,"try_into","","",0,[[],["result"]]],[11,"borrow","","",0,[[["self"]],["t"]]],[11,"borrow_mut","","",0,[[["self"]],["t"]]],[11,"type_id","","",0,[[["self"]],["typeid"]]],[11,"from","serde::de::value","",29,[[["t"]],["t"]]],[11,"into","","",29,[[],["u"]]],[11,"to_owned","","",29,[[["self"]],["t"]]],[11,"clone_into","","",29,[[["self"],["t"]]]],[11,"to_string","","",29,[[["self"]],["string"]]],[11,"try_from","","",29,[[["u"]],["result"]]],[11,"try_into","","",29,[[],["result"]]],[11,"borrow","","",29,[[["self"]],["t"]]],[11,"borrow_mut","","",29,[[["self"]],["t"]]],[11,"type_id","","",29,[[["self"]],["typeid"]]],[11,"from","","",30,[[["t"]],["t"]]],[11,"into","","",30,[[],["u"]]],[11,"to_owned","","",30,[[["self"]],["t"]]],[11,"clone_into","","",30,[[["self"],["t"]]]],[11,"try_from","","",30,[[["u"]],["result"]]],[11,"try_into","","",30,[[],["result"]]],[11,"borrow","","",30,[[["self"]],["t"]]],[11,"borrow_mut","","",30,[[["self"]],["t"]]],[11,"type_id","","",30,[[["self"]],["typeid"]]],[11,"from","","",31,[[["t"]],["t"]]],[11,"into","","",31,[[],["u"]]],[11,"to_owned","","",31,[[["self"]],["t"]]],[11,"clone_into","","",31,[[["self"],["t"]]]],[11,"try_from","","",31,[[["u"]],["result"]]],[11,"try_into","","",31,[[],["result"]]],[11,"borrow","","",31,[[["self"]],["t"]]],[11,"borrow_mut","","",31,[[["self"]],["t"]]],[11,"type_id","","",31,[[["self"]],["typeid"]]],[11,"from","","",32,[[["t"]],["t"]]],[11,"into","","",32,[[],["u"]]],[11,"to_owned","","",32,[[["self"]],["t"]]],[11,"clone_into","","",32,[[["self"],["t"]]]],[11,"try_from","","",32,[[["u"]],["result"]]],[11,"try_into","","",32,[[],["result"]]],[11,"borrow","","",32,[[["self"]],["t"]]],[11,"borrow_mut","","",32,[[["self"]],["t"]]],[11,"type_id","","",32,[[["self"]],["typeid"]]],[11,"from","","",33,[[["t"]],["t"]]],[11,"into","","",33,[[],["u"]]],[11,"to_owned","","",33,[[["self"]],["t"]]],[11,"clone_into","","",33,[[["self"],["t"]]]],[11,"try_from","","",33,[[["u"]],["result"]]],[11,"try_into","","",33,[[],["result"]]],[11,"borrow","","",33,[[["self"]],["t"]]],[11,"borrow_mut","","",33,[[["self"]],["t"]]],[11,"type_id","","",33,[[["self"]],["typeid"]]],[11,"from","","",34,[[["t"]],["t"]]],[11,"into","","",34,[[],["u"]]],[11,"to_owned","","",34,[[["self"]],["t"]]],[11,"clone_into","","",34,[[["self"],["t"]]]],[11,"try_from","","",34,[[["u"]],["result"]]],[11,"try_into","","",34,[[],["result"]]],[11,"borrow","","",34,[[["self"]],["t"]]],[11,"borrow_mut","","",34,[[["self"]],["t"]]],[11,"type_id","","",34,[[["self"]],["typeid"]]],[11,"from","","",35,[[["t"]],["t"]]],[11,"into","","",35,[[],["u"]]],[11,"to_owned","","",35,[[["self"]],["t"]]],[11,"clone_into","","",35,[[["self"],["t"]]]],[11,"try_from","","",35,[[["u"]],["result"]]],[11,"try_into","","",35,[[],["result"]]],[11,"borrow","","",35,[[["self"]],["t"]]],[11,"borrow_mut","","",35,[[["self"]],["t"]]],[11,"type_id","","",35,[[["self"]],["typeid"]]],[11,"from","","",36,[[["t"]],["t"]]],[11,"into","","",36,[[],["u"]]],[11,"to_owned","","",36,[[["self"]],["t"]]],[11,"clone_into","","",36,[[["self"],["t"]]]],[11,"try_from","","",36,[[["u"]],["result"]]],[11,"try_into","","",36,[[],["result"]]],[11,"borrow","","",36,[[["self"]],["t"]]],[11,"borrow_mut","","",36,[[["self"]],["t"]]],[11,"type_id","","",36,[[["self"]],["typeid"]]],[11,"from","","",37,[[["t"]],["t"]]],[11,"into","","",37,[[],["u"]]],[11,"to_owned","","",37,[[["self"]],["t"]]],[11,"clone_into","","",37,[[["self"],["t"]]]],[11,"try_from","","",37,[[["u"]],["result"]]],[11,"try_into","","",37,[[],["result"]]],[11,"borrow","","",37,[[["self"]],["t"]]],[11,"borrow_mut","","",37,[[["self"]],["t"]]],[11,"type_id","","",37,[[["self"]],["typeid"]]],[11,"from","","",38,[[["t"]],["t"]]],[11,"into","","",38,[[],["u"]]],[11,"to_owned","","",38,[[["self"]],["t"]]],[11,"clone_into","","",38,[[["self"],["t"]]]],[11,"try_from","","",38,[[["u"]],["result"]]],[11,"try_into","","",38,[[],["result"]]],[11,"borrow","","",38,[[["self"]],["t"]]],[11,"borrow_mut","","",38,[[["self"]],["t"]]],[11,"type_id","","",38,[[["self"]],["typeid"]]],[11,"from","","",39,[[["t"]],["t"]]],[11,"into","","",39,[[],["u"]]],[11,"to_owned","","",39,[[["self"]],["t"]]],[11,"clone_into","","",39,[[["self"],["t"]]]],[11,"try_from","","",39,[[["u"]],["result"]]],[11,"try_into","","",39,[[],["result"]]],[11,"borrow","","",39,[[["self"]],["t"]]],[11,"borrow_mut","","",39,[[["self"]],["t"]]],[11,"type_id","","",39,[[["self"]],["typeid"]]],[11,"from","","",40,[[["t"]],["t"]]],[11,"into","","",40,[[],["u"]]],[11,"to_owned","","",40,[[["self"]],["t"]]],[11,"clone_into","","",40,[[["self"],["t"]]]],[11,"try_from","","",40,[[["u"]],["result"]]],[11,"try_into","","",40,[[],["result"]]],[11,"borrow","","",40,[[["self"]],["t"]]],[11,"borrow_mut","","",40,[[["self"]],["t"]]],[11,"type_id","","",40,[[["self"]],["typeid"]]],[11,"from","","",41,[[["t"]],["t"]]],[11,"into","","",41,[[],["u"]]],[11,"to_owned","","",41,[[["self"]],["t"]]],[11,"clone_into","","",41,[[["self"],["t"]]]],[11,"try_from","","",41,[[["u"]],["result"]]],[11,"try_into","","",41,[[],["result"]]],[11,"borrow","","",41,[[["self"]],["t"]]],[11,"borrow_mut","","",41,[[["self"]],["t"]]],[11,"type_id","","",41,[[["self"]],["typeid"]]],[11,"from","","",42,[[["t"]],["t"]]],[11,"into","","",42,[[],["u"]]],[11,"to_owned","","",42,[[["self"]],["t"]]],[11,"clone_into","","",42,[[["self"],["t"]]]],[11,"try_from","","",42,[[["u"]],["result"]]],[11,"try_into","","",42,[[],["result"]]],[11,"borrow","","",42,[[["self"]],["t"]]],[11,"borrow_mut","","",42,[[["self"]],["t"]]],[11,"type_id","","",42,[[["self"]],["typeid"]]],[11,"from","","",43,[[["t"]],["t"]]],[11,"into","","",43,[[],["u"]]],[11,"to_owned","","",43,[[["self"]],["t"]]],[11,"clone_into","","",43,[[["self"],["t"]]]],[11,"try_from","","",43,[[["u"]],["result"]]],[11,"try_into","","",43,[[],["result"]]],[11,"borrow","","",43,[[["self"]],["t"]]],[11,"borrow_mut","","",43,[[["self"]],["t"]]],[11,"type_id","","",43,[[["self"]],["typeid"]]],[11,"from","","",44,[[["t"]],["t"]]],[11,"into","","",44,[[],["u"]]],[11,"to_owned","","",44,[[["self"]],["t"]]],[11,"clone_into","","",44,[[["self"],["t"]]]],[11,"try_from","","",44,[[["u"]],["result"]]],[11,"try_into","","",44,[[],["result"]]],[11,"borrow","","",44,[[["self"]],["t"]]],[11,"borrow_mut","","",44,[[["self"]],["t"]]],[11,"type_id","","",44,[[["self"]],["typeid"]]],[11,"from","","",45,[[["t"]],["t"]]],[11,"into","","",45,[[],["u"]]],[11,"to_owned","","",45,[[["self"]],["t"]]],[11,"clone_into","","",45,[[["self"],["t"]]]],[11,"try_from","","",45,[[["u"]],["result"]]],[11,"try_into","","",45,[[],["result"]]],[11,"borrow","","",45,[[["self"]],["t"]]],[11,"borrow_mut","","",45,[[["self"]],["t"]]],[11,"type_id","","",45,[[["self"]],["typeid"]]],[11,"from","","",46,[[["t"]],["t"]]],[11,"into","","",46,[[],["u"]]],[11,"to_owned","","",46,[[["self"]],["t"]]],[11,"clone_into","","",46,[[["self"],["t"]]]],[11,"try_from","","",46,[[["u"]],["result"]]],[11,"try_into","","",46,[[],["result"]]],[11,"borrow","","",46,[[["self"]],["t"]]],[11,"borrow_mut","","",46,[[["self"]],["t"]]],[11,"type_id","","",46,[[["self"]],["typeid"]]],[11,"from","","",47,[[["t"]],["t"]]],[11,"into","","",47,[[],["u"]]],[11,"to_owned","","",47,[[["self"]],["t"]]],[11,"clone_into","","",47,[[["self"],["t"]]]],[11,"try_from","","",47,[[["u"]],["result"]]],[11,"try_into","","",47,[[],["result"]]],[11,"borrow","","",47,[[["self"]],["t"]]],[11,"borrow_mut","","",47,[[["self"]],["t"]]],[11,"type_id","","",47,[[["self"]],["typeid"]]],[11,"from","","",1,[[["t"]],["t"]]],[11,"into","","",1,[[],["u"]]],[11,"to_owned","","",1,[[["self"]],["t"]]],[11,"clone_into","","",1,[[["self"],["t"]]]],[11,"try_from","","",1,[[["u"]],["result"]]],[11,"try_into","","",1,[[],["result"]]],[11,"borrow","","",1,[[["self"]],["t"]]],[11,"borrow_mut","","",1,[[["self"]],["t"]]],[11,"type_id","","",1,[[["self"]],["typeid"]]],[11,"from","","",48,[[["t"]],["t"]]],[11,"into","","",48,[[],["u"]]],[11,"to_owned","","",48,[[["self"]],["t"]]],[11,"clone_into","","",48,[[["self"],["t"]]]],[11,"try_from","","",48,[[["u"]],["result"]]],[11,"try_into","","",48,[[],["result"]]],[11,"borrow","","",48,[[["self"]],["t"]]],[11,"borrow_mut","","",48,[[["self"]],["t"]]],[11,"type_id","","",48,[[["self"]],["typeid"]]],[11,"from","","",49,[[["t"]],["t"]]],[11,"into","","",49,[[],["u"]]],[11,"to_owned","","",49,[[["self"]],["t"]]],[11,"clone_into","","",49,[[["self"],["t"]]]],[11,"try_from","","",49,[[["u"]],["result"]]],[11,"try_into","","",49,[[],["result"]]],[11,"borrow","","",49,[[["self"]],["t"]]],[11,"borrow_mut","","",49,[[["self"]],["t"]]],[11,"type_id","","",49,[[["self"]],["typeid"]]],[11,"from","","",2,[[["t"]],["t"]]],[11,"into","","",2,[[],["u"]]],[11,"to_owned","","",2,[[["self"]],["t"]]],[11,"clone_into","","",2,[[["self"],["t"]]]],[11,"try_from","","",2,[[["u"]],["result"]]],[11,"try_into","","",2,[[],["result"]]],[11,"borrow","","",2,[[["self"]],["t"]]],[11,"borrow_mut","","",2,[[["self"]],["t"]]],[11,"type_id","","",2,[[["self"]],["typeid"]]],[11,"from","","",3,[[["t"]],["t"]]],[11,"into","","",3,[[],["u"]]],[11,"to_owned","","",3,[[["self"]],["t"]]],[11,"clone_into","","",3,[[["self"],["t"]]]],[11,"try_from","","",3,[[["u"]],["result"]]],[11,"try_into","","",3,[[],["result"]]],[11,"borrow","","",3,[[["self"]],["t"]]],[11,"borrow_mut","","",3,[[["self"]],["t"]]],[11,"type_id","","",3,[[["self"]],["typeid"]]],[11,"from","","",4,[[["t"]],["t"]]],[11,"into","","",4,[[],["u"]]],[11,"to_owned","","",4,[[["self"]],["t"]]],[11,"clone_into","","",4,[[["self"],["t"]]]],[11,"try_from","","",4,[[["u"]],["result"]]],[11,"try_into","","",4,[[],["result"]]],[11,"borrow","","",4,[[["self"]],["t"]]],[11,"borrow_mut","","",4,[[["self"]],["t"]]],[11,"type_id","","",4,[[["self"]],["typeid"]]],[11,"from","","",5,[[["t"]],["t"]]],[11,"into","","",5,[[],["u"]]],[11,"to_owned","","",5,[[["self"]],["t"]]],[11,"clone_into","","",5,[[["self"],["t"]]]],[11,"try_from","","",5,[[["u"]],["result"]]],[11,"try_into","","",5,[[],["result"]]],[11,"borrow","","",5,[[["self"]],["t"]]],[11,"borrow_mut","","",5,[[["self"]],["t"]]],[11,"type_id","","",5,[[["self"]],["typeid"]]],[11,"from","","",6,[[["t"]],["t"]]],[11,"into","","",6,[[],["u"]]],[11,"to_owned","","",6,[[["self"]],["t"]]],[11,"clone_into","","",6,[[["self"],["t"]]]],[11,"try_from","","",6,[[["u"]],["result"]]],[11,"try_into","","",6,[[],["result"]]],[11,"borrow","","",6,[[["self"]],["t"]]],[11,"borrow_mut","","",6,[[["self"]],["t"]]],[11,"type_id","","",6,[[["self"]],["typeid"]]],[11,"from","serde::ser","",50,[[["t"]],["t"]]],[11,"into","","",50,[[],["u"]]],[11,"try_from","","",50,[[["u"]],["result"]]],[11,"try_into","","",50,[[],["result"]]],[11,"borrow","","",50,[[["self"]],["t"]]],[11,"borrow_mut","","",50,[[["self"]],["t"]]],[11,"type_id","","",50,[[["self"]],["typeid"]]],[11,"deserialize","serde::de","",28,[[["d"]],[["result",["ignoredany"]],["ignoredany"]]]],[11,"deserialize_bool","serde::de::value","",30,[[["v"]],["result"]]],[11,"deserialize_i8","","",30,[[["v"]],["result"]]],[11,"deserialize_i16","","",30,[[["v"]],["result"]]],[11,"deserialize_i32","","",30,[[["v"]],["result"]]],[11,"deserialize_i64","","",30,[[["v"]],["result"]]],[11,"deserialize_i128","","",30,[[["v"]],["result"]]],[11,"deserialize_u8","","",30,[[["v"]],["result"]]],[11,"deserialize_u16","","",30,[[["v"]],["result"]]],[11,"deserialize_u32","","",30,[[["v"]],["result"]]],[11,"deserialize_u64","","",30,[[["v"]],["result"]]],[11,"deserialize_u128","","",30,[[["v"]],["result"]]],[11,"deserialize_f32","","",30,[[["v"]],["result"]]],[11,"deserialize_f64","","",30,[[["v"]],["result"]]],[11,"deserialize_char","","",30,[[["v"]],["result"]]],[11,"deserialize_str","","",30,[[["v"]],["result"]]],[11,"deserialize_string","","",30,[[["v"]],["result"]]],[11,"deserialize_bytes","","",30,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",30,[[["v"]],["result"]]],[11,"deserialize_unit","","",30,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",30,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",30,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",30,[[["v"]],["result"]]],[11,"deserialize_tuple","","",30,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",30,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",30,[[["v"]],["result"]]],[11,"deserialize_struct","","",30,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",30,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",30,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",30,[[["v"]],["result"]]],[11,"deserialize_any","","",30,[[["v"]],["result"]]],[11,"deserialize_option","","",30,[[["v"]],["result"]]],[11,"deserialize_bool","","",31,[[["v"]],["result"]]],[11,"deserialize_i8","","",31,[[["v"]],["result"]]],[11,"deserialize_i16","","",31,[[["v"]],["result"]]],[11,"deserialize_i32","","",31,[[["v"]],["result"]]],[11,"deserialize_i64","","",31,[[["v"]],["result"]]],[11,"deserialize_i128","","",31,[[["v"]],["result"]]],[11,"deserialize_u8","","",31,[[["v"]],["result"]]],[11,"deserialize_u16","","",31,[[["v"]],["result"]]],[11,"deserialize_u32","","",31,[[["v"]],["result"]]],[11,"deserialize_u64","","",31,[[["v"]],["result"]]],[11,"deserialize_u128","","",31,[[["v"]],["result"]]],[11,"deserialize_f32","","",31,[[["v"]],["result"]]],[11,"deserialize_f64","","",31,[[["v"]],["result"]]],[11,"deserialize_char","","",31,[[["v"]],["result"]]],[11,"deserialize_str","","",31,[[["v"]],["result"]]],[11,"deserialize_string","","",31,[[["v"]],["result"]]],[11,"deserialize_bytes","","",31,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",31,[[["v"]],["result"]]],[11,"deserialize_option","","",31,[[["v"]],["result"]]],[11,"deserialize_unit","","",31,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",31,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",31,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",31,[[["v"]],["result"]]],[11,"deserialize_tuple","","",31,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",31,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",31,[[["v"]],["result"]]],[11,"deserialize_struct","","",31,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",31,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",31,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",31,[[["v"]],["result"]]],[11,"deserialize_any","","",31,[[["v"]],["result"]]],[11,"deserialize_bool","","",32,[[["v"]],["result"]]],[11,"deserialize_i8","","",32,[[["v"]],["result"]]],[11,"deserialize_i16","","",32,[[["v"]],["result"]]],[11,"deserialize_i32","","",32,[[["v"]],["result"]]],[11,"deserialize_i64","","",32,[[["v"]],["result"]]],[11,"deserialize_i128","","",32,[[["v"]],["result"]]],[11,"deserialize_u8","","",32,[[["v"]],["result"]]],[11,"deserialize_u16","","",32,[[["v"]],["result"]]],[11,"deserialize_u32","","",32,[[["v"]],["result"]]],[11,"deserialize_u64","","",32,[[["v"]],["result"]]],[11,"deserialize_u128","","",32,[[["v"]],["result"]]],[11,"deserialize_f32","","",32,[[["v"]],["result"]]],[11,"deserialize_f64","","",32,[[["v"]],["result"]]],[11,"deserialize_char","","",32,[[["v"]],["result"]]],[11,"deserialize_str","","",32,[[["v"]],["result"]]],[11,"deserialize_string","","",32,[[["v"]],["result"]]],[11,"deserialize_bytes","","",32,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",32,[[["v"]],["result"]]],[11,"deserialize_option","","",32,[[["v"]],["result"]]],[11,"deserialize_unit","","",32,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",32,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",32,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",32,[[["v"]],["result"]]],[11,"deserialize_tuple","","",32,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",32,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",32,[[["v"]],["result"]]],[11,"deserialize_struct","","",32,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",32,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",32,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",32,[[["v"]],["result"]]],[11,"deserialize_any","","",32,[[["v"]],["result"]]],[11,"deserialize_bool","","",33,[[["v"]],["result"]]],[11,"deserialize_i8","","",33,[[["v"]],["result"]]],[11,"deserialize_i16","","",33,[[["v"]],["result"]]],[11,"deserialize_i32","","",33,[[["v"]],["result"]]],[11,"deserialize_i64","","",33,[[["v"]],["result"]]],[11,"deserialize_i128","","",33,[[["v"]],["result"]]],[11,"deserialize_u8","","",33,[[["v"]],["result"]]],[11,"deserialize_u16","","",33,[[["v"]],["result"]]],[11,"deserialize_u32","","",33,[[["v"]],["result"]]],[11,"deserialize_u64","","",33,[[["v"]],["result"]]],[11,"deserialize_u128","","",33,[[["v"]],["result"]]],[11,"deserialize_f32","","",33,[[["v"]],["result"]]],[11,"deserialize_f64","","",33,[[["v"]],["result"]]],[11,"deserialize_char","","",33,[[["v"]],["result"]]],[11,"deserialize_str","","",33,[[["v"]],["result"]]],[11,"deserialize_string","","",33,[[["v"]],["result"]]],[11,"deserialize_bytes","","",33,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",33,[[["v"]],["result"]]],[11,"deserialize_option","","",33,[[["v"]],["result"]]],[11,"deserialize_unit","","",33,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",33,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",33,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",33,[[["v"]],["result"]]],[11,"deserialize_tuple","","",33,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",33,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",33,[[["v"]],["result"]]],[11,"deserialize_struct","","",33,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",33,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",33,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",33,[[["v"]],["result"]]],[11,"deserialize_any","","",33,[[["v"]],["result"]]],[11,"deserialize_bool","","",34,[[["v"]],["result"]]],[11,"deserialize_i8","","",34,[[["v"]],["result"]]],[11,"deserialize_i16","","",34,[[["v"]],["result"]]],[11,"deserialize_i32","","",34,[[["v"]],["result"]]],[11,"deserialize_i64","","",34,[[["v"]],["result"]]],[11,"deserialize_i128","","",34,[[["v"]],["result"]]],[11,"deserialize_u8","","",34,[[["v"]],["result"]]],[11,"deserialize_u16","","",34,[[["v"]],["result"]]],[11,"deserialize_u32","","",34,[[["v"]],["result"]]],[11,"deserialize_u64","","",34,[[["v"]],["result"]]],[11,"deserialize_u128","","",34,[[["v"]],["result"]]],[11,"deserialize_f32","","",34,[[["v"]],["result"]]],[11,"deserialize_f64","","",34,[[["v"]],["result"]]],[11,"deserialize_char","","",34,[[["v"]],["result"]]],[11,"deserialize_str","","",34,[[["v"]],["result"]]],[11,"deserialize_string","","",34,[[["v"]],["result"]]],[11,"deserialize_bytes","","",34,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",34,[[["v"]],["result"]]],[11,"deserialize_option","","",34,[[["v"]],["result"]]],[11,"deserialize_unit","","",34,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",34,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",34,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",34,[[["v"]],["result"]]],[11,"deserialize_tuple","","",34,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",34,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",34,[[["v"]],["result"]]],[11,"deserialize_struct","","",34,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",34,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",34,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",34,[[["v"]],["result"]]],[11,"deserialize_any","","",34,[[["v"]],["result"]]],[11,"deserialize_bool","","",35,[[["v"]],["result"]]],[11,"deserialize_i8","","",35,[[["v"]],["result"]]],[11,"deserialize_i16","","",35,[[["v"]],["result"]]],[11,"deserialize_i32","","",35,[[["v"]],["result"]]],[11,"deserialize_i64","","",35,[[["v"]],["result"]]],[11,"deserialize_i128","","",35,[[["v"]],["result"]]],[11,"deserialize_u8","","",35,[[["v"]],["result"]]],[11,"deserialize_u16","","",35,[[["v"]],["result"]]],[11,"deserialize_u32","","",35,[[["v"]],["result"]]],[11,"deserialize_u64","","",35,[[["v"]],["result"]]],[11,"deserialize_u128","","",35,[[["v"]],["result"]]],[11,"deserialize_f32","","",35,[[["v"]],["result"]]],[11,"deserialize_f64","","",35,[[["v"]],["result"]]],[11,"deserialize_char","","",35,[[["v"]],["result"]]],[11,"deserialize_str","","",35,[[["v"]],["result"]]],[11,"deserialize_string","","",35,[[["v"]],["result"]]],[11,"deserialize_bytes","","",35,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",35,[[["v"]],["result"]]],[11,"deserialize_option","","",35,[[["v"]],["result"]]],[11,"deserialize_unit","","",35,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",35,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",35,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",35,[[["v"]],["result"]]],[11,"deserialize_tuple","","",35,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",35,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",35,[[["v"]],["result"]]],[11,"deserialize_struct","","",35,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",35,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",35,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",35,[[["v"]],["result"]]],[11,"deserialize_any","","",35,[[["v"]],["result"]]],[11,"deserialize_bool","","",36,[[["v"]],["result"]]],[11,"deserialize_i8","","",36,[[["v"]],["result"]]],[11,"deserialize_i16","","",36,[[["v"]],["result"]]],[11,"deserialize_i32","","",36,[[["v"]],["result"]]],[11,"deserialize_i64","","",36,[[["v"]],["result"]]],[11,"deserialize_i128","","",36,[[["v"]],["result"]]],[11,"deserialize_u8","","",36,[[["v"]],["result"]]],[11,"deserialize_u16","","",36,[[["v"]],["result"]]],[11,"deserialize_u32","","",36,[[["v"]],["result"]]],[11,"deserialize_u64","","",36,[[["v"]],["result"]]],[11,"deserialize_u128","","",36,[[["v"]],["result"]]],[11,"deserialize_f32","","",36,[[["v"]],["result"]]],[11,"deserialize_f64","","",36,[[["v"]],["result"]]],[11,"deserialize_char","","",36,[[["v"]],["result"]]],[11,"deserialize_str","","",36,[[["v"]],["result"]]],[11,"deserialize_string","","",36,[[["v"]],["result"]]],[11,"deserialize_bytes","","",36,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",36,[[["v"]],["result"]]],[11,"deserialize_option","","",36,[[["v"]],["result"]]],[11,"deserialize_unit","","",36,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",36,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",36,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",36,[[["v"]],["result"]]],[11,"deserialize_tuple","","",36,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",36,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",36,[[["v"]],["result"]]],[11,"deserialize_struct","","",36,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",36,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",36,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",36,[[["v"]],["result"]]],[11,"deserialize_any","","",36,[[["v"]],["result"]]],[11,"deserialize_bool","","",37,[[["v"]],["result"]]],[11,"deserialize_i8","","",37,[[["v"]],["result"]]],[11,"deserialize_i16","","",37,[[["v"]],["result"]]],[11,"deserialize_i32","","",37,[[["v"]],["result"]]],[11,"deserialize_i64","","",37,[[["v"]],["result"]]],[11,"deserialize_i128","","",37,[[["v"]],["result"]]],[11,"deserialize_u8","","",37,[[["v"]],["result"]]],[11,"deserialize_u16","","",37,[[["v"]],["result"]]],[11,"deserialize_u32","","",37,[[["v"]],["result"]]],[11,"deserialize_u64","","",37,[[["v"]],["result"]]],[11,"deserialize_u128","","",37,[[["v"]],["result"]]],[11,"deserialize_f32","","",37,[[["v"]],["result"]]],[11,"deserialize_f64","","",37,[[["v"]],["result"]]],[11,"deserialize_char","","",37,[[["v"]],["result"]]],[11,"deserialize_str","","",37,[[["v"]],["result"]]],[11,"deserialize_string","","",37,[[["v"]],["result"]]],[11,"deserialize_bytes","","",37,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",37,[[["v"]],["result"]]],[11,"deserialize_option","","",37,[[["v"]],["result"]]],[11,"deserialize_unit","","",37,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",37,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",37,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",37,[[["v"]],["result"]]],[11,"deserialize_tuple","","",37,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",37,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",37,[[["v"]],["result"]]],[11,"deserialize_struct","","",37,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",37,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",37,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",37,[[["v"]],["result"]]],[11,"deserialize_any","","",37,[[["v"]],["result"]]],[11,"deserialize_bool","","",38,[[["v"]],["result"]]],[11,"deserialize_i8","","",38,[[["v"]],["result"]]],[11,"deserialize_i16","","",38,[[["v"]],["result"]]],[11,"deserialize_i32","","",38,[[["v"]],["result"]]],[11,"deserialize_i64","","",38,[[["v"]],["result"]]],[11,"deserialize_i128","","",38,[[["v"]],["result"]]],[11,"deserialize_u8","","",38,[[["v"]],["result"]]],[11,"deserialize_u16","","",38,[[["v"]],["result"]]],[11,"deserialize_u32","","",38,[[["v"]],["result"]]],[11,"deserialize_u64","","",38,[[["v"]],["result"]]],[11,"deserialize_u128","","",38,[[["v"]],["result"]]],[11,"deserialize_f32","","",38,[[["v"]],["result"]]],[11,"deserialize_f64","","",38,[[["v"]],["result"]]],[11,"deserialize_char","","",38,[[["v"]],["result"]]],[11,"deserialize_str","","",38,[[["v"]],["result"]]],[11,"deserialize_string","","",38,[[["v"]],["result"]]],[11,"deserialize_bytes","","",38,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",38,[[["v"]],["result"]]],[11,"deserialize_option","","",38,[[["v"]],["result"]]],[11,"deserialize_unit","","",38,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",38,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",38,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",38,[[["v"]],["result"]]],[11,"deserialize_tuple","","",38,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",38,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",38,[[["v"]],["result"]]],[11,"deserialize_struct","","",38,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",38,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",38,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",38,[[["v"]],["result"]]],[11,"deserialize_any","","",38,[[["v"]],["result"]]],[11,"deserialize_bool","","",39,[[["v"]],["result"]]],[11,"deserialize_i8","","",39,[[["v"]],["result"]]],[11,"deserialize_i16","","",39,[[["v"]],["result"]]],[11,"deserialize_i32","","",39,[[["v"]],["result"]]],[11,"deserialize_i64","","",39,[[["v"]],["result"]]],[11,"deserialize_i128","","",39,[[["v"]],["result"]]],[11,"deserialize_u8","","",39,[[["v"]],["result"]]],[11,"deserialize_u16","","",39,[[["v"]],["result"]]],[11,"deserialize_u32","","",39,[[["v"]],["result"]]],[11,"deserialize_u64","","",39,[[["v"]],["result"]]],[11,"deserialize_u128","","",39,[[["v"]],["result"]]],[11,"deserialize_f32","","",39,[[["v"]],["result"]]],[11,"deserialize_f64","","",39,[[["v"]],["result"]]],[11,"deserialize_char","","",39,[[["v"]],["result"]]],[11,"deserialize_str","","",39,[[["v"]],["result"]]],[11,"deserialize_string","","",39,[[["v"]],["result"]]],[11,"deserialize_bytes","","",39,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",39,[[["v"]],["result"]]],[11,"deserialize_option","","",39,[[["v"]],["result"]]],[11,"deserialize_unit","","",39,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",39,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",39,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",39,[[["v"]],["result"]]],[11,"deserialize_tuple","","",39,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",39,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",39,[[["v"]],["result"]]],[11,"deserialize_struct","","",39,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",39,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",39,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",39,[[["v"]],["result"]]],[11,"deserialize_any","","",39,[[["v"]],["result"]]],[11,"deserialize_bool","","",40,[[["v"]],["result"]]],[11,"deserialize_i8","","",40,[[["v"]],["result"]]],[11,"deserialize_i16","","",40,[[["v"]],["result"]]],[11,"deserialize_i32","","",40,[[["v"]],["result"]]],[11,"deserialize_i64","","",40,[[["v"]],["result"]]],[11,"deserialize_i128","","",40,[[["v"]],["result"]]],[11,"deserialize_u8","","",40,[[["v"]],["result"]]],[11,"deserialize_u16","","",40,[[["v"]],["result"]]],[11,"deserialize_u32","","",40,[[["v"]],["result"]]],[11,"deserialize_u64","","",40,[[["v"]],["result"]]],[11,"deserialize_u128","","",40,[[["v"]],["result"]]],[11,"deserialize_f32","","",40,[[["v"]],["result"]]],[11,"deserialize_f64","","",40,[[["v"]],["result"]]],[11,"deserialize_char","","",40,[[["v"]],["result"]]],[11,"deserialize_str","","",40,[[["v"]],["result"]]],[11,"deserialize_string","","",40,[[["v"]],["result"]]],[11,"deserialize_bytes","","",40,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",40,[[["v"]],["result"]]],[11,"deserialize_option","","",40,[[["v"]],["result"]]],[11,"deserialize_unit","","",40,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",40,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",40,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",40,[[["v"]],["result"]]],[11,"deserialize_tuple","","",40,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",40,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",40,[[["v"]],["result"]]],[11,"deserialize_struct","","",40,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",40,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",40,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",40,[[["v"]],["result"]]],[11,"deserialize_any","","",40,[[["v"]],["result"]]],[11,"deserialize_bool","","",41,[[["v"]],["result"]]],[11,"deserialize_i8","","",41,[[["v"]],["result"]]],[11,"deserialize_i16","","",41,[[["v"]],["result"]]],[11,"deserialize_i32","","",41,[[["v"]],["result"]]],[11,"deserialize_i64","","",41,[[["v"]],["result"]]],[11,"deserialize_i128","","",41,[[["v"]],["result"]]],[11,"deserialize_u8","","",41,[[["v"]],["result"]]],[11,"deserialize_u16","","",41,[[["v"]],["result"]]],[11,"deserialize_u32","","",41,[[["v"]],["result"]]],[11,"deserialize_u64","","",41,[[["v"]],["result"]]],[11,"deserialize_u128","","",41,[[["v"]],["result"]]],[11,"deserialize_f32","","",41,[[["v"]],["result"]]],[11,"deserialize_f64","","",41,[[["v"]],["result"]]],[11,"deserialize_char","","",41,[[["v"]],["result"]]],[11,"deserialize_str","","",41,[[["v"]],["result"]]],[11,"deserialize_string","","",41,[[["v"]],["result"]]],[11,"deserialize_bytes","","",41,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",41,[[["v"]],["result"]]],[11,"deserialize_option","","",41,[[["v"]],["result"]]],[11,"deserialize_unit","","",41,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",41,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",41,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",41,[[["v"]],["result"]]],[11,"deserialize_tuple","","",41,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",41,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",41,[[["v"]],["result"]]],[11,"deserialize_struct","","",41,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",41,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",41,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",41,[[["v"]],["result"]]],[11,"deserialize_any","","",41,[[["v"]],["result"]]],[11,"deserialize_bool","","",42,[[["v"]],["result"]]],[11,"deserialize_i8","","",42,[[["v"]],["result"]]],[11,"deserialize_i16","","",42,[[["v"]],["result"]]],[11,"deserialize_i32","","",42,[[["v"]],["result"]]],[11,"deserialize_i64","","",42,[[["v"]],["result"]]],[11,"deserialize_i128","","",42,[[["v"]],["result"]]],[11,"deserialize_u8","","",42,[[["v"]],["result"]]],[11,"deserialize_u16","","",42,[[["v"]],["result"]]],[11,"deserialize_u32","","",42,[[["v"]],["result"]]],[11,"deserialize_u64","","",42,[[["v"]],["result"]]],[11,"deserialize_u128","","",42,[[["v"]],["result"]]],[11,"deserialize_f32","","",42,[[["v"]],["result"]]],[11,"deserialize_f64","","",42,[[["v"]],["result"]]],[11,"deserialize_char","","",42,[[["v"]],["result"]]],[11,"deserialize_str","","",42,[[["v"]],["result"]]],[11,"deserialize_string","","",42,[[["v"]],["result"]]],[11,"deserialize_bytes","","",42,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",42,[[["v"]],["result"]]],[11,"deserialize_option","","",42,[[["v"]],["result"]]],[11,"deserialize_unit","","",42,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",42,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",42,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",42,[[["v"]],["result"]]],[11,"deserialize_tuple","","",42,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",42,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",42,[[["v"]],["result"]]],[11,"deserialize_struct","","",42,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",42,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",42,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",42,[[["v"]],["result"]]],[11,"deserialize_any","","",42,[[["v"]],["result"]]],[11,"deserialize_bool","","",43,[[["v"]],["result"]]],[11,"deserialize_i8","","",43,[[["v"]],["result"]]],[11,"deserialize_i16","","",43,[[["v"]],["result"]]],[11,"deserialize_i32","","",43,[[["v"]],["result"]]],[11,"deserialize_i64","","",43,[[["v"]],["result"]]],[11,"deserialize_i128","","",43,[[["v"]],["result"]]],[11,"deserialize_u8","","",43,[[["v"]],["result"]]],[11,"deserialize_u16","","",43,[[["v"]],["result"]]],[11,"deserialize_u32","","",43,[[["v"]],["result"]]],[11,"deserialize_u64","","",43,[[["v"]],["result"]]],[11,"deserialize_u128","","",43,[[["v"]],["result"]]],[11,"deserialize_f32","","",43,[[["v"]],["result"]]],[11,"deserialize_f64","","",43,[[["v"]],["result"]]],[11,"deserialize_char","","",43,[[["v"]],["result"]]],[11,"deserialize_str","","",43,[[["v"]],["result"]]],[11,"deserialize_string","","",43,[[["v"]],["result"]]],[11,"deserialize_bytes","","",43,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",43,[[["v"]],["result"]]],[11,"deserialize_option","","",43,[[["v"]],["result"]]],[11,"deserialize_unit","","",43,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",43,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",43,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",43,[[["v"]],["result"]]],[11,"deserialize_tuple","","",43,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",43,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",43,[[["v"]],["result"]]],[11,"deserialize_struct","","",43,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",43,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",43,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",43,[[["v"]],["result"]]],[11,"deserialize_any","","",43,[[["v"]],["result"]]],[11,"deserialize_bool","","",44,[[["v"]],["result"]]],[11,"deserialize_i8","","",44,[[["v"]],["result"]]],[11,"deserialize_i16","","",44,[[["v"]],["result"]]],[11,"deserialize_i32","","",44,[[["v"]],["result"]]],[11,"deserialize_i64","","",44,[[["v"]],["result"]]],[11,"deserialize_i128","","",44,[[["v"]],["result"]]],[11,"deserialize_u8","","",44,[[["v"]],["result"]]],[11,"deserialize_u16","","",44,[[["v"]],["result"]]],[11,"deserialize_u32","","",44,[[["v"]],["result"]]],[11,"deserialize_u64","","",44,[[["v"]],["result"]]],[11,"deserialize_u128","","",44,[[["v"]],["result"]]],[11,"deserialize_f32","","",44,[[["v"]],["result"]]],[11,"deserialize_f64","","",44,[[["v"]],["result"]]],[11,"deserialize_char","","",44,[[["v"]],["result"]]],[11,"deserialize_str","","",44,[[["v"]],["result"]]],[11,"deserialize_string","","",44,[[["v"]],["result"]]],[11,"deserialize_bytes","","",44,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",44,[[["v"]],["result"]]],[11,"deserialize_option","","",44,[[["v"]],["result"]]],[11,"deserialize_unit","","",44,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",44,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",44,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",44,[[["v"]],["result"]]],[11,"deserialize_tuple","","",44,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",44,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",44,[[["v"]],["result"]]],[11,"deserialize_struct","","",44,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",44,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",44,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",44,[[["v"]],["result"]]],[11,"deserialize_any","","",44,[[["v"]],["result"]]],[11,"deserialize_bool","","",45,[[["v"]],["result"]]],[11,"deserialize_i8","","",45,[[["v"]],["result"]]],[11,"deserialize_i16","","",45,[[["v"]],["result"]]],[11,"deserialize_i32","","",45,[[["v"]],["result"]]],[11,"deserialize_i64","","",45,[[["v"]],["result"]]],[11,"deserialize_i128","","",45,[[["v"]],["result"]]],[11,"deserialize_u8","","",45,[[["v"]],["result"]]],[11,"deserialize_u16","","",45,[[["v"]],["result"]]],[11,"deserialize_u32","","",45,[[["v"]],["result"]]],[11,"deserialize_u64","","",45,[[["v"]],["result"]]],[11,"deserialize_u128","","",45,[[["v"]],["result"]]],[11,"deserialize_f32","","",45,[[["v"]],["result"]]],[11,"deserialize_f64","","",45,[[["v"]],["result"]]],[11,"deserialize_char","","",45,[[["v"]],["result"]]],[11,"deserialize_str","","",45,[[["v"]],["result"]]],[11,"deserialize_string","","",45,[[["v"]],["result"]]],[11,"deserialize_bytes","","",45,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",45,[[["v"]],["result"]]],[11,"deserialize_option","","",45,[[["v"]],["result"]]],[11,"deserialize_unit","","",45,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",45,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",45,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",45,[[["v"]],["result"]]],[11,"deserialize_tuple","","",45,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",45,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",45,[[["v"]],["result"]]],[11,"deserialize_struct","","",45,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",45,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",45,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",45,[[["v"]],["result"]]],[11,"deserialize_any","","",45,[[["v"]],["result"]]],[11,"deserialize_bool","","",46,[[["v"]],["result"]]],[11,"deserialize_i8","","",46,[[["v"]],["result"]]],[11,"deserialize_i16","","",46,[[["v"]],["result"]]],[11,"deserialize_i32","","",46,[[["v"]],["result"]]],[11,"deserialize_i64","","",46,[[["v"]],["result"]]],[11,"deserialize_i128","","",46,[[["v"]],["result"]]],[11,"deserialize_u8","","",46,[[["v"]],["result"]]],[11,"deserialize_u16","","",46,[[["v"]],["result"]]],[11,"deserialize_u32","","",46,[[["v"]],["result"]]],[11,"deserialize_u64","","",46,[[["v"]],["result"]]],[11,"deserialize_u128","","",46,[[["v"]],["result"]]],[11,"deserialize_f32","","",46,[[["v"]],["result"]]],[11,"deserialize_f64","","",46,[[["v"]],["result"]]],[11,"deserialize_char","","",46,[[["v"]],["result"]]],[11,"deserialize_str","","",46,[[["v"]],["result"]]],[11,"deserialize_string","","",46,[[["v"]],["result"]]],[11,"deserialize_bytes","","",46,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",46,[[["v"]],["result"]]],[11,"deserialize_option","","",46,[[["v"]],["result"]]],[11,"deserialize_unit","","",46,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",46,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",46,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",46,[[["v"]],["result"]]],[11,"deserialize_tuple","","",46,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",46,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",46,[[["v"]],["result"]]],[11,"deserialize_struct","","",46,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",46,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",46,[[["v"]],["result"]]],[11,"deserialize_any","","",46,[[["v"]],["result"]]],[11,"deserialize_enum","","",46,[[["str"],["v"]],["result"]]],[11,"deserialize_any","","",47,[[["v"]],["result"]]],[11,"deserialize_enum","","",47,[[["str"],["v"]],["result"]]],[11,"deserialize_bool","","",47,[[["v"]],["result"]]],[11,"deserialize_i8","","",47,[[["v"]],["result"]]],[11,"deserialize_i16","","",47,[[["v"]],["result"]]],[11,"deserialize_i32","","",47,[[["v"]],["result"]]],[11,"deserialize_i64","","",47,[[["v"]],["result"]]],[11,"deserialize_i128","","",47,[[["v"]],["result"]]],[11,"deserialize_u8","","",47,[[["v"]],["result"]]],[11,"deserialize_u16","","",47,[[["v"]],["result"]]],[11,"deserialize_u32","","",47,[[["v"]],["result"]]],[11,"deserialize_u64","","",47,[[["v"]],["result"]]],[11,"deserialize_u128","","",47,[[["v"]],["result"]]],[11,"deserialize_f32","","",47,[[["v"]],["result"]]],[11,"deserialize_f64","","",47,[[["v"]],["result"]]],[11,"deserialize_char","","",47,[[["v"]],["result"]]],[11,"deserialize_str","","",47,[[["v"]],["result"]]],[11,"deserialize_string","","",47,[[["v"]],["result"]]],[11,"deserialize_bytes","","",47,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",47,[[["v"]],["result"]]],[11,"deserialize_option","","",47,[[["v"]],["result"]]],[11,"deserialize_unit","","",47,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",47,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",47,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",47,[[["v"]],["result"]]],[11,"deserialize_tuple","","",47,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",47,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",47,[[["v"]],["result"]]],[11,"deserialize_struct","","",47,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",47,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",47,[[["v"]],["result"]]],[11,"deserialize_any","","",1,[[["v"]],["result"]]],[11,"deserialize_enum","","",1,[[["str"],["v"]],["result"]]],[11,"deserialize_bool","","",1,[[["v"]],["result"]]],[11,"deserialize_i8","","",1,[[["v"]],["result"]]],[11,"deserialize_i16","","",1,[[["v"]],["result"]]],[11,"deserialize_i32","","",1,[[["v"]],["result"]]],[11,"deserialize_i64","","",1,[[["v"]],["result"]]],[11,"deserialize_i128","","",1,[[["v"]],["result"]]],[11,"deserialize_u8","","",1,[[["v"]],["result"]]],[11,"deserialize_u16","","",1,[[["v"]],["result"]]],[11,"deserialize_u32","","",1,[[["v"]],["result"]]],[11,"deserialize_u64","","",1,[[["v"]],["result"]]],[11,"deserialize_u128","","",1,[[["v"]],["result"]]],[11,"deserialize_f32","","",1,[[["v"]],["result"]]],[11,"deserialize_f64","","",1,[[["v"]],["result"]]],[11,"deserialize_char","","",1,[[["v"]],["result"]]],[11,"deserialize_str","","",1,[[["v"]],["result"]]],[11,"deserialize_string","","",1,[[["v"]],["result"]]],[11,"deserialize_bytes","","",1,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",1,[[["v"]],["result"]]],[11,"deserialize_option","","",1,[[["v"]],["result"]]],[11,"deserialize_unit","","",1,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",1,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",1,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",1,[[["v"]],["result"]]],[11,"deserialize_tuple","","",1,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",1,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",1,[[["v"]],["result"]]],[11,"deserialize_struct","","",1,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",1,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",1,[[["v"]],["result"]]],[11,"deserialize_any","","",48,[[["v"]],["result"]]],[11,"deserialize_enum","","",48,[[["str"],["v"]],["result"]]],[11,"deserialize_bool","","",48,[[["v"]],["result"]]],[11,"deserialize_i8","","",48,[[["v"]],["result"]]],[11,"deserialize_i16","","",48,[[["v"]],["result"]]],[11,"deserialize_i32","","",48,[[["v"]],["result"]]],[11,"deserialize_i64","","",48,[[["v"]],["result"]]],[11,"deserialize_i128","","",48,[[["v"]],["result"]]],[11,"deserialize_u8","","",48,[[["v"]],["result"]]],[11,"deserialize_u16","","",48,[[["v"]],["result"]]],[11,"deserialize_u32","","",48,[[["v"]],["result"]]],[11,"deserialize_u64","","",48,[[["v"]],["result"]]],[11,"deserialize_u128","","",48,[[["v"]],["result"]]],[11,"deserialize_f32","","",48,[[["v"]],["result"]]],[11,"deserialize_f64","","",48,[[["v"]],["result"]]],[11,"deserialize_char","","",48,[[["v"]],["result"]]],[11,"deserialize_str","","",48,[[["v"]],["result"]]],[11,"deserialize_string","","",48,[[["v"]],["result"]]],[11,"deserialize_bytes","","",48,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",48,[[["v"]],["result"]]],[11,"deserialize_option","","",48,[[["v"]],["result"]]],[11,"deserialize_unit","","",48,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",48,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",48,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",48,[[["v"]],["result"]]],[11,"deserialize_tuple","","",48,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",48,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",48,[[["v"]],["result"]]],[11,"deserialize_struct","","",48,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",48,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",48,[[["v"]],["result"]]],[11,"deserialize_any","","",49,[[["v"]],["result"]]],[11,"deserialize_enum","","",49,[[["str"],["v"]],["result"]]],[11,"deserialize_bool","","",49,[[["v"]],["result"]]],[11,"deserialize_i8","","",49,[[["v"]],["result"]]],[11,"deserialize_i16","","",49,[[["v"]],["result"]]],[11,"deserialize_i32","","",49,[[["v"]],["result"]]],[11,"deserialize_i64","","",49,[[["v"]],["result"]]],[11,"deserialize_i128","","",49,[[["v"]],["result"]]],[11,"deserialize_u8","","",49,[[["v"]],["result"]]],[11,"deserialize_u16","","",49,[[["v"]],["result"]]],[11,"deserialize_u32","","",49,[[["v"]],["result"]]],[11,"deserialize_u64","","",49,[[["v"]],["result"]]],[11,"deserialize_u128","","",49,[[["v"]],["result"]]],[11,"deserialize_f32","","",49,[[["v"]],["result"]]],[11,"deserialize_f64","","",49,[[["v"]],["result"]]],[11,"deserialize_char","","",49,[[["v"]],["result"]]],[11,"deserialize_str","","",49,[[["v"]],["result"]]],[11,"deserialize_string","","",49,[[["v"]],["result"]]],[11,"deserialize_bytes","","",49,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",49,[[["v"]],["result"]]],[11,"deserialize_option","","",49,[[["v"]],["result"]]],[11,"deserialize_unit","","",49,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",49,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",49,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",49,[[["v"]],["result"]]],[11,"deserialize_tuple","","",49,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",49,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",49,[[["v"]],["result"]]],[11,"deserialize_struct","","",49,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",49,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",49,[[["v"]],["result"]]],[11,"deserialize_any","","",2,[[["v"]],["result"]]],[11,"deserialize_bool","","",2,[[["v"]],["result"]]],[11,"deserialize_i8","","",2,[[["v"]],["result"]]],[11,"deserialize_i16","","",2,[[["v"]],["result"]]],[11,"deserialize_i32","","",2,[[["v"]],["result"]]],[11,"deserialize_i64","","",2,[[["v"]],["result"]]],[11,"deserialize_i128","","",2,[[["v"]],["result"]]],[11,"deserialize_u8","","",2,[[["v"]],["result"]]],[11,"deserialize_u16","","",2,[[["v"]],["result"]]],[11,"deserialize_u32","","",2,[[["v"]],["result"]]],[11,"deserialize_u64","","",2,[[["v"]],["result"]]],[11,"deserialize_u128","","",2,[[["v"]],["result"]]],[11,"deserialize_f32","","",2,[[["v"]],["result"]]],[11,"deserialize_f64","","",2,[[["v"]],["result"]]],[11,"deserialize_char","","",2,[[["v"]],["result"]]],[11,"deserialize_str","","",2,[[["v"]],["result"]]],[11,"deserialize_string","","",2,[[["v"]],["result"]]],[11,"deserialize_bytes","","",2,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",2,[[["v"]],["result"]]],[11,"deserialize_option","","",2,[[["v"]],["result"]]],[11,"deserialize_unit","","",2,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",2,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",2,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",2,[[["v"]],["result"]]],[11,"deserialize_tuple","","",2,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",2,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",2,[[["v"]],["result"]]],[11,"deserialize_struct","","",2,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",2,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",2,[[["v"]],["result"]]],[11,"deserialize_enum","","",2,[[["str"],["v"]],["result"]]],[11,"deserialize_any","","",3,[[["v"]],["result"]]],[11,"deserialize_bool","","",3,[[["v"]],["result"]]],[11,"deserialize_i8","","",3,[[["v"]],["result"]]],[11,"deserialize_i16","","",3,[[["v"]],["result"]]],[11,"deserialize_i32","","",3,[[["v"]],["result"]]],[11,"deserialize_i64","","",3,[[["v"]],["result"]]],[11,"deserialize_i128","","",3,[[["v"]],["result"]]],[11,"deserialize_u8","","",3,[[["v"]],["result"]]],[11,"deserialize_u16","","",3,[[["v"]],["result"]]],[11,"deserialize_u32","","",3,[[["v"]],["result"]]],[11,"deserialize_u64","","",3,[[["v"]],["result"]]],[11,"deserialize_u128","","",3,[[["v"]],["result"]]],[11,"deserialize_f32","","",3,[[["v"]],["result"]]],[11,"deserialize_f64","","",3,[[["v"]],["result"]]],[11,"deserialize_char","","",3,[[["v"]],["result"]]],[11,"deserialize_str","","",3,[[["v"]],["result"]]],[11,"deserialize_string","","",3,[[["v"]],["result"]]],[11,"deserialize_bytes","","",3,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",3,[[["v"]],["result"]]],[11,"deserialize_option","","",3,[[["v"]],["result"]]],[11,"deserialize_unit","","",3,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",3,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",3,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",3,[[["v"]],["result"]]],[11,"deserialize_tuple","","",3,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",3,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",3,[[["v"]],["result"]]],[11,"deserialize_struct","","",3,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",3,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",3,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",3,[[["v"]],["result"]]],[11,"deserialize_any","","",4,[[["v"]],["result"]]],[11,"deserialize_bool","","",4,[[["v"]],["result"]]],[11,"deserialize_i8","","",4,[[["v"]],["result"]]],[11,"deserialize_i16","","",4,[[["v"]],["result"]]],[11,"deserialize_i32","","",4,[[["v"]],["result"]]],[11,"deserialize_i64","","",4,[[["v"]],["result"]]],[11,"deserialize_i128","","",4,[[["v"]],["result"]]],[11,"deserialize_u8","","",4,[[["v"]],["result"]]],[11,"deserialize_u16","","",4,[[["v"]],["result"]]],[11,"deserialize_u32","","",4,[[["v"]],["result"]]],[11,"deserialize_u64","","",4,[[["v"]],["result"]]],[11,"deserialize_u128","","",4,[[["v"]],["result"]]],[11,"deserialize_f32","","",4,[[["v"]],["result"]]],[11,"deserialize_f64","","",4,[[["v"]],["result"]]],[11,"deserialize_char","","",4,[[["v"]],["result"]]],[11,"deserialize_str","","",4,[[["v"]],["result"]]],[11,"deserialize_string","","",4,[[["v"]],["result"]]],[11,"deserialize_bytes","","",4,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",4,[[["v"]],["result"]]],[11,"deserialize_option","","",4,[[["v"]],["result"]]],[11,"deserialize_unit","","",4,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",4,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",4,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",4,[[["v"]],["result"]]],[11,"deserialize_tuple","","",4,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",4,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",4,[[["v"]],["result"]]],[11,"deserialize_struct","","",4,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",4,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",4,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",4,[[["v"]],["result"]]],[11,"deserialize_any","","",5,[[["v"]],["result"]]],[11,"deserialize_seq","","",5,[[["v"]],["result"]]],[11,"deserialize_tuple","","",5,[[["usize"],["v"]],["result"]]],[11,"deserialize_bool","","",5,[[["v"]],["result"]]],[11,"deserialize_i8","","",5,[[["v"]],["result"]]],[11,"deserialize_i16","","",5,[[["v"]],["result"]]],[11,"deserialize_i32","","",5,[[["v"]],["result"]]],[11,"deserialize_i64","","",5,[[["v"]],["result"]]],[11,"deserialize_i128","","",5,[[["v"]],["result"]]],[11,"deserialize_u8","","",5,[[["v"]],["result"]]],[11,"deserialize_u16","","",5,[[["v"]],["result"]]],[11,"deserialize_u32","","",5,[[["v"]],["result"]]],[11,"deserialize_u64","","",5,[[["v"]],["result"]]],[11,"deserialize_u128","","",5,[[["v"]],["result"]]],[11,"deserialize_f32","","",5,[[["v"]],["result"]]],[11,"deserialize_f64","","",5,[[["v"]],["result"]]],[11,"deserialize_char","","",5,[[["v"]],["result"]]],[11,"deserialize_str","","",5,[[["v"]],["result"]]],[11,"deserialize_string","","",5,[[["v"]],["result"]]],[11,"deserialize_bytes","","",5,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",5,[[["v"]],["result"]]],[11,"deserialize_option","","",5,[[["v"]],["result"]]],[11,"deserialize_unit","","",5,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",5,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",5,[[["str"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",5,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",5,[[["v"]],["result"]]],[11,"deserialize_struct","","",5,[[["str"],["v"]],["result"]]],[11,"deserialize_enum","","",5,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",5,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",5,[[["v"]],["result"]]],[11,"deserialize_any","","",6,[[["v"]],["result"]]],[11,"deserialize_enum","","",6,[[["str"],["v"]],["result"]]],[11,"deserialize_bool","","",6,[[["v"]],["result"]]],[11,"deserialize_i8","","",6,[[["v"]],["result"]]],[11,"deserialize_i16","","",6,[[["v"]],["result"]]],[11,"deserialize_i32","","",6,[[["v"]],["result"]]],[11,"deserialize_i64","","",6,[[["v"]],["result"]]],[11,"deserialize_i128","","",6,[[["v"]],["result"]]],[11,"deserialize_u8","","",6,[[["v"]],["result"]]],[11,"deserialize_u16","","",6,[[["v"]],["result"]]],[11,"deserialize_u32","","",6,[[["v"]],["result"]]],[11,"deserialize_u64","","",6,[[["v"]],["result"]]],[11,"deserialize_u128","","",6,[[["v"]],["result"]]],[11,"deserialize_f32","","",6,[[["v"]],["result"]]],[11,"deserialize_f64","","",6,[[["v"]],["result"]]],[11,"deserialize_char","","",6,[[["v"]],["result"]]],[11,"deserialize_str","","",6,[[["v"]],["result"]]],[11,"deserialize_string","","",6,[[["v"]],["result"]]],[11,"deserialize_bytes","","",6,[[["v"]],["result"]]],[11,"deserialize_byte_buf","","",6,[[["v"]],["result"]]],[11,"deserialize_option","","",6,[[["v"]],["result"]]],[11,"deserialize_unit","","",6,[[["v"]],["result"]]],[11,"deserialize_unit_struct","","",6,[[["str"],["v"]],["result"]]],[11,"deserialize_newtype_struct","","",6,[[["str"],["v"]],["result"]]],[11,"deserialize_seq","","",6,[[["v"]],["result"]]],[11,"deserialize_tuple","","",6,[[["usize"],["v"]],["result"]]],[11,"deserialize_tuple_struct","","",6,[[["str"],["usize"],["v"]],["result"]]],[11,"deserialize_map","","",6,[[["v"]],["result"]]],[11,"deserialize_struct","","",6,[[["str"],["v"]],["result"]]],[11,"deserialize_identifier","","",6,[[["v"]],["result"]]],[11,"deserialize_ignored_any","","",6,[[["v"]],["result"]]],[11,"expecting","serde::de","",28,[[["formatter"],["self"]],["result"]]],[11,"visit_bool","","",28,[[["bool"]],["result"]]],[11,"visit_i64","","",28,[[["i64"]],["result"]]],[11,"visit_u64","","",28,[[["u64"]],["result"]]],[11,"visit_f64","","",28,[[["f64"]],["result"]]],[11,"visit_str","","",28,[[["str"]],["result"]]],[11,"visit_none","","",28,[[],["result"]]],[11,"visit_some","","",28,[[["d"]],["result"]]],[11,"visit_newtype_struct","","",28,[[["d"]],["result"]]],[11,"visit_unit","","",28,[[],["result"]]],[11,"visit_seq","","",28,[[["a"]],["result"]]],[11,"visit_map","","",28,[[["a"]],["result"]]],[11,"visit_bytes","","",28,[[],["result"]]],[11,"visit_enum","","",28,[[["a"]],["result"]]],[11,"next_element_seed","serde::de::value","",3,[[["self"],["v"]],[["option"],["result",["option"]]]]],[11,"size_hint","","",3,[[["self"]],[["usize"],["option",["usize"]]]]],[11,"next_element_seed","","",5,[[["self"],["t"]],[["option"],["result",["option"]]]]],[11,"size_hint","","",5,[[["self"]],[["usize"],["option",["usize"]]]]],[11,"next_key_seed","","",5,[[["self"],["t"]],[["result",["option"]],["option"]]]],[11,"next_value_seed","","",5,[[["self"],["t"]],["result"]]],[11,"next_entry_seed","","",5,[[["tv"],["self"],["tk"]],[["result",["option"]],["option"]]]],[11,"size_hint","","",5,[[["self"]],[["usize"],["option",["usize"]]]]],[11,"variant_seed","","",46,[[["t"]],["result"]]],[11,"variant_seed","","",47,[[["t"]],["result"]]],[11,"variant_seed","","",1,[[["t"]],["result"]]],[11,"variant_seed","","",48,[[["t"]],["result"]]],[11,"variant_seed","","",49,[[["t"]],["result"]]],[11,"variant_seed","","",6,[[["t"]],["result"]]],[11,"serialize_element","serde::ser","",50,[[["self"],["t"]],["result"]]],[11,"end","","",50,[[],["result"]]],[11,"serialize_element","","",50,[[["self"],["t"]],["result"]]],[11,"end","","",50,[[],["result"]]],[11,"serialize_field","","",50,[[["self"],["t"]],["result"]]],[11,"end","","",50,[[],["result"]]],[11,"serialize_field","","",50,[[["self"],["t"]],["result"]]],[11,"end","","",50,[[],["result"]]],[11,"serialize_key","","",50,[[["self"],["t"]],["result"]]],[11,"serialize_value","","",50,[[["self"],["t"]],["result"]]],[11,"end","","",50,[[],["result"]]],[11,"serialize_field","","",50,[[["self"],["str"],["t"]],["result"]]],[11,"end","","",50,[[],["result"]]],[11,"serialize_field","","",50,[[["self"],["str"],["t"]],["result"]]],[11,"end","","",50,[[],["result"]]],[11,"custom","serde::de::value","",29,[[["t"]],["self"]]],[11,"custom","","",29,[[["t"]],["self"]]],[11,"clone","","",29,[[["self"]],["error"]]],[11,"clone","","",30,[[["self"]],["self"]]],[11,"clone","","",31,[[["self"]],["self"]]],[11,"clone","","",32,[[["self"]],["self"]]],[11,"clone","","",33,[[["self"]],["self"]]],[11,"clone","","",34,[[["self"]],["self"]]],[11,"clone","","",35,[[["self"]],["self"]]],[11,"clone","","",36,[[["self"]],["self"]]],[11,"clone","","",37,[[["self"]],["self"]]],[11,"clone","","",38,[[["self"]],["self"]]],[11,"clone","","",39,[[["self"]],["self"]]],[11,"clone","","",40,[[["self"]],["self"]]],[11,"clone","","",41,[[["self"]],["self"]]],[11,"clone","","",42,[[["self"]],["self"]]],[11,"clone","","",43,[[["self"]],["self"]]],[11,"clone","","",44,[[["self"]],["self"]]],[11,"clone","","",45,[[["self"]],["self"]]],[11,"clone","","",46,[[["self"]],["self"]]],[11,"clone","","",47,[[["self"]],["self"]]],[11,"clone","","",1,[[["self"]],["self"]]],[11,"clone","","",48,[[["self"]],["self"]]],[11,"clone","","",49,[[["self"]],["self"]]],[11,"clone","","",2,[[["self"]],["self"]]],[11,"clone","","",3,[[["self"]],["seqdeserializer"]]],[11,"clone","","",4,[[["self"]],["seqaccessdeserializer"]]],[11,"clone","","",5,[[["self"]],["self"]]],[11,"clone","","",6,[[["self"]],["mapaccessdeserializer"]]],[11,"clone","serde::de","",28,[[["self"]],["ignoredany"]]],[11,"clone","","",0,[[["self"]],["unexpected"]]],[11,"default","","",28,[[],["ignoredany"]]],[11,"eq","serde::de::value","",29,[[["error"],["self"]],["bool"]]],[11,"ne","","",29,[[["error"],["self"]],["bool"]]],[11,"eq","serde::de","",0,[[["unexpected"],["self"]],["bool"]]],[11,"ne","","",0,[[["unexpected"],["self"]],["bool"]]],[11,"fmt","serde::de::value","",29,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",30,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",31,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",32,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",33,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",34,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",35,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",36,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",37,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",38,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",39,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",40,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",41,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",42,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",43,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",44,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",45,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",46,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",47,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",1,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",48,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",49,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",2,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",3,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",4,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",5,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",6,[[["formatter"],["self"]],["result"]]],[11,"fmt","serde::de","",28,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",0,[[["formatter"],["self"]],["result"]]],[11,"fmt","serde::de::value","",29,[[["formatter"],["self"]],[["result",["error"]],["error"]]]],[11,"fmt","serde::de","",0,[[["formatter"],["self"]],[["result",["error"]],["error"]]]],[11,"fmt","","",8,[[["formatter"],["self"]],["result"]]],[11,"description","serde::de::value","",29,[[["self"]],["str"]]]],"p":[[4,"Unexpected"],[3,"BorrowedStrDeserializer"],[3,"BorrowedBytesDeserializer"],[3,"SeqDeserializer"],[3,"SeqAccessDeserializer"],[3,"MapDeserializer"],[3,"MapAccessDeserializer"],[8,"Error"],[8,"Expected"],[8,"Deserialize"],[8,"DeserializeSeed"],[8,"Deserializer"],[8,"Visitor"],[8,"SeqAccess"],[8,"MapAccess"],[8,"EnumAccess"],[8,"VariantAccess"],[8,"IntoDeserializer"],[8,"Error"],[8,"Serialize"],[8,"Serializer"],[8,"SerializeSeq"],[8,"SerializeTuple"],[8,"SerializeTupleStruct"],[8,"SerializeTupleVariant"],[8,"SerializeMap"],[8,"SerializeStruct"],[8,"SerializeStructVariant"],[3,"IgnoredAny"],[3,"Error"],[3,"UnitDeserializer"],[3,"BoolDeserializer"],[3,"I8Deserializer"],[3,"I16Deserializer"],[3,"I32Deserializer"],[3,"I64Deserializer"],[3,"IsizeDeserializer"],[3,"U8Deserializer"],[3,"U16Deserializer"],[3,"U64Deserializer"],[3,"UsizeDeserializer"],[3,"F32Deserializer"],[3,"F64Deserializer"],[3,"CharDeserializer"],[3,"I128Deserializer"],[3,"U128Deserializer"],[3,"U32Deserializer"],[3,"StrDeserializer"],[3,"StringDeserializer"],[3,"CowStrDeserializer"],[3,"Impossible"]]}; +searchIndex["serde_derive"] = {"doc":"This crate provides Serde's two derive macros.","i":[[24,"Serialize","serde_derive","",null,null],[24,"Deserialize","","",null,null]],"p":[]}; +searchIndex["syn"] = {"doc":"Syn is a parsing library for parsing a stream of Rust…","i":[[3,"Ident","syn","A word of Rust code, which may be a keyword or legal…",null,null],[3,"Attribute","","An attribute like `#[repr(transparent)]`.",null,null],[12,"pound_token","","",0,null],[12,"style","","",0,null],[12,"bracket_token","","",0,null],[12,"path","","",0,null],[12,"tokens","","",0,null],[3,"MetaList","","A structured list within an attribute, like `derive(Copy,…",null,null],[12,"path","","",1,null],[12,"paren_token","","",1,null],[12,"nested","","",1,null],[3,"MetaNameValue","","A name-value pair within an attribute, like `feature =…",null,null],[12,"path","","",2,null],[12,"eq_token","","",2,null],[12,"lit","","",2,null],[3,"Field","","A field of a struct or enum variant.",null,null],[12,"attrs","","Attributes tagged on the field.",3,null],[12,"vis","","Visibility of the field.",3,null],[12,"ident","","Name of the field, if any.",3,null],[12,"colon_token","","",3,null],[12,"ty","","Type of the field.",3,null],[3,"FieldsNamed","","Named fields of a struct or struct variant such as `Point…",null,null],[12,"brace_token","","",4,null],[12,"named","","",4,null],[3,"FieldsUnnamed","","Unnamed fields of a tuple struct or tuple variant such as…",null,null],[12,"paren_token","","",5,null],[12,"unnamed","","",5,null],[3,"Variant","","An enum variant.",null,null],[12,"attrs","","Attributes tagged on the variant.",6,null],[12,"ident","","Name of the variant.",6,null],[12,"fields","","Content stored in the variant.",6,null],[12,"discriminant","","Explicit discriminant: `Variant = 1`",6,null],[3,"VisCrate","","A crate-level visibility: `crate`.",null,null],[12,"crate_token","","",7,null],[3,"VisPublic","","A public visibility level: `pub`.",null,null],[12,"pub_token","","",8,null],[3,"VisRestricted","","A visibility level restricted to some path: `pub(self)` or…",null,null],[12,"pub_token","","",9,null],[12,"paren_token","","",9,null],[12,"in_token","","",9,null],[12,"path","","",9,null],[3,"ExprArray","","A slice literal expression: `[a, b, c, d]`.",null,null],[3,"ExprAssign","","An assignment expression: `a = compute()`.",null,null],[3,"ExprAssignOp","","A compound assignment expression: `counter += 1`.",null,null],[3,"ExprAsync","","An async block: `async { ... }`.",null,null],[3,"ExprAwait","","An await expression: `fut.await`.",null,null],[3,"ExprBinary","","A binary operation: `a + b`, `a * b`.",null,null],[12,"attrs","","",10,null],[12,"left","","",10,null],[12,"op","","",10,null],[12,"right","","",10,null],[3,"ExprBlock","","A blocked scope: `{ ... }`.",null,null],[3,"ExprBox","","A box expression: `box f`.",null,null],[3,"ExprBreak","","A `break`, with an optional label to break and an optional…",null,null],[3,"ExprCall","","A function call expression: `invoke(a, b)`.",null,null],[12,"attrs","","",11,null],[12,"func","","",11,null],[12,"paren_token","","",11,null],[12,"args","","",11,null],[3,"ExprCast","","A cast expression: `foo as f64`.",null,null],[12,"attrs","","",12,null],[12,"expr","","",12,null],[12,"as_token","","",12,null],[12,"ty","","",12,null],[3,"ExprClosure","","A closure expression: `|a, b| a + b`.",null,null],[3,"ExprContinue","","A `continue`, with an optional label.",null,null],[3,"ExprField","","Access of a named struct field (`obj.k`) or unnamed tuple…",null,null],[12,"attrs","","",13,null],[12,"base","","",13,null],[12,"dot_token","","",13,null],[12,"member","","",13,null],[3,"ExprForLoop","","A for loop: `for pat in expr { ... }`.",null,null],[3,"ExprGroup","","An expression contained within invisible delimiters.",null,null],[3,"ExprIf","","An `if` expression with an optional `else` block: `if expr…",null,null],[3,"ExprIndex","","A square bracketed indexing expression: `vector[2]`.",null,null],[12,"attrs","","",14,null],[12,"expr","","",14,null],[12,"bracket_token","","",14,null],[12,"index","","",14,null],[3,"ExprLet","","A `let` guard: `let Some(x) = opt`.",null,null],[3,"ExprLit","","A literal in place of an expression: `1`, `\"foo\"`.",null,null],[12,"attrs","","",15,null],[12,"lit","","",15,null],[3,"ExprLoop","","Conditionless loop: `loop { ... }`.",null,null],[3,"ExprMacro","","A macro invocation expression: `format!(\"{}\", q)`.",null,null],[3,"ExprMatch","","A `match` expression: `match n { Some(n) => {}, None => {}…",null,null],[3,"ExprMethodCall","","A method call expression: `x.foo::(a, b)`.",null,null],[3,"ExprParen","","A parenthesized expression: `(a + b)`.",null,null],[12,"attrs","","",16,null],[12,"paren_token","","",16,null],[12,"expr","","",16,null],[3,"ExprPath","","A path like `std::mem::replace` possibly containing…",null,null],[12,"attrs","","",17,null],[12,"qself","","",17,null],[12,"path","","",17,null],[3,"ExprRange","","A range expression: `1..2`, `1..`, `..2`, `1..=2`, `..=2`.",null,null],[3,"ExprReference","","A referencing operation: `&a` or `&mut a`.",null,null],[3,"ExprRepeat","","An array literal constructed from one repeated element:…",null,null],[3,"ExprReturn","","A `return`, with an optional value to be returned.",null,null],[3,"ExprStruct","","A struct literal expression: `Point { x: 1, y: 1 }`.",null,null],[3,"ExprTry","","A try-expression: `expr?`.",null,null],[3,"ExprTryBlock","","A try block: `try { ... }`.",null,null],[3,"ExprTuple","","A tuple expression: `(a, b, c, d)`.",null,null],[3,"ExprType","","A type ascription expression: `foo: f64`.",null,null],[3,"ExprUnary","","A unary operation: `!x`, `*x`.",null,null],[12,"attrs","","",18,null],[12,"op","","",18,null],[12,"expr","","",18,null],[3,"ExprUnsafe","","An unsafe block: `unsafe { ... }`.",null,null],[3,"ExprWhile","","A while loop: `while expr { ... }`.",null,null],[3,"ExprYield","","A yield expression: `yield expr`.",null,null],[3,"Index","","The index of an unnamed tuple struct field.",null,null],[12,"index","","",19,null],[12,"span","","",19,null],[3,"BoundLifetimes","","A set of bound lifetimes: `for<'a, 'b, 'c>`.",null,null],[12,"for_token","","",20,null],[12,"lt_token","","",20,null],[12,"lifetimes","","",20,null],[12,"gt_token","","",20,null],[3,"ConstParam","","A const generic parameter: `const LENGTH: usize`.",null,null],[12,"attrs","","",21,null],[12,"const_token","","",21,null],[12,"ident","","",21,null],[12,"colon_token","","",21,null],[12,"ty","","",21,null],[12,"eq_token","","",21,null],[12,"default","","",21,null],[3,"Generics","","Lifetimes and type parameters attached to a declaration of…",null,null],[12,"lt_token","","",22,null],[12,"params","","",22,null],[12,"gt_token","","",22,null],[12,"where_clause","","",22,null],[3,"LifetimeDef","","A lifetime definition: `'a: 'b + 'c + 'd`.",null,null],[12,"attrs","","",23,null],[12,"lifetime","","",23,null],[12,"colon_token","","",23,null],[12,"bounds","","",23,null],[3,"PredicateEq","","An equality predicate in a `where` clause (unsupported).",null,null],[12,"lhs_ty","","",24,null],[12,"eq_token","","",24,null],[12,"rhs_ty","","",24,null],[3,"PredicateLifetime","","A lifetime predicate in a `where` clause: `'a: 'b + 'c`.",null,null],[12,"lifetime","","",25,null],[12,"colon_token","","",25,null],[12,"bounds","","",25,null],[3,"PredicateType","","A type predicate in a `where` clause: `for<'c> Foo<'c>:…",null,null],[12,"lifetimes","","Any lifetimes from a `for` binding",26,null],[12,"bounded_ty","","The type being bounded",26,null],[12,"colon_token","","",26,null],[12,"bounds","","Trait and lifetime bounds (`Clone+Send+'static`)",26,null],[3,"TraitBound","","A trait used as a bound on a type parameter.",null,null],[12,"paren_token","","",27,null],[12,"modifier","","",27,null],[12,"lifetimes","","The `for<'a>` in `for<'a> Foo<&'a T>`",27,null],[12,"path","","The `Foo<&'a T>` in `for<'a> Foo<&'a T>`",27,null],[3,"TypeParam","","A generic type parameter: `T: Into`.",null,null],[12,"attrs","","",28,null],[12,"ident","","",28,null],[12,"colon_token","","",28,null],[12,"bounds","","",28,null],[12,"eq_token","","",28,null],[12,"default","","",28,null],[3,"WhereClause","","A `where` clause in a definition: `where T:…",null,null],[12,"where_token","","",29,null],[12,"predicates","","",29,null],[3,"ImplGenerics","","Returned by `Generics::split_for_impl`.",null,null],[3,"Turbofish","","Returned by `TypeGenerics::as_turbofish`.",null,null],[3,"TypeGenerics","","Returned by `Generics::split_for_impl`.",null,null],[3,"Lifetime","","A Rust lifetime: `'a`.",null,null],[12,"apostrophe","","",30,null],[12,"ident","","",30,null],[3,"LitBool","","A boolean literal: `true` or `false`.",null,null],[12,"value","","",31,null],[12,"span","","",31,null],[3,"LitByte","","A byte literal: `b'f'`.",null,null],[3,"LitByteStr","","A byte string literal: `b\"foo\"`.",null,null],[3,"LitChar","","A character literal: `'a'`.",null,null],[3,"LitFloat","","A floating point literal: `1f64` or `1.0e10f64`.",null,null],[3,"LitInt","","An integer literal: `1` or `1u16`.",null,null],[3,"LitStr","","A UTF-8 string literal: `\"foo\"`.",null,null],[3,"Macro","","A macro invocation: `println!(\"{}\", mac)`.",null,null],[12,"path","","",32,null],[12,"bang_token","","",32,null],[12,"delimiter","","",32,null],[12,"tokens","","",32,null],[3,"DataEnum","","An enum input to a `proc_macro_derive` macro.",null,null],[12,"enum_token","","",33,null],[12,"brace_token","","",33,null],[12,"variants","","",33,null],[3,"DataStruct","","A struct input to a `proc_macro_derive` macro.",null,null],[12,"struct_token","","",34,null],[12,"fields","","",34,null],[12,"semi_token","","",34,null],[3,"DataUnion","","An untagged union input to a `proc_macro_derive` macro.",null,null],[12,"union_token","","",35,null],[12,"fields","","",35,null],[3,"DeriveInput","","Data structure sent to a `proc_macro_derive` macro.",null,null],[12,"attrs","","Attributes tagged on the whole struct or enum.",36,null],[12,"vis","","Visibility of the struct or enum.",36,null],[12,"ident","","Name of the struct or enum.",36,null],[12,"generics","","Generics required to complete the definition.",36,null],[12,"data","","Data within the struct or enum.",36,null],[3,"Abi","","The binary interface of a function: `extern \"C\"`.",null,null],[12,"extern_token","","",37,null],[12,"name","","",37,null],[3,"BareFnArg","","An argument in a function type: the `usize` in `fn(usize)…",null,null],[12,"attrs","","",38,null],[12,"name","","",38,null],[12,"ty","","",38,null],[3,"TypeArray","","A fixed size array type: `[T; n]`.",null,null],[12,"bracket_token","","",39,null],[12,"elem","","",39,null],[12,"semi_token","","",39,null],[12,"len","","",39,null],[3,"TypeBareFn","","A bare function type: `fn(usize) -> bool`.",null,null],[12,"lifetimes","","",40,null],[12,"unsafety","","",40,null],[12,"abi","","",40,null],[12,"fn_token","","",40,null],[12,"paren_token","","",40,null],[12,"inputs","","",40,null],[12,"variadic","","",40,null],[12,"output","","",40,null],[3,"TypeGroup","","A type contained within invisible delimiters.",null,null],[12,"group_token","","",41,null],[12,"elem","","",41,null],[3,"TypeImplTrait","","An `impl Bound1 + Bound2 + Bound3` type where `Bound` is a…",null,null],[12,"impl_token","","",42,null],[12,"bounds","","",42,null],[3,"TypeInfer","","Indication that a type should be inferred by the compiler:…",null,null],[12,"underscore_token","","",43,null],[3,"TypeMacro","","A macro in the type position.",null,null],[12,"mac","","",44,null],[3,"TypeNever","","The never type: `!`.",null,null],[12,"bang_token","","",45,null],[3,"TypeParen","","A parenthesized type equivalent to the inner type.",null,null],[12,"paren_token","","",46,null],[12,"elem","","",46,null],[3,"TypePath","","A path like `std::slice::Iter`, optionally qualified with…",null,null],[12,"qself","","",47,null],[12,"path","","",47,null],[3,"TypePtr","","A raw pointer type: `*const T` or `*mut T`.",null,null],[12,"star_token","","",48,null],[12,"const_token","","",48,null],[12,"mutability","","",48,null],[12,"elem","","",48,null],[3,"TypeReference","","A reference type: `&'a T` or `&'a mut T`.",null,null],[12,"and_token","","",49,null],[12,"lifetime","","",49,null],[12,"mutability","","",49,null],[12,"elem","","",49,null],[3,"TypeSlice","","A dynamically sized slice type: `[T]`.",null,null],[12,"bracket_token","","",50,null],[12,"elem","","",50,null],[3,"TypeTraitObject","","A trait object type `Bound1 + Bound2 + Bound3` where…",null,null],[12,"dyn_token","","",51,null],[12,"bounds","","",51,null],[3,"TypeTuple","","A tuple type: `(A, B, C, String)`.",null,null],[12,"paren_token","","",52,null],[12,"elems","","",52,null],[3,"Variadic","","The variadic argument of a foreign function.",null,null],[12,"attrs","","",53,null],[12,"dots","","",53,null],[3,"AngleBracketedGenericArguments","","Angle bracketed arguments of a path segment: the ``…",null,null],[12,"colon2_token","","",54,null],[12,"lt_token","","",54,null],[12,"args","","",54,null],[12,"gt_token","","",54,null],[3,"Binding","","A binding (equality constraint) on an associated type:…",null,null],[12,"ident","","",55,null],[12,"eq_token","","",55,null],[12,"ty","","",55,null],[3,"Constraint","","An associated type bound: `Iterator`.",null,null],[12,"ident","","",56,null],[12,"colon_token","","",56,null],[12,"bounds","","",56,null],[3,"ParenthesizedGenericArguments","","Arguments of a function path segment: the `(A, B) -> C` in…",null,null],[12,"paren_token","","",57,null],[12,"inputs","","`(A, B)`",57,null],[12,"output","","`C`",57,null],[3,"Path","","A path at which a named item is exported:…",null,null],[12,"leading_colon","","",58,null],[12,"segments","","",58,null],[3,"PathSegment","","A segment of a path together with any path arguments on…",null,null],[12,"ident","","",59,null],[12,"arguments","","",59,null],[3,"QSelf","","The explicit Self type in a qualified path: the `T` in ` {}, None => {}…",66,null],[13,"MethodCall","","A method call expression: `x.foo::(a, b)`.",66,null],[13,"Paren","","A parenthesized expression: `(a + b)`.",66,null],[13,"Path","","A path like `std::mem::replace` possibly containing…",66,null],[13,"Range","","A range expression: `1..2`, `1..`, `..2`, `1..=2`, `..=2`.",66,null],[13,"Reference","","A referencing operation: `&a` or `&mut a`.",66,null],[13,"Repeat","","An array literal constructed from one repeated element:…",66,null],[13,"Return","","A `return`, with an optional value to be returned.",66,null],[13,"Struct","","A struct literal expression: `Point { x: 1, y: 1 }`.",66,null],[13,"Try","","A try-expression: `expr?`.",66,null],[13,"TryBlock","","A try block: `try { ... }`.",66,null],[13,"Tuple","","A tuple expression: `(a, b, c, d)`.",66,null],[13,"Type","","A type ascription expression: `foo: f64`.",66,null],[13,"Unary","","A unary operation: `!x`, `*x`.",66,null],[13,"Unsafe","","An unsafe block: `unsafe { ... }`.",66,null],[13,"Verbatim","","Tokens in expression position not interpreted by Syn.",66,null],[13,"While","","A while loop: `while expr { ... }`.",66,null],[13,"Yield","","A yield expression: `yield expr`.",66,null],[4,"Member","","A struct or tuple struct field accessed in a struct…",null,null],[13,"Named","","A named field like `self.x`.",67,null],[13,"Unnamed","","An unnamed field like `self.0`.",67,null],[4,"GenericParam","","A generic type parameter, lifetime, or const generic: `T:…",null,null],[13,"Type","","A generic type parameter: `T: Into`.",68,null],[13,"Lifetime","","A lifetime definition: `'a: 'b + 'c + 'd`.",68,null],[13,"Const","","A const generic parameter: `const LENGTH: usize`.",68,null],[4,"TraitBoundModifier","","A modifier on a trait bound, currently only used for the…",null,null],[13,"None","","",69,null],[13,"Maybe","","",69,null],[4,"TypeParamBound","","A trait or lifetime used as a bound on a type parameter.",null,null],[13,"Trait","","",70,null],[13,"Lifetime","","",70,null],[4,"WherePredicate","","A single predicate in a `where` clause: `T:…",null,null],[13,"Type","","A type predicate in a `where` clause: `for<'c> Foo<'c>:…",71,null],[13,"Lifetime","","A lifetime predicate in a `where` clause: `'a: 'b + 'c`.",71,null],[13,"Eq","","An equality predicate in a `where` clause (unsupported).",71,null],[4,"Lit","","A Rust literal such as a string or integer or boolean.",null,null],[13,"Str","","A UTF-8 string literal: `\"foo\"`.",72,null],[13,"ByteStr","","A byte string literal: `b\"foo\"`.",72,null],[13,"Byte","","A byte literal: `b'f'`.",72,null],[13,"Char","","A character literal: `'a'`.",72,null],[13,"Int","","An integer literal: `1` or `1u16`.",72,null],[13,"Float","","A floating point literal: `1f64` or `1.0e10f64`.",72,null],[13,"Bool","","A boolean literal: `true` or `false`.",72,null],[13,"Verbatim","","A raw token literal not interpreted by Syn.",72,null],[4,"StrStyle","","The style of a string literal, either plain quoted or a…",null,null],[13,"Cooked","","An ordinary string like `\"data\"`.",73,null],[13,"Raw","","A raw string like `r##\"data\"##`.",73,null],[4,"MacroDelimiter","","A grouping token that surrounds a macro body: `m!(...)` or…",null,null],[13,"Paren","","",74,null],[13,"Brace","","",74,null],[13,"Bracket","","",74,null],[4,"Data","","The storage of a struct, enum or union data structure.",null,null],[13,"Struct","","A struct input to a `proc_macro_derive` macro.",75,null],[13,"Enum","","An enum input to a `proc_macro_derive` macro.",75,null],[13,"Union","","An untagged union input to a `proc_macro_derive` macro.",75,null],[4,"BinOp","","A binary operator: `+`, `+=`, `&`.",null,null],[13,"Add","","The `+` operator (addition)",76,null],[13,"Sub","","The `-` operator (subtraction)",76,null],[13,"Mul","","The `*` operator (multiplication)",76,null],[13,"Div","","The `/` operator (division)",76,null],[13,"Rem","","The `%` operator (modulus)",76,null],[13,"And","","The `&&` operator (logical and)",76,null],[13,"Or","","The `||` operator (logical or)",76,null],[13,"BitXor","","The `^` operator (bitwise xor)",76,null],[13,"BitAnd","","The `&` operator (bitwise and)",76,null],[13,"BitOr","","The `|` operator (bitwise or)",76,null],[13,"Shl","","The `<<` operator (shift left)",76,null],[13,"Shr","","The `>>` operator (shift right)",76,null],[13,"Eq","","The `==` operator (equality)",76,null],[13,"Lt","","The `<` operator (less than)",76,null],[13,"Le","","The `<=` operator (less than or equal to)",76,null],[13,"Ne","","The `!=` operator (not equal to)",76,null],[13,"Ge","","The `>=` operator (greater than or equal to)",76,null],[13,"Gt","","The `>` operator (greater than)",76,null],[13,"AddEq","","The `+=` operator",76,null],[13,"SubEq","","The `-=` operator",76,null],[13,"MulEq","","The `*=` operator",76,null],[13,"DivEq","","The `/=` operator",76,null],[13,"RemEq","","The `%=` operator",76,null],[13,"BitXorEq","","The `^=` operator",76,null],[13,"BitAndEq","","The `&=` operator",76,null],[13,"BitOrEq","","The `|=` operator",76,null],[13,"ShlEq","","The `<<=` operator",76,null],[13,"ShrEq","","The `>>=` operator",76,null],[4,"UnOp","","A unary operator: `*`, `!`, `-`.",null,null],[13,"Deref","","The `*` operator for dereferencing",77,null],[13,"Not","","The `!` operator for logical inversion",77,null],[13,"Neg","","The `-` operator for negation",77,null],[4,"ReturnType","","Return type of a function signature.",null,null],[13,"Default","","Return type is not specified.",78,null],[13,"Type","","A particular type is returned.",78,null],[4,"Type","","The possible types that a Rust value could have.",null,null],[13,"Array","","A fixed size array type: `[T; n]`.",79,null],[13,"BareFn","","A bare function type: `fn(usize) -> bool`.",79,null],[13,"Group","","A type contained within invisible delimiters.",79,null],[13,"ImplTrait","","An `impl Bound1 + Bound2 + Bound3` type where `Bound` is a…",79,null],[13,"Infer","","Indication that a type should be inferred by the compiler:…",79,null],[13,"Macro","","A macro in the type position.",79,null],[13,"Never","","The never type: `!`.",79,null],[13,"Paren","","A parenthesized type equivalent to the inner type.",79,null],[13,"Path","","A path like `std::slice::Iter`, optionally qualified with…",79,null],[13,"Ptr","","A raw pointer type: `*const T` or `*mut T`.",79,null],[13,"Reference","","A reference type: `&'a T` or `&'a mut T`.",79,null],[13,"Slice","","A dynamically sized slice type: `[T]`.",79,null],[13,"TraitObject","","A trait object type `Bound1 + Bound2 + Bound3` where…",79,null],[13,"Tuple","","A tuple type: `(A, B, C, String)`.",79,null],[13,"Verbatim","","Tokens in type position not interpreted by Syn.",79,null],[4,"GenericArgument","","An individual generic argument, like `'a`, `T`, or `Item =…",null,null],[13,"Lifetime","","A lifetime argument.",80,null],[13,"Type","","A type argument.",80,null],[13,"Binding","","A binding (equality constraint) on an associated type: the…",80,null],[13,"Constraint","","An associated type bound: `Iterator`.",80,null],[13,"Const","","A const expression. Must be inside of a block.",80,null],[4,"PathArguments","","Angle bracketed or parenthesized arguments of a path…",null,null],[13,"None","","",81,null],[13,"AngleBracketed","","The `<'a, T>` in `std::slice::iter<'a, T>`.",81,null],[13,"Parenthesized","","The `(A, B) -> C` in `Fn(A, B) -> C`.",81,null],[5,"parse","","Parse tokens of source code into the chosen syntax tree…",null,[[["tokenstream"]],[["parse"],["result"]]]],[5,"parse2","","Parse a proc-macro2 token stream into the chosen syntax…",null,[[["tokenstream"]],[["parse"],["result"]]]],[5,"parse_str","","Parse a string of Rust code into the chosen syntax tree…",null,[[["str"]],[["parse"],["result"]]]],[0,"token","","Tokens representing Rust punctuation, keywords, and…",null,null],[3,"Underscore","syn::token","`_`",null,null],[12,"spans","","",82,null],[3,"Abstract","","`abstract`",null,null],[12,"span","","",83,null],[3,"As","","`as`",null,null],[12,"span","","",84,null],[3,"Async","","`async`",null,null],[12,"span","","",85,null],[3,"Auto","","`auto`",null,null],[12,"span","","",86,null],[3,"Await","","`await`",null,null],[12,"span","","",87,null],[3,"Become","","`become`",null,null],[12,"span","","",88,null],[3,"Box","","`box`",null,null],[12,"span","","",89,null],[3,"Break","","`break`",null,null],[12,"span","","",90,null],[3,"Const","","`const`",null,null],[12,"span","","",91,null],[3,"Continue","","`continue`",null,null],[12,"span","","",92,null],[3,"Crate","","`crate`",null,null],[12,"span","","",93,null],[3,"Default","","`default`",null,null],[12,"span","","",94,null],[3,"Do","","`do`",null,null],[12,"span","","",95,null],[3,"Dyn","","`dyn`",null,null],[12,"span","","",96,null],[3,"Else","","`else`",null,null],[12,"span","","",97,null],[3,"Enum","","`enum`",null,null],[12,"span","","",98,null],[3,"Extern","","`extern`",null,null],[12,"span","","",99,null],[3,"Final","","`final`",null,null],[12,"span","","",100,null],[3,"Fn","","`fn`",null,null],[12,"span","","",101,null],[3,"For","","`for`",null,null],[12,"span","","",102,null],[3,"If","","`if`",null,null],[12,"span","","",103,null],[3,"Impl","","`impl`",null,null],[12,"span","","",104,null],[3,"In","","`in`",null,null],[12,"span","","",105,null],[3,"Let","","`let`",null,null],[12,"span","","",106,null],[3,"Loop","","`loop`",null,null],[12,"span","","",107,null],[3,"Macro","","`macro`",null,null],[12,"span","","",108,null],[3,"Match","","`match`",null,null],[12,"span","","",109,null],[3,"Mod","","`mod`",null,null],[12,"span","","",110,null],[3,"Move","","`move`",null,null],[12,"span","","",111,null],[3,"Mut","","`mut`",null,null],[12,"span","","",112,null],[3,"Override","","`override`",null,null],[12,"span","","",113,null],[3,"Priv","","`priv`",null,null],[12,"span","","",114,null],[3,"Pub","","`pub`",null,null],[12,"span","","",115,null],[3,"Ref","","`ref`",null,null],[12,"span","","",116,null],[3,"Return","","`return`",null,null],[12,"span","","",117,null],[3,"SelfType","","`Self`",null,null],[12,"span","","",118,null],[3,"SelfValue","","`self`",null,null],[12,"span","","",119,null],[3,"Static","","`static`",null,null],[12,"span","","",120,null],[3,"Struct","","`struct`",null,null],[12,"span","","",121,null],[3,"Super","","`super`",null,null],[12,"span","","",122,null],[3,"Trait","","`trait`",null,null],[12,"span","","",123,null],[3,"Try","","`try`",null,null],[12,"span","","",124,null],[3,"Type","","`type`",null,null],[12,"span","","",125,null],[3,"Typeof","","`typeof`",null,null],[12,"span","","",126,null],[3,"Union","","`union`",null,null],[12,"span","","",127,null],[3,"Unsafe","","`unsafe`",null,null],[12,"span","","",128,null],[3,"Unsized","","`unsized`",null,null],[12,"span","","",129,null],[3,"Use","","`use`",null,null],[12,"span","","",130,null],[3,"Virtual","","`virtual`",null,null],[12,"span","","",131,null],[3,"Where","","`where`",null,null],[12,"span","","",132,null],[3,"While","","`while`",null,null],[12,"span","","",133,null],[3,"Yield","","`yield`",null,null],[12,"span","","",134,null],[3,"Add","","`+`",null,null],[12,"spans","","",135,null],[3,"AddEq","","`+=`",null,null],[12,"spans","","",136,null],[3,"And","","`&`",null,null],[12,"spans","","",137,null],[3,"AndAnd","","`&&`",null,null],[12,"spans","","",138,null],[3,"AndEq","","`&=`",null,null],[12,"spans","","",139,null],[3,"At","","`@`",null,null],[12,"spans","","",140,null],[3,"Bang","","`!`",null,null],[12,"spans","","",141,null],[3,"Caret","","`^`",null,null],[12,"spans","","",142,null],[3,"CaretEq","","`^=`",null,null],[12,"spans","","",143,null],[3,"Colon","","`:`",null,null],[12,"spans","","",144,null],[3,"Colon2","","`::`",null,null],[12,"spans","","",145,null],[3,"Comma","","`,`",null,null],[12,"spans","","",146,null],[3,"Div","","`/`",null,null],[12,"spans","","",147,null],[3,"DivEq","","`/=`",null,null],[12,"spans","","",148,null],[3,"Dollar","","`$`",null,null],[12,"spans","","",149,null],[3,"Dot","","`.`",null,null],[12,"spans","","",150,null],[3,"Dot2","","`..`",null,null],[12,"spans","","",151,null],[3,"Dot3","","`...`",null,null],[12,"spans","","",152,null],[3,"DotDotEq","","`..=`",null,null],[12,"spans","","",153,null],[3,"Eq","","`=`",null,null],[12,"spans","","",154,null],[3,"EqEq","","`==`",null,null],[12,"spans","","",155,null],[3,"Ge","","`>=`",null,null],[12,"spans","","",156,null],[3,"Gt","","`>`",null,null],[12,"spans","","",157,null],[3,"Le","","`<=`",null,null],[12,"spans","","",158,null],[3,"Lt","","`<`",null,null],[12,"spans","","",159,null],[3,"MulEq","","`*=`",null,null],[12,"spans","","",160,null],[3,"Ne","","`!=`",null,null],[12,"spans","","",161,null],[3,"Or","","`|`",null,null],[12,"spans","","",162,null],[3,"OrEq","","`|=`",null,null],[12,"spans","","",163,null],[3,"OrOr","","`||`",null,null],[12,"spans","","",164,null],[3,"Pound","","`#`",null,null],[12,"spans","","",165,null],[3,"Question","","`?`",null,null],[12,"spans","","",166,null],[3,"RArrow","","`->`",null,null],[12,"spans","","",167,null],[3,"LArrow","","`<-`",null,null],[12,"spans","","",168,null],[3,"Rem","","`%`",null,null],[12,"spans","","",169,null],[3,"RemEq","","`%=`",null,null],[12,"spans","","",170,null],[3,"FatArrow","","`=>`",null,null],[12,"spans","","",171,null],[3,"Semi","","`;`",null,null],[12,"spans","","",172,null],[3,"Shl","","`<<`",null,null],[12,"spans","","",173,null],[3,"ShlEq","","`<<=`",null,null],[12,"spans","","",174,null],[3,"Shr","","`>>`",null,null],[12,"spans","","",175,null],[3,"ShrEq","","`>>=`",null,null],[12,"spans","","",176,null],[3,"Star","","`*`",null,null],[12,"spans","","",177,null],[3,"Sub","","`-`",null,null],[12,"spans","","",178,null],[3,"SubEq","","`-=`",null,null],[12,"spans","","",179,null],[3,"Tilde","","`~`",null,null],[12,"spans","","",180,null],[3,"Brace","","`{...}`",null,null],[12,"span","","",181,null],[3,"Bracket","","`[...]`",null,null],[12,"span","","",182,null],[3,"Paren","","`(...)`",null,null],[12,"span","","",183,null],[3,"Group","","None-delimited group",null,null],[12,"span","","",184,null],[8,"Token","","Marker trait for types that represent single tokens.",null,null],[11,"surround","","",181,[[["tokenstream"],["self"],["f"]]]],[11,"surround","","",182,[[["tokenstream"],["self"],["f"]]]],[11,"surround","","",183,[[["tokenstream"],["self"],["f"]]]],[11,"surround","","",184,[[["tokenstream"],["self"],["f"]]]],[11,"parse_meta","syn","Parses the content of the attribute, consisting of the…",0,[[["self"]],[["meta"],["result",["meta"]]]]],[11,"parse_args","","Parse the arguments to the attribute as a syntax tree.",0,[[["self"]],[["parse"],["result"]]]],[11,"parse_args_with","","Parse the arguments to the attribute using the given parser.",0,[[["self"],["parser"]],["result"]]],[11,"parse_outer","","Parses zero or more outer attributes from the stream.",0,[[["parsestream"]],[["result",["vec"]],["vec"]]]],[11,"parse_inner","","Parses zero or more inner attributes from the stream.",0,[[["parsestream"]],[["result",["vec"]],["vec"]]]],[11,"path","","Returns the identifier that begins this structured meta…",62,[[["self"]],["path"]]],[11,"parse_named","","Parses a named (braced struct) field.",3,[[["parsestream"]],["result"]]],[11,"parse_unnamed","","Parses an unnamed (tuple struct) field.",3,[[["parsestream"]],["result"]]],[11,"iter","","Get an iterator over the borrowed [`Field`] items in this…",64,[[["self"]],[["field"],["iter",["field"]]]]],[11,"iter_mut","","Get an iterator over the mutably borrowed [`Field`] items…",64,[[["self"]],[["field"],["itermut",["field"]]]]],[11,"len","","Returns the number of fields.",64,[[["self"]],["usize"]]],[11,"is_empty","","Returns `true` if there are zero fields.",64,[[["self"]],["bool"]]],[11,"type_params","","Returns an Iterator over the type…",22,[[["self"]],["typeparams"]]],[11,"type_params_mut","","Returns an Iterator over the type…",22,[[["self"]],["typeparamsmut"]]],[11,"lifetimes","","Returns an Iterator over the lifetime…",22,[[["self"]],["lifetimes"]]],[11,"lifetimes_mut","","Returns an Iterator over the…",22,[[["self"]],["lifetimesmut"]]],[11,"const_params","","Returns an Iterator over the constant…",22,[[["self"]],["constparams"]]],[11,"const_params_mut","","Returns an Iterator over the…",22,[[["self"]],["constparamsmut"]]],[11,"make_where_clause","","Initializes an empty `where`-clause if there is not one…",22,[[["self"]],["whereclause"]]],[11,"split_for_impl","","Split a type's generics into the pieces required for…",22,[[["self"]]]],[11,"as_turbofish","","Turn a type's generics like `` into a turbofish like…",185,[[["self"]],["turbofish"]]],[11,"new","","",23,[[["lifetime"]],["self"]]],[11,"new","","Panics",30,[[["str"],["span"]],["self"]]],[11,"new","","Interpret a Syn literal from a proc-macro2 literal.",72,[[["literal"]],["self"]]],[11,"new","","",186,[[["str"],["span"]],["self"]]],[11,"value","","",186,[[["self"]],["string"]]],[11,"parse","","Parse a syntax tree node from the content of this string…",186,[[["self"]],[["parse"],["result"]]]],[11,"parse_with","","Invoke parser on the content of this string literal.",186,[[["self"],["parser"]],["result"]]],[11,"span","","",186,[[["self"]],["span"]]],[11,"set_span","","",186,[[["self"],["span"]]]],[11,"suffix","","",186,[[["self"]],["str"]]],[11,"new","","",187,[[["span"]],["self"]]],[11,"value","","",187,[[["self"]],[["vec",["u8"]],["u8"]]]],[11,"span","","",187,[[["self"]],["span"]]],[11,"set_span","","",187,[[["self"],["span"]]]],[11,"new","","",188,[[["span"],["u8"]],["self"]]],[11,"value","","",188,[[["self"]],["u8"]]],[11,"span","","",188,[[["self"]],["span"]]],[11,"set_span","","",188,[[["self"],["span"]]]],[11,"new","","",189,[[["char"],["span"]],["self"]]],[11,"value","","",189,[[["self"]],["char"]]],[11,"span","","",189,[[["self"]],["span"]]],[11,"set_span","","",189,[[["self"],["span"]]]],[11,"new","","",190,[[["str"],["span"]],["self"]]],[11,"base10_digits","","",190,[[["self"]],["str"]]],[11,"base10_parse","","Parses the literal into a selected number type.",190,[[["self"]],["result"]]],[11,"suffix","","",190,[[["self"]],["str"]]],[11,"span","","",190,[[["self"]],["span"]]],[11,"set_span","","",190,[[["self"],["span"]]]],[11,"new","","",191,[[["str"],["span"]],["self"]]],[11,"base10_digits","","",191,[[["self"]],["str"]]],[11,"base10_parse","","",191,[[["self"]],["result"]]],[11,"suffix","","",191,[[["self"]],["str"]]],[11,"span","","",191,[[["self"]],["span"]]],[11,"set_span","","",191,[[["self"],["span"]]]],[11,"parse_body","","Parse the tokens within the macro invocation's delimiters…",32,[[["self"]],[["parse"],["result"]]]],[11,"parse_body_with","","Parse the tokens within the macro invocation's delimiters…",32,[[["self"],["parser"]],["result"]]],[11,"without_plus","","In some positions, types may not contain the `+`…",79,[[["parsestream"]],["result"]]],[11,"without_plus","","",78,[[["parsestream"]],["result"]]],[11,"parse","","",78,[[["bool"],["parsestream"]],["result"]]],[11,"without_plus","","",51,[[["parsestream"]],["result"]]],[11,"parse","","",51,[[["bool"],["parsestream"]],["result"]]],[11,"parse_mod_style","","Parse a `Path` containing no path arguments on any of its…",58,[[["parsestream"]],["result"]]],[11,"is_ident","","Determines whether this is a path of length 1 equal to the…",58,[[["i"],["self"]],["bool"]]],[11,"get_ident","","If this path consists of a single ident, returns the ident.",58,[[["self"]],[["ident"],["option",["ident"]]]]],[11,"is_empty","","",81,[[["self"]],["bool"]]],[0,"buffer","","A stably addressed token buffer supporting efficient…",null,null],[3,"TokenBuffer","syn::buffer","A buffer that can be efficiently traversed multiple times,…",null,null],[3,"Cursor","","A cheaply copyable cursor into a `TokenBuffer`.",null,null],[11,"new","","Creates a `TokenBuffer` containing all the tokens from the…",192,[[["tokenstream"]],["tokenbuffer"]]],[11,"new2","","Creates a `TokenBuffer` containing all the tokens from the…",192,[[["tokenstream"]],["tokenbuffer"]]],[11,"begin","","Creates a cursor referencing the first token in the buffer…",192,[[["self"]],["cursor"]]],[11,"empty","","Creates a cursor referencing a static empty TokenStream.",193,[[],["self"]]],[11,"eof","","Checks whether the cursor is currently pointing at the end…",193,[[],["bool"]]],[11,"group","","If the cursor is pointing at a `Group` with the given…",193,[[["delimiter"]],["option"]]],[11,"ident","","If the cursor is pointing at a `Ident`, returns it along…",193,[[],["option"]]],[11,"punct","","If the cursor is pointing at an `Punct`, returns it along…",193,[[],["option"]]],[11,"literal","","If the cursor is pointing at a `Literal`, return it along…",193,[[],["option"]]],[11,"lifetime","","If the cursor is pointing at a `Lifetime`, returns it…",193,[[],["option"]]],[11,"token_stream","","Copies all remaining tokens visible from this cursor into…",193,[[],["tokenstream"]]],[11,"token_tree","","If the cursor is pointing at a `TokenTree`, returns it…",193,[[],["option"]]],[11,"span","","Returns the `Span` of the current token, or…",193,[[],["span"]]],[0,"ext","syn","Extension traits to provide parsing methods on foreign…",null,null],[8,"IdentExt","syn::ext","Additional methods for `Ident` not provided by proc-macro2…",null,null],[10,"parse_any","","Parses any identifier including keywords.",194,[[["parsestream"]],["result"]]],[18,"peek_any","","Peeks any identifier including keywords. Usage:…",194,null],[10,"unraw","","Strips the raw marker `r#`, if any, from the beginning of…",194,[[["self"]],["ident"]]],[0,"punctuated","syn","A punctuated sequence of syntax tree nodes separated by…",null,null],[3,"Punctuated","syn::punctuated","A punctuated sequence of syntax tree nodes of type `T`…",null,null],[3,"Pairs","","An iterator over borrowed pairs of type `Pair<&T, &P>`.",null,null],[3,"PairsMut","","An iterator over mutably borrowed pairs of type `Pair<&mut…",null,null],[3,"IntoPairs","","An iterator over owned pairs of type `Pair`.",null,null],[3,"IntoIter","","An iterator over owned values of type `T`.",null,null],[3,"Iter","","An iterator over borrowed values of type `&T`.",null,null],[3,"IterMut","","An iterator over mutably borrowed values of type `&mut T`.",null,null],[4,"Pair","","A single syntax tree node of type `T` followed by its…",null,null],[13,"Punctuated","","",195,null],[13,"End","","",195,null],[11,"new","","Creates an empty punctuated sequence.",196,[[],["punctuated"]]],[11,"is_empty","","Determines whether this punctuated sequence is empty,…",196,[[["self"]],["bool"]]],[11,"len","","Returns the number of syntax tree nodes in this punctuated…",196,[[["self"]],["usize"]]],[11,"first","","Borrows the first element in this sequence.",196,[[["self"]],[["t"],["option"]]]],[11,"last","","Borrows the last element in this sequence.",196,[[["self"]],[["t"],["option"]]]],[11,"last_mut","","Mutably borrows the last element in this sequence.",196,[[["self"]],[["option"],["t"]]]],[11,"iter","","Returns an iterator over borrowed syntax tree nodes of…",196,[[["self"]],["iter"]]],[11,"iter_mut","","Returns an iterator over mutably borrowed syntax tree…",196,[[["self"]],["itermut"]]],[11,"pairs","","Returns an iterator over the contents of this sequence as…",196,[[["self"]],["pairs"]]],[11,"pairs_mut","","Returns an iterator over the contents of this sequence as…",196,[[["self"]],["pairsmut"]]],[11,"into_pairs","","Returns an iterator over the contents of this sequence as…",196,[[],["intopairs"]]],[11,"push_value","","Appends a syntax tree node onto the end of this punctuated…",196,[[["self"],["t"]]]],[11,"push_punct","","Appends a trailing punctuation onto the end of this…",196,[[["self"],["p"]]]],[11,"pop","","Removes the last punctuated pair from this sequence, or…",196,[[["self"]],[["pair"],["option",["pair"]]]]],[11,"trailing_punct","","Determines whether this punctuated sequence ends with a…",196,[[["self"]],["bool"]]],[11,"empty_or_trailing","","Returns true if either this `Punctuated` is empty, or it…",196,[[["self"]],["bool"]]],[11,"push","","Appends a syntax tree node onto the end of this punctuated…",196,[[["self"],["t"]]]],[11,"insert","","Inserts an element at position `index`.",196,[[["self"],["usize"],["t"]]]],[11,"parse_terminated","","Parses zero or more occurrences of `T` separated by…",196,[[["parsestream"]],["result"]]],[11,"parse_terminated_with","","Parses zero or more occurrences of `T` using the given…",196,[[["parsestream"]],["result"]]],[11,"parse_separated_nonempty","","Parses one or more occurrences of `T` separated by…",196,[[["parsestream"]],["result"]]],[11,"parse_separated_nonempty_with","","Parses one or more occurrences of `T` using the given…",196,[[["parsestream"]],["result"]]],[11,"into_value","","Extracts the syntax tree node from this punctuated pair,…",195,[[],["t"]]],[11,"value","","Borrows the syntax tree node from this punctuated pair.",195,[[["self"]],["t"]]],[11,"value_mut","","Mutably borrows the syntax tree node from this punctuated…",195,[[["self"]],["t"]]],[11,"punct","","Borrows the punctuation from this punctuated pair, unless…",195,[[["self"]],[["option"],["p"]]]],[11,"new","","Creates a punctuated pair out of a syntax tree node and an…",195,[[["t"],["option"]],["self"]]],[11,"into_tuple","","Produces this punctuated pair as a tuple of syntax tree…",195,[[]]],[0,"spanned","syn","A trait that can provide the `Span` of the complete…",null,null],[8,"Spanned","syn::spanned","A trait that can provide the `Span` of the complete…",null,null],[10,"span","","Returns a `Span` covering the complete contents of this…",197,[[["self"]],["span"]]],[0,"visit","syn","Syntax tree traversal to walk a shared borrow of a syntax…",null,null],[5,"visit_abi","syn::visit","",null,[[["v"],["abi"]]]],[5,"visit_angle_bracketed_generic_arguments","","",null,[[["anglebracketedgenericarguments"],["v"]]]],[5,"visit_attr_style","","",null,[[["attrstyle"],["v"]]]],[5,"visit_attribute","","",null,[[["attribute"],["v"]]]],[5,"visit_bare_fn_arg","","",null,[[["v"],["barefnarg"]]]],[5,"visit_bin_op","","",null,[[["v"],["binop"]]]],[5,"visit_binding","","",null,[[["v"],["binding"]]]],[5,"visit_bound_lifetimes","","",null,[[["v"],["boundlifetimes"]]]],[5,"visit_const_param","","",null,[[["constparam"],["v"]]]],[5,"visit_constraint","","",null,[[["constraint"],["v"]]]],[5,"visit_data","","",null,[[["v"],["data"]]]],[5,"visit_data_enum","","",null,[[["v"],["dataenum"]]]],[5,"visit_data_struct","","",null,[[["v"],["datastruct"]]]],[5,"visit_data_union","","",null,[[["v"],["dataunion"]]]],[5,"visit_derive_input","","",null,[[["v"],["deriveinput"]]]],[5,"visit_expr","","",null,[[["expr"],["v"]]]],[5,"visit_expr_binary","","",null,[[["exprbinary"],["v"]]]],[5,"visit_expr_call","","",null,[[["exprcall"],["v"]]]],[5,"visit_expr_cast","","",null,[[["v"],["exprcast"]]]],[5,"visit_expr_field","","",null,[[["exprfield"],["v"]]]],[5,"visit_expr_index","","",null,[[["v"],["exprindex"]]]],[5,"visit_expr_lit","","",null,[[["exprlit"],["v"]]]],[5,"visit_expr_paren","","",null,[[["v"],["exprparen"]]]],[5,"visit_expr_path","","",null,[[["v"],["exprpath"]]]],[5,"visit_expr_unary","","",null,[[["v"],["exprunary"]]]],[5,"visit_field","","",null,[[["field"],["v"]]]],[5,"visit_fields","","",null,[[["fields"],["v"]]]],[5,"visit_fields_named","","",null,[[["v"],["fieldsnamed"]]]],[5,"visit_fields_unnamed","","",null,[[["fieldsunnamed"],["v"]]]],[5,"visit_generic_argument","","",null,[[["genericargument"],["v"]]]],[5,"visit_generic_param","","",null,[[["v"],["genericparam"]]]],[5,"visit_generics","","",null,[[["v"],["generics"]]]],[5,"visit_ident","","",null,[[["v"],["ident"]]]],[5,"visit_index","","",null,[[["index"],["v"]]]],[5,"visit_lifetime","","",null,[[["lifetime"],["v"]]]],[5,"visit_lifetime_def","","",null,[[["v"],["lifetimedef"]]]],[5,"visit_lit","","",null,[[["lit"],["v"]]]],[5,"visit_lit_bool","","",null,[[["litbool"],["v"]]]],[5,"visit_lit_byte","","",null,[[["litbyte"],["v"]]]],[5,"visit_lit_byte_str","","",null,[[["litbytestr"],["v"]]]],[5,"visit_lit_char","","",null,[[["v"],["litchar"]]]],[5,"visit_lit_float","","",null,[[["v"],["litfloat"]]]],[5,"visit_lit_int","","",null,[[["litint"],["v"]]]],[5,"visit_lit_str","","",null,[[["v"],["litstr"]]]],[5,"visit_macro","","",null,[[["macro"],["v"]]]],[5,"visit_macro_delimiter","","",null,[[["v"],["macrodelimiter"]]]],[5,"visit_member","","",null,[[["member"],["v"]]]],[5,"visit_meta","","",null,[[["meta"],["v"]]]],[5,"visit_meta_list","","",null,[[["v"],["metalist"]]]],[5,"visit_meta_name_value","","",null,[[["v"],["metanamevalue"]]]],[5,"visit_nested_meta","","",null,[[["nestedmeta"],["v"]]]],[5,"visit_parenthesized_generic_arguments","","",null,[[["v"],["parenthesizedgenericarguments"]]]],[5,"visit_path","","",null,[[["v"],["path"]]]],[5,"visit_path_arguments","","",null,[[["v"],["patharguments"]]]],[5,"visit_path_segment","","",null,[[["v"],["pathsegment"]]]],[5,"visit_predicate_eq","","",null,[[["v"],["predicateeq"]]]],[5,"visit_predicate_lifetime","","",null,[[["predicatelifetime"],["v"]]]],[5,"visit_predicate_type","","",null,[[["v"],["predicatetype"]]]],[5,"visit_qself","","",null,[[["qself"],["v"]]]],[5,"visit_return_type","","",null,[[["returntype"],["v"]]]],[5,"visit_span","","",null,[[["span"],["v"]]]],[5,"visit_trait_bound","","",null,[[["traitbound"],["v"]]]],[5,"visit_trait_bound_modifier","","",null,[[["v"],["traitboundmodifier"]]]],[5,"visit_type","","",null,[[["v"],["type"]]]],[5,"visit_type_array","","",null,[[["v"],["typearray"]]]],[5,"visit_type_bare_fn","","",null,[[["v"],["typebarefn"]]]],[5,"visit_type_group","","",null,[[["typegroup"],["v"]]]],[5,"visit_type_impl_trait","","",null,[[["v"],["typeimpltrait"]]]],[5,"visit_type_infer","","",null,[[["v"],["typeinfer"]]]],[5,"visit_type_macro","","",null,[[["v"],["typemacro"]]]],[5,"visit_type_never","","",null,[[["v"],["typenever"]]]],[5,"visit_type_param","","",null,[[["typeparam"],["v"]]]],[5,"visit_type_param_bound","","",null,[[["v"],["typeparambound"]]]],[5,"visit_type_paren","","",null,[[["typeparen"],["v"]]]],[5,"visit_type_path","","",null,[[["v"],["typepath"]]]],[5,"visit_type_ptr","","",null,[[["v"],["typeptr"]]]],[5,"visit_type_reference","","",null,[[["v"],["typereference"]]]],[5,"visit_type_slice","","",null,[[["typeslice"],["v"]]]],[5,"visit_type_trait_object","","",null,[[["v"],["typetraitobject"]]]],[5,"visit_type_tuple","","",null,[[["typetuple"],["v"]]]],[5,"visit_un_op","","",null,[[["v"],["unop"]]]],[5,"visit_variadic","","",null,[[["v"],["variadic"]]]],[5,"visit_variant","","",null,[[["variant"],["v"]]]],[5,"visit_vis_crate","","",null,[[["v"],["viscrate"]]]],[5,"visit_vis_public","","",null,[[["v"],["vispublic"]]]],[5,"visit_vis_restricted","","",null,[[["v"],["visrestricted"]]]],[5,"visit_visibility","","",null,[[["v"],["visibility"]]]],[5,"visit_where_clause","","",null,[[["whereclause"],["v"]]]],[5,"visit_where_predicate","","",null,[[["wherepredicate"],["v"]]]],[8,"Visit","","Syntax tree traversal to walk a shared borrow of a syntax…",null,null],[11,"visit_abi","","",198,[[["self"],["abi"]]]],[11,"visit_angle_bracketed_generic_arguments","","",198,[[["anglebracketedgenericarguments"],["self"]]]],[11,"visit_attr_style","","",198,[[["attrstyle"],["self"]]]],[11,"visit_attribute","","",198,[[["self"],["attribute"]]]],[11,"visit_bare_fn_arg","","",198,[[["self"],["barefnarg"]]]],[11,"visit_bin_op","","",198,[[["self"],["binop"]]]],[11,"visit_binding","","",198,[[["self"],["binding"]]]],[11,"visit_bound_lifetimes","","",198,[[["self"],["boundlifetimes"]]]],[11,"visit_const_param","","",198,[[["self"],["constparam"]]]],[11,"visit_constraint","","",198,[[["self"],["constraint"]]]],[11,"visit_data","","",198,[[["self"],["data"]]]],[11,"visit_data_enum","","",198,[[["self"],["dataenum"]]]],[11,"visit_data_struct","","",198,[[["self"],["datastruct"]]]],[11,"visit_data_union","","",198,[[["self"],["dataunion"]]]],[11,"visit_derive_input","","",198,[[["self"],["deriveinput"]]]],[11,"visit_expr","","",198,[[["self"],["expr"]]]],[11,"visit_expr_binary","","",198,[[["exprbinary"],["self"]]]],[11,"visit_expr_call","","",198,[[["exprcall"],["self"]]]],[11,"visit_expr_cast","","",198,[[["self"],["exprcast"]]]],[11,"visit_expr_field","","",198,[[["self"],["exprfield"]]]],[11,"visit_expr_index","","",198,[[["self"],["exprindex"]]]],[11,"visit_expr_lit","","",198,[[["self"],["exprlit"]]]],[11,"visit_expr_paren","","",198,[[["self"],["exprparen"]]]],[11,"visit_expr_path","","",198,[[["self"],["exprpath"]]]],[11,"visit_expr_unary","","",198,[[["self"],["exprunary"]]]],[11,"visit_field","","",198,[[["field"],["self"]]]],[11,"visit_fields","","",198,[[["self"],["fields"]]]],[11,"visit_fields_named","","",198,[[["self"],["fieldsnamed"]]]],[11,"visit_fields_unnamed","","",198,[[["fieldsunnamed"],["self"]]]],[11,"visit_generic_argument","","",198,[[["genericargument"],["self"]]]],[11,"visit_generic_param","","",198,[[["self"],["genericparam"]]]],[11,"visit_generics","","",198,[[["self"],["generics"]]]],[11,"visit_ident","","",198,[[["self"],["ident"]]]],[11,"visit_index","","",198,[[["index"],["self"]]]],[11,"visit_lifetime","","",198,[[["lifetime"],["self"]]]],[11,"visit_lifetime_def","","",198,[[["self"],["lifetimedef"]]]],[11,"visit_lit","","",198,[[["self"],["lit"]]]],[11,"visit_lit_bool","","",198,[[["litbool"],["self"]]]],[11,"visit_lit_byte","","",198,[[["litbyte"],["self"]]]],[11,"visit_lit_byte_str","","",198,[[["self"],["litbytestr"]]]],[11,"visit_lit_char","","",198,[[["self"],["litchar"]]]],[11,"visit_lit_float","","",198,[[["self"],["litfloat"]]]],[11,"visit_lit_int","","",198,[[["litint"],["self"]]]],[11,"visit_lit_str","","",198,[[["self"],["litstr"]]]],[11,"visit_macro","","",198,[[["self"],["macro"]]]],[11,"visit_macro_delimiter","","",198,[[["self"],["macrodelimiter"]]]],[11,"visit_member","","",198,[[["member"],["self"]]]],[11,"visit_meta","","",198,[[["meta"],["self"]]]],[11,"visit_meta_list","","",198,[[["self"],["metalist"]]]],[11,"visit_meta_name_value","","",198,[[["self"],["metanamevalue"]]]],[11,"visit_nested_meta","","",198,[[["nestedmeta"],["self"]]]],[11,"visit_parenthesized_generic_arguments","","",198,[[["self"],["parenthesizedgenericarguments"]]]],[11,"visit_path","","",198,[[["self"],["path"]]]],[11,"visit_path_arguments","","",198,[[["self"],["patharguments"]]]],[11,"visit_path_segment","","",198,[[["self"],["pathsegment"]]]],[11,"visit_predicate_eq","","",198,[[["self"],["predicateeq"]]]],[11,"visit_predicate_lifetime","","",198,[[["self"],["predicatelifetime"]]]],[11,"visit_predicate_type","","",198,[[["self"],["predicatetype"]]]],[11,"visit_qself","","",198,[[["self"],["qself"]]]],[11,"visit_return_type","","",198,[[["returntype"],["self"]]]],[11,"visit_span","","",198,[[["self"],["span"]]]],[11,"visit_trait_bound","","",198,[[["self"],["traitbound"]]]],[11,"visit_trait_bound_modifier","","",198,[[["self"],["traitboundmodifier"]]]],[11,"visit_type","","",198,[[["self"],["type"]]]],[11,"visit_type_array","","",198,[[["self"],["typearray"]]]],[11,"visit_type_bare_fn","","",198,[[["self"],["typebarefn"]]]],[11,"visit_type_group","","",198,[[["self"],["typegroup"]]]],[11,"visit_type_impl_trait","","",198,[[["self"],["typeimpltrait"]]]],[11,"visit_type_infer","","",198,[[["self"],["typeinfer"]]]],[11,"visit_type_macro","","",198,[[["self"],["typemacro"]]]],[11,"visit_type_never","","",198,[[["self"],["typenever"]]]],[11,"visit_type_param","","",198,[[["typeparam"],["self"]]]],[11,"visit_type_param_bound","","",198,[[["self"],["typeparambound"]]]],[11,"visit_type_paren","","",198,[[["self"],["typeparen"]]]],[11,"visit_type_path","","",198,[[["self"],["typepath"]]]],[11,"visit_type_ptr","","",198,[[["self"],["typeptr"]]]],[11,"visit_type_reference","","",198,[[["self"],["typereference"]]]],[11,"visit_type_slice","","",198,[[["self"],["typeslice"]]]],[11,"visit_type_trait_object","","",198,[[["self"],["typetraitobject"]]]],[11,"visit_type_tuple","","",198,[[["self"],["typetuple"]]]],[11,"visit_un_op","","",198,[[["self"],["unop"]]]],[11,"visit_variadic","","",198,[[["self"],["variadic"]]]],[11,"visit_variant","","",198,[[["variant"],["self"]]]],[11,"visit_vis_crate","","",198,[[["self"],["viscrate"]]]],[11,"visit_vis_public","","",198,[[["self"],["vispublic"]]]],[11,"visit_vis_restricted","","",198,[[["self"],["visrestricted"]]]],[11,"visit_visibility","","",198,[[["self"],["visibility"]]]],[11,"visit_where_clause","","",198,[[["whereclause"],["self"]]]],[11,"visit_where_predicate","","",198,[[["wherepredicate"],["self"]]]],[0,"parse","syn","Parsing interface for parsing a token stream into a syntax…",null,null],[3,"Error","syn::parse","Error returned when a Syn parser cannot parse the input…",null,null],[3,"Lookahead1","","Support for checking the next token in a stream to decide…",null,null],[3,"ParseBuffer","","Cursor position within a buffered token stream.",null,null],[3,"StepCursor","","Cursor state associated with speculative parsing.",null,null],[3,"Nothing","","An empty syntax tree node that consumes no tokens when…",null,null],[0,"discouraged","","Extensions to the parsing API with niche applicability.",null,null],[8,"Speculative","syn::parse::discouraged","Extensions to the `ParseStream` API to support speculative…",null,null],[10,"advance_to","","Advance this parse stream to the position of a forked…",199,[[["self"]]]],[6,"Result","syn::parse","The result of a Syn parser.",null,null],[6,"ParseStream","","Input to a Syn parser function.",null,null],[8,"Peek","","Types that can be parsed by looking at just one token.",null,null],[8,"Parse","","Parsing interface implemented by all types that can be…",null,null],[10,"parse","","",200,[[["parsestream"]],["result"]]],[8,"Parser","","Parser that can parse Rust tokens into a particular syntax…",null,null],[16,"Output","","",201,null],[10,"parse2","","Parse a proc-macro2 token stream into the chosen syntax…",201,[[["tokenstream"]],["result"]]],[11,"parse","","Parse tokens of source code into the chosen syntax tree…",201,[[["tokenstream"]],["result"]]],[11,"parse_str","","Parse a string of Rust code into the chosen syntax tree…",201,[[["str"]],["result"]]],[11,"error","","Triggers an error at the current position of the parse…",202,[[["display"]],["error"]]],[11,"parse","","Parses a syntax tree node of type `T`, advancing the…",203,[[["self"]],[["parse"],["result"]]]],[11,"call","","Calls the given parser function to parse a syntax tree…",203,[[["self"]],["result"]]],[11,"peek","","Looks at the next token in the parse stream to determine…",203,[[["self"],["peek"]],["bool"]]],[11,"peek2","","Looks at the second-next token in the parse stream.",203,[[["self"],["peek"]],["bool"]]],[11,"peek3","","Looks at the third-next token in the parse stream.",203,[[["self"],["peek"]],["bool"]]],[11,"parse_terminated","","Parses zero or more occurrences of `T` separated by…",203,[[["self"]],[["punctuated"],["result",["punctuated"]]]]],[11,"is_empty","","Returns whether there are tokens remaining in this stream.",203,[[["self"]],["bool"]]],[11,"lookahead1","","Constructs a helper for peeking at the next token in this…",203,[[["self"]],["lookahead1"]]],[11,"fork","","Forks a parse stream so that parsing tokens out of either…",203,[[["self"]],["self"]]],[11,"error","","Triggers an error at the current position of the parse…",203,[[["self"],["display"]],["error"]]],[11,"step","","Speculatively parses tokens from this parse stream,…",203,[[["self"],["f"]],["result"]]],[11,"span","","Returns the `Span` of the next token in the parse stream,…",203,[[["self"]],["span"]]],[11,"cursor","","Provides low-level access to the token representation…",203,[[["self"]],["cursor"]]],[11,"new","syn","Usually the [`ParseStream::error`] method will be used…",204,[[["display"],["span"]],["self"]]],[11,"new_spanned","","Creates an error with the specified message spanning the…",204,[[["totokens"],["display"]],["self"]]],[11,"span","","The source location of the error.",204,[[["self"]],["span"]]],[11,"to_compile_error","","Render the error as an invocation of [`compile_error!`].",204,[[["self"]],["tokenstream"]]],[11,"combine","","Add another error message to self such that when…",204,[[["self"],["error"]]]],[6,"AttributeArgs","","Conventional argument type associated with an invocation…",null,null],[6,"Result","","The result of a Syn parser.",null,null],[14,"parenthesized","","Parse a set of parentheses and expose their content to…",null,null],[14,"braced","","Parse a set of curly braces and expose their content to…",null,null],[14,"bracketed","","Parse a set of square brackets and expose their content to…",null,null],[14,"Token","","A type-macro that expands to the name of the Rust type…",null,null],[14,"parse_quote","","Quasi-quotation macro that accepts input like the…",null,null],[14,"parse_macro_input","","Parse the input TokenStream of a macro, triggering a…",null,null],[14,"custom_keyword","","Define a type that supports parsing and printing a given…",null,null],[14,"custom_punctuation","","Define a type that supports parsing and printing a…",null,null],[11,"peek","","",205,[[["cursor"]],["bool"]]],[11,"display","","",205,[[],["str"]]],[11,"span","","",205,[[["self"]],["span"]]],[11,"from","","",205,[[["t"]],["t"]]],[11,"into","","",205,[[],["u"]]],[11,"to_owned","","",205,[[["self"]],["t"]]],[11,"clone_into","","",205,[[["self"],["t"]]]],[11,"to_string","","",205,[[["self"]],["string"]]],[11,"try_from","","",205,[[["u"]],["result"]]],[11,"try_into","","",205,[[],["result"]]],[11,"borrow","","",205,[[["self"]],["t"]]],[11,"borrow_mut","","",205,[[["self"]],["t"]]],[11,"type_id","","",205,[[["self"]],["typeid"]]],[11,"span","","",0,[[["self"]],["span"]]],[11,"from","","",0,[[["t"]],["t"]]],[11,"into","","",0,[[],["u"]]],[11,"to_owned","","",0,[[["self"]],["t"]]],[11,"clone_into","","",0,[[["self"],["t"]]]],[11,"try_from","","",0,[[["u"]],["result"]]],[11,"try_into","","",0,[[],["result"]]],[11,"borrow","","",0,[[["self"]],["t"]]],[11,"borrow_mut","","",0,[[["self"]],["t"]]],[11,"type_id","","",0,[[["self"]],["typeid"]]],[11,"span","","",1,[[["self"]],["span"]]],[11,"from","","",1,[[["t"]],["t"]]],[11,"into","","",1,[[],["u"]]],[11,"to_owned","","",1,[[["self"]],["t"]]],[11,"clone_into","","",1,[[["self"],["t"]]]],[11,"try_from","","",1,[[["u"]],["result"]]],[11,"try_into","","",1,[[],["result"]]],[11,"borrow","","",1,[[["self"]],["t"]]],[11,"borrow_mut","","",1,[[["self"]],["t"]]],[11,"type_id","","",1,[[["self"]],["typeid"]]],[11,"span","","",2,[[["self"]],["span"]]],[11,"from","","",2,[[["t"]],["t"]]],[11,"into","","",2,[[],["u"]]],[11,"to_owned","","",2,[[["self"]],["t"]]],[11,"clone_into","","",2,[[["self"],["t"]]]],[11,"try_from","","",2,[[["u"]],["result"]]],[11,"try_into","","",2,[[],["result"]]],[11,"borrow","","",2,[[["self"]],["t"]]],[11,"borrow_mut","","",2,[[["self"]],["t"]]],[11,"type_id","","",2,[[["self"]],["typeid"]]],[11,"span","","",3,[[["self"]],["span"]]],[11,"from","","",3,[[["t"]],["t"]]],[11,"into","","",3,[[],["u"]]],[11,"to_owned","","",3,[[["self"]],["t"]]],[11,"clone_into","","",3,[[["self"],["t"]]]],[11,"try_from","","",3,[[["u"]],["result"]]],[11,"try_into","","",3,[[],["result"]]],[11,"borrow","","",3,[[["self"]],["t"]]],[11,"borrow_mut","","",3,[[["self"]],["t"]]],[11,"type_id","","",3,[[["self"]],["typeid"]]],[11,"span","","",4,[[["self"]],["span"]]],[11,"from","","",4,[[["t"]],["t"]]],[11,"into","","",4,[[],["u"]]],[11,"to_owned","","",4,[[["self"]],["t"]]],[11,"clone_into","","",4,[[["self"],["t"]]]],[11,"try_from","","",4,[[["u"]],["result"]]],[11,"try_into","","",4,[[],["result"]]],[11,"borrow","","",4,[[["self"]],["t"]]],[11,"borrow_mut","","",4,[[["self"]],["t"]]],[11,"type_id","","",4,[[["self"]],["typeid"]]],[11,"span","","",5,[[["self"]],["span"]]],[11,"from","","",5,[[["t"]],["t"]]],[11,"into","","",5,[[],["u"]]],[11,"to_owned","","",5,[[["self"]],["t"]]],[11,"clone_into","","",5,[[["self"],["t"]]]],[11,"try_from","","",5,[[["u"]],["result"]]],[11,"try_into","","",5,[[],["result"]]],[11,"borrow","","",5,[[["self"]],["t"]]],[11,"borrow_mut","","",5,[[["self"]],["t"]]],[11,"type_id","","",5,[[["self"]],["typeid"]]],[11,"span","","",6,[[["self"]],["span"]]],[11,"from","","",6,[[["t"]],["t"]]],[11,"into","","",6,[[],["u"]]],[11,"to_owned","","",6,[[["self"]],["t"]]],[11,"clone_into","","",6,[[["self"],["t"]]]],[11,"try_from","","",6,[[["u"]],["result"]]],[11,"try_into","","",6,[[],["result"]]],[11,"borrow","","",6,[[["self"]],["t"]]],[11,"borrow_mut","","",6,[[["self"]],["t"]]],[11,"type_id","","",6,[[["self"]],["typeid"]]],[11,"span","","",7,[[["self"]],["span"]]],[11,"from","","",7,[[["t"]],["t"]]],[11,"into","","",7,[[],["u"]]],[11,"to_owned","","",7,[[["self"]],["t"]]],[11,"clone_into","","",7,[[["self"],["t"]]]],[11,"try_from","","",7,[[["u"]],["result"]]],[11,"try_into","","",7,[[],["result"]]],[11,"borrow","","",7,[[["self"]],["t"]]],[11,"borrow_mut","","",7,[[["self"]],["t"]]],[11,"type_id","","",7,[[["self"]],["typeid"]]],[11,"span","","",8,[[["self"]],["span"]]],[11,"from","","",8,[[["t"]],["t"]]],[11,"into","","",8,[[],["u"]]],[11,"to_owned","","",8,[[["self"]],["t"]]],[11,"clone_into","","",8,[[["self"],["t"]]]],[11,"try_from","","",8,[[["u"]],["result"]]],[11,"try_into","","",8,[[],["result"]]],[11,"borrow","","",8,[[["self"]],["t"]]],[11,"borrow_mut","","",8,[[["self"]],["t"]]],[11,"type_id","","",8,[[["self"]],["typeid"]]],[11,"span","","",9,[[["self"]],["span"]]],[11,"from","","",9,[[["t"]],["t"]]],[11,"into","","",9,[[],["u"]]],[11,"to_owned","","",9,[[["self"]],["t"]]],[11,"clone_into","","",9,[[["self"],["t"]]]],[11,"try_from","","",9,[[["u"]],["result"]]],[11,"try_into","","",9,[[],["result"]]],[11,"borrow","","",9,[[["self"]],["t"]]],[11,"borrow_mut","","",9,[[["self"]],["t"]]],[11,"type_id","","",9,[[["self"]],["typeid"]]],[11,"span","","",206,[[["self"]],["span"]]],[11,"from","","",206,[[["t"]],["t"]]],[11,"into","","",206,[[],["u"]]],[11,"to_owned","","",206,[[["self"]],["t"]]],[11,"clone_into","","",206,[[["self"],["t"]]]],[11,"try_from","","",206,[[["u"]],["result"]]],[11,"try_into","","",206,[[],["result"]]],[11,"borrow","","",206,[[["self"]],["t"]]],[11,"borrow_mut","","",206,[[["self"]],["t"]]],[11,"type_id","","",206,[[["self"]],["typeid"]]],[11,"span","","",207,[[["self"]],["span"]]],[11,"from","","",207,[[["t"]],["t"]]],[11,"into","","",207,[[],["u"]]],[11,"to_owned","","",207,[[["self"]],["t"]]],[11,"clone_into","","",207,[[["self"],["t"]]]],[11,"try_from","","",207,[[["u"]],["result"]]],[11,"try_into","","",207,[[],["result"]]],[11,"borrow","","",207,[[["self"]],["t"]]],[11,"borrow_mut","","",207,[[["self"]],["t"]]],[11,"type_id","","",207,[[["self"]],["typeid"]]],[11,"span","","",208,[[["self"]],["span"]]],[11,"from","","",208,[[["t"]],["t"]]],[11,"into","","",208,[[],["u"]]],[11,"to_owned","","",208,[[["self"]],["t"]]],[11,"clone_into","","",208,[[["self"],["t"]]]],[11,"try_from","","",208,[[["u"]],["result"]]],[11,"try_into","","",208,[[],["result"]]],[11,"borrow","","",208,[[["self"]],["t"]]],[11,"borrow_mut","","",208,[[["self"]],["t"]]],[11,"type_id","","",208,[[["self"]],["typeid"]]],[11,"span","","",209,[[["self"]],["span"]]],[11,"from","","",209,[[["t"]],["t"]]],[11,"into","","",209,[[],["u"]]],[11,"to_owned","","",209,[[["self"]],["t"]]],[11,"clone_into","","",209,[[["self"],["t"]]]],[11,"try_from","","",209,[[["u"]],["result"]]],[11,"try_into","","",209,[[],["result"]]],[11,"borrow","","",209,[[["self"]],["t"]]],[11,"borrow_mut","","",209,[[["self"]],["t"]]],[11,"type_id","","",209,[[["self"]],["typeid"]]],[11,"span","","",210,[[["self"]],["span"]]],[11,"from","","",210,[[["t"]],["t"]]],[11,"into","","",210,[[],["u"]]],[11,"to_owned","","",210,[[["self"]],["t"]]],[11,"clone_into","","",210,[[["self"],["t"]]]],[11,"try_from","","",210,[[["u"]],["result"]]],[11,"try_into","","",210,[[],["result"]]],[11,"borrow","","",210,[[["self"]],["t"]]],[11,"borrow_mut","","",210,[[["self"]],["t"]]],[11,"type_id","","",210,[[["self"]],["typeid"]]],[11,"span","","",10,[[["self"]],["span"]]],[11,"from","","",10,[[["t"]],["t"]]],[11,"into","","",10,[[],["u"]]],[11,"to_owned","","",10,[[["self"]],["t"]]],[11,"clone_into","","",10,[[["self"],["t"]]]],[11,"try_from","","",10,[[["u"]],["result"]]],[11,"try_into","","",10,[[],["result"]]],[11,"borrow","","",10,[[["self"]],["t"]]],[11,"borrow_mut","","",10,[[["self"]],["t"]]],[11,"type_id","","",10,[[["self"]],["typeid"]]],[11,"span","","",211,[[["self"]],["span"]]],[11,"from","","",211,[[["t"]],["t"]]],[11,"into","","",211,[[],["u"]]],[11,"to_owned","","",211,[[["self"]],["t"]]],[11,"clone_into","","",211,[[["self"],["t"]]]],[11,"try_from","","",211,[[["u"]],["result"]]],[11,"try_into","","",211,[[],["result"]]],[11,"borrow","","",211,[[["self"]],["t"]]],[11,"borrow_mut","","",211,[[["self"]],["t"]]],[11,"type_id","","",211,[[["self"]],["typeid"]]],[11,"span","","",212,[[["self"]],["span"]]],[11,"from","","",212,[[["t"]],["t"]]],[11,"into","","",212,[[],["u"]]],[11,"to_owned","","",212,[[["self"]],["t"]]],[11,"clone_into","","",212,[[["self"],["t"]]]],[11,"try_from","","",212,[[["u"]],["result"]]],[11,"try_into","","",212,[[],["result"]]],[11,"borrow","","",212,[[["self"]],["t"]]],[11,"borrow_mut","","",212,[[["self"]],["t"]]],[11,"type_id","","",212,[[["self"]],["typeid"]]],[11,"span","","",213,[[["self"]],["span"]]],[11,"from","","",213,[[["t"]],["t"]]],[11,"into","","",213,[[],["u"]]],[11,"to_owned","","",213,[[["self"]],["t"]]],[11,"clone_into","","",213,[[["self"],["t"]]]],[11,"try_from","","",213,[[["u"]],["result"]]],[11,"try_into","","",213,[[],["result"]]],[11,"borrow","","",213,[[["self"]],["t"]]],[11,"borrow_mut","","",213,[[["self"]],["t"]]],[11,"type_id","","",213,[[["self"]],["typeid"]]],[11,"span","","",11,[[["self"]],["span"]]],[11,"from","","",11,[[["t"]],["t"]]],[11,"into","","",11,[[],["u"]]],[11,"to_owned","","",11,[[["self"]],["t"]]],[11,"clone_into","","",11,[[["self"],["t"]]]],[11,"try_from","","",11,[[["u"]],["result"]]],[11,"try_into","","",11,[[],["result"]]],[11,"borrow","","",11,[[["self"]],["t"]]],[11,"borrow_mut","","",11,[[["self"]],["t"]]],[11,"type_id","","",11,[[["self"]],["typeid"]]],[11,"span","","",12,[[["self"]],["span"]]],[11,"from","","",12,[[["t"]],["t"]]],[11,"into","","",12,[[],["u"]]],[11,"to_owned","","",12,[[["self"]],["t"]]],[11,"clone_into","","",12,[[["self"],["t"]]]],[11,"try_from","","",12,[[["u"]],["result"]]],[11,"try_into","","",12,[[],["result"]]],[11,"borrow","","",12,[[["self"]],["t"]]],[11,"borrow_mut","","",12,[[["self"]],["t"]]],[11,"type_id","","",12,[[["self"]],["typeid"]]],[11,"span","","",214,[[["self"]],["span"]]],[11,"from","","",214,[[["t"]],["t"]]],[11,"into","","",214,[[],["u"]]],[11,"to_owned","","",214,[[["self"]],["t"]]],[11,"clone_into","","",214,[[["self"],["t"]]]],[11,"try_from","","",214,[[["u"]],["result"]]],[11,"try_into","","",214,[[],["result"]]],[11,"borrow","","",214,[[["self"]],["t"]]],[11,"borrow_mut","","",214,[[["self"]],["t"]]],[11,"type_id","","",214,[[["self"]],["typeid"]]],[11,"span","","",215,[[["self"]],["span"]]],[11,"from","","",215,[[["t"]],["t"]]],[11,"into","","",215,[[],["u"]]],[11,"to_owned","","",215,[[["self"]],["t"]]],[11,"clone_into","","",215,[[["self"],["t"]]]],[11,"try_from","","",215,[[["u"]],["result"]]],[11,"try_into","","",215,[[],["result"]]],[11,"borrow","","",215,[[["self"]],["t"]]],[11,"borrow_mut","","",215,[[["self"]],["t"]]],[11,"type_id","","",215,[[["self"]],["typeid"]]],[11,"span","","",13,[[["self"]],["span"]]],[11,"from","","",13,[[["t"]],["t"]]],[11,"into","","",13,[[],["u"]]],[11,"to_owned","","",13,[[["self"]],["t"]]],[11,"clone_into","","",13,[[["self"],["t"]]]],[11,"try_from","","",13,[[["u"]],["result"]]],[11,"try_into","","",13,[[],["result"]]],[11,"borrow","","",13,[[["self"]],["t"]]],[11,"borrow_mut","","",13,[[["self"]],["t"]]],[11,"type_id","","",13,[[["self"]],["typeid"]]],[11,"span","","",216,[[["self"]],["span"]]],[11,"from","","",216,[[["t"]],["t"]]],[11,"into","","",216,[[],["u"]]],[11,"to_owned","","",216,[[["self"]],["t"]]],[11,"clone_into","","",216,[[["self"],["t"]]]],[11,"try_from","","",216,[[["u"]],["result"]]],[11,"try_into","","",216,[[],["result"]]],[11,"borrow","","",216,[[["self"]],["t"]]],[11,"borrow_mut","","",216,[[["self"]],["t"]]],[11,"type_id","","",216,[[["self"]],["typeid"]]],[11,"span","","",217,[[["self"]],["span"]]],[11,"from","","",217,[[["t"]],["t"]]],[11,"into","","",217,[[],["u"]]],[11,"to_owned","","",217,[[["self"]],["t"]]],[11,"clone_into","","",217,[[["self"],["t"]]]],[11,"try_from","","",217,[[["u"]],["result"]]],[11,"try_into","","",217,[[],["result"]]],[11,"borrow","","",217,[[["self"]],["t"]]],[11,"borrow_mut","","",217,[[["self"]],["t"]]],[11,"type_id","","",217,[[["self"]],["typeid"]]],[11,"span","","",218,[[["self"]],["span"]]],[11,"from","","",218,[[["t"]],["t"]]],[11,"into","","",218,[[],["u"]]],[11,"to_owned","","",218,[[["self"]],["t"]]],[11,"clone_into","","",218,[[["self"],["t"]]]],[11,"try_from","","",218,[[["u"]],["result"]]],[11,"try_into","","",218,[[],["result"]]],[11,"borrow","","",218,[[["self"]],["t"]]],[11,"borrow_mut","","",218,[[["self"]],["t"]]],[11,"type_id","","",218,[[["self"]],["typeid"]]],[11,"span","","",14,[[["self"]],["span"]]],[11,"from","","",14,[[["t"]],["t"]]],[11,"into","","",14,[[],["u"]]],[11,"to_owned","","",14,[[["self"]],["t"]]],[11,"clone_into","","",14,[[["self"],["t"]]]],[11,"try_from","","",14,[[["u"]],["result"]]],[11,"try_into","","",14,[[],["result"]]],[11,"borrow","","",14,[[["self"]],["t"]]],[11,"borrow_mut","","",14,[[["self"]],["t"]]],[11,"type_id","","",14,[[["self"]],["typeid"]]],[11,"span","","",219,[[["self"]],["span"]]],[11,"from","","",219,[[["t"]],["t"]]],[11,"into","","",219,[[],["u"]]],[11,"to_owned","","",219,[[["self"]],["t"]]],[11,"clone_into","","",219,[[["self"],["t"]]]],[11,"try_from","","",219,[[["u"]],["result"]]],[11,"try_into","","",219,[[],["result"]]],[11,"borrow","","",219,[[["self"]],["t"]]],[11,"borrow_mut","","",219,[[["self"]],["t"]]],[11,"type_id","","",219,[[["self"]],["typeid"]]],[11,"span","","",15,[[["self"]],["span"]]],[11,"from","","",15,[[["t"]],["t"]]],[11,"into","","",15,[[],["u"]]],[11,"to_owned","","",15,[[["self"]],["t"]]],[11,"clone_into","","",15,[[["self"],["t"]]]],[11,"try_from","","",15,[[["u"]],["result"]]],[11,"try_into","","",15,[[],["result"]]],[11,"borrow","","",15,[[["self"]],["t"]]],[11,"borrow_mut","","",15,[[["self"]],["t"]]],[11,"type_id","","",15,[[["self"]],["typeid"]]],[11,"span","","",220,[[["self"]],["span"]]],[11,"from","","",220,[[["t"]],["t"]]],[11,"into","","",220,[[],["u"]]],[11,"to_owned","","",220,[[["self"]],["t"]]],[11,"clone_into","","",220,[[["self"],["t"]]]],[11,"try_from","","",220,[[["u"]],["result"]]],[11,"try_into","","",220,[[],["result"]]],[11,"borrow","","",220,[[["self"]],["t"]]],[11,"borrow_mut","","",220,[[["self"]],["t"]]],[11,"type_id","","",220,[[["self"]],["typeid"]]],[11,"span","","",221,[[["self"]],["span"]]],[11,"from","","",221,[[["t"]],["t"]]],[11,"into","","",221,[[],["u"]]],[11,"to_owned","","",221,[[["self"]],["t"]]],[11,"clone_into","","",221,[[["self"],["t"]]]],[11,"try_from","","",221,[[["u"]],["result"]]],[11,"try_into","","",221,[[],["result"]]],[11,"borrow","","",221,[[["self"]],["t"]]],[11,"borrow_mut","","",221,[[["self"]],["t"]]],[11,"type_id","","",221,[[["self"]],["typeid"]]],[11,"span","","",222,[[["self"]],["span"]]],[11,"from","","",222,[[["t"]],["t"]]],[11,"into","","",222,[[],["u"]]],[11,"to_owned","","",222,[[["self"]],["t"]]],[11,"clone_into","","",222,[[["self"],["t"]]]],[11,"try_from","","",222,[[["u"]],["result"]]],[11,"try_into","","",222,[[],["result"]]],[11,"borrow","","",222,[[["self"]],["t"]]],[11,"borrow_mut","","",222,[[["self"]],["t"]]],[11,"type_id","","",222,[[["self"]],["typeid"]]],[11,"span","","",223,[[["self"]],["span"]]],[11,"from","","",223,[[["t"]],["t"]]],[11,"into","","",223,[[],["u"]]],[11,"to_owned","","",223,[[["self"]],["t"]]],[11,"clone_into","","",223,[[["self"],["t"]]]],[11,"try_from","","",223,[[["u"]],["result"]]],[11,"try_into","","",223,[[],["result"]]],[11,"borrow","","",223,[[["self"]],["t"]]],[11,"borrow_mut","","",223,[[["self"]],["t"]]],[11,"type_id","","",223,[[["self"]],["typeid"]]],[11,"span","","",16,[[["self"]],["span"]]],[11,"from","","",16,[[["t"]],["t"]]],[11,"into","","",16,[[],["u"]]],[11,"to_owned","","",16,[[["self"]],["t"]]],[11,"clone_into","","",16,[[["self"],["t"]]]],[11,"try_from","","",16,[[["u"]],["result"]]],[11,"try_into","","",16,[[],["result"]]],[11,"borrow","","",16,[[["self"]],["t"]]],[11,"borrow_mut","","",16,[[["self"]],["t"]]],[11,"type_id","","",16,[[["self"]],["typeid"]]],[11,"span","","",17,[[["self"]],["span"]]],[11,"from","","",17,[[["t"]],["t"]]],[11,"into","","",17,[[],["u"]]],[11,"to_owned","","",17,[[["self"]],["t"]]],[11,"clone_into","","",17,[[["self"],["t"]]]],[11,"try_from","","",17,[[["u"]],["result"]]],[11,"try_into","","",17,[[],["result"]]],[11,"borrow","","",17,[[["self"]],["t"]]],[11,"borrow_mut","","",17,[[["self"]],["t"]]],[11,"type_id","","",17,[[["self"]],["typeid"]]],[11,"span","","",224,[[["self"]],["span"]]],[11,"from","","",224,[[["t"]],["t"]]],[11,"into","","",224,[[],["u"]]],[11,"to_owned","","",224,[[["self"]],["t"]]],[11,"clone_into","","",224,[[["self"],["t"]]]],[11,"try_from","","",224,[[["u"]],["result"]]],[11,"try_into","","",224,[[],["result"]]],[11,"borrow","","",224,[[["self"]],["t"]]],[11,"borrow_mut","","",224,[[["self"]],["t"]]],[11,"type_id","","",224,[[["self"]],["typeid"]]],[11,"span","","",225,[[["self"]],["span"]]],[11,"from","","",225,[[["t"]],["t"]]],[11,"into","","",225,[[],["u"]]],[11,"to_owned","","",225,[[["self"]],["t"]]],[11,"clone_into","","",225,[[["self"],["t"]]]],[11,"try_from","","",225,[[["u"]],["result"]]],[11,"try_into","","",225,[[],["result"]]],[11,"borrow","","",225,[[["self"]],["t"]]],[11,"borrow_mut","","",225,[[["self"]],["t"]]],[11,"type_id","","",225,[[["self"]],["typeid"]]],[11,"span","","",226,[[["self"]],["span"]]],[11,"from","","",226,[[["t"]],["t"]]],[11,"into","","",226,[[],["u"]]],[11,"to_owned","","",226,[[["self"]],["t"]]],[11,"clone_into","","",226,[[["self"],["t"]]]],[11,"try_from","","",226,[[["u"]],["result"]]],[11,"try_into","","",226,[[],["result"]]],[11,"borrow","","",226,[[["self"]],["t"]]],[11,"borrow_mut","","",226,[[["self"]],["t"]]],[11,"type_id","","",226,[[["self"]],["typeid"]]],[11,"span","","",227,[[["self"]],["span"]]],[11,"from","","",227,[[["t"]],["t"]]],[11,"into","","",227,[[],["u"]]],[11,"to_owned","","",227,[[["self"]],["t"]]],[11,"clone_into","","",227,[[["self"],["t"]]]],[11,"try_from","","",227,[[["u"]],["result"]]],[11,"try_into","","",227,[[],["result"]]],[11,"borrow","","",227,[[["self"]],["t"]]],[11,"borrow_mut","","",227,[[["self"]],["t"]]],[11,"type_id","","",227,[[["self"]],["typeid"]]],[11,"span","","",228,[[["self"]],["span"]]],[11,"from","","",228,[[["t"]],["t"]]],[11,"into","","",228,[[],["u"]]],[11,"to_owned","","",228,[[["self"]],["t"]]],[11,"clone_into","","",228,[[["self"],["t"]]]],[11,"try_from","","",228,[[["u"]],["result"]]],[11,"try_into","","",228,[[],["result"]]],[11,"borrow","","",228,[[["self"]],["t"]]],[11,"borrow_mut","","",228,[[["self"]],["t"]]],[11,"type_id","","",228,[[["self"]],["typeid"]]],[11,"span","","",229,[[["self"]],["span"]]],[11,"from","","",229,[[["t"]],["t"]]],[11,"into","","",229,[[],["u"]]],[11,"to_owned","","",229,[[["self"]],["t"]]],[11,"clone_into","","",229,[[["self"],["t"]]]],[11,"try_from","","",229,[[["u"]],["result"]]],[11,"try_into","","",229,[[],["result"]]],[11,"borrow","","",229,[[["self"]],["t"]]],[11,"borrow_mut","","",229,[[["self"]],["t"]]],[11,"type_id","","",229,[[["self"]],["typeid"]]],[11,"span","","",230,[[["self"]],["span"]]],[11,"from","","",230,[[["t"]],["t"]]],[11,"into","","",230,[[],["u"]]],[11,"to_owned","","",230,[[["self"]],["t"]]],[11,"clone_into","","",230,[[["self"],["t"]]]],[11,"try_from","","",230,[[["u"]],["result"]]],[11,"try_into","","",230,[[],["result"]]],[11,"borrow","","",230,[[["self"]],["t"]]],[11,"borrow_mut","","",230,[[["self"]],["t"]]],[11,"type_id","","",230,[[["self"]],["typeid"]]],[11,"span","","",231,[[["self"]],["span"]]],[11,"from","","",231,[[["t"]],["t"]]],[11,"into","","",231,[[],["u"]]],[11,"to_owned","","",231,[[["self"]],["t"]]],[11,"clone_into","","",231,[[["self"],["t"]]]],[11,"try_from","","",231,[[["u"]],["result"]]],[11,"try_into","","",231,[[],["result"]]],[11,"borrow","","",231,[[["self"]],["t"]]],[11,"borrow_mut","","",231,[[["self"]],["t"]]],[11,"type_id","","",231,[[["self"]],["typeid"]]],[11,"span","","",232,[[["self"]],["span"]]],[11,"from","","",232,[[["t"]],["t"]]],[11,"into","","",232,[[],["u"]]],[11,"to_owned","","",232,[[["self"]],["t"]]],[11,"clone_into","","",232,[[["self"],["t"]]]],[11,"try_from","","",232,[[["u"]],["result"]]],[11,"try_into","","",232,[[],["result"]]],[11,"borrow","","",232,[[["self"]],["t"]]],[11,"borrow_mut","","",232,[[["self"]],["t"]]],[11,"type_id","","",232,[[["self"]],["typeid"]]],[11,"span","","",18,[[["self"]],["span"]]],[11,"from","","",18,[[["t"]],["t"]]],[11,"into","","",18,[[],["u"]]],[11,"to_owned","","",18,[[["self"]],["t"]]],[11,"clone_into","","",18,[[["self"],["t"]]]],[11,"try_from","","",18,[[["u"]],["result"]]],[11,"try_into","","",18,[[],["result"]]],[11,"borrow","","",18,[[["self"]],["t"]]],[11,"borrow_mut","","",18,[[["self"]],["t"]]],[11,"type_id","","",18,[[["self"]],["typeid"]]],[11,"span","","",233,[[["self"]],["span"]]],[11,"from","","",233,[[["t"]],["t"]]],[11,"into","","",233,[[],["u"]]],[11,"to_owned","","",233,[[["self"]],["t"]]],[11,"clone_into","","",233,[[["self"],["t"]]]],[11,"try_from","","",233,[[["u"]],["result"]]],[11,"try_into","","",233,[[],["result"]]],[11,"borrow","","",233,[[["self"]],["t"]]],[11,"borrow_mut","","",233,[[["self"]],["t"]]],[11,"type_id","","",233,[[["self"]],["typeid"]]],[11,"span","","",234,[[["self"]],["span"]]],[11,"from","","",234,[[["t"]],["t"]]],[11,"into","","",234,[[],["u"]]],[11,"to_owned","","",234,[[["self"]],["t"]]],[11,"clone_into","","",234,[[["self"],["t"]]]],[11,"try_from","","",234,[[["u"]],["result"]]],[11,"try_into","","",234,[[],["result"]]],[11,"borrow","","",234,[[["self"]],["t"]]],[11,"borrow_mut","","",234,[[["self"]],["t"]]],[11,"type_id","","",234,[[["self"]],["typeid"]]],[11,"span","","",235,[[["self"]],["span"]]],[11,"from","","",235,[[["t"]],["t"]]],[11,"into","","",235,[[],["u"]]],[11,"to_owned","","",235,[[["self"]],["t"]]],[11,"clone_into","","",235,[[["self"],["t"]]]],[11,"try_from","","",235,[[["u"]],["result"]]],[11,"try_into","","",235,[[],["result"]]],[11,"borrow","","",235,[[["self"]],["t"]]],[11,"borrow_mut","","",235,[[["self"]],["t"]]],[11,"type_id","","",235,[[["self"]],["typeid"]]],[11,"span","","",19,[[["self"]],["span"]]],[11,"from","","",19,[[["t"]],["t"]]],[11,"into","","",19,[[],["u"]]],[11,"to_owned","","",19,[[["self"]],["t"]]],[11,"clone_into","","",19,[[["self"],["t"]]]],[11,"try_from","","",19,[[["u"]],["result"]]],[11,"try_into","","",19,[[],["result"]]],[11,"borrow","","",19,[[["self"]],["t"]]],[11,"borrow_mut","","",19,[[["self"]],["t"]]],[11,"type_id","","",19,[[["self"]],["typeid"]]],[11,"span","","",20,[[["self"]],["span"]]],[11,"from","","",20,[[["t"]],["t"]]],[11,"into","","",20,[[],["u"]]],[11,"to_owned","","",20,[[["self"]],["t"]]],[11,"clone_into","","",20,[[["self"],["t"]]]],[11,"try_from","","",20,[[["u"]],["result"]]],[11,"try_into","","",20,[[],["result"]]],[11,"borrow","","",20,[[["self"]],["t"]]],[11,"borrow_mut","","",20,[[["self"]],["t"]]],[11,"type_id","","",20,[[["self"]],["typeid"]]],[11,"span","","",21,[[["self"]],["span"]]],[11,"from","","",21,[[["t"]],["t"]]],[11,"into","","",21,[[],["u"]]],[11,"to_owned","","",21,[[["self"]],["t"]]],[11,"clone_into","","",21,[[["self"],["t"]]]],[11,"try_from","","",21,[[["u"]],["result"]]],[11,"try_into","","",21,[[],["result"]]],[11,"borrow","","",21,[[["self"]],["t"]]],[11,"borrow_mut","","",21,[[["self"]],["t"]]],[11,"type_id","","",21,[[["self"]],["typeid"]]],[11,"span","","",22,[[["self"]],["span"]]],[11,"from","","",22,[[["t"]],["t"]]],[11,"into","","",22,[[],["u"]]],[11,"to_owned","","",22,[[["self"]],["t"]]],[11,"clone_into","","",22,[[["self"],["t"]]]],[11,"try_from","","",22,[[["u"]],["result"]]],[11,"try_into","","",22,[[],["result"]]],[11,"borrow","","",22,[[["self"]],["t"]]],[11,"borrow_mut","","",22,[[["self"]],["t"]]],[11,"type_id","","",22,[[["self"]],["typeid"]]],[11,"span","","",23,[[["self"]],["span"]]],[11,"from","","",23,[[["t"]],["t"]]],[11,"into","","",23,[[],["u"]]],[11,"to_owned","","",23,[[["self"]],["t"]]],[11,"clone_into","","",23,[[["self"],["t"]]]],[11,"try_from","","",23,[[["u"]],["result"]]],[11,"try_into","","",23,[[],["result"]]],[11,"borrow","","",23,[[["self"]],["t"]]],[11,"borrow_mut","","",23,[[["self"]],["t"]]],[11,"type_id","","",23,[[["self"]],["typeid"]]],[11,"span","","",24,[[["self"]],["span"]]],[11,"from","","",24,[[["t"]],["t"]]],[11,"into","","",24,[[],["u"]]],[11,"to_owned","","",24,[[["self"]],["t"]]],[11,"clone_into","","",24,[[["self"],["t"]]]],[11,"try_from","","",24,[[["u"]],["result"]]],[11,"try_into","","",24,[[],["result"]]],[11,"borrow","","",24,[[["self"]],["t"]]],[11,"borrow_mut","","",24,[[["self"]],["t"]]],[11,"type_id","","",24,[[["self"]],["typeid"]]],[11,"span","","",25,[[["self"]],["span"]]],[11,"from","","",25,[[["t"]],["t"]]],[11,"into","","",25,[[],["u"]]],[11,"to_owned","","",25,[[["self"]],["t"]]],[11,"clone_into","","",25,[[["self"],["t"]]]],[11,"try_from","","",25,[[["u"]],["result"]]],[11,"try_into","","",25,[[],["result"]]],[11,"borrow","","",25,[[["self"]],["t"]]],[11,"borrow_mut","","",25,[[["self"]],["t"]]],[11,"type_id","","",25,[[["self"]],["typeid"]]],[11,"span","","",26,[[["self"]],["span"]]],[11,"from","","",26,[[["t"]],["t"]]],[11,"into","","",26,[[],["u"]]],[11,"to_owned","","",26,[[["self"]],["t"]]],[11,"clone_into","","",26,[[["self"],["t"]]]],[11,"try_from","","",26,[[["u"]],["result"]]],[11,"try_into","","",26,[[],["result"]]],[11,"borrow","","",26,[[["self"]],["t"]]],[11,"borrow_mut","","",26,[[["self"]],["t"]]],[11,"type_id","","",26,[[["self"]],["typeid"]]],[11,"span","","",27,[[["self"]],["span"]]],[11,"from","","",27,[[["t"]],["t"]]],[11,"into","","",27,[[],["u"]]],[11,"to_owned","","",27,[[["self"]],["t"]]],[11,"clone_into","","",27,[[["self"],["t"]]]],[11,"try_from","","",27,[[["u"]],["result"]]],[11,"try_into","","",27,[[],["result"]]],[11,"borrow","","",27,[[["self"]],["t"]]],[11,"borrow_mut","","",27,[[["self"]],["t"]]],[11,"type_id","","",27,[[["self"]],["typeid"]]],[11,"span","","",28,[[["self"]],["span"]]],[11,"from","","",28,[[["t"]],["t"]]],[11,"into","","",28,[[],["u"]]],[11,"to_owned","","",28,[[["self"]],["t"]]],[11,"clone_into","","",28,[[["self"],["t"]]]],[11,"try_from","","",28,[[["u"]],["result"]]],[11,"try_into","","",28,[[],["result"]]],[11,"borrow","","",28,[[["self"]],["t"]]],[11,"borrow_mut","","",28,[[["self"]],["t"]]],[11,"type_id","","",28,[[["self"]],["typeid"]]],[11,"span","","",29,[[["self"]],["span"]]],[11,"from","","",29,[[["t"]],["t"]]],[11,"into","","",29,[[],["u"]]],[11,"to_owned","","",29,[[["self"]],["t"]]],[11,"clone_into","","",29,[[["self"],["t"]]]],[11,"try_from","","",29,[[["u"]],["result"]]],[11,"try_into","","",29,[[],["result"]]],[11,"borrow","","",29,[[["self"]],["t"]]],[11,"borrow_mut","","",29,[[["self"]],["t"]]],[11,"type_id","","",29,[[["self"]],["typeid"]]],[11,"span","","",236,[[["self"]],["span"]]],[11,"from","","",236,[[["t"]],["t"]]],[11,"into","","",236,[[],["u"]]],[11,"to_owned","","",236,[[["self"]],["t"]]],[11,"clone_into","","",236,[[["self"],["t"]]]],[11,"try_from","","",236,[[["u"]],["result"]]],[11,"try_into","","",236,[[],["result"]]],[11,"borrow","","",236,[[["self"]],["t"]]],[11,"borrow_mut","","",236,[[["self"]],["t"]]],[11,"type_id","","",236,[[["self"]],["typeid"]]],[11,"span","","",237,[[["self"]],["span"]]],[11,"from","","",237,[[["t"]],["t"]]],[11,"into","","",237,[[],["u"]]],[11,"to_owned","","",237,[[["self"]],["t"]]],[11,"clone_into","","",237,[[["self"],["t"]]]],[11,"try_from","","",237,[[["u"]],["result"]]],[11,"try_into","","",237,[[],["result"]]],[11,"borrow","","",237,[[["self"]],["t"]]],[11,"borrow_mut","","",237,[[["self"]],["t"]]],[11,"type_id","","",237,[[["self"]],["typeid"]]],[11,"span","","",185,[[["self"]],["span"]]],[11,"from","","",185,[[["t"]],["t"]]],[11,"into","","",185,[[],["u"]]],[11,"to_owned","","",185,[[["self"]],["t"]]],[11,"clone_into","","",185,[[["self"],["t"]]]],[11,"try_from","","",185,[[["u"]],["result"]]],[11,"try_into","","",185,[[],["result"]]],[11,"borrow","","",185,[[["self"]],["t"]]],[11,"borrow_mut","","",185,[[["self"]],["t"]]],[11,"type_id","","",185,[[["self"]],["typeid"]]],[11,"peek","","",30,[[["cursor"]],["bool"]]],[11,"display","","",30,[[],["str"]]],[11,"span","","",30,[[["self"]],["span"]]],[11,"from","","",30,[[["t"]],["t"]]],[11,"into","","",30,[[],["u"]]],[11,"to_owned","","",30,[[["self"]],["t"]]],[11,"clone_into","","",30,[[["self"],["t"]]]],[11,"to_string","","",30,[[["self"]],["string"]]],[11,"try_from","","",30,[[["u"]],["result"]]],[11,"try_into","","",30,[[],["result"]]],[11,"borrow","","",30,[[["self"]],["t"]]],[11,"borrow_mut","","",30,[[["self"]],["t"]]],[11,"type_id","","",30,[[["self"]],["typeid"]]],[11,"peek","","",31,[[["cursor"]],["bool"]]],[11,"display","","",31,[[],["str"]]],[11,"span","","",31,[[["self"]],["span"]]],[11,"from","","",31,[[["t"]],["t"]]],[11,"into","","",31,[[],["u"]]],[11,"to_owned","","",31,[[["self"]],["t"]]],[11,"clone_into","","",31,[[["self"],["t"]]]],[11,"try_from","","",31,[[["u"]],["result"]]],[11,"try_into","","",31,[[],["result"]]],[11,"borrow","","",31,[[["self"]],["t"]]],[11,"borrow_mut","","",31,[[["self"]],["t"]]],[11,"type_id","","",31,[[["self"]],["typeid"]]],[11,"peek","","",188,[[["cursor"]],["bool"]]],[11,"display","","",188,[[],["str"]]],[11,"span","","",188,[[["self"]],["span"]]],[11,"from","","",188,[[["t"]],["t"]]],[11,"into","","",188,[[],["u"]]],[11,"to_owned","","",188,[[["self"]],["t"]]],[11,"clone_into","","",188,[[["self"],["t"]]]],[11,"try_from","","",188,[[["u"]],["result"]]],[11,"try_into","","",188,[[],["result"]]],[11,"borrow","","",188,[[["self"]],["t"]]],[11,"borrow_mut","","",188,[[["self"]],["t"]]],[11,"type_id","","",188,[[["self"]],["typeid"]]],[11,"peek","","",187,[[["cursor"]],["bool"]]],[11,"display","","",187,[[],["str"]]],[11,"span","","",187,[[["self"]],["span"]]],[11,"from","","",187,[[["t"]],["t"]]],[11,"into","","",187,[[],["u"]]],[11,"to_owned","","",187,[[["self"]],["t"]]],[11,"clone_into","","",187,[[["self"],["t"]]]],[11,"try_from","","",187,[[["u"]],["result"]]],[11,"try_into","","",187,[[],["result"]]],[11,"borrow","","",187,[[["self"]],["t"]]],[11,"borrow_mut","","",187,[[["self"]],["t"]]],[11,"type_id","","",187,[[["self"]],["typeid"]]],[11,"peek","","",189,[[["cursor"]],["bool"]]],[11,"display","","",189,[[],["str"]]],[11,"span","","",189,[[["self"]],["span"]]],[11,"from","","",189,[[["t"]],["t"]]],[11,"into","","",189,[[],["u"]]],[11,"to_owned","","",189,[[["self"]],["t"]]],[11,"clone_into","","",189,[[["self"],["t"]]]],[11,"try_from","","",189,[[["u"]],["result"]]],[11,"try_into","","",189,[[],["result"]]],[11,"borrow","","",189,[[["self"]],["t"]]],[11,"borrow_mut","","",189,[[["self"]],["t"]]],[11,"type_id","","",189,[[["self"]],["typeid"]]],[11,"peek","","",191,[[["cursor"]],["bool"]]],[11,"display","","",191,[[],["str"]]],[11,"span","","",191,[[["self"]],["span"]]],[11,"from","","",191,[[["t"]],["t"]]],[11,"into","","",191,[[],["u"]]],[11,"to_owned","","",191,[[["self"]],["t"]]],[11,"clone_into","","",191,[[["self"],["t"]]]],[11,"to_string","","",191,[[["self"]],["string"]]],[11,"try_from","","",191,[[["u"]],["result"]]],[11,"try_into","","",191,[[],["result"]]],[11,"borrow","","",191,[[["self"]],["t"]]],[11,"borrow_mut","","",191,[[["self"]],["t"]]],[11,"type_id","","",191,[[["self"]],["typeid"]]],[11,"peek","","",190,[[["cursor"]],["bool"]]],[11,"display","","",190,[[],["str"]]],[11,"span","","",190,[[["self"]],["span"]]],[11,"from","","",190,[[["t"]],["t"]]],[11,"into","","",190,[[],["u"]]],[11,"to_owned","","",190,[[["self"]],["t"]]],[11,"clone_into","","",190,[[["self"],["t"]]]],[11,"to_string","","",190,[[["self"]],["string"]]],[11,"try_from","","",190,[[["u"]],["result"]]],[11,"try_into","","",190,[[],["result"]]],[11,"borrow","","",190,[[["self"]],["t"]]],[11,"borrow_mut","","",190,[[["self"]],["t"]]],[11,"type_id","","",190,[[["self"]],["typeid"]]],[11,"peek","","",186,[[["cursor"]],["bool"]]],[11,"display","","",186,[[],["str"]]],[11,"span","","",186,[[["self"]],["span"]]],[11,"from","","",186,[[["t"]],["t"]]],[11,"into","","",186,[[],["u"]]],[11,"to_owned","","",186,[[["self"]],["t"]]],[11,"clone_into","","",186,[[["self"],["t"]]]],[11,"try_from","","",186,[[["u"]],["result"]]],[11,"try_into","","",186,[[],["result"]]],[11,"borrow","","",186,[[["self"]],["t"]]],[11,"borrow_mut","","",186,[[["self"]],["t"]]],[11,"type_id","","",186,[[["self"]],["typeid"]]],[11,"span","","",32,[[["self"]],["span"]]],[11,"from","","",32,[[["t"]],["t"]]],[11,"into","","",32,[[],["u"]]],[11,"to_owned","","",32,[[["self"]],["t"]]],[11,"clone_into","","",32,[[["self"],["t"]]]],[11,"try_from","","",32,[[["u"]],["result"]]],[11,"try_into","","",32,[[],["result"]]],[11,"borrow","","",32,[[["self"]],["t"]]],[11,"borrow_mut","","",32,[[["self"]],["t"]]],[11,"type_id","","",32,[[["self"]],["typeid"]]],[11,"from","","",33,[[["t"]],["t"]]],[11,"into","","",33,[[],["u"]]],[11,"to_owned","","",33,[[["self"]],["t"]]],[11,"clone_into","","",33,[[["self"],["t"]]]],[11,"try_from","","",33,[[["u"]],["result"]]],[11,"try_into","","",33,[[],["result"]]],[11,"borrow","","",33,[[["self"]],["t"]]],[11,"borrow_mut","","",33,[[["self"]],["t"]]],[11,"type_id","","",33,[[["self"]],["typeid"]]],[11,"from","","",34,[[["t"]],["t"]]],[11,"into","","",34,[[],["u"]]],[11,"to_owned","","",34,[[["self"]],["t"]]],[11,"clone_into","","",34,[[["self"],["t"]]]],[11,"try_from","","",34,[[["u"]],["result"]]],[11,"try_into","","",34,[[],["result"]]],[11,"borrow","","",34,[[["self"]],["t"]]],[11,"borrow_mut","","",34,[[["self"]],["t"]]],[11,"type_id","","",34,[[["self"]],["typeid"]]],[11,"from","","",35,[[["t"]],["t"]]],[11,"into","","",35,[[],["u"]]],[11,"to_owned","","",35,[[["self"]],["t"]]],[11,"clone_into","","",35,[[["self"],["t"]]]],[11,"try_from","","",35,[[["u"]],["result"]]],[11,"try_into","","",35,[[],["result"]]],[11,"borrow","","",35,[[["self"]],["t"]]],[11,"borrow_mut","","",35,[[["self"]],["t"]]],[11,"type_id","","",35,[[["self"]],["typeid"]]],[11,"span","","",36,[[["self"]],["span"]]],[11,"from","","",36,[[["t"]],["t"]]],[11,"into","","",36,[[],["u"]]],[11,"to_owned","","",36,[[["self"]],["t"]]],[11,"clone_into","","",36,[[["self"],["t"]]]],[11,"try_from","","",36,[[["u"]],["result"]]],[11,"try_into","","",36,[[],["result"]]],[11,"borrow","","",36,[[["self"]],["t"]]],[11,"borrow_mut","","",36,[[["self"]],["t"]]],[11,"type_id","","",36,[[["self"]],["typeid"]]],[11,"span","","",37,[[["self"]],["span"]]],[11,"from","","",37,[[["t"]],["t"]]],[11,"into","","",37,[[],["u"]]],[11,"to_owned","","",37,[[["self"]],["t"]]],[11,"clone_into","","",37,[[["self"],["t"]]]],[11,"try_from","","",37,[[["u"]],["result"]]],[11,"try_into","","",37,[[],["result"]]],[11,"borrow","","",37,[[["self"]],["t"]]],[11,"borrow_mut","","",37,[[["self"]],["t"]]],[11,"type_id","","",37,[[["self"]],["typeid"]]],[11,"span","","",38,[[["self"]],["span"]]],[11,"from","","",38,[[["t"]],["t"]]],[11,"into","","",38,[[],["u"]]],[11,"to_owned","","",38,[[["self"]],["t"]]],[11,"clone_into","","",38,[[["self"],["t"]]]],[11,"try_from","","",38,[[["u"]],["result"]]],[11,"try_into","","",38,[[],["result"]]],[11,"borrow","","",38,[[["self"]],["t"]]],[11,"borrow_mut","","",38,[[["self"]],["t"]]],[11,"type_id","","",38,[[["self"]],["typeid"]]],[11,"span","","",39,[[["self"]],["span"]]],[11,"from","","",39,[[["t"]],["t"]]],[11,"into","","",39,[[],["u"]]],[11,"to_owned","","",39,[[["self"]],["t"]]],[11,"clone_into","","",39,[[["self"],["t"]]]],[11,"try_from","","",39,[[["u"]],["result"]]],[11,"try_into","","",39,[[],["result"]]],[11,"borrow","","",39,[[["self"]],["t"]]],[11,"borrow_mut","","",39,[[["self"]],["t"]]],[11,"type_id","","",39,[[["self"]],["typeid"]]],[11,"span","","",40,[[["self"]],["span"]]],[11,"from","","",40,[[["t"]],["t"]]],[11,"into","","",40,[[],["u"]]],[11,"to_owned","","",40,[[["self"]],["t"]]],[11,"clone_into","","",40,[[["self"],["t"]]]],[11,"try_from","","",40,[[["u"]],["result"]]],[11,"try_into","","",40,[[],["result"]]],[11,"borrow","","",40,[[["self"]],["t"]]],[11,"borrow_mut","","",40,[[["self"]],["t"]]],[11,"type_id","","",40,[[["self"]],["typeid"]]],[11,"span","","",41,[[["self"]],["span"]]],[11,"from","","",41,[[["t"]],["t"]]],[11,"into","","",41,[[],["u"]]],[11,"to_owned","","",41,[[["self"]],["t"]]],[11,"clone_into","","",41,[[["self"],["t"]]]],[11,"try_from","","",41,[[["u"]],["result"]]],[11,"try_into","","",41,[[],["result"]]],[11,"borrow","","",41,[[["self"]],["t"]]],[11,"borrow_mut","","",41,[[["self"]],["t"]]],[11,"type_id","","",41,[[["self"]],["typeid"]]],[11,"span","","",42,[[["self"]],["span"]]],[11,"from","","",42,[[["t"]],["t"]]],[11,"into","","",42,[[],["u"]]],[11,"to_owned","","",42,[[["self"]],["t"]]],[11,"clone_into","","",42,[[["self"],["t"]]]],[11,"try_from","","",42,[[["u"]],["result"]]],[11,"try_into","","",42,[[],["result"]]],[11,"borrow","","",42,[[["self"]],["t"]]],[11,"borrow_mut","","",42,[[["self"]],["t"]]],[11,"type_id","","",42,[[["self"]],["typeid"]]],[11,"span","","",43,[[["self"]],["span"]]],[11,"from","","",43,[[["t"]],["t"]]],[11,"into","","",43,[[],["u"]]],[11,"to_owned","","",43,[[["self"]],["t"]]],[11,"clone_into","","",43,[[["self"],["t"]]]],[11,"try_from","","",43,[[["u"]],["result"]]],[11,"try_into","","",43,[[],["result"]]],[11,"borrow","","",43,[[["self"]],["t"]]],[11,"borrow_mut","","",43,[[["self"]],["t"]]],[11,"type_id","","",43,[[["self"]],["typeid"]]],[11,"span","","",44,[[["self"]],["span"]]],[11,"from","","",44,[[["t"]],["t"]]],[11,"into","","",44,[[],["u"]]],[11,"to_owned","","",44,[[["self"]],["t"]]],[11,"clone_into","","",44,[[["self"],["t"]]]],[11,"try_from","","",44,[[["u"]],["result"]]],[11,"try_into","","",44,[[],["result"]]],[11,"borrow","","",44,[[["self"]],["t"]]],[11,"borrow_mut","","",44,[[["self"]],["t"]]],[11,"type_id","","",44,[[["self"]],["typeid"]]],[11,"span","","",45,[[["self"]],["span"]]],[11,"from","","",45,[[["t"]],["t"]]],[11,"into","","",45,[[],["u"]]],[11,"to_owned","","",45,[[["self"]],["t"]]],[11,"clone_into","","",45,[[["self"],["t"]]]],[11,"try_from","","",45,[[["u"]],["result"]]],[11,"try_into","","",45,[[],["result"]]],[11,"borrow","","",45,[[["self"]],["t"]]],[11,"borrow_mut","","",45,[[["self"]],["t"]]],[11,"type_id","","",45,[[["self"]],["typeid"]]],[11,"span","","",46,[[["self"]],["span"]]],[11,"from","","",46,[[["t"]],["t"]]],[11,"into","","",46,[[],["u"]]],[11,"to_owned","","",46,[[["self"]],["t"]]],[11,"clone_into","","",46,[[["self"],["t"]]]],[11,"try_from","","",46,[[["u"]],["result"]]],[11,"try_into","","",46,[[],["result"]]],[11,"borrow","","",46,[[["self"]],["t"]]],[11,"borrow_mut","","",46,[[["self"]],["t"]]],[11,"type_id","","",46,[[["self"]],["typeid"]]],[11,"span","","",47,[[["self"]],["span"]]],[11,"from","","",47,[[["t"]],["t"]]],[11,"into","","",47,[[],["u"]]],[11,"to_owned","","",47,[[["self"]],["t"]]],[11,"clone_into","","",47,[[["self"],["t"]]]],[11,"try_from","","",47,[[["u"]],["result"]]],[11,"try_into","","",47,[[],["result"]]],[11,"borrow","","",47,[[["self"]],["t"]]],[11,"borrow_mut","","",47,[[["self"]],["t"]]],[11,"type_id","","",47,[[["self"]],["typeid"]]],[11,"span","","",48,[[["self"]],["span"]]],[11,"from","","",48,[[["t"]],["t"]]],[11,"into","","",48,[[],["u"]]],[11,"to_owned","","",48,[[["self"]],["t"]]],[11,"clone_into","","",48,[[["self"],["t"]]]],[11,"try_from","","",48,[[["u"]],["result"]]],[11,"try_into","","",48,[[],["result"]]],[11,"borrow","","",48,[[["self"]],["t"]]],[11,"borrow_mut","","",48,[[["self"]],["t"]]],[11,"type_id","","",48,[[["self"]],["typeid"]]],[11,"span","","",49,[[["self"]],["span"]]],[11,"from","","",49,[[["t"]],["t"]]],[11,"into","","",49,[[],["u"]]],[11,"to_owned","","",49,[[["self"]],["t"]]],[11,"clone_into","","",49,[[["self"],["t"]]]],[11,"try_from","","",49,[[["u"]],["result"]]],[11,"try_into","","",49,[[],["result"]]],[11,"borrow","","",49,[[["self"]],["t"]]],[11,"borrow_mut","","",49,[[["self"]],["t"]]],[11,"type_id","","",49,[[["self"]],["typeid"]]],[11,"span","","",50,[[["self"]],["span"]]],[11,"from","","",50,[[["t"]],["t"]]],[11,"into","","",50,[[],["u"]]],[11,"to_owned","","",50,[[["self"]],["t"]]],[11,"clone_into","","",50,[[["self"],["t"]]]],[11,"try_from","","",50,[[["u"]],["result"]]],[11,"try_into","","",50,[[],["result"]]],[11,"borrow","","",50,[[["self"]],["t"]]],[11,"borrow_mut","","",50,[[["self"]],["t"]]],[11,"type_id","","",50,[[["self"]],["typeid"]]],[11,"span","","",51,[[["self"]],["span"]]],[11,"from","","",51,[[["t"]],["t"]]],[11,"into","","",51,[[],["u"]]],[11,"to_owned","","",51,[[["self"]],["t"]]],[11,"clone_into","","",51,[[["self"],["t"]]]],[11,"try_from","","",51,[[["u"]],["result"]]],[11,"try_into","","",51,[[],["result"]]],[11,"borrow","","",51,[[["self"]],["t"]]],[11,"borrow_mut","","",51,[[["self"]],["t"]]],[11,"type_id","","",51,[[["self"]],["typeid"]]],[11,"span","","",52,[[["self"]],["span"]]],[11,"from","","",52,[[["t"]],["t"]]],[11,"into","","",52,[[],["u"]]],[11,"to_owned","","",52,[[["self"]],["t"]]],[11,"clone_into","","",52,[[["self"],["t"]]]],[11,"try_from","","",52,[[["u"]],["result"]]],[11,"try_into","","",52,[[],["result"]]],[11,"borrow","","",52,[[["self"]],["t"]]],[11,"borrow_mut","","",52,[[["self"]],["t"]]],[11,"type_id","","",52,[[["self"]],["typeid"]]],[11,"span","","",53,[[["self"]],["span"]]],[11,"from","","",53,[[["t"]],["t"]]],[11,"into","","",53,[[],["u"]]],[11,"to_owned","","",53,[[["self"]],["t"]]],[11,"clone_into","","",53,[[["self"],["t"]]]],[11,"try_from","","",53,[[["u"]],["result"]]],[11,"try_into","","",53,[[],["result"]]],[11,"borrow","","",53,[[["self"]],["t"]]],[11,"borrow_mut","","",53,[[["self"]],["t"]]],[11,"type_id","","",53,[[["self"]],["typeid"]]],[11,"span","","",54,[[["self"]],["span"]]],[11,"from","","",54,[[["t"]],["t"]]],[11,"into","","",54,[[],["u"]]],[11,"to_owned","","",54,[[["self"]],["t"]]],[11,"clone_into","","",54,[[["self"],["t"]]]],[11,"try_from","","",54,[[["u"]],["result"]]],[11,"try_into","","",54,[[],["result"]]],[11,"borrow","","",54,[[["self"]],["t"]]],[11,"borrow_mut","","",54,[[["self"]],["t"]]],[11,"type_id","","",54,[[["self"]],["typeid"]]],[11,"span","","",55,[[["self"]],["span"]]],[11,"from","","",55,[[["t"]],["t"]]],[11,"into","","",55,[[],["u"]]],[11,"to_owned","","",55,[[["self"]],["t"]]],[11,"clone_into","","",55,[[["self"],["t"]]]],[11,"try_from","","",55,[[["u"]],["result"]]],[11,"try_into","","",55,[[],["result"]]],[11,"borrow","","",55,[[["self"]],["t"]]],[11,"borrow_mut","","",55,[[["self"]],["t"]]],[11,"type_id","","",55,[[["self"]],["typeid"]]],[11,"span","","",56,[[["self"]],["span"]]],[11,"from","","",56,[[["t"]],["t"]]],[11,"into","","",56,[[],["u"]]],[11,"to_owned","","",56,[[["self"]],["t"]]],[11,"clone_into","","",56,[[["self"],["t"]]]],[11,"try_from","","",56,[[["u"]],["result"]]],[11,"try_into","","",56,[[],["result"]]],[11,"borrow","","",56,[[["self"]],["t"]]],[11,"borrow_mut","","",56,[[["self"]],["t"]]],[11,"type_id","","",56,[[["self"]],["typeid"]]],[11,"span","","",57,[[["self"]],["span"]]],[11,"from","","",57,[[["t"]],["t"]]],[11,"into","","",57,[[],["u"]]],[11,"to_owned","","",57,[[["self"]],["t"]]],[11,"clone_into","","",57,[[["self"],["t"]]]],[11,"try_from","","",57,[[["u"]],["result"]]],[11,"try_into","","",57,[[],["result"]]],[11,"borrow","","",57,[[["self"]],["t"]]],[11,"borrow_mut","","",57,[[["self"]],["t"]]],[11,"type_id","","",57,[[["self"]],["typeid"]]],[11,"span","","",58,[[["self"]],["span"]]],[11,"from","","",58,[[["t"]],["t"]]],[11,"into","","",58,[[],["u"]]],[11,"to_owned","","",58,[[["self"]],["t"]]],[11,"clone_into","","",58,[[["self"],["t"]]]],[11,"try_from","","",58,[[["u"]],["result"]]],[11,"try_into","","",58,[[],["result"]]],[11,"borrow","","",58,[[["self"]],["t"]]],[11,"borrow_mut","","",58,[[["self"]],["t"]]],[11,"type_id","","",58,[[["self"]],["typeid"]]],[11,"span","","",59,[[["self"]],["span"]]],[11,"from","","",59,[[["t"]],["t"]]],[11,"into","","",59,[[],["u"]]],[11,"to_owned","","",59,[[["self"]],["t"]]],[11,"clone_into","","",59,[[["self"],["t"]]]],[11,"try_from","","",59,[[["u"]],["result"]]],[11,"try_into","","",59,[[],["result"]]],[11,"borrow","","",59,[[["self"]],["t"]]],[11,"borrow_mut","","",59,[[["self"]],["t"]]],[11,"type_id","","",59,[[["self"]],["typeid"]]],[11,"from","","",60,[[["t"]],["t"]]],[11,"into","","",60,[[],["u"]]],[11,"to_owned","","",60,[[["self"]],["t"]]],[11,"clone_into","","",60,[[["self"],["t"]]]],[11,"try_from","","",60,[[["u"]],["result"]]],[11,"try_into","","",60,[[],["result"]]],[11,"borrow","","",60,[[["self"]],["t"]]],[11,"borrow_mut","","",60,[[["self"]],["t"]]],[11,"type_id","","",60,[[["self"]],["typeid"]]],[11,"from","","",204,[[["t"]],["t"]]],[11,"into","","",204,[[],["u"]]],[11,"into_iter","","",204,[[],["i"]]],[11,"to_owned","","",204,[[["self"]],["t"]]],[11,"clone_into","","",204,[[["self"],["t"]]]],[11,"to_string","","",204,[[["self"]],["string"]]],[11,"try_from","","",204,[[["u"]],["result"]]],[11,"try_into","","",204,[[],["result"]]],[11,"borrow","","",204,[[["self"]],["t"]]],[11,"borrow_mut","","",204,[[["self"]],["t"]]],[11,"type_id","","",204,[[["self"]],["typeid"]]],[11,"from","","",61,[[["t"]],["t"]]],[11,"into","","",61,[[],["u"]]],[11,"to_owned","","",61,[[["self"]],["t"]]],[11,"clone_into","","",61,[[["self"],["t"]]]],[11,"try_from","","",61,[[["u"]],["result"]]],[11,"try_into","","",61,[[],["result"]]],[11,"borrow","","",61,[[["self"]],["t"]]],[11,"borrow_mut","","",61,[[["self"]],["t"]]],[11,"type_id","","",61,[[["self"]],["typeid"]]],[11,"span","","",62,[[["self"]],["span"]]],[11,"from","","",62,[[["t"]],["t"]]],[11,"into","","",62,[[],["u"]]],[11,"to_owned","","",62,[[["self"]],["t"]]],[11,"clone_into","","",62,[[["self"],["t"]]]],[11,"try_from","","",62,[[["u"]],["result"]]],[11,"try_into","","",62,[[],["result"]]],[11,"borrow","","",62,[[["self"]],["t"]]],[11,"borrow_mut","","",62,[[["self"]],["t"]]],[11,"type_id","","",62,[[["self"]],["typeid"]]],[11,"span","","",63,[[["self"]],["span"]]],[11,"from","","",63,[[["t"]],["t"]]],[11,"into","","",63,[[],["u"]]],[11,"to_owned","","",63,[[["self"]],["t"]]],[11,"clone_into","","",63,[[["self"],["t"]]]],[11,"try_from","","",63,[[["u"]],["result"]]],[11,"try_into","","",63,[[],["result"]]],[11,"borrow","","",63,[[["self"]],["t"]]],[11,"borrow_mut","","",63,[[["self"]],["t"]]],[11,"type_id","","",63,[[["self"]],["typeid"]]],[11,"span","","",64,[[["self"]],["span"]]],[11,"from","","",64,[[["t"]],["t"]]],[11,"into","","",64,[[],["u"]]],[11,"into_iter","","",64,[[],["i"]]],[11,"to_owned","","",64,[[["self"]],["t"]]],[11,"clone_into","","",64,[[["self"],["t"]]]],[11,"try_from","","",64,[[["u"]],["result"]]],[11,"try_into","","",64,[[],["result"]]],[11,"borrow","","",64,[[["self"]],["t"]]],[11,"borrow_mut","","",64,[[["self"]],["t"]]],[11,"type_id","","",64,[[["self"]],["typeid"]]],[11,"span","","",65,[[["self"]],["span"]]],[11,"from","","",65,[[["t"]],["t"]]],[11,"into","","",65,[[],["u"]]],[11,"to_owned","","",65,[[["self"]],["t"]]],[11,"clone_into","","",65,[[["self"],["t"]]]],[11,"try_from","","",65,[[["u"]],["result"]]],[11,"try_into","","",65,[[],["result"]]],[11,"borrow","","",65,[[["self"]],["t"]]],[11,"borrow_mut","","",65,[[["self"]],["t"]]],[11,"type_id","","",65,[[["self"]],["typeid"]]],[11,"span","","",66,[[["self"]],["span"]]],[11,"from","","",66,[[["t"]],["t"]]],[11,"into","","",66,[[],["u"]]],[11,"to_owned","","",66,[[["self"]],["t"]]],[11,"clone_into","","",66,[[["self"],["t"]]]],[11,"try_from","","",66,[[["u"]],["result"]]],[11,"try_into","","",66,[[],["result"]]],[11,"borrow","","",66,[[["self"]],["t"]]],[11,"borrow_mut","","",66,[[["self"]],["t"]]],[11,"type_id","","",66,[[["self"]],["typeid"]]],[11,"span","","",67,[[["self"]],["span"]]],[11,"from","","",67,[[["t"]],["t"]]],[11,"into","","",67,[[],["u"]]],[11,"to_owned","","",67,[[["self"]],["t"]]],[11,"clone_into","","",67,[[["self"],["t"]]]],[11,"try_from","","",67,[[["u"]],["result"]]],[11,"try_into","","",67,[[],["result"]]],[11,"borrow","","",67,[[["self"]],["t"]]],[11,"borrow_mut","","",67,[[["self"]],["t"]]],[11,"type_id","","",67,[[["self"]],["typeid"]]],[11,"span","","",68,[[["self"]],["span"]]],[11,"from","","",68,[[["t"]],["t"]]],[11,"into","","",68,[[],["u"]]],[11,"to_owned","","",68,[[["self"]],["t"]]],[11,"clone_into","","",68,[[["self"],["t"]]]],[11,"try_from","","",68,[[["u"]],["result"]]],[11,"try_into","","",68,[[],["result"]]],[11,"borrow","","",68,[[["self"]],["t"]]],[11,"borrow_mut","","",68,[[["self"]],["t"]]],[11,"type_id","","",68,[[["self"]],["typeid"]]],[11,"span","","",69,[[["self"]],["span"]]],[11,"from","","",69,[[["t"]],["t"]]],[11,"into","","",69,[[],["u"]]],[11,"to_owned","","",69,[[["self"]],["t"]]],[11,"clone_into","","",69,[[["self"],["t"]]]],[11,"try_from","","",69,[[["u"]],["result"]]],[11,"try_into","","",69,[[],["result"]]],[11,"borrow","","",69,[[["self"]],["t"]]],[11,"borrow_mut","","",69,[[["self"]],["t"]]],[11,"type_id","","",69,[[["self"]],["typeid"]]],[11,"span","","",70,[[["self"]],["span"]]],[11,"from","","",70,[[["t"]],["t"]]],[11,"into","","",70,[[],["u"]]],[11,"to_owned","","",70,[[["self"]],["t"]]],[11,"clone_into","","",70,[[["self"],["t"]]]],[11,"try_from","","",70,[[["u"]],["result"]]],[11,"try_into","","",70,[[],["result"]]],[11,"borrow","","",70,[[["self"]],["t"]]],[11,"borrow_mut","","",70,[[["self"]],["t"]]],[11,"type_id","","",70,[[["self"]],["typeid"]]],[11,"span","","",71,[[["self"]],["span"]]],[11,"from","","",71,[[["t"]],["t"]]],[11,"into","","",71,[[],["u"]]],[11,"to_owned","","",71,[[["self"]],["t"]]],[11,"clone_into","","",71,[[["self"],["t"]]]],[11,"try_from","","",71,[[["u"]],["result"]]],[11,"try_into","","",71,[[],["result"]]],[11,"borrow","","",71,[[["self"]],["t"]]],[11,"borrow_mut","","",71,[[["self"]],["t"]]],[11,"type_id","","",71,[[["self"]],["typeid"]]],[11,"peek","","",72,[[["cursor"]],["bool"]]],[11,"display","","",72,[[],["str"]]],[11,"span","","",72,[[["self"]],["span"]]],[11,"from","","",72,[[["t"]],["t"]]],[11,"into","","",72,[[],["u"]]],[11,"to_owned","","",72,[[["self"]],["t"]]],[11,"clone_into","","",72,[[["self"],["t"]]]],[11,"try_from","","",72,[[["u"]],["result"]]],[11,"try_into","","",72,[[],["result"]]],[11,"borrow","","",72,[[["self"]],["t"]]],[11,"borrow_mut","","",72,[[["self"]],["t"]]],[11,"type_id","","",72,[[["self"]],["typeid"]]],[11,"from","","",73,[[["t"]],["t"]]],[11,"into","","",73,[[],["u"]]],[11,"to_owned","","",73,[[["self"]],["t"]]],[11,"clone_into","","",73,[[["self"],["t"]]]],[11,"try_from","","",73,[[["u"]],["result"]]],[11,"try_into","","",73,[[],["result"]]],[11,"borrow","","",73,[[["self"]],["t"]]],[11,"borrow_mut","","",73,[[["self"]],["t"]]],[11,"type_id","","",73,[[["self"]],["typeid"]]],[11,"from","","",74,[[["t"]],["t"]]],[11,"into","","",74,[[],["u"]]],[11,"to_owned","","",74,[[["self"]],["t"]]],[11,"clone_into","","",74,[[["self"],["t"]]]],[11,"try_from","","",74,[[["u"]],["result"]]],[11,"try_into","","",74,[[],["result"]]],[11,"borrow","","",74,[[["self"]],["t"]]],[11,"borrow_mut","","",74,[[["self"]],["t"]]],[11,"type_id","","",74,[[["self"]],["typeid"]]],[11,"from","","",75,[[["t"]],["t"]]],[11,"into","","",75,[[],["u"]]],[11,"to_owned","","",75,[[["self"]],["t"]]],[11,"clone_into","","",75,[[["self"],["t"]]]],[11,"try_from","","",75,[[["u"]],["result"]]],[11,"try_into","","",75,[[],["result"]]],[11,"borrow","","",75,[[["self"]],["t"]]],[11,"borrow_mut","","",75,[[["self"]],["t"]]],[11,"type_id","","",75,[[["self"]],["typeid"]]],[11,"span","","",76,[[["self"]],["span"]]],[11,"from","","",76,[[["t"]],["t"]]],[11,"into","","",76,[[],["u"]]],[11,"to_owned","","",76,[[["self"]],["t"]]],[11,"clone_into","","",76,[[["self"],["t"]]]],[11,"try_from","","",76,[[["u"]],["result"]]],[11,"try_into","","",76,[[],["result"]]],[11,"borrow","","",76,[[["self"]],["t"]]],[11,"borrow_mut","","",76,[[["self"]],["t"]]],[11,"type_id","","",76,[[["self"]],["typeid"]]],[11,"span","","",77,[[["self"]],["span"]]],[11,"from","","",77,[[["t"]],["t"]]],[11,"into","","",77,[[],["u"]]],[11,"to_owned","","",77,[[["self"]],["t"]]],[11,"clone_into","","",77,[[["self"],["t"]]]],[11,"try_from","","",77,[[["u"]],["result"]]],[11,"try_into","","",77,[[],["result"]]],[11,"borrow","","",77,[[["self"]],["t"]]],[11,"borrow_mut","","",77,[[["self"]],["t"]]],[11,"type_id","","",77,[[["self"]],["typeid"]]],[11,"span","","",78,[[["self"]],["span"]]],[11,"from","","",78,[[["t"]],["t"]]],[11,"into","","",78,[[],["u"]]],[11,"to_owned","","",78,[[["self"]],["t"]]],[11,"clone_into","","",78,[[["self"],["t"]]]],[11,"try_from","","",78,[[["u"]],["result"]]],[11,"try_into","","",78,[[],["result"]]],[11,"borrow","","",78,[[["self"]],["t"]]],[11,"borrow_mut","","",78,[[["self"]],["t"]]],[11,"type_id","","",78,[[["self"]],["typeid"]]],[11,"span","","",79,[[["self"]],["span"]]],[11,"from","","",79,[[["t"]],["t"]]],[11,"into","","",79,[[],["u"]]],[11,"to_owned","","",79,[[["self"]],["t"]]],[11,"clone_into","","",79,[[["self"],["t"]]]],[11,"try_from","","",79,[[["u"]],["result"]]],[11,"try_into","","",79,[[],["result"]]],[11,"borrow","","",79,[[["self"]],["t"]]],[11,"borrow_mut","","",79,[[["self"]],["t"]]],[11,"type_id","","",79,[[["self"]],["typeid"]]],[11,"span","","",80,[[["self"]],["span"]]],[11,"from","","",80,[[["t"]],["t"]]],[11,"into","","",80,[[],["u"]]],[11,"to_owned","","",80,[[["self"]],["t"]]],[11,"clone_into","","",80,[[["self"],["t"]]]],[11,"try_from","","",80,[[["u"]],["result"]]],[11,"try_into","","",80,[[],["result"]]],[11,"borrow","","",80,[[["self"]],["t"]]],[11,"borrow_mut","","",80,[[["self"]],["t"]]],[11,"type_id","","",80,[[["self"]],["typeid"]]],[11,"span","","",81,[[["self"]],["span"]]],[11,"from","","",81,[[["t"]],["t"]]],[11,"into","","",81,[[],["u"]]],[11,"to_owned","","",81,[[["self"]],["t"]]],[11,"clone_into","","",81,[[["self"],["t"]]]],[11,"try_from","","",81,[[["u"]],["result"]]],[11,"try_into","","",81,[[],["result"]]],[11,"borrow","","",81,[[["self"]],["t"]]],[11,"borrow_mut","","",81,[[["self"]],["t"]]],[11,"type_id","","",81,[[["self"]],["typeid"]]],[11,"peek","syn::token","",82,[[["cursor"]],["bool"]]],[11,"display","","",82,[[],["str"]]],[11,"span","","",82,[[["self"]],["span"]]],[11,"from","","",82,[[["t"]],["t"]]],[11,"into","","",82,[[],["u"]]],[11,"to_owned","","",82,[[["self"]],["t"]]],[11,"clone_into","","",82,[[["self"],["t"]]]],[11,"try_from","","",82,[[["u"]],["result"]]],[11,"try_into","","",82,[[],["result"]]],[11,"borrow","","",82,[[["self"]],["t"]]],[11,"borrow_mut","","",82,[[["self"]],["t"]]],[11,"type_id","","",82,[[["self"]],["typeid"]]],[11,"peek","","",83,[[["cursor"]],["bool"]]],[11,"display","","",83,[[],["str"]]],[11,"span","","",83,[[["self"]],["span"]]],[11,"from","","",83,[[["t"]],["t"]]],[11,"into","","",83,[[],["u"]]],[11,"to_owned","","",83,[[["self"]],["t"]]],[11,"clone_into","","",83,[[["self"],["t"]]]],[11,"try_from","","",83,[[["u"]],["result"]]],[11,"try_into","","",83,[[],["result"]]],[11,"borrow","","",83,[[["self"]],["t"]]],[11,"borrow_mut","","",83,[[["self"]],["t"]]],[11,"type_id","","",83,[[["self"]],["typeid"]]],[11,"peek","","",84,[[["cursor"]],["bool"]]],[11,"display","","",84,[[],["str"]]],[11,"span","","",84,[[["self"]],["span"]]],[11,"from","","",84,[[["t"]],["t"]]],[11,"into","","",84,[[],["u"]]],[11,"to_owned","","",84,[[["self"]],["t"]]],[11,"clone_into","","",84,[[["self"],["t"]]]],[11,"try_from","","",84,[[["u"]],["result"]]],[11,"try_into","","",84,[[],["result"]]],[11,"borrow","","",84,[[["self"]],["t"]]],[11,"borrow_mut","","",84,[[["self"]],["t"]]],[11,"type_id","","",84,[[["self"]],["typeid"]]],[11,"peek","","",85,[[["cursor"]],["bool"]]],[11,"display","","",85,[[],["str"]]],[11,"span","","",85,[[["self"]],["span"]]],[11,"from","","",85,[[["t"]],["t"]]],[11,"into","","",85,[[],["u"]]],[11,"to_owned","","",85,[[["self"]],["t"]]],[11,"clone_into","","",85,[[["self"],["t"]]]],[11,"try_from","","",85,[[["u"]],["result"]]],[11,"try_into","","",85,[[],["result"]]],[11,"borrow","","",85,[[["self"]],["t"]]],[11,"borrow_mut","","",85,[[["self"]],["t"]]],[11,"type_id","","",85,[[["self"]],["typeid"]]],[11,"peek","","",86,[[["cursor"]],["bool"]]],[11,"display","","",86,[[],["str"]]],[11,"span","","",86,[[["self"]],["span"]]],[11,"from","","",86,[[["t"]],["t"]]],[11,"into","","",86,[[],["u"]]],[11,"to_owned","","",86,[[["self"]],["t"]]],[11,"clone_into","","",86,[[["self"],["t"]]]],[11,"try_from","","",86,[[["u"]],["result"]]],[11,"try_into","","",86,[[],["result"]]],[11,"borrow","","",86,[[["self"]],["t"]]],[11,"borrow_mut","","",86,[[["self"]],["t"]]],[11,"type_id","","",86,[[["self"]],["typeid"]]],[11,"peek","","",87,[[["cursor"]],["bool"]]],[11,"display","","",87,[[],["str"]]],[11,"span","","",87,[[["self"]],["span"]]],[11,"from","","",87,[[["t"]],["t"]]],[11,"into","","",87,[[],["u"]]],[11,"to_owned","","",87,[[["self"]],["t"]]],[11,"clone_into","","",87,[[["self"],["t"]]]],[11,"try_from","","",87,[[["u"]],["result"]]],[11,"try_into","","",87,[[],["result"]]],[11,"borrow","","",87,[[["self"]],["t"]]],[11,"borrow_mut","","",87,[[["self"]],["t"]]],[11,"type_id","","",87,[[["self"]],["typeid"]]],[11,"peek","","",88,[[["cursor"]],["bool"]]],[11,"display","","",88,[[],["str"]]],[11,"span","","",88,[[["self"]],["span"]]],[11,"from","","",88,[[["t"]],["t"]]],[11,"into","","",88,[[],["u"]]],[11,"to_owned","","",88,[[["self"]],["t"]]],[11,"clone_into","","",88,[[["self"],["t"]]]],[11,"try_from","","",88,[[["u"]],["result"]]],[11,"try_into","","",88,[[],["result"]]],[11,"borrow","","",88,[[["self"]],["t"]]],[11,"borrow_mut","","",88,[[["self"]],["t"]]],[11,"type_id","","",88,[[["self"]],["typeid"]]],[11,"peek","","",89,[[["cursor"]],["bool"]]],[11,"display","","",89,[[],["str"]]],[11,"span","","",89,[[["self"]],["span"]]],[11,"from","","",89,[[["t"]],["t"]]],[11,"into","","",89,[[],["u"]]],[11,"to_owned","","",89,[[["self"]],["t"]]],[11,"clone_into","","",89,[[["self"],["t"]]]],[11,"try_from","","",89,[[["u"]],["result"]]],[11,"try_into","","",89,[[],["result"]]],[11,"borrow","","",89,[[["self"]],["t"]]],[11,"borrow_mut","","",89,[[["self"]],["t"]]],[11,"type_id","","",89,[[["self"]],["typeid"]]],[11,"peek","","",90,[[["cursor"]],["bool"]]],[11,"display","","",90,[[],["str"]]],[11,"span","","",90,[[["self"]],["span"]]],[11,"from","","",90,[[["t"]],["t"]]],[11,"into","","",90,[[],["u"]]],[11,"to_owned","","",90,[[["self"]],["t"]]],[11,"clone_into","","",90,[[["self"],["t"]]]],[11,"try_from","","",90,[[["u"]],["result"]]],[11,"try_into","","",90,[[],["result"]]],[11,"borrow","","",90,[[["self"]],["t"]]],[11,"borrow_mut","","",90,[[["self"]],["t"]]],[11,"type_id","","",90,[[["self"]],["typeid"]]],[11,"peek","","",91,[[["cursor"]],["bool"]]],[11,"display","","",91,[[],["str"]]],[11,"span","","",91,[[["self"]],["span"]]],[11,"from","","",91,[[["t"]],["t"]]],[11,"into","","",91,[[],["u"]]],[11,"to_owned","","",91,[[["self"]],["t"]]],[11,"clone_into","","",91,[[["self"],["t"]]]],[11,"try_from","","",91,[[["u"]],["result"]]],[11,"try_into","","",91,[[],["result"]]],[11,"borrow","","",91,[[["self"]],["t"]]],[11,"borrow_mut","","",91,[[["self"]],["t"]]],[11,"type_id","","",91,[[["self"]],["typeid"]]],[11,"peek","","",92,[[["cursor"]],["bool"]]],[11,"display","","",92,[[],["str"]]],[11,"span","","",92,[[["self"]],["span"]]],[11,"from","","",92,[[["t"]],["t"]]],[11,"into","","",92,[[],["u"]]],[11,"to_owned","","",92,[[["self"]],["t"]]],[11,"clone_into","","",92,[[["self"],["t"]]]],[11,"try_from","","",92,[[["u"]],["result"]]],[11,"try_into","","",92,[[],["result"]]],[11,"borrow","","",92,[[["self"]],["t"]]],[11,"borrow_mut","","",92,[[["self"]],["t"]]],[11,"type_id","","",92,[[["self"]],["typeid"]]],[11,"peek","","",93,[[["cursor"]],["bool"]]],[11,"display","","",93,[[],["str"]]],[11,"span","","",93,[[["self"]],["span"]]],[11,"from","","",93,[[["t"]],["t"]]],[11,"into","","",93,[[],["u"]]],[11,"to_owned","","",93,[[["self"]],["t"]]],[11,"clone_into","","",93,[[["self"],["t"]]]],[11,"try_from","","",93,[[["u"]],["result"]]],[11,"try_into","","",93,[[],["result"]]],[11,"borrow","","",93,[[["self"]],["t"]]],[11,"borrow_mut","","",93,[[["self"]],["t"]]],[11,"type_id","","",93,[[["self"]],["typeid"]]],[11,"peek","","",94,[[["cursor"]],["bool"]]],[11,"display","","",94,[[],["str"]]],[11,"span","","",94,[[["self"]],["span"]]],[11,"from","","",94,[[["t"]],["t"]]],[11,"into","","",94,[[],["u"]]],[11,"to_owned","","",94,[[["self"]],["t"]]],[11,"clone_into","","",94,[[["self"],["t"]]]],[11,"try_from","","",94,[[["u"]],["result"]]],[11,"try_into","","",94,[[],["result"]]],[11,"borrow","","",94,[[["self"]],["t"]]],[11,"borrow_mut","","",94,[[["self"]],["t"]]],[11,"type_id","","",94,[[["self"]],["typeid"]]],[11,"peek","","",95,[[["cursor"]],["bool"]]],[11,"display","","",95,[[],["str"]]],[11,"span","","",95,[[["self"]],["span"]]],[11,"from","","",95,[[["t"]],["t"]]],[11,"into","","",95,[[],["u"]]],[11,"to_owned","","",95,[[["self"]],["t"]]],[11,"clone_into","","",95,[[["self"],["t"]]]],[11,"try_from","","",95,[[["u"]],["result"]]],[11,"try_into","","",95,[[],["result"]]],[11,"borrow","","",95,[[["self"]],["t"]]],[11,"borrow_mut","","",95,[[["self"]],["t"]]],[11,"type_id","","",95,[[["self"]],["typeid"]]],[11,"peek","","",96,[[["cursor"]],["bool"]]],[11,"display","","",96,[[],["str"]]],[11,"span","","",96,[[["self"]],["span"]]],[11,"from","","",96,[[["t"]],["t"]]],[11,"into","","",96,[[],["u"]]],[11,"to_owned","","",96,[[["self"]],["t"]]],[11,"clone_into","","",96,[[["self"],["t"]]]],[11,"try_from","","",96,[[["u"]],["result"]]],[11,"try_into","","",96,[[],["result"]]],[11,"borrow","","",96,[[["self"]],["t"]]],[11,"borrow_mut","","",96,[[["self"]],["t"]]],[11,"type_id","","",96,[[["self"]],["typeid"]]],[11,"peek","","",97,[[["cursor"]],["bool"]]],[11,"display","","",97,[[],["str"]]],[11,"span","","",97,[[["self"]],["span"]]],[11,"from","","",97,[[["t"]],["t"]]],[11,"into","","",97,[[],["u"]]],[11,"to_owned","","",97,[[["self"]],["t"]]],[11,"clone_into","","",97,[[["self"],["t"]]]],[11,"try_from","","",97,[[["u"]],["result"]]],[11,"try_into","","",97,[[],["result"]]],[11,"borrow","","",97,[[["self"]],["t"]]],[11,"borrow_mut","","",97,[[["self"]],["t"]]],[11,"type_id","","",97,[[["self"]],["typeid"]]],[11,"peek","","",98,[[["cursor"]],["bool"]]],[11,"display","","",98,[[],["str"]]],[11,"span","","",98,[[["self"]],["span"]]],[11,"from","","",98,[[["t"]],["t"]]],[11,"into","","",98,[[],["u"]]],[11,"to_owned","","",98,[[["self"]],["t"]]],[11,"clone_into","","",98,[[["self"],["t"]]]],[11,"try_from","","",98,[[["u"]],["result"]]],[11,"try_into","","",98,[[],["result"]]],[11,"borrow","","",98,[[["self"]],["t"]]],[11,"borrow_mut","","",98,[[["self"]],["t"]]],[11,"type_id","","",98,[[["self"]],["typeid"]]],[11,"peek","","",99,[[["cursor"]],["bool"]]],[11,"display","","",99,[[],["str"]]],[11,"span","","",99,[[["self"]],["span"]]],[11,"from","","",99,[[["t"]],["t"]]],[11,"into","","",99,[[],["u"]]],[11,"to_owned","","",99,[[["self"]],["t"]]],[11,"clone_into","","",99,[[["self"],["t"]]]],[11,"try_from","","",99,[[["u"]],["result"]]],[11,"try_into","","",99,[[],["result"]]],[11,"borrow","","",99,[[["self"]],["t"]]],[11,"borrow_mut","","",99,[[["self"]],["t"]]],[11,"type_id","","",99,[[["self"]],["typeid"]]],[11,"peek","","",100,[[["cursor"]],["bool"]]],[11,"display","","",100,[[],["str"]]],[11,"span","","",100,[[["self"]],["span"]]],[11,"from","","",100,[[["t"]],["t"]]],[11,"into","","",100,[[],["u"]]],[11,"to_owned","","",100,[[["self"]],["t"]]],[11,"clone_into","","",100,[[["self"],["t"]]]],[11,"try_from","","",100,[[["u"]],["result"]]],[11,"try_into","","",100,[[],["result"]]],[11,"borrow","","",100,[[["self"]],["t"]]],[11,"borrow_mut","","",100,[[["self"]],["t"]]],[11,"type_id","","",100,[[["self"]],["typeid"]]],[11,"peek","","",101,[[["cursor"]],["bool"]]],[11,"display","","",101,[[],["str"]]],[11,"span","","",101,[[["self"]],["span"]]],[11,"from","","",101,[[["t"]],["t"]]],[11,"into","","",101,[[],["u"]]],[11,"to_owned","","",101,[[["self"]],["t"]]],[11,"clone_into","","",101,[[["self"],["t"]]]],[11,"try_from","","",101,[[["u"]],["result"]]],[11,"try_into","","",101,[[],["result"]]],[11,"borrow","","",101,[[["self"]],["t"]]],[11,"borrow_mut","","",101,[[["self"]],["t"]]],[11,"type_id","","",101,[[["self"]],["typeid"]]],[11,"peek","","",102,[[["cursor"]],["bool"]]],[11,"display","","",102,[[],["str"]]],[11,"span","","",102,[[["self"]],["span"]]],[11,"from","","",102,[[["t"]],["t"]]],[11,"into","","",102,[[],["u"]]],[11,"to_owned","","",102,[[["self"]],["t"]]],[11,"clone_into","","",102,[[["self"],["t"]]]],[11,"try_from","","",102,[[["u"]],["result"]]],[11,"try_into","","",102,[[],["result"]]],[11,"borrow","","",102,[[["self"]],["t"]]],[11,"borrow_mut","","",102,[[["self"]],["t"]]],[11,"type_id","","",102,[[["self"]],["typeid"]]],[11,"peek","","",103,[[["cursor"]],["bool"]]],[11,"display","","",103,[[],["str"]]],[11,"span","","",103,[[["self"]],["span"]]],[11,"from","","",103,[[["t"]],["t"]]],[11,"into","","",103,[[],["u"]]],[11,"to_owned","","",103,[[["self"]],["t"]]],[11,"clone_into","","",103,[[["self"],["t"]]]],[11,"try_from","","",103,[[["u"]],["result"]]],[11,"try_into","","",103,[[],["result"]]],[11,"borrow","","",103,[[["self"]],["t"]]],[11,"borrow_mut","","",103,[[["self"]],["t"]]],[11,"type_id","","",103,[[["self"]],["typeid"]]],[11,"peek","","",104,[[["cursor"]],["bool"]]],[11,"display","","",104,[[],["str"]]],[11,"span","","",104,[[["self"]],["span"]]],[11,"from","","",104,[[["t"]],["t"]]],[11,"into","","",104,[[],["u"]]],[11,"to_owned","","",104,[[["self"]],["t"]]],[11,"clone_into","","",104,[[["self"],["t"]]]],[11,"try_from","","",104,[[["u"]],["result"]]],[11,"try_into","","",104,[[],["result"]]],[11,"borrow","","",104,[[["self"]],["t"]]],[11,"borrow_mut","","",104,[[["self"]],["t"]]],[11,"type_id","","",104,[[["self"]],["typeid"]]],[11,"peek","","",105,[[["cursor"]],["bool"]]],[11,"display","","",105,[[],["str"]]],[11,"span","","",105,[[["self"]],["span"]]],[11,"from","","",105,[[["t"]],["t"]]],[11,"into","","",105,[[],["u"]]],[11,"to_owned","","",105,[[["self"]],["t"]]],[11,"clone_into","","",105,[[["self"],["t"]]]],[11,"try_from","","",105,[[["u"]],["result"]]],[11,"try_into","","",105,[[],["result"]]],[11,"borrow","","",105,[[["self"]],["t"]]],[11,"borrow_mut","","",105,[[["self"]],["t"]]],[11,"type_id","","",105,[[["self"]],["typeid"]]],[11,"peek","","",106,[[["cursor"]],["bool"]]],[11,"display","","",106,[[],["str"]]],[11,"span","","",106,[[["self"]],["span"]]],[11,"from","","",106,[[["t"]],["t"]]],[11,"into","","",106,[[],["u"]]],[11,"to_owned","","",106,[[["self"]],["t"]]],[11,"clone_into","","",106,[[["self"],["t"]]]],[11,"try_from","","",106,[[["u"]],["result"]]],[11,"try_into","","",106,[[],["result"]]],[11,"borrow","","",106,[[["self"]],["t"]]],[11,"borrow_mut","","",106,[[["self"]],["t"]]],[11,"type_id","","",106,[[["self"]],["typeid"]]],[11,"peek","","",107,[[["cursor"]],["bool"]]],[11,"display","","",107,[[],["str"]]],[11,"span","","",107,[[["self"]],["span"]]],[11,"from","","",107,[[["t"]],["t"]]],[11,"into","","",107,[[],["u"]]],[11,"to_owned","","",107,[[["self"]],["t"]]],[11,"clone_into","","",107,[[["self"],["t"]]]],[11,"try_from","","",107,[[["u"]],["result"]]],[11,"try_into","","",107,[[],["result"]]],[11,"borrow","","",107,[[["self"]],["t"]]],[11,"borrow_mut","","",107,[[["self"]],["t"]]],[11,"type_id","","",107,[[["self"]],["typeid"]]],[11,"peek","","",108,[[["cursor"]],["bool"]]],[11,"display","","",108,[[],["str"]]],[11,"span","","",108,[[["self"]],["span"]]],[11,"from","","",108,[[["t"]],["t"]]],[11,"into","","",108,[[],["u"]]],[11,"to_owned","","",108,[[["self"]],["t"]]],[11,"clone_into","","",108,[[["self"],["t"]]]],[11,"try_from","","",108,[[["u"]],["result"]]],[11,"try_into","","",108,[[],["result"]]],[11,"borrow","","",108,[[["self"]],["t"]]],[11,"borrow_mut","","",108,[[["self"]],["t"]]],[11,"type_id","","",108,[[["self"]],["typeid"]]],[11,"peek","","",109,[[["cursor"]],["bool"]]],[11,"display","","",109,[[],["str"]]],[11,"span","","",109,[[["self"]],["span"]]],[11,"from","","",109,[[["t"]],["t"]]],[11,"into","","",109,[[],["u"]]],[11,"to_owned","","",109,[[["self"]],["t"]]],[11,"clone_into","","",109,[[["self"],["t"]]]],[11,"try_from","","",109,[[["u"]],["result"]]],[11,"try_into","","",109,[[],["result"]]],[11,"borrow","","",109,[[["self"]],["t"]]],[11,"borrow_mut","","",109,[[["self"]],["t"]]],[11,"type_id","","",109,[[["self"]],["typeid"]]],[11,"peek","","",110,[[["cursor"]],["bool"]]],[11,"display","","",110,[[],["str"]]],[11,"span","","",110,[[["self"]],["span"]]],[11,"from","","",110,[[["t"]],["t"]]],[11,"into","","",110,[[],["u"]]],[11,"to_owned","","",110,[[["self"]],["t"]]],[11,"clone_into","","",110,[[["self"],["t"]]]],[11,"try_from","","",110,[[["u"]],["result"]]],[11,"try_into","","",110,[[],["result"]]],[11,"borrow","","",110,[[["self"]],["t"]]],[11,"borrow_mut","","",110,[[["self"]],["t"]]],[11,"type_id","","",110,[[["self"]],["typeid"]]],[11,"peek","","",111,[[["cursor"]],["bool"]]],[11,"display","","",111,[[],["str"]]],[11,"span","","",111,[[["self"]],["span"]]],[11,"from","","",111,[[["t"]],["t"]]],[11,"into","","",111,[[],["u"]]],[11,"to_owned","","",111,[[["self"]],["t"]]],[11,"clone_into","","",111,[[["self"],["t"]]]],[11,"try_from","","",111,[[["u"]],["result"]]],[11,"try_into","","",111,[[],["result"]]],[11,"borrow","","",111,[[["self"]],["t"]]],[11,"borrow_mut","","",111,[[["self"]],["t"]]],[11,"type_id","","",111,[[["self"]],["typeid"]]],[11,"peek","","",112,[[["cursor"]],["bool"]]],[11,"display","","",112,[[],["str"]]],[11,"span","","",112,[[["self"]],["span"]]],[11,"from","","",112,[[["t"]],["t"]]],[11,"into","","",112,[[],["u"]]],[11,"to_owned","","",112,[[["self"]],["t"]]],[11,"clone_into","","",112,[[["self"],["t"]]]],[11,"try_from","","",112,[[["u"]],["result"]]],[11,"try_into","","",112,[[],["result"]]],[11,"borrow","","",112,[[["self"]],["t"]]],[11,"borrow_mut","","",112,[[["self"]],["t"]]],[11,"type_id","","",112,[[["self"]],["typeid"]]],[11,"peek","","",113,[[["cursor"]],["bool"]]],[11,"display","","",113,[[],["str"]]],[11,"span","","",113,[[["self"]],["span"]]],[11,"from","","",113,[[["t"]],["t"]]],[11,"into","","",113,[[],["u"]]],[11,"to_owned","","",113,[[["self"]],["t"]]],[11,"clone_into","","",113,[[["self"],["t"]]]],[11,"try_from","","",113,[[["u"]],["result"]]],[11,"try_into","","",113,[[],["result"]]],[11,"borrow","","",113,[[["self"]],["t"]]],[11,"borrow_mut","","",113,[[["self"]],["t"]]],[11,"type_id","","",113,[[["self"]],["typeid"]]],[11,"peek","","",114,[[["cursor"]],["bool"]]],[11,"display","","",114,[[],["str"]]],[11,"span","","",114,[[["self"]],["span"]]],[11,"from","","",114,[[["t"]],["t"]]],[11,"into","","",114,[[],["u"]]],[11,"to_owned","","",114,[[["self"]],["t"]]],[11,"clone_into","","",114,[[["self"],["t"]]]],[11,"try_from","","",114,[[["u"]],["result"]]],[11,"try_into","","",114,[[],["result"]]],[11,"borrow","","",114,[[["self"]],["t"]]],[11,"borrow_mut","","",114,[[["self"]],["t"]]],[11,"type_id","","",114,[[["self"]],["typeid"]]],[11,"peek","","",115,[[["cursor"]],["bool"]]],[11,"display","","",115,[[],["str"]]],[11,"span","","",115,[[["self"]],["span"]]],[11,"from","","",115,[[["t"]],["t"]]],[11,"into","","",115,[[],["u"]]],[11,"to_owned","","",115,[[["self"]],["t"]]],[11,"clone_into","","",115,[[["self"],["t"]]]],[11,"try_from","","",115,[[["u"]],["result"]]],[11,"try_into","","",115,[[],["result"]]],[11,"borrow","","",115,[[["self"]],["t"]]],[11,"borrow_mut","","",115,[[["self"]],["t"]]],[11,"type_id","","",115,[[["self"]],["typeid"]]],[11,"peek","","",116,[[["cursor"]],["bool"]]],[11,"display","","",116,[[],["str"]]],[11,"span","","",116,[[["self"]],["span"]]],[11,"from","","",116,[[["t"]],["t"]]],[11,"into","","",116,[[],["u"]]],[11,"to_owned","","",116,[[["self"]],["t"]]],[11,"clone_into","","",116,[[["self"],["t"]]]],[11,"try_from","","",116,[[["u"]],["result"]]],[11,"try_into","","",116,[[],["result"]]],[11,"borrow","","",116,[[["self"]],["t"]]],[11,"borrow_mut","","",116,[[["self"]],["t"]]],[11,"type_id","","",116,[[["self"]],["typeid"]]],[11,"peek","","",117,[[["cursor"]],["bool"]]],[11,"display","","",117,[[],["str"]]],[11,"span","","",117,[[["self"]],["span"]]],[11,"from","","",117,[[["t"]],["t"]]],[11,"into","","",117,[[],["u"]]],[11,"to_owned","","",117,[[["self"]],["t"]]],[11,"clone_into","","",117,[[["self"],["t"]]]],[11,"try_from","","",117,[[["u"]],["result"]]],[11,"try_into","","",117,[[],["result"]]],[11,"borrow","","",117,[[["self"]],["t"]]],[11,"borrow_mut","","",117,[[["self"]],["t"]]],[11,"type_id","","",117,[[["self"]],["typeid"]]],[11,"peek","","",118,[[["cursor"]],["bool"]]],[11,"display","","",118,[[],["str"]]],[11,"span","","",118,[[["self"]],["span"]]],[11,"from","","",118,[[["t"]],["t"]]],[11,"into","","",118,[[],["u"]]],[11,"to_owned","","",118,[[["self"]],["t"]]],[11,"clone_into","","",118,[[["self"],["t"]]]],[11,"try_from","","",118,[[["u"]],["result"]]],[11,"try_into","","",118,[[],["result"]]],[11,"borrow","","",118,[[["self"]],["t"]]],[11,"borrow_mut","","",118,[[["self"]],["t"]]],[11,"type_id","","",118,[[["self"]],["typeid"]]],[11,"peek","","",119,[[["cursor"]],["bool"]]],[11,"display","","",119,[[],["str"]]],[11,"span","","",119,[[["self"]],["span"]]],[11,"from","","",119,[[["t"]],["t"]]],[11,"into","","",119,[[],["u"]]],[11,"to_owned","","",119,[[["self"]],["t"]]],[11,"clone_into","","",119,[[["self"],["t"]]]],[11,"try_from","","",119,[[["u"]],["result"]]],[11,"try_into","","",119,[[],["result"]]],[11,"borrow","","",119,[[["self"]],["t"]]],[11,"borrow_mut","","",119,[[["self"]],["t"]]],[11,"type_id","","",119,[[["self"]],["typeid"]]],[11,"peek","","",120,[[["cursor"]],["bool"]]],[11,"display","","",120,[[],["str"]]],[11,"span","","",120,[[["self"]],["span"]]],[11,"from","","",120,[[["t"]],["t"]]],[11,"into","","",120,[[],["u"]]],[11,"to_owned","","",120,[[["self"]],["t"]]],[11,"clone_into","","",120,[[["self"],["t"]]]],[11,"try_from","","",120,[[["u"]],["result"]]],[11,"try_into","","",120,[[],["result"]]],[11,"borrow","","",120,[[["self"]],["t"]]],[11,"borrow_mut","","",120,[[["self"]],["t"]]],[11,"type_id","","",120,[[["self"]],["typeid"]]],[11,"peek","","",121,[[["cursor"]],["bool"]]],[11,"display","","",121,[[],["str"]]],[11,"span","","",121,[[["self"]],["span"]]],[11,"from","","",121,[[["t"]],["t"]]],[11,"into","","",121,[[],["u"]]],[11,"to_owned","","",121,[[["self"]],["t"]]],[11,"clone_into","","",121,[[["self"],["t"]]]],[11,"try_from","","",121,[[["u"]],["result"]]],[11,"try_into","","",121,[[],["result"]]],[11,"borrow","","",121,[[["self"]],["t"]]],[11,"borrow_mut","","",121,[[["self"]],["t"]]],[11,"type_id","","",121,[[["self"]],["typeid"]]],[11,"peek","","",122,[[["cursor"]],["bool"]]],[11,"display","","",122,[[],["str"]]],[11,"span","","",122,[[["self"]],["span"]]],[11,"from","","",122,[[["t"]],["t"]]],[11,"into","","",122,[[],["u"]]],[11,"to_owned","","",122,[[["self"]],["t"]]],[11,"clone_into","","",122,[[["self"],["t"]]]],[11,"try_from","","",122,[[["u"]],["result"]]],[11,"try_into","","",122,[[],["result"]]],[11,"borrow","","",122,[[["self"]],["t"]]],[11,"borrow_mut","","",122,[[["self"]],["t"]]],[11,"type_id","","",122,[[["self"]],["typeid"]]],[11,"peek","","",123,[[["cursor"]],["bool"]]],[11,"display","","",123,[[],["str"]]],[11,"span","","",123,[[["self"]],["span"]]],[11,"from","","",123,[[["t"]],["t"]]],[11,"into","","",123,[[],["u"]]],[11,"to_owned","","",123,[[["self"]],["t"]]],[11,"clone_into","","",123,[[["self"],["t"]]]],[11,"try_from","","",123,[[["u"]],["result"]]],[11,"try_into","","",123,[[],["result"]]],[11,"borrow","","",123,[[["self"]],["t"]]],[11,"borrow_mut","","",123,[[["self"]],["t"]]],[11,"type_id","","",123,[[["self"]],["typeid"]]],[11,"peek","","",124,[[["cursor"]],["bool"]]],[11,"display","","",124,[[],["str"]]],[11,"span","","",124,[[["self"]],["span"]]],[11,"from","","",124,[[["t"]],["t"]]],[11,"into","","",124,[[],["u"]]],[11,"to_owned","","",124,[[["self"]],["t"]]],[11,"clone_into","","",124,[[["self"],["t"]]]],[11,"try_from","","",124,[[["u"]],["result"]]],[11,"try_into","","",124,[[],["result"]]],[11,"borrow","","",124,[[["self"]],["t"]]],[11,"borrow_mut","","",124,[[["self"]],["t"]]],[11,"type_id","","",124,[[["self"]],["typeid"]]],[11,"peek","","",125,[[["cursor"]],["bool"]]],[11,"display","","",125,[[],["str"]]],[11,"span","","",125,[[["self"]],["span"]]],[11,"from","","",125,[[["t"]],["t"]]],[11,"into","","",125,[[],["u"]]],[11,"to_owned","","",125,[[["self"]],["t"]]],[11,"clone_into","","",125,[[["self"],["t"]]]],[11,"try_from","","",125,[[["u"]],["result"]]],[11,"try_into","","",125,[[],["result"]]],[11,"borrow","","",125,[[["self"]],["t"]]],[11,"borrow_mut","","",125,[[["self"]],["t"]]],[11,"type_id","","",125,[[["self"]],["typeid"]]],[11,"peek","","",126,[[["cursor"]],["bool"]]],[11,"display","","",126,[[],["str"]]],[11,"span","","",126,[[["self"]],["span"]]],[11,"from","","",126,[[["t"]],["t"]]],[11,"into","","",126,[[],["u"]]],[11,"to_owned","","",126,[[["self"]],["t"]]],[11,"clone_into","","",126,[[["self"],["t"]]]],[11,"try_from","","",126,[[["u"]],["result"]]],[11,"try_into","","",126,[[],["result"]]],[11,"borrow","","",126,[[["self"]],["t"]]],[11,"borrow_mut","","",126,[[["self"]],["t"]]],[11,"type_id","","",126,[[["self"]],["typeid"]]],[11,"peek","","",127,[[["cursor"]],["bool"]]],[11,"display","","",127,[[],["str"]]],[11,"span","","",127,[[["self"]],["span"]]],[11,"from","","",127,[[["t"]],["t"]]],[11,"into","","",127,[[],["u"]]],[11,"to_owned","","",127,[[["self"]],["t"]]],[11,"clone_into","","",127,[[["self"],["t"]]]],[11,"try_from","","",127,[[["u"]],["result"]]],[11,"try_into","","",127,[[],["result"]]],[11,"borrow","","",127,[[["self"]],["t"]]],[11,"borrow_mut","","",127,[[["self"]],["t"]]],[11,"type_id","","",127,[[["self"]],["typeid"]]],[11,"peek","","",128,[[["cursor"]],["bool"]]],[11,"display","","",128,[[],["str"]]],[11,"span","","",128,[[["self"]],["span"]]],[11,"from","","",128,[[["t"]],["t"]]],[11,"into","","",128,[[],["u"]]],[11,"to_owned","","",128,[[["self"]],["t"]]],[11,"clone_into","","",128,[[["self"],["t"]]]],[11,"try_from","","",128,[[["u"]],["result"]]],[11,"try_into","","",128,[[],["result"]]],[11,"borrow","","",128,[[["self"]],["t"]]],[11,"borrow_mut","","",128,[[["self"]],["t"]]],[11,"type_id","","",128,[[["self"]],["typeid"]]],[11,"peek","","",129,[[["cursor"]],["bool"]]],[11,"display","","",129,[[],["str"]]],[11,"span","","",129,[[["self"]],["span"]]],[11,"from","","",129,[[["t"]],["t"]]],[11,"into","","",129,[[],["u"]]],[11,"to_owned","","",129,[[["self"]],["t"]]],[11,"clone_into","","",129,[[["self"],["t"]]]],[11,"try_from","","",129,[[["u"]],["result"]]],[11,"try_into","","",129,[[],["result"]]],[11,"borrow","","",129,[[["self"]],["t"]]],[11,"borrow_mut","","",129,[[["self"]],["t"]]],[11,"type_id","","",129,[[["self"]],["typeid"]]],[11,"peek","","",130,[[["cursor"]],["bool"]]],[11,"display","","",130,[[],["str"]]],[11,"span","","",130,[[["self"]],["span"]]],[11,"from","","",130,[[["t"]],["t"]]],[11,"into","","",130,[[],["u"]]],[11,"to_owned","","",130,[[["self"]],["t"]]],[11,"clone_into","","",130,[[["self"],["t"]]]],[11,"try_from","","",130,[[["u"]],["result"]]],[11,"try_into","","",130,[[],["result"]]],[11,"borrow","","",130,[[["self"]],["t"]]],[11,"borrow_mut","","",130,[[["self"]],["t"]]],[11,"type_id","","",130,[[["self"]],["typeid"]]],[11,"peek","","",131,[[["cursor"]],["bool"]]],[11,"display","","",131,[[],["str"]]],[11,"span","","",131,[[["self"]],["span"]]],[11,"from","","",131,[[["t"]],["t"]]],[11,"into","","",131,[[],["u"]]],[11,"to_owned","","",131,[[["self"]],["t"]]],[11,"clone_into","","",131,[[["self"],["t"]]]],[11,"try_from","","",131,[[["u"]],["result"]]],[11,"try_into","","",131,[[],["result"]]],[11,"borrow","","",131,[[["self"]],["t"]]],[11,"borrow_mut","","",131,[[["self"]],["t"]]],[11,"type_id","","",131,[[["self"]],["typeid"]]],[11,"peek","","",132,[[["cursor"]],["bool"]]],[11,"display","","",132,[[],["str"]]],[11,"span","","",132,[[["self"]],["span"]]],[11,"from","","",132,[[["t"]],["t"]]],[11,"into","","",132,[[],["u"]]],[11,"to_owned","","",132,[[["self"]],["t"]]],[11,"clone_into","","",132,[[["self"],["t"]]]],[11,"try_from","","",132,[[["u"]],["result"]]],[11,"try_into","","",132,[[],["result"]]],[11,"borrow","","",132,[[["self"]],["t"]]],[11,"borrow_mut","","",132,[[["self"]],["t"]]],[11,"type_id","","",132,[[["self"]],["typeid"]]],[11,"peek","","",133,[[["cursor"]],["bool"]]],[11,"display","","",133,[[],["str"]]],[11,"span","","",133,[[["self"]],["span"]]],[11,"from","","",133,[[["t"]],["t"]]],[11,"into","","",133,[[],["u"]]],[11,"to_owned","","",133,[[["self"]],["t"]]],[11,"clone_into","","",133,[[["self"],["t"]]]],[11,"try_from","","",133,[[["u"]],["result"]]],[11,"try_into","","",133,[[],["result"]]],[11,"borrow","","",133,[[["self"]],["t"]]],[11,"borrow_mut","","",133,[[["self"]],["t"]]],[11,"type_id","","",133,[[["self"]],["typeid"]]],[11,"peek","","",134,[[["cursor"]],["bool"]]],[11,"display","","",134,[[],["str"]]],[11,"span","","",134,[[["self"]],["span"]]],[11,"from","","",134,[[["t"]],["t"]]],[11,"into","","",134,[[],["u"]]],[11,"to_owned","","",134,[[["self"]],["t"]]],[11,"clone_into","","",134,[[["self"],["t"]]]],[11,"try_from","","",134,[[["u"]],["result"]]],[11,"try_into","","",134,[[],["result"]]],[11,"borrow","","",134,[[["self"]],["t"]]],[11,"borrow_mut","","",134,[[["self"]],["t"]]],[11,"type_id","","",134,[[["self"]],["typeid"]]],[11,"peek","","",135,[[["cursor"]],["bool"]]],[11,"display","","",135,[[],["str"]]],[11,"span","","",135,[[["self"]],["span"]]],[11,"from","","",135,[[["t"]],["t"]]],[11,"into","","",135,[[],["u"]]],[11,"to_owned","","",135,[[["self"]],["t"]]],[11,"clone_into","","",135,[[["self"],["t"]]]],[11,"try_from","","",135,[[["u"]],["result"]]],[11,"try_into","","",135,[[],["result"]]],[11,"borrow","","",135,[[["self"]],["t"]]],[11,"borrow_mut","","",135,[[["self"]],["t"]]],[11,"type_id","","",135,[[["self"]],["typeid"]]],[11,"peek","","",136,[[["cursor"]],["bool"]]],[11,"display","","",136,[[],["str"]]],[11,"span","","",136,[[["self"]],["span"]]],[11,"from","","",136,[[["t"]],["t"]]],[11,"into","","",136,[[],["u"]]],[11,"to_owned","","",136,[[["self"]],["t"]]],[11,"clone_into","","",136,[[["self"],["t"]]]],[11,"try_from","","",136,[[["u"]],["result"]]],[11,"try_into","","",136,[[],["result"]]],[11,"borrow","","",136,[[["self"]],["t"]]],[11,"borrow_mut","","",136,[[["self"]],["t"]]],[11,"type_id","","",136,[[["self"]],["typeid"]]],[11,"peek","","",137,[[["cursor"]],["bool"]]],[11,"display","","",137,[[],["str"]]],[11,"span","","",137,[[["self"]],["span"]]],[11,"from","","",137,[[["t"]],["t"]]],[11,"into","","",137,[[],["u"]]],[11,"to_owned","","",137,[[["self"]],["t"]]],[11,"clone_into","","",137,[[["self"],["t"]]]],[11,"try_from","","",137,[[["u"]],["result"]]],[11,"try_into","","",137,[[],["result"]]],[11,"borrow","","",137,[[["self"]],["t"]]],[11,"borrow_mut","","",137,[[["self"]],["t"]]],[11,"type_id","","",137,[[["self"]],["typeid"]]],[11,"peek","","",138,[[["cursor"]],["bool"]]],[11,"display","","",138,[[],["str"]]],[11,"span","","",138,[[["self"]],["span"]]],[11,"from","","",138,[[["t"]],["t"]]],[11,"into","","",138,[[],["u"]]],[11,"to_owned","","",138,[[["self"]],["t"]]],[11,"clone_into","","",138,[[["self"],["t"]]]],[11,"try_from","","",138,[[["u"]],["result"]]],[11,"try_into","","",138,[[],["result"]]],[11,"borrow","","",138,[[["self"]],["t"]]],[11,"borrow_mut","","",138,[[["self"]],["t"]]],[11,"type_id","","",138,[[["self"]],["typeid"]]],[11,"peek","","",139,[[["cursor"]],["bool"]]],[11,"display","","",139,[[],["str"]]],[11,"span","","",139,[[["self"]],["span"]]],[11,"from","","",139,[[["t"]],["t"]]],[11,"into","","",139,[[],["u"]]],[11,"to_owned","","",139,[[["self"]],["t"]]],[11,"clone_into","","",139,[[["self"],["t"]]]],[11,"try_from","","",139,[[["u"]],["result"]]],[11,"try_into","","",139,[[],["result"]]],[11,"borrow","","",139,[[["self"]],["t"]]],[11,"borrow_mut","","",139,[[["self"]],["t"]]],[11,"type_id","","",139,[[["self"]],["typeid"]]],[11,"peek","","",140,[[["cursor"]],["bool"]]],[11,"display","","",140,[[],["str"]]],[11,"span","","",140,[[["self"]],["span"]]],[11,"from","","",140,[[["t"]],["t"]]],[11,"into","","",140,[[],["u"]]],[11,"to_owned","","",140,[[["self"]],["t"]]],[11,"clone_into","","",140,[[["self"],["t"]]]],[11,"try_from","","",140,[[["u"]],["result"]]],[11,"try_into","","",140,[[],["result"]]],[11,"borrow","","",140,[[["self"]],["t"]]],[11,"borrow_mut","","",140,[[["self"]],["t"]]],[11,"type_id","","",140,[[["self"]],["typeid"]]],[11,"peek","","",141,[[["cursor"]],["bool"]]],[11,"display","","",141,[[],["str"]]],[11,"span","","",141,[[["self"]],["span"]]],[11,"from","","",141,[[["t"]],["t"]]],[11,"into","","",141,[[],["u"]]],[11,"to_owned","","",141,[[["self"]],["t"]]],[11,"clone_into","","",141,[[["self"],["t"]]]],[11,"try_from","","",141,[[["u"]],["result"]]],[11,"try_into","","",141,[[],["result"]]],[11,"borrow","","",141,[[["self"]],["t"]]],[11,"borrow_mut","","",141,[[["self"]],["t"]]],[11,"type_id","","",141,[[["self"]],["typeid"]]],[11,"peek","","",142,[[["cursor"]],["bool"]]],[11,"display","","",142,[[],["str"]]],[11,"span","","",142,[[["self"]],["span"]]],[11,"from","","",142,[[["t"]],["t"]]],[11,"into","","",142,[[],["u"]]],[11,"to_owned","","",142,[[["self"]],["t"]]],[11,"clone_into","","",142,[[["self"],["t"]]]],[11,"try_from","","",142,[[["u"]],["result"]]],[11,"try_into","","",142,[[],["result"]]],[11,"borrow","","",142,[[["self"]],["t"]]],[11,"borrow_mut","","",142,[[["self"]],["t"]]],[11,"type_id","","",142,[[["self"]],["typeid"]]],[11,"peek","","",143,[[["cursor"]],["bool"]]],[11,"display","","",143,[[],["str"]]],[11,"span","","",143,[[["self"]],["span"]]],[11,"from","","",143,[[["t"]],["t"]]],[11,"into","","",143,[[],["u"]]],[11,"to_owned","","",143,[[["self"]],["t"]]],[11,"clone_into","","",143,[[["self"],["t"]]]],[11,"try_from","","",143,[[["u"]],["result"]]],[11,"try_into","","",143,[[],["result"]]],[11,"borrow","","",143,[[["self"]],["t"]]],[11,"borrow_mut","","",143,[[["self"]],["t"]]],[11,"type_id","","",143,[[["self"]],["typeid"]]],[11,"peek","","",144,[[["cursor"]],["bool"]]],[11,"display","","",144,[[],["str"]]],[11,"span","","",144,[[["self"]],["span"]]],[11,"from","","",144,[[["t"]],["t"]]],[11,"into","","",144,[[],["u"]]],[11,"to_owned","","",144,[[["self"]],["t"]]],[11,"clone_into","","",144,[[["self"],["t"]]]],[11,"try_from","","",144,[[["u"]],["result"]]],[11,"try_into","","",144,[[],["result"]]],[11,"borrow","","",144,[[["self"]],["t"]]],[11,"borrow_mut","","",144,[[["self"]],["t"]]],[11,"type_id","","",144,[[["self"]],["typeid"]]],[11,"peek","","",145,[[["cursor"]],["bool"]]],[11,"display","","",145,[[],["str"]]],[11,"span","","",145,[[["self"]],["span"]]],[11,"from","","",145,[[["t"]],["t"]]],[11,"into","","",145,[[],["u"]]],[11,"to_owned","","",145,[[["self"]],["t"]]],[11,"clone_into","","",145,[[["self"],["t"]]]],[11,"try_from","","",145,[[["u"]],["result"]]],[11,"try_into","","",145,[[],["result"]]],[11,"borrow","","",145,[[["self"]],["t"]]],[11,"borrow_mut","","",145,[[["self"]],["t"]]],[11,"type_id","","",145,[[["self"]],["typeid"]]],[11,"peek","","",146,[[["cursor"]],["bool"]]],[11,"display","","",146,[[],["str"]]],[11,"span","","",146,[[["self"]],["span"]]],[11,"from","","",146,[[["t"]],["t"]]],[11,"into","","",146,[[],["u"]]],[11,"to_owned","","",146,[[["self"]],["t"]]],[11,"clone_into","","",146,[[["self"],["t"]]]],[11,"try_from","","",146,[[["u"]],["result"]]],[11,"try_into","","",146,[[],["result"]]],[11,"borrow","","",146,[[["self"]],["t"]]],[11,"borrow_mut","","",146,[[["self"]],["t"]]],[11,"type_id","","",146,[[["self"]],["typeid"]]],[11,"peek","","",147,[[["cursor"]],["bool"]]],[11,"display","","",147,[[],["str"]]],[11,"span","","",147,[[["self"]],["span"]]],[11,"from","","",147,[[["t"]],["t"]]],[11,"into","","",147,[[],["u"]]],[11,"to_owned","","",147,[[["self"]],["t"]]],[11,"clone_into","","",147,[[["self"],["t"]]]],[11,"try_from","","",147,[[["u"]],["result"]]],[11,"try_into","","",147,[[],["result"]]],[11,"borrow","","",147,[[["self"]],["t"]]],[11,"borrow_mut","","",147,[[["self"]],["t"]]],[11,"type_id","","",147,[[["self"]],["typeid"]]],[11,"peek","","",148,[[["cursor"]],["bool"]]],[11,"display","","",148,[[],["str"]]],[11,"span","","",148,[[["self"]],["span"]]],[11,"from","","",148,[[["t"]],["t"]]],[11,"into","","",148,[[],["u"]]],[11,"to_owned","","",148,[[["self"]],["t"]]],[11,"clone_into","","",148,[[["self"],["t"]]]],[11,"try_from","","",148,[[["u"]],["result"]]],[11,"try_into","","",148,[[],["result"]]],[11,"borrow","","",148,[[["self"]],["t"]]],[11,"borrow_mut","","",148,[[["self"]],["t"]]],[11,"type_id","","",148,[[["self"]],["typeid"]]],[11,"peek","","",149,[[["cursor"]],["bool"]]],[11,"display","","",149,[[],["str"]]],[11,"span","","",149,[[["self"]],["span"]]],[11,"from","","",149,[[["t"]],["t"]]],[11,"into","","",149,[[],["u"]]],[11,"to_owned","","",149,[[["self"]],["t"]]],[11,"clone_into","","",149,[[["self"],["t"]]]],[11,"try_from","","",149,[[["u"]],["result"]]],[11,"try_into","","",149,[[],["result"]]],[11,"borrow","","",149,[[["self"]],["t"]]],[11,"borrow_mut","","",149,[[["self"]],["t"]]],[11,"type_id","","",149,[[["self"]],["typeid"]]],[11,"peek","","",150,[[["cursor"]],["bool"]]],[11,"display","","",150,[[],["str"]]],[11,"span","","",150,[[["self"]],["span"]]],[11,"from","","",150,[[["t"]],["t"]]],[11,"into","","",150,[[],["u"]]],[11,"to_owned","","",150,[[["self"]],["t"]]],[11,"clone_into","","",150,[[["self"],["t"]]]],[11,"try_from","","",150,[[["u"]],["result"]]],[11,"try_into","","",150,[[],["result"]]],[11,"borrow","","",150,[[["self"]],["t"]]],[11,"borrow_mut","","",150,[[["self"]],["t"]]],[11,"type_id","","",150,[[["self"]],["typeid"]]],[11,"peek","","",151,[[["cursor"]],["bool"]]],[11,"display","","",151,[[],["str"]]],[11,"span","","",151,[[["self"]],["span"]]],[11,"from","","",151,[[["t"]],["t"]]],[11,"into","","",151,[[],["u"]]],[11,"to_owned","","",151,[[["self"]],["t"]]],[11,"clone_into","","",151,[[["self"],["t"]]]],[11,"try_from","","",151,[[["u"]],["result"]]],[11,"try_into","","",151,[[],["result"]]],[11,"borrow","","",151,[[["self"]],["t"]]],[11,"borrow_mut","","",151,[[["self"]],["t"]]],[11,"type_id","","",151,[[["self"]],["typeid"]]],[11,"peek","","",152,[[["cursor"]],["bool"]]],[11,"display","","",152,[[],["str"]]],[11,"span","","",152,[[["self"]],["span"]]],[11,"from","","",152,[[["t"]],["t"]]],[11,"into","","",152,[[],["u"]]],[11,"to_owned","","",152,[[["self"]],["t"]]],[11,"clone_into","","",152,[[["self"],["t"]]]],[11,"try_from","","",152,[[["u"]],["result"]]],[11,"try_into","","",152,[[],["result"]]],[11,"borrow","","",152,[[["self"]],["t"]]],[11,"borrow_mut","","",152,[[["self"]],["t"]]],[11,"type_id","","",152,[[["self"]],["typeid"]]],[11,"peek","","",153,[[["cursor"]],["bool"]]],[11,"display","","",153,[[],["str"]]],[11,"span","","",153,[[["self"]],["span"]]],[11,"from","","",153,[[["t"]],["t"]]],[11,"into","","",153,[[],["u"]]],[11,"to_owned","","",153,[[["self"]],["t"]]],[11,"clone_into","","",153,[[["self"],["t"]]]],[11,"try_from","","",153,[[["u"]],["result"]]],[11,"try_into","","",153,[[],["result"]]],[11,"borrow","","",153,[[["self"]],["t"]]],[11,"borrow_mut","","",153,[[["self"]],["t"]]],[11,"type_id","","",153,[[["self"]],["typeid"]]],[11,"peek","","",154,[[["cursor"]],["bool"]]],[11,"display","","",154,[[],["str"]]],[11,"span","","",154,[[["self"]],["span"]]],[11,"from","","",154,[[["t"]],["t"]]],[11,"into","","",154,[[],["u"]]],[11,"to_owned","","",154,[[["self"]],["t"]]],[11,"clone_into","","",154,[[["self"],["t"]]]],[11,"try_from","","",154,[[["u"]],["result"]]],[11,"try_into","","",154,[[],["result"]]],[11,"borrow","","",154,[[["self"]],["t"]]],[11,"borrow_mut","","",154,[[["self"]],["t"]]],[11,"type_id","","",154,[[["self"]],["typeid"]]],[11,"peek","","",155,[[["cursor"]],["bool"]]],[11,"display","","",155,[[],["str"]]],[11,"span","","",155,[[["self"]],["span"]]],[11,"from","","",155,[[["t"]],["t"]]],[11,"into","","",155,[[],["u"]]],[11,"to_owned","","",155,[[["self"]],["t"]]],[11,"clone_into","","",155,[[["self"],["t"]]]],[11,"try_from","","",155,[[["u"]],["result"]]],[11,"try_into","","",155,[[],["result"]]],[11,"borrow","","",155,[[["self"]],["t"]]],[11,"borrow_mut","","",155,[[["self"]],["t"]]],[11,"type_id","","",155,[[["self"]],["typeid"]]],[11,"peek","","",156,[[["cursor"]],["bool"]]],[11,"display","","",156,[[],["str"]]],[11,"span","","",156,[[["self"]],["span"]]],[11,"from","","",156,[[["t"]],["t"]]],[11,"into","","",156,[[],["u"]]],[11,"to_owned","","",156,[[["self"]],["t"]]],[11,"clone_into","","",156,[[["self"],["t"]]]],[11,"try_from","","",156,[[["u"]],["result"]]],[11,"try_into","","",156,[[],["result"]]],[11,"borrow","","",156,[[["self"]],["t"]]],[11,"borrow_mut","","",156,[[["self"]],["t"]]],[11,"type_id","","",156,[[["self"]],["typeid"]]],[11,"peek","","",157,[[["cursor"]],["bool"]]],[11,"display","","",157,[[],["str"]]],[11,"span","","",157,[[["self"]],["span"]]],[11,"from","","",157,[[["t"]],["t"]]],[11,"into","","",157,[[],["u"]]],[11,"to_owned","","",157,[[["self"]],["t"]]],[11,"clone_into","","",157,[[["self"],["t"]]]],[11,"try_from","","",157,[[["u"]],["result"]]],[11,"try_into","","",157,[[],["result"]]],[11,"borrow","","",157,[[["self"]],["t"]]],[11,"borrow_mut","","",157,[[["self"]],["t"]]],[11,"type_id","","",157,[[["self"]],["typeid"]]],[11,"peek","","",158,[[["cursor"]],["bool"]]],[11,"display","","",158,[[],["str"]]],[11,"span","","",158,[[["self"]],["span"]]],[11,"from","","",158,[[["t"]],["t"]]],[11,"into","","",158,[[],["u"]]],[11,"to_owned","","",158,[[["self"]],["t"]]],[11,"clone_into","","",158,[[["self"],["t"]]]],[11,"try_from","","",158,[[["u"]],["result"]]],[11,"try_into","","",158,[[],["result"]]],[11,"borrow","","",158,[[["self"]],["t"]]],[11,"borrow_mut","","",158,[[["self"]],["t"]]],[11,"type_id","","",158,[[["self"]],["typeid"]]],[11,"peek","","",159,[[["cursor"]],["bool"]]],[11,"display","","",159,[[],["str"]]],[11,"span","","",159,[[["self"]],["span"]]],[11,"from","","",159,[[["t"]],["t"]]],[11,"into","","",159,[[],["u"]]],[11,"to_owned","","",159,[[["self"]],["t"]]],[11,"clone_into","","",159,[[["self"],["t"]]]],[11,"try_from","","",159,[[["u"]],["result"]]],[11,"try_into","","",159,[[],["result"]]],[11,"borrow","","",159,[[["self"]],["t"]]],[11,"borrow_mut","","",159,[[["self"]],["t"]]],[11,"type_id","","",159,[[["self"]],["typeid"]]],[11,"peek","","",160,[[["cursor"]],["bool"]]],[11,"display","","",160,[[],["str"]]],[11,"span","","",160,[[["self"]],["span"]]],[11,"from","","",160,[[["t"]],["t"]]],[11,"into","","",160,[[],["u"]]],[11,"to_owned","","",160,[[["self"]],["t"]]],[11,"clone_into","","",160,[[["self"],["t"]]]],[11,"try_from","","",160,[[["u"]],["result"]]],[11,"try_into","","",160,[[],["result"]]],[11,"borrow","","",160,[[["self"]],["t"]]],[11,"borrow_mut","","",160,[[["self"]],["t"]]],[11,"type_id","","",160,[[["self"]],["typeid"]]],[11,"peek","","",161,[[["cursor"]],["bool"]]],[11,"display","","",161,[[],["str"]]],[11,"span","","",161,[[["self"]],["span"]]],[11,"from","","",161,[[["t"]],["t"]]],[11,"into","","",161,[[],["u"]]],[11,"to_owned","","",161,[[["self"]],["t"]]],[11,"clone_into","","",161,[[["self"],["t"]]]],[11,"try_from","","",161,[[["u"]],["result"]]],[11,"try_into","","",161,[[],["result"]]],[11,"borrow","","",161,[[["self"]],["t"]]],[11,"borrow_mut","","",161,[[["self"]],["t"]]],[11,"type_id","","",161,[[["self"]],["typeid"]]],[11,"peek","","",162,[[["cursor"]],["bool"]]],[11,"display","","",162,[[],["str"]]],[11,"span","","",162,[[["self"]],["span"]]],[11,"from","","",162,[[["t"]],["t"]]],[11,"into","","",162,[[],["u"]]],[11,"to_owned","","",162,[[["self"]],["t"]]],[11,"clone_into","","",162,[[["self"],["t"]]]],[11,"try_from","","",162,[[["u"]],["result"]]],[11,"try_into","","",162,[[],["result"]]],[11,"borrow","","",162,[[["self"]],["t"]]],[11,"borrow_mut","","",162,[[["self"]],["t"]]],[11,"type_id","","",162,[[["self"]],["typeid"]]],[11,"peek","","",163,[[["cursor"]],["bool"]]],[11,"display","","",163,[[],["str"]]],[11,"span","","",163,[[["self"]],["span"]]],[11,"from","","",163,[[["t"]],["t"]]],[11,"into","","",163,[[],["u"]]],[11,"to_owned","","",163,[[["self"]],["t"]]],[11,"clone_into","","",163,[[["self"],["t"]]]],[11,"try_from","","",163,[[["u"]],["result"]]],[11,"try_into","","",163,[[],["result"]]],[11,"borrow","","",163,[[["self"]],["t"]]],[11,"borrow_mut","","",163,[[["self"]],["t"]]],[11,"type_id","","",163,[[["self"]],["typeid"]]],[11,"peek","","",164,[[["cursor"]],["bool"]]],[11,"display","","",164,[[],["str"]]],[11,"span","","",164,[[["self"]],["span"]]],[11,"from","","",164,[[["t"]],["t"]]],[11,"into","","",164,[[],["u"]]],[11,"to_owned","","",164,[[["self"]],["t"]]],[11,"clone_into","","",164,[[["self"],["t"]]]],[11,"try_from","","",164,[[["u"]],["result"]]],[11,"try_into","","",164,[[],["result"]]],[11,"borrow","","",164,[[["self"]],["t"]]],[11,"borrow_mut","","",164,[[["self"]],["t"]]],[11,"type_id","","",164,[[["self"]],["typeid"]]],[11,"peek","","",165,[[["cursor"]],["bool"]]],[11,"display","","",165,[[],["str"]]],[11,"span","","",165,[[["self"]],["span"]]],[11,"from","","",165,[[["t"]],["t"]]],[11,"into","","",165,[[],["u"]]],[11,"to_owned","","",165,[[["self"]],["t"]]],[11,"clone_into","","",165,[[["self"],["t"]]]],[11,"try_from","","",165,[[["u"]],["result"]]],[11,"try_into","","",165,[[],["result"]]],[11,"borrow","","",165,[[["self"]],["t"]]],[11,"borrow_mut","","",165,[[["self"]],["t"]]],[11,"type_id","","",165,[[["self"]],["typeid"]]],[11,"peek","","",166,[[["cursor"]],["bool"]]],[11,"display","","",166,[[],["str"]]],[11,"span","","",166,[[["self"]],["span"]]],[11,"from","","",166,[[["t"]],["t"]]],[11,"into","","",166,[[],["u"]]],[11,"to_owned","","",166,[[["self"]],["t"]]],[11,"clone_into","","",166,[[["self"],["t"]]]],[11,"try_from","","",166,[[["u"]],["result"]]],[11,"try_into","","",166,[[],["result"]]],[11,"borrow","","",166,[[["self"]],["t"]]],[11,"borrow_mut","","",166,[[["self"]],["t"]]],[11,"type_id","","",166,[[["self"]],["typeid"]]],[11,"peek","","",167,[[["cursor"]],["bool"]]],[11,"display","","",167,[[],["str"]]],[11,"span","","",167,[[["self"]],["span"]]],[11,"from","","",167,[[["t"]],["t"]]],[11,"into","","",167,[[],["u"]]],[11,"to_owned","","",167,[[["self"]],["t"]]],[11,"clone_into","","",167,[[["self"],["t"]]]],[11,"try_from","","",167,[[["u"]],["result"]]],[11,"try_into","","",167,[[],["result"]]],[11,"borrow","","",167,[[["self"]],["t"]]],[11,"borrow_mut","","",167,[[["self"]],["t"]]],[11,"type_id","","",167,[[["self"]],["typeid"]]],[11,"peek","","",168,[[["cursor"]],["bool"]]],[11,"display","","",168,[[],["str"]]],[11,"span","","",168,[[["self"]],["span"]]],[11,"from","","",168,[[["t"]],["t"]]],[11,"into","","",168,[[],["u"]]],[11,"to_owned","","",168,[[["self"]],["t"]]],[11,"clone_into","","",168,[[["self"],["t"]]]],[11,"try_from","","",168,[[["u"]],["result"]]],[11,"try_into","","",168,[[],["result"]]],[11,"borrow","","",168,[[["self"]],["t"]]],[11,"borrow_mut","","",168,[[["self"]],["t"]]],[11,"type_id","","",168,[[["self"]],["typeid"]]],[11,"peek","","",169,[[["cursor"]],["bool"]]],[11,"display","","",169,[[],["str"]]],[11,"span","","",169,[[["self"]],["span"]]],[11,"from","","",169,[[["t"]],["t"]]],[11,"into","","",169,[[],["u"]]],[11,"to_owned","","",169,[[["self"]],["t"]]],[11,"clone_into","","",169,[[["self"],["t"]]]],[11,"try_from","","",169,[[["u"]],["result"]]],[11,"try_into","","",169,[[],["result"]]],[11,"borrow","","",169,[[["self"]],["t"]]],[11,"borrow_mut","","",169,[[["self"]],["t"]]],[11,"type_id","","",169,[[["self"]],["typeid"]]],[11,"peek","","",170,[[["cursor"]],["bool"]]],[11,"display","","",170,[[],["str"]]],[11,"span","","",170,[[["self"]],["span"]]],[11,"from","","",170,[[["t"]],["t"]]],[11,"into","","",170,[[],["u"]]],[11,"to_owned","","",170,[[["self"]],["t"]]],[11,"clone_into","","",170,[[["self"],["t"]]]],[11,"try_from","","",170,[[["u"]],["result"]]],[11,"try_into","","",170,[[],["result"]]],[11,"borrow","","",170,[[["self"]],["t"]]],[11,"borrow_mut","","",170,[[["self"]],["t"]]],[11,"type_id","","",170,[[["self"]],["typeid"]]],[11,"peek","","",171,[[["cursor"]],["bool"]]],[11,"display","","",171,[[],["str"]]],[11,"span","","",171,[[["self"]],["span"]]],[11,"from","","",171,[[["t"]],["t"]]],[11,"into","","",171,[[],["u"]]],[11,"to_owned","","",171,[[["self"]],["t"]]],[11,"clone_into","","",171,[[["self"],["t"]]]],[11,"try_from","","",171,[[["u"]],["result"]]],[11,"try_into","","",171,[[],["result"]]],[11,"borrow","","",171,[[["self"]],["t"]]],[11,"borrow_mut","","",171,[[["self"]],["t"]]],[11,"type_id","","",171,[[["self"]],["typeid"]]],[11,"peek","","",172,[[["cursor"]],["bool"]]],[11,"display","","",172,[[],["str"]]],[11,"span","","",172,[[["self"]],["span"]]],[11,"from","","",172,[[["t"]],["t"]]],[11,"into","","",172,[[],["u"]]],[11,"to_owned","","",172,[[["self"]],["t"]]],[11,"clone_into","","",172,[[["self"],["t"]]]],[11,"try_from","","",172,[[["u"]],["result"]]],[11,"try_into","","",172,[[],["result"]]],[11,"borrow","","",172,[[["self"]],["t"]]],[11,"borrow_mut","","",172,[[["self"]],["t"]]],[11,"type_id","","",172,[[["self"]],["typeid"]]],[11,"peek","","",173,[[["cursor"]],["bool"]]],[11,"display","","",173,[[],["str"]]],[11,"span","","",173,[[["self"]],["span"]]],[11,"from","","",173,[[["t"]],["t"]]],[11,"into","","",173,[[],["u"]]],[11,"to_owned","","",173,[[["self"]],["t"]]],[11,"clone_into","","",173,[[["self"],["t"]]]],[11,"try_from","","",173,[[["u"]],["result"]]],[11,"try_into","","",173,[[],["result"]]],[11,"borrow","","",173,[[["self"]],["t"]]],[11,"borrow_mut","","",173,[[["self"]],["t"]]],[11,"type_id","","",173,[[["self"]],["typeid"]]],[11,"peek","","",174,[[["cursor"]],["bool"]]],[11,"display","","",174,[[],["str"]]],[11,"span","","",174,[[["self"]],["span"]]],[11,"from","","",174,[[["t"]],["t"]]],[11,"into","","",174,[[],["u"]]],[11,"to_owned","","",174,[[["self"]],["t"]]],[11,"clone_into","","",174,[[["self"],["t"]]]],[11,"try_from","","",174,[[["u"]],["result"]]],[11,"try_into","","",174,[[],["result"]]],[11,"borrow","","",174,[[["self"]],["t"]]],[11,"borrow_mut","","",174,[[["self"]],["t"]]],[11,"type_id","","",174,[[["self"]],["typeid"]]],[11,"peek","","",175,[[["cursor"]],["bool"]]],[11,"display","","",175,[[],["str"]]],[11,"span","","",175,[[["self"]],["span"]]],[11,"from","","",175,[[["t"]],["t"]]],[11,"into","","",175,[[],["u"]]],[11,"to_owned","","",175,[[["self"]],["t"]]],[11,"clone_into","","",175,[[["self"],["t"]]]],[11,"try_from","","",175,[[["u"]],["result"]]],[11,"try_into","","",175,[[],["result"]]],[11,"borrow","","",175,[[["self"]],["t"]]],[11,"borrow_mut","","",175,[[["self"]],["t"]]],[11,"type_id","","",175,[[["self"]],["typeid"]]],[11,"peek","","",176,[[["cursor"]],["bool"]]],[11,"display","","",176,[[],["str"]]],[11,"span","","",176,[[["self"]],["span"]]],[11,"from","","",176,[[["t"]],["t"]]],[11,"into","","",176,[[],["u"]]],[11,"to_owned","","",176,[[["self"]],["t"]]],[11,"clone_into","","",176,[[["self"],["t"]]]],[11,"try_from","","",176,[[["u"]],["result"]]],[11,"try_into","","",176,[[],["result"]]],[11,"borrow","","",176,[[["self"]],["t"]]],[11,"borrow_mut","","",176,[[["self"]],["t"]]],[11,"type_id","","",176,[[["self"]],["typeid"]]],[11,"peek","","",177,[[["cursor"]],["bool"]]],[11,"display","","",177,[[],["str"]]],[11,"span","","",177,[[["self"]],["span"]]],[11,"from","","",177,[[["t"]],["t"]]],[11,"into","","",177,[[],["u"]]],[11,"to_owned","","",177,[[["self"]],["t"]]],[11,"clone_into","","",177,[[["self"],["t"]]]],[11,"try_from","","",177,[[["u"]],["result"]]],[11,"try_into","","",177,[[],["result"]]],[11,"borrow","","",177,[[["self"]],["t"]]],[11,"borrow_mut","","",177,[[["self"]],["t"]]],[11,"type_id","","",177,[[["self"]],["typeid"]]],[11,"peek","","",178,[[["cursor"]],["bool"]]],[11,"display","","",178,[[],["str"]]],[11,"span","","",178,[[["self"]],["span"]]],[11,"from","","",178,[[["t"]],["t"]]],[11,"into","","",178,[[],["u"]]],[11,"to_owned","","",178,[[["self"]],["t"]]],[11,"clone_into","","",178,[[["self"],["t"]]]],[11,"try_from","","",178,[[["u"]],["result"]]],[11,"try_into","","",178,[[],["result"]]],[11,"borrow","","",178,[[["self"]],["t"]]],[11,"borrow_mut","","",178,[[["self"]],["t"]]],[11,"type_id","","",178,[[["self"]],["typeid"]]],[11,"peek","","",179,[[["cursor"]],["bool"]]],[11,"display","","",179,[[],["str"]]],[11,"span","","",179,[[["self"]],["span"]]],[11,"from","","",179,[[["t"]],["t"]]],[11,"into","","",179,[[],["u"]]],[11,"to_owned","","",179,[[["self"]],["t"]]],[11,"clone_into","","",179,[[["self"],["t"]]]],[11,"try_from","","",179,[[["u"]],["result"]]],[11,"try_into","","",179,[[],["result"]]],[11,"borrow","","",179,[[["self"]],["t"]]],[11,"borrow_mut","","",179,[[["self"]],["t"]]],[11,"type_id","","",179,[[["self"]],["typeid"]]],[11,"peek","","",180,[[["cursor"]],["bool"]]],[11,"display","","",180,[[],["str"]]],[11,"span","","",180,[[["self"]],["span"]]],[11,"from","","",180,[[["t"]],["t"]]],[11,"into","","",180,[[],["u"]]],[11,"to_owned","","",180,[[["self"]],["t"]]],[11,"clone_into","","",180,[[["self"],["t"]]]],[11,"try_from","","",180,[[["u"]],["result"]]],[11,"try_into","","",180,[[],["result"]]],[11,"borrow","","",180,[[["self"]],["t"]]],[11,"borrow_mut","","",180,[[["self"]],["t"]]],[11,"type_id","","",180,[[["self"]],["typeid"]]],[11,"peek","","",181,[[["cursor"]],["bool"]]],[11,"display","","",181,[[],["str"]]],[11,"from","","",181,[[["t"]],["t"]]],[11,"into","","",181,[[],["u"]]],[11,"to_owned","","",181,[[["self"]],["t"]]],[11,"clone_into","","",181,[[["self"],["t"]]]],[11,"try_from","","",181,[[["u"]],["result"]]],[11,"try_into","","",181,[[],["result"]]],[11,"borrow","","",181,[[["self"]],["t"]]],[11,"borrow_mut","","",181,[[["self"]],["t"]]],[11,"type_id","","",181,[[["self"]],["typeid"]]],[11,"peek","","",182,[[["cursor"]],["bool"]]],[11,"display","","",182,[[],["str"]]],[11,"from","","",182,[[["t"]],["t"]]],[11,"into","","",182,[[],["u"]]],[11,"to_owned","","",182,[[["self"]],["t"]]],[11,"clone_into","","",182,[[["self"],["t"]]]],[11,"try_from","","",182,[[["u"]],["result"]]],[11,"try_into","","",182,[[],["result"]]],[11,"borrow","","",182,[[["self"]],["t"]]],[11,"borrow_mut","","",182,[[["self"]],["t"]]],[11,"type_id","","",182,[[["self"]],["typeid"]]],[11,"peek","","",183,[[["cursor"]],["bool"]]],[11,"display","","",183,[[],["str"]]],[11,"from","","",183,[[["t"]],["t"]]],[11,"into","","",183,[[],["u"]]],[11,"to_owned","","",183,[[["self"]],["t"]]],[11,"clone_into","","",183,[[["self"],["t"]]]],[11,"try_from","","",183,[[["u"]],["result"]]],[11,"try_into","","",183,[[],["result"]]],[11,"borrow","","",183,[[["self"]],["t"]]],[11,"borrow_mut","","",183,[[["self"]],["t"]]],[11,"type_id","","",183,[[["self"]],["typeid"]]],[11,"peek","","",184,[[["cursor"]],["bool"]]],[11,"display","","",184,[[],["str"]]],[11,"from","","",184,[[["t"]],["t"]]],[11,"into","","",184,[[],["u"]]],[11,"to_owned","","",184,[[["self"]],["t"]]],[11,"clone_into","","",184,[[["self"],["t"]]]],[11,"try_from","","",184,[[["u"]],["result"]]],[11,"try_into","","",184,[[],["result"]]],[11,"borrow","","",184,[[["self"]],["t"]]],[11,"borrow_mut","","",184,[[["self"]],["t"]]],[11,"type_id","","",184,[[["self"]],["typeid"]]],[11,"from","syn::buffer","",192,[[["t"]],["t"]]],[11,"into","","",192,[[],["u"]]],[11,"try_from","","",192,[[["u"]],["result"]]],[11,"try_into","","",192,[[],["result"]]],[11,"borrow","","",192,[[["self"]],["t"]]],[11,"borrow_mut","","",192,[[["self"]],["t"]]],[11,"type_id","","",192,[[["self"]],["typeid"]]],[11,"from","","",193,[[["t"]],["t"]]],[11,"into","","",193,[[],["u"]]],[11,"to_owned","","",193,[[["self"]],["t"]]],[11,"clone_into","","",193,[[["self"],["t"]]]],[11,"try_from","","",193,[[["u"]],["result"]]],[11,"try_into","","",193,[[],["result"]]],[11,"borrow","","",193,[[["self"]],["t"]]],[11,"borrow_mut","","",193,[[["self"]],["t"]]],[11,"type_id","","",193,[[["self"]],["typeid"]]],[11,"span","syn::punctuated","",196,[[["self"]],["span"]]],[11,"from","","",196,[[["t"]],["t"]]],[11,"into","","",196,[[],["u"]]],[11,"into_iter","","",196,[[],["i"]]],[11,"to_owned","","",196,[[["self"]],["t"]]],[11,"clone_into","","",196,[[["self"],["t"]]]],[11,"try_from","","",196,[[["u"]],["result"]]],[11,"try_into","","",196,[[],["result"]]],[11,"borrow","","",196,[[["self"]],["t"]]],[11,"borrow_mut","","",196,[[["self"]],["t"]]],[11,"type_id","","",196,[[["self"]],["typeid"]]],[11,"from","","",238,[[["t"]],["t"]]],[11,"into","","",238,[[],["u"]]],[11,"into_iter","","",238,[[],["i"]]],[11,"to_owned","","",238,[[["self"]],["t"]]],[11,"clone_into","","",238,[[["self"],["t"]]]],[11,"try_from","","",238,[[["u"]],["result"]]],[11,"try_into","","",238,[[],["result"]]],[11,"borrow","","",238,[[["self"]],["t"]]],[11,"borrow_mut","","",238,[[["self"]],["t"]]],[11,"type_id","","",238,[[["self"]],["typeid"]]],[11,"from","","",239,[[["t"]],["t"]]],[11,"into","","",239,[[],["u"]]],[11,"into_iter","","",239,[[],["i"]]],[11,"try_from","","",239,[[["u"]],["result"]]],[11,"try_into","","",239,[[],["result"]]],[11,"borrow","","",239,[[["self"]],["t"]]],[11,"borrow_mut","","",239,[[["self"]],["t"]]],[11,"type_id","","",239,[[["self"]],["typeid"]]],[11,"from","","",240,[[["t"]],["t"]]],[11,"into","","",240,[[],["u"]]],[11,"into_iter","","",240,[[],["i"]]],[11,"to_owned","","",240,[[["self"]],["t"]]],[11,"clone_into","","",240,[[["self"],["t"]]]],[11,"try_from","","",240,[[["u"]],["result"]]],[11,"try_into","","",240,[[],["result"]]],[11,"borrow","","",240,[[["self"]],["t"]]],[11,"borrow_mut","","",240,[[["self"]],["t"]]],[11,"type_id","","",240,[[["self"]],["typeid"]]],[11,"from","","",241,[[["t"]],["t"]]],[11,"into","","",241,[[],["u"]]],[11,"into_iter","","",241,[[],["i"]]],[11,"to_owned","","",241,[[["self"]],["t"]]],[11,"clone_into","","",241,[[["self"],["t"]]]],[11,"try_from","","",241,[[["u"]],["result"]]],[11,"try_into","","",241,[[],["result"]]],[11,"borrow","","",241,[[["self"]],["t"]]],[11,"borrow_mut","","",241,[[["self"]],["t"]]],[11,"type_id","","",241,[[["self"]],["typeid"]]],[11,"from","","",242,[[["t"]],["t"]]],[11,"into","","",242,[[],["u"]]],[11,"into_iter","","",242,[[],["i"]]],[11,"to_owned","","",242,[[["self"]],["t"]]],[11,"clone_into","","",242,[[["self"],["t"]]]],[11,"try_from","","",242,[[["u"]],["result"]]],[11,"try_into","","",242,[[],["result"]]],[11,"borrow","","",242,[[["self"]],["t"]]],[11,"borrow_mut","","",242,[[["self"]],["t"]]],[11,"type_id","","",242,[[["self"]],["typeid"]]],[11,"from","","",243,[[["t"]],["t"]]],[11,"into","","",243,[[],["u"]]],[11,"into_iter","","",243,[[],["i"]]],[11,"try_from","","",243,[[["u"]],["result"]]],[11,"try_into","","",243,[[],["result"]]],[11,"borrow","","",243,[[["self"]],["t"]]],[11,"borrow_mut","","",243,[[["self"]],["t"]]],[11,"type_id","","",243,[[["self"]],["typeid"]]],[11,"span","","",195,[[["self"]],["span"]]],[11,"from","","",195,[[["t"]],["t"]]],[11,"into","","",195,[[],["u"]]],[11,"to_owned","","",195,[[["self"]],["t"]]],[11,"clone_into","","",195,[[["self"],["t"]]]],[11,"try_from","","",195,[[["u"]],["result"]]],[11,"try_into","","",195,[[],["result"]]],[11,"borrow","","",195,[[["self"]],["t"]]],[11,"borrow_mut","","",195,[[["self"]],["t"]]],[11,"type_id","","",195,[[["self"]],["typeid"]]],[11,"from","syn::parse","",244,[[["t"]],["t"]]],[11,"into","","",244,[[],["u"]]],[11,"try_from","","",244,[[["u"]],["result"]]],[11,"try_into","","",244,[[],["result"]]],[11,"borrow","","",244,[[["self"]],["t"]]],[11,"borrow_mut","","",244,[[["self"]],["t"]]],[11,"type_id","","",244,[[["self"]],["typeid"]]],[11,"from","","",203,[[["t"]],["t"]]],[11,"into","","",203,[[],["u"]]],[11,"to_string","","",203,[[["self"]],["string"]]],[11,"try_from","","",203,[[["u"]],["result"]]],[11,"try_into","","",203,[[],["result"]]],[11,"borrow","","",203,[[["self"]],["t"]]],[11,"borrow_mut","","",203,[[["self"]],["t"]]],[11,"type_id","","",203,[[["self"]],["typeid"]]],[11,"from","","",202,[[["t"]],["t"]]],[11,"into","","",202,[[],["u"]]],[11,"to_owned","","",202,[[["self"]],["t"]]],[11,"clone_into","","",202,[[["self"],["t"]]]],[11,"try_from","","",202,[[["u"]],["result"]]],[11,"try_into","","",202,[[],["result"]]],[11,"borrow","","",202,[[["self"]],["t"]]],[11,"borrow_mut","","",202,[[["self"]],["t"]]],[11,"type_id","","",202,[[["self"]],["typeid"]]],[11,"from","","",245,[[["t"]],["t"]]],[11,"into","","",245,[[],["u"]]],[11,"try_from","","",245,[[["u"]],["result"]]],[11,"try_into","","",245,[[],["result"]]],[11,"borrow","","",245,[[["self"]],["t"]]],[11,"borrow_mut","","",245,[[["self"]],["t"]]],[11,"type_id","","",245,[[["self"]],["typeid"]]],[11,"fmt","syn","",205,[[["formatter"],["self"]],[["error"],["result",["error"]]]]],[11,"fmt","","",205,[[["formatter"],["self"]],[["error"],["result",["error"]]]]],[11,"cmp","","",205,[[["self"],["ident"]],["ordering"]]],[11,"clone","","",205,[[["self"]],["ident"]]],[11,"hash","","",205,[[["self"],["h"]]]],[11,"eq","","",205,[[["t"],["self"]],["bool"]]],[11,"eq","","",205,[[["self"],["ident"]],["bool"]]],[11,"partial_cmp","","",205,[[["self"],["ident"]],[["ordering"],["option",["ordering"]]]]],[11,"to_tokens","","",205,[[["self"],["tokenstream"]]]],[11,"span","","",205,[[["self"]],[["option",["span"]],["span"]]]],[11,"fmt","","",205,[[["formatter"],["self"]],[["error"],["result",["error"]]]]],[11,"peek","","",30,[[["cursor"]],["bool"]]],[11,"display","","",30,[[],["str"]]],[11,"peek","","",72,[[["cursor"]],["bool"]]],[11,"display","","",72,[[],["str"]]],[11,"peek","","",186,[[["cursor"]],["bool"]]],[11,"display","","",186,[[],["str"]]],[11,"peek","","",187,[[["cursor"]],["bool"]]],[11,"display","","",187,[[],["str"]]],[11,"peek","","",188,[[["cursor"]],["bool"]]],[11,"display","","",188,[[],["str"]]],[11,"peek","","",189,[[["cursor"]],["bool"]]],[11,"display","","",189,[[],["str"]]],[11,"peek","","",190,[[["cursor"]],["bool"]]],[11,"display","","",190,[[],["str"]]],[11,"peek","","",191,[[["cursor"]],["bool"]]],[11,"display","","",191,[[],["str"]]],[11,"peek","","",31,[[["cursor"]],["bool"]]],[11,"display","","",31,[[],["str"]]],[11,"peek","syn::token","",82,[[["cursor"]],["bool"]]],[11,"display","","",82,[[],["str"]]],[11,"peek","","",183,[[["cursor"]],["bool"]]],[11,"display","","",183,[[],["str"]]],[11,"peek","","",181,[[["cursor"]],["bool"]]],[11,"display","","",181,[[],["str"]]],[11,"peek","","",182,[[["cursor"]],["bool"]]],[11,"display","","",182,[[],["str"]]],[11,"peek","","",184,[[["cursor"]],["bool"]]],[11,"display","","",184,[[],["str"]]],[11,"peek","","",83,[[["cursor"]],["bool"]]],[11,"display","","",83,[[],["str"]]],[11,"peek","","",84,[[["cursor"]],["bool"]]],[11,"display","","",84,[[],["str"]]],[11,"peek","","",85,[[["cursor"]],["bool"]]],[11,"display","","",85,[[],["str"]]],[11,"peek","","",86,[[["cursor"]],["bool"]]],[11,"display","","",86,[[],["str"]]],[11,"peek","","",87,[[["cursor"]],["bool"]]],[11,"display","","",87,[[],["str"]]],[11,"peek","","",88,[[["cursor"]],["bool"]]],[11,"display","","",88,[[],["str"]]],[11,"peek","","",89,[[["cursor"]],["bool"]]],[11,"display","","",89,[[],["str"]]],[11,"peek","","",90,[[["cursor"]],["bool"]]],[11,"display","","",90,[[],["str"]]],[11,"peek","","",91,[[["cursor"]],["bool"]]],[11,"display","","",91,[[],["str"]]],[11,"peek","","",92,[[["cursor"]],["bool"]]],[11,"display","","",92,[[],["str"]]],[11,"peek","","",93,[[["cursor"]],["bool"]]],[11,"display","","",93,[[],["str"]]],[11,"peek","","",94,[[["cursor"]],["bool"]]],[11,"display","","",94,[[],["str"]]],[11,"peek","","",95,[[["cursor"]],["bool"]]],[11,"display","","",95,[[],["str"]]],[11,"peek","","",96,[[["cursor"]],["bool"]]],[11,"display","","",96,[[],["str"]]],[11,"peek","","",97,[[["cursor"]],["bool"]]],[11,"display","","",97,[[],["str"]]],[11,"peek","","",98,[[["cursor"]],["bool"]]],[11,"display","","",98,[[],["str"]]],[11,"peek","","",99,[[["cursor"]],["bool"]]],[11,"display","","",99,[[],["str"]]],[11,"peek","","",100,[[["cursor"]],["bool"]]],[11,"display","","",100,[[],["str"]]],[11,"peek","","",101,[[["cursor"]],["bool"]]],[11,"display","","",101,[[],["str"]]],[11,"peek","","",102,[[["cursor"]],["bool"]]],[11,"display","","",102,[[],["str"]]],[11,"peek","","",103,[[["cursor"]],["bool"]]],[11,"display","","",103,[[],["str"]]],[11,"peek","","",104,[[["cursor"]],["bool"]]],[11,"display","","",104,[[],["str"]]],[11,"peek","","",105,[[["cursor"]],["bool"]]],[11,"display","","",105,[[],["str"]]],[11,"peek","","",106,[[["cursor"]],["bool"]]],[11,"display","","",106,[[],["str"]]],[11,"peek","","",107,[[["cursor"]],["bool"]]],[11,"display","","",107,[[],["str"]]],[11,"peek","","",108,[[["cursor"]],["bool"]]],[11,"display","","",108,[[],["str"]]],[11,"peek","","",109,[[["cursor"]],["bool"]]],[11,"display","","",109,[[],["str"]]],[11,"peek","","",110,[[["cursor"]],["bool"]]],[11,"display","","",110,[[],["str"]]],[11,"peek","","",111,[[["cursor"]],["bool"]]],[11,"display","","",111,[[],["str"]]],[11,"peek","","",112,[[["cursor"]],["bool"]]],[11,"display","","",112,[[],["str"]]],[11,"peek","","",113,[[["cursor"]],["bool"]]],[11,"display","","",113,[[],["str"]]],[11,"peek","","",114,[[["cursor"]],["bool"]]],[11,"display","","",114,[[],["str"]]],[11,"peek","","",115,[[["cursor"]],["bool"]]],[11,"display","","",115,[[],["str"]]],[11,"peek","","",116,[[["cursor"]],["bool"]]],[11,"display","","",116,[[],["str"]]],[11,"peek","","",117,[[["cursor"]],["bool"]]],[11,"display","","",117,[[],["str"]]],[11,"peek","","",118,[[["cursor"]],["bool"]]],[11,"display","","",118,[[],["str"]]],[11,"peek","","",119,[[["cursor"]],["bool"]]],[11,"display","","",119,[[],["str"]]],[11,"peek","","",120,[[["cursor"]],["bool"]]],[11,"display","","",120,[[],["str"]]],[11,"peek","","",121,[[["cursor"]],["bool"]]],[11,"display","","",121,[[],["str"]]],[11,"peek","","",122,[[["cursor"]],["bool"]]],[11,"display","","",122,[[],["str"]]],[11,"peek","","",123,[[["cursor"]],["bool"]]],[11,"display","","",123,[[],["str"]]],[11,"peek","","",124,[[["cursor"]],["bool"]]],[11,"display","","",124,[[],["str"]]],[11,"peek","","",125,[[["cursor"]],["bool"]]],[11,"display","","",125,[[],["str"]]],[11,"peek","","",126,[[["cursor"]],["bool"]]],[11,"display","","",126,[[],["str"]]],[11,"peek","","",127,[[["cursor"]],["bool"]]],[11,"display","","",127,[[],["str"]]],[11,"peek","","",128,[[["cursor"]],["bool"]]],[11,"display","","",128,[[],["str"]]],[11,"peek","","",129,[[["cursor"]],["bool"]]],[11,"display","","",129,[[],["str"]]],[11,"peek","","",130,[[["cursor"]],["bool"]]],[11,"display","","",130,[[],["str"]]],[11,"peek","","",131,[[["cursor"]],["bool"]]],[11,"display","","",131,[[],["str"]]],[11,"peek","","",132,[[["cursor"]],["bool"]]],[11,"display","","",132,[[],["str"]]],[11,"peek","","",133,[[["cursor"]],["bool"]]],[11,"display","","",133,[[],["str"]]],[11,"peek","","",134,[[["cursor"]],["bool"]]],[11,"display","","",134,[[],["str"]]],[11,"peek","","",135,[[["cursor"]],["bool"]]],[11,"display","","",135,[[],["str"]]],[11,"peek","","",136,[[["cursor"]],["bool"]]],[11,"display","","",136,[[],["str"]]],[11,"peek","","",137,[[["cursor"]],["bool"]]],[11,"display","","",137,[[],["str"]]],[11,"peek","","",138,[[["cursor"]],["bool"]]],[11,"display","","",138,[[],["str"]]],[11,"peek","","",139,[[["cursor"]],["bool"]]],[11,"display","","",139,[[],["str"]]],[11,"peek","","",140,[[["cursor"]],["bool"]]],[11,"display","","",140,[[],["str"]]],[11,"peek","","",141,[[["cursor"]],["bool"]]],[11,"display","","",141,[[],["str"]]],[11,"peek","","",142,[[["cursor"]],["bool"]]],[11,"display","","",142,[[],["str"]]],[11,"peek","","",143,[[["cursor"]],["bool"]]],[11,"display","","",143,[[],["str"]]],[11,"peek","","",144,[[["cursor"]],["bool"]]],[11,"display","","",144,[[],["str"]]],[11,"peek","","",145,[[["cursor"]],["bool"]]],[11,"display","","",145,[[],["str"]]],[11,"peek","","",146,[[["cursor"]],["bool"]]],[11,"display","","",146,[[],["str"]]],[11,"peek","","",147,[[["cursor"]],["bool"]]],[11,"display","","",147,[[],["str"]]],[11,"peek","","",148,[[["cursor"]],["bool"]]],[11,"display","","",148,[[],["str"]]],[11,"peek","","",149,[[["cursor"]],["bool"]]],[11,"display","","",149,[[],["str"]]],[11,"peek","","",150,[[["cursor"]],["bool"]]],[11,"display","","",150,[[],["str"]]],[11,"peek","","",151,[[["cursor"]],["bool"]]],[11,"display","","",151,[[],["str"]]],[11,"peek","","",152,[[["cursor"]],["bool"]]],[11,"display","","",152,[[],["str"]]],[11,"peek","","",153,[[["cursor"]],["bool"]]],[11,"display","","",153,[[],["str"]]],[11,"peek","","",154,[[["cursor"]],["bool"]]],[11,"display","","",154,[[],["str"]]],[11,"peek","","",155,[[["cursor"]],["bool"]]],[11,"display","","",155,[[],["str"]]],[11,"peek","","",156,[[["cursor"]],["bool"]]],[11,"display","","",156,[[],["str"]]],[11,"peek","","",157,[[["cursor"]],["bool"]]],[11,"display","","",157,[[],["str"]]],[11,"peek","","",158,[[["cursor"]],["bool"]]],[11,"display","","",158,[[],["str"]]],[11,"peek","","",159,[[["cursor"]],["bool"]]],[11,"display","","",159,[[],["str"]]],[11,"peek","","",160,[[["cursor"]],["bool"]]],[11,"display","","",160,[[],["str"]]],[11,"peek","","",161,[[["cursor"]],["bool"]]],[11,"display","","",161,[[],["str"]]],[11,"peek","","",162,[[["cursor"]],["bool"]]],[11,"display","","",162,[[],["str"]]],[11,"peek","","",163,[[["cursor"]],["bool"]]],[11,"display","","",163,[[],["str"]]],[11,"peek","","",164,[[["cursor"]],["bool"]]],[11,"display","","",164,[[],["str"]]],[11,"peek","","",165,[[["cursor"]],["bool"]]],[11,"display","","",165,[[],["str"]]],[11,"peek","","",166,[[["cursor"]],["bool"]]],[11,"display","","",166,[[],["str"]]],[11,"peek","","",167,[[["cursor"]],["bool"]]],[11,"display","","",167,[[],["str"]]],[11,"peek","","",168,[[["cursor"]],["bool"]]],[11,"display","","",168,[[],["str"]]],[11,"peek","","",169,[[["cursor"]],["bool"]]],[11,"display","","",169,[[],["str"]]],[11,"peek","","",170,[[["cursor"]],["bool"]]],[11,"display","","",170,[[],["str"]]],[11,"peek","","",171,[[["cursor"]],["bool"]]],[11,"display","","",171,[[],["str"]]],[11,"peek","","",172,[[["cursor"]],["bool"]]],[11,"display","","",172,[[],["str"]]],[11,"peek","","",173,[[["cursor"]],["bool"]]],[11,"display","","",173,[[],["str"]]],[11,"peek","","",174,[[["cursor"]],["bool"]]],[11,"display","","",174,[[],["str"]]],[11,"peek","","",175,[[["cursor"]],["bool"]]],[11,"display","","",175,[[],["str"]]],[11,"peek","","",176,[[["cursor"]],["bool"]]],[11,"display","","",176,[[],["str"]]],[11,"peek","","",177,[[["cursor"]],["bool"]]],[11,"display","","",177,[[],["str"]]],[11,"peek","","",178,[[["cursor"]],["bool"]]],[11,"display","","",178,[[],["str"]]],[11,"peek","","",179,[[["cursor"]],["bool"]]],[11,"display","","",179,[[],["str"]]],[11,"peek","","",180,[[["cursor"]],["bool"]]],[11,"display","","",180,[[],["str"]]],[11,"peek","syn","",205,[[["cursor"]],["bool"]]],[11,"display","","",205,[[],["str"]]],[11,"parse_any","","",205,[[["parsestream"]],["result"]]],[11,"unraw","","",205,[[["self"]],["ident"]]],[11,"advance_to","syn::parse","",203,[[["self"]]]],[11,"parse","syn::token","",82,[[["parsestream"]],["result"]]],[11,"parse","","",83,[[["parsestream"]],["result"]]],[11,"parse","","",84,[[["parsestream"]],["result"]]],[11,"parse","","",85,[[["parsestream"]],["result"]]],[11,"parse","","",86,[[["parsestream"]],["result"]]],[11,"parse","","",87,[[["parsestream"]],["result"]]],[11,"parse","","",88,[[["parsestream"]],["result"]]],[11,"parse","","",89,[[["parsestream"]],["result"]]],[11,"parse","","",90,[[["parsestream"]],["result"]]],[11,"parse","","",91,[[["parsestream"]],["result"]]],[11,"parse","","",92,[[["parsestream"]],["result"]]],[11,"parse","","",93,[[["parsestream"]],["result"]]],[11,"parse","","",94,[[["parsestream"]],["result"]]],[11,"parse","","",95,[[["parsestream"]],["result"]]],[11,"parse","","",96,[[["parsestream"]],["result"]]],[11,"parse","","",97,[[["parsestream"]],["result"]]],[11,"parse","","",98,[[["parsestream"]],["result"]]],[11,"parse","","",99,[[["parsestream"]],["result"]]],[11,"parse","","",100,[[["parsestream"]],["result"]]],[11,"parse","","",101,[[["parsestream"]],["result"]]],[11,"parse","","",102,[[["parsestream"]],["result"]]],[11,"parse","","",103,[[["parsestream"]],["result"]]],[11,"parse","","",104,[[["parsestream"]],["result"]]],[11,"parse","","",105,[[["parsestream"]],["result"]]],[11,"parse","","",106,[[["parsestream"]],["result"]]],[11,"parse","","",107,[[["parsestream"]],["result"]]],[11,"parse","","",108,[[["parsestream"]],["result"]]],[11,"parse","","",109,[[["parsestream"]],["result"]]],[11,"parse","","",110,[[["parsestream"]],["result"]]],[11,"parse","","",111,[[["parsestream"]],["result"]]],[11,"parse","","",112,[[["parsestream"]],["result"]]],[11,"parse","","",113,[[["parsestream"]],["result"]]],[11,"parse","","",114,[[["parsestream"]],["result"]]],[11,"parse","","",115,[[["parsestream"]],["result"]]],[11,"parse","","",116,[[["parsestream"]],["result"]]],[11,"parse","","",117,[[["parsestream"]],["result"]]],[11,"parse","","",118,[[["parsestream"]],["result"]]],[11,"parse","","",119,[[["parsestream"]],["result"]]],[11,"parse","","",120,[[["parsestream"]],["result"]]],[11,"parse","","",121,[[["parsestream"]],["result"]]],[11,"parse","","",122,[[["parsestream"]],["result"]]],[11,"parse","","",123,[[["parsestream"]],["result"]]],[11,"parse","","",124,[[["parsestream"]],["result"]]],[11,"parse","","",125,[[["parsestream"]],["result"]]],[11,"parse","","",126,[[["parsestream"]],["result"]]],[11,"parse","","",127,[[["parsestream"]],["result"]]],[11,"parse","","",128,[[["parsestream"]],["result"]]],[11,"parse","","",129,[[["parsestream"]],["result"]]],[11,"parse","","",130,[[["parsestream"]],["result"]]],[11,"parse","","",131,[[["parsestream"]],["result"]]],[11,"parse","","",132,[[["parsestream"]],["result"]]],[11,"parse","","",133,[[["parsestream"]],["result"]]],[11,"parse","","",134,[[["parsestream"]],["result"]]],[11,"parse","","",135,[[["parsestream"]],["result"]]],[11,"parse","","",136,[[["parsestream"]],["result"]]],[11,"parse","","",137,[[["parsestream"]],["result"]]],[11,"parse","","",138,[[["parsestream"]],["result"]]],[11,"parse","","",139,[[["parsestream"]],["result"]]],[11,"parse","","",140,[[["parsestream"]],["result"]]],[11,"parse","","",141,[[["parsestream"]],["result"]]],[11,"parse","","",142,[[["parsestream"]],["result"]]],[11,"parse","","",143,[[["parsestream"]],["result"]]],[11,"parse","","",144,[[["parsestream"]],["result"]]],[11,"parse","","",145,[[["parsestream"]],["result"]]],[11,"parse","","",146,[[["parsestream"]],["result"]]],[11,"parse","","",147,[[["parsestream"]],["result"]]],[11,"parse","","",148,[[["parsestream"]],["result"]]],[11,"parse","","",149,[[["parsestream"]],["result"]]],[11,"parse","","",150,[[["parsestream"]],["result"]]],[11,"parse","","",151,[[["parsestream"]],["result"]]],[11,"parse","","",152,[[["parsestream"]],["result"]]],[11,"parse","","",153,[[["parsestream"]],["result"]]],[11,"parse","","",154,[[["parsestream"]],["result"]]],[11,"parse","","",155,[[["parsestream"]],["result"]]],[11,"parse","","",156,[[["parsestream"]],["result"]]],[11,"parse","","",157,[[["parsestream"]],["result"]]],[11,"parse","","",158,[[["parsestream"]],["result"]]],[11,"parse","","",159,[[["parsestream"]],["result"]]],[11,"parse","","",160,[[["parsestream"]],["result"]]],[11,"parse","","",161,[[["parsestream"]],["result"]]],[11,"parse","","",162,[[["parsestream"]],["result"]]],[11,"parse","","",163,[[["parsestream"]],["result"]]],[11,"parse","","",164,[[["parsestream"]],["result"]]],[11,"parse","","",165,[[["parsestream"]],["result"]]],[11,"parse","","",166,[[["parsestream"]],["result"]]],[11,"parse","","",167,[[["parsestream"]],["result"]]],[11,"parse","","",168,[[["parsestream"]],["result"]]],[11,"parse","","",169,[[["parsestream"]],["result"]]],[11,"parse","","",170,[[["parsestream"]],["result"]]],[11,"parse","","",171,[[["parsestream"]],["result"]]],[11,"parse","","",172,[[["parsestream"]],["result"]]],[11,"parse","","",173,[[["parsestream"]],["result"]]],[11,"parse","","",174,[[["parsestream"]],["result"]]],[11,"parse","","",175,[[["parsestream"]],["result"]]],[11,"parse","","",176,[[["parsestream"]],["result"]]],[11,"parse","","",177,[[["parsestream"]],["result"]]],[11,"parse","","",178,[[["parsestream"]],["result"]]],[11,"parse","","",179,[[["parsestream"]],["result"]]],[11,"parse","","",180,[[["parsestream"]],["result"]]],[11,"parse","syn","",205,[[["parsestream"]],["result"]]],[11,"parse","","",62,[[["parsestream"]],["result"]]],[11,"parse","","",1,[[["parsestream"]],["result"]]],[11,"parse","","",2,[[["parsestream"]],["result"]]],[11,"parse","","",63,[[["parsestream"]],["result"]]],[11,"parse","","",6,[[["parsestream"]],["result"]]],[11,"parse","","",4,[[["parsestream"]],["result"]]],[11,"parse","","",5,[[["parsestream"]],["result"]]],[11,"parse","","",65,[[["parsestream"]],["result"]]],[11,"parse","","",66,[[["parsestream"]],["result"]]],[11,"parse","","",15,[[["parsestream"]],["result"]]],[11,"parse","","",17,[[["parsestream"]],["result"]]],[11,"parse","","",67,[[["parsestream"]],["result"]]],[11,"parse","","",19,[[["parsestream"]],["result"]]],[11,"parse","","",22,[[["parsestream"]],["result"]]],[11,"parse","","",68,[[["parsestream"]],["result"]]],[11,"parse","","",23,[[["parsestream"]],["result"]]],[11,"parse","","",20,[[["parsestream"]],["result"]]],[11,"parse","","",28,[[["parsestream"]],["result"]]],[11,"parse","","",70,[[["parsestream"]],["result"]]],[11,"parse","","",27,[[["parsestream"]],["result"]]],[11,"parse","","",69,[[["parsestream"]],["result"]]],[11,"parse","","",21,[[["parsestream"]],["result"]]],[11,"parse","","",29,[[["parsestream"]],["result"]]],[11,"parse","","",71,[[["parsestream"]],["result"]]],[11,"parse","","",30,[[["parsestream"]],["result"]]],[11,"parse","","",72,[[["parsestream"]],["result"]]],[11,"parse","","",186,[[["parsestream"]],["result"]]],[11,"parse","","",187,[[["parsestream"]],["result"]]],[11,"parse","","",188,[[["parsestream"]],["result"]]],[11,"parse","","",189,[[["parsestream"]],["result"]]],[11,"parse","","",190,[[["parsestream"]],["result"]]],[11,"parse","","",191,[[["parsestream"]],["result"]]],[11,"parse","","",31,[[["parsestream"]],["result"]]],[11,"parse","","",32,[[["parsestream"]],["result"]]],[11,"parse","","",36,[[["parsestream"]],["result"]]],[11,"parse","","",76,[[["parsestream"]],["result"]]],[11,"parse","","",77,[[["parsestream"]],["result"]]],[11,"parse","","",79,[[["parsestream"]],["result"]]],[11,"parse","","",50,[[["parsestream"]],["result"]]],[11,"parse","","",39,[[["parsestream"]],["result"]]],[11,"parse","","",48,[[["parsestream"]],["result"]]],[11,"parse","","",49,[[["parsestream"]],["result"]]],[11,"parse","","",40,[[["parsestream"]],["result"]]],[11,"parse","","",45,[[["parsestream"]],["result"]]],[11,"parse","","",43,[[["parsestream"]],["result"]]],[11,"parse","","",52,[[["parsestream"]],["result"]]],[11,"parse","","",44,[[["parsestream"]],["result"]]],[11,"parse","","",47,[[["parsestream"]],["result"]]],[11,"parse","","",78,[[["parsestream"]],["result"]]],[11,"parse","","",51,[[["parsestream"]],["result"]]],[11,"parse","","",42,[[["parsestream"]],["result"]]],[11,"parse","","",41,[[["parsestream"]],["result"]]],[11,"parse","","",46,[[["parsestream"]],["result"]]],[11,"parse","","",38,[[["parsestream"]],["result"]]],[11,"parse","","",37,[[["parsestream"]],["result"]]],[11,"parse","","",58,[[["parsestream"]],["result"]]],[11,"parse","","",80,[[["parsestream"]],["result"]]],[11,"parse","","",54,[[["parsestream"]],["result"]]],[11,"parse","","",57,[[["parsestream"]],["result"]]],[11,"parse","","",59,[[["parsestream"]],["result"]]],[11,"parse","","",55,[[["parsestream"]],["result"]]],[11,"parse","syn::parse","",245,[[["parsestream"]],["result"]]],[11,"drop","","",203,[[["self"]]]],[11,"from","syn","",205,[[["selfvalue"]],["ident"]]],[11,"from","","",205,[[["selftype"]],["ident"]]],[11,"from","","",205,[[["super"]],["ident"]]],[11,"from","","",205,[[["crate"]],["ident"]]],[11,"from","","",205,[[["extern"]],["ident"]]],[11,"from","","",205,[[["underscore"]],["ident"]]],[11,"from","","",62,[[["path"]],["meta"]]],[11,"from","","",62,[[["metalist"]],["meta"]]],[11,"from","","",62,[[["metanamevalue"]],["meta"]]],[11,"from","","",63,[[["meta"]],["nestedmeta"]]],[11,"from","","",63,[[["lit"]],["nestedmeta"]]],[11,"from","","",64,[[["fieldsnamed"]],["fields"]]],[11,"from","","",64,[[["fieldsunnamed"]],["fields"]]],[11,"from","","",65,[[["vispublic"]],["visibility"]]],[11,"from","","",65,[[["viscrate"]],["visibility"]]],[11,"from","","",65,[[["visrestricted"]],["visibility"]]],[11,"from","","",66,[[["exprarray"]],["expr"]]],[11,"from","","",66,[[["exprassign"]],["expr"]]],[11,"from","","",66,[[["exprassignop"]],["expr"]]],[11,"from","","",66,[[["exprasync"]],["expr"]]],[11,"from","","",66,[[["exprawait"]],["expr"]]],[11,"from","","",66,[[["exprbinary"]],["expr"]]],[11,"from","","",66,[[["exprblock"]],["expr"]]],[11,"from","","",66,[[["exprbox"]],["expr"]]],[11,"from","","",66,[[["exprbreak"]],["expr"]]],[11,"from","","",66,[[["exprcall"]],["expr"]]],[11,"from","","",66,[[["exprcast"]],["expr"]]],[11,"from","","",66,[[["exprclosure"]],["expr"]]],[11,"from","","",66,[[["exprcontinue"]],["expr"]]],[11,"from","","",66,[[["exprfield"]],["expr"]]],[11,"from","","",66,[[["exprforloop"]],["expr"]]],[11,"from","","",66,[[["exprgroup"]],["expr"]]],[11,"from","","",66,[[["exprif"]],["expr"]]],[11,"from","","",66,[[["exprindex"]],["expr"]]],[11,"from","","",66,[[["exprlet"]],["expr"]]],[11,"from","","",66,[[["exprlit"]],["expr"]]],[11,"from","","",66,[[["exprloop"]],["expr"]]],[11,"from","","",66,[[["exprmacro"]],["expr"]]],[11,"from","","",66,[[["exprmatch"]],["expr"]]],[11,"from","","",66,[[["exprmethodcall"]],["expr"]]],[11,"from","","",66,[[["exprparen"]],["expr"]]],[11,"from","","",66,[[["exprpath"]],["expr"]]],[11,"from","","",66,[[["exprrange"]],["expr"]]],[11,"from","","",66,[[["exprreference"]],["expr"]]],[11,"from","","",66,[[["exprrepeat"]],["expr"]]],[11,"from","","",66,[[["exprreturn"]],["expr"]]],[11,"from","","",66,[[["exprstruct"]],["expr"]]],[11,"from","","",66,[[["exprtry"]],["expr"]]],[11,"from","","",66,[[["exprtryblock"]],["expr"]]],[11,"from","","",66,[[["exprtuple"]],["expr"]]],[11,"from","","",66,[[["exprtype"]],["expr"]]],[11,"from","","",66,[[["exprunary"]],["expr"]]],[11,"from","","",66,[[["exprunsafe"]],["expr"]]],[11,"from","","",66,[[["exprwhile"]],["expr"]]],[11,"from","","",66,[[["expryield"]],["expr"]]],[11,"from","","",19,[[["usize"]],["index"]]],[11,"from","","",68,[[["typeparam"]],["genericparam"]]],[11,"from","","",68,[[["lifetimedef"]],["genericparam"]]],[11,"from","","",68,[[["constparam"]],["genericparam"]]],[11,"from","","",28,[[["ident"]],["self"]]],[11,"from","","",70,[[["traitbound"]],["typeparambound"]]],[11,"from","","",70,[[["lifetime"]],["typeparambound"]]],[11,"from","","",71,[[["predicatetype"]],["wherepredicate"]]],[11,"from","","",71,[[["predicatelifetime"]],["wherepredicate"]]],[11,"from","","",71,[[["predicateeq"]],["wherepredicate"]]],[11,"from","","",72,[[["litstr"]],["lit"]]],[11,"from","","",72,[[["litbytestr"]],["lit"]]],[11,"from","","",72,[[["litbyte"]],["lit"]]],[11,"from","","",72,[[["litchar"]],["lit"]]],[11,"from","","",72,[[["litint"]],["lit"]]],[11,"from","","",72,[[["litfloat"]],["lit"]]],[11,"from","","",72,[[["litbool"]],["lit"]]],[11,"from","","",190,[[["literal"]],["self"]]],[11,"from","","",191,[[["literal"]],["self"]]],[11,"from","","",75,[[["datastruct"]],["data"]]],[11,"from","","",75,[[["dataenum"]],["data"]]],[11,"from","","",75,[[["dataunion"]],["data"]]],[11,"from","","",79,[[["typearray"]],["type"]]],[11,"from","","",79,[[["typebarefn"]],["type"]]],[11,"from","","",79,[[["typegroup"]],["type"]]],[11,"from","","",79,[[["typeimpltrait"]],["type"]]],[11,"from","","",79,[[["typeinfer"]],["type"]]],[11,"from","","",79,[[["typemacro"]],["type"]]],[11,"from","","",79,[[["typenever"]],["type"]]],[11,"from","","",79,[[["typeparen"]],["type"]]],[11,"from","","",79,[[["typepath"]],["type"]]],[11,"from","","",79,[[["typeptr"]],["type"]]],[11,"from","","",79,[[["typereference"]],["type"]]],[11,"from","","",79,[[["typeslice"]],["type"]]],[11,"from","","",79,[[["typetraitobject"]],["type"]]],[11,"from","","",79,[[["typetuple"]],["type"]]],[11,"from","","",58,[[["t"]],["self"]]],[11,"from","","",59,[[["t"]],["self"]]],[11,"from","","",204,[[["lexerror"]],["self"]]],[11,"next_back","syn::punctuated","",238,[[["self"]],["option"]]],[11,"next_back","","",239,[[["self"]],["option"]]],[11,"next_back","","",240,[[["self"]],["option"]]],[11,"next_back","","",241,[[["self"]],["option"]]],[11,"next_back","","",242,[[["self"]],["option"]]],[11,"next_back","","",243,[[["self"]],["option"]]],[11,"len","","",238,[[["self"]],["usize"]]],[11,"len","","",239,[[["self"]],["usize"]]],[11,"len","","",240,[[["self"]],["usize"]]],[11,"len","","",241,[[["self"]],["usize"]]],[11,"len","","",242,[[["self"]],["usize"]]],[11,"len","","",243,[[["self"]],["usize"]]],[11,"extend","","",196,[[["intoiterator"],["self"]]]],[11,"extend","","",196,[[["self"],["intoiterator"]]]],[11,"into_iter","syn","",64,[[]]],[11,"into_iter","syn::punctuated","",196,[[]]],[11,"into_iter","syn","",204,[[]]],[11,"next","syn::punctuated","",238,[[["self"]],["option"]]],[11,"size_hint","","",238,[[["self"]]]],[11,"next","","",239,[[["self"]],["option"]]],[11,"size_hint","","",239,[[["self"]]]],[11,"next","","",240,[[["self"]],["option"]]],[11,"size_hint","","",240,[[["self"]]]],[11,"next","","",241,[[["self"]],["option"]]],[11,"size_hint","","",241,[[["self"]]]],[11,"next","","",242,[[["self"]],["option"]]],[11,"size_hint","","",242,[[["self"]]]],[11,"next","","",243,[[["self"]],["option"]]],[11,"size_hint","","",243,[[["self"]]]],[11,"clone","syn::token","",82,[[["self"]],["underscore"]]],[11,"clone","","",83,[[["self"]],["abstract"]]],[11,"clone","","",84,[[["self"]],["as"]]],[11,"clone","","",85,[[["self"]],["async"]]],[11,"clone","","",86,[[["self"]],["auto"]]],[11,"clone","","",87,[[["self"]],["await"]]],[11,"clone","","",88,[[["self"]],["become"]]],[11,"clone","","",89,[[["self"]],["box"]]],[11,"clone","","",90,[[["self"]],["break"]]],[11,"clone","","",91,[[["self"]],["const"]]],[11,"clone","","",92,[[["self"]],["continue"]]],[11,"clone","","",93,[[["self"]],["crate"]]],[11,"clone","","",94,[[["self"]],["default"]]],[11,"clone","","",95,[[["self"]],["do"]]],[11,"clone","","",96,[[["self"]],["dyn"]]],[11,"clone","","",97,[[["self"]],["else"]]],[11,"clone","","",98,[[["self"]],["enum"]]],[11,"clone","","",99,[[["self"]],["extern"]]],[11,"clone","","",100,[[["self"]],["final"]]],[11,"clone","","",101,[[["self"]],["fn"]]],[11,"clone","","",102,[[["self"]],["for"]]],[11,"clone","","",103,[[["self"]],["if"]]],[11,"clone","","",104,[[["self"]],["impl"]]],[11,"clone","","",105,[[["self"]],["in"]]],[11,"clone","","",106,[[["self"]],["let"]]],[11,"clone","","",107,[[["self"]],["loop"]]],[11,"clone","","",108,[[["self"]],["macro"]]],[11,"clone","","",109,[[["self"]],["match"]]],[11,"clone","","",110,[[["self"]],["mod"]]],[11,"clone","","",111,[[["self"]],["move"]]],[11,"clone","","",112,[[["self"]],["mut"]]],[11,"clone","","",113,[[["self"]],["override"]]],[11,"clone","","",114,[[["self"]],["priv"]]],[11,"clone","","",115,[[["self"]],["pub"]]],[11,"clone","","",116,[[["self"]],["ref"]]],[11,"clone","","",117,[[["self"]],["return"]]],[11,"clone","","",118,[[["self"]],["selftype"]]],[11,"clone","","",119,[[["self"]],["selfvalue"]]],[11,"clone","","",120,[[["self"]],["static"]]],[11,"clone","","",121,[[["self"]],["struct"]]],[11,"clone","","",122,[[["self"]],["super"]]],[11,"clone","","",123,[[["self"]],["trait"]]],[11,"clone","","",124,[[["self"]],["try"]]],[11,"clone","","",125,[[["self"]],["type"]]],[11,"clone","","",126,[[["self"]],["typeof"]]],[11,"clone","","",127,[[["self"]],["union"]]],[11,"clone","","",128,[[["self"]],["unsafe"]]],[11,"clone","","",129,[[["self"]],["unsized"]]],[11,"clone","","",130,[[["self"]],["use"]]],[11,"clone","","",131,[[["self"]],["virtual"]]],[11,"clone","","",132,[[["self"]],["where"]]],[11,"clone","","",133,[[["self"]],["while"]]],[11,"clone","","",134,[[["self"]],["yield"]]],[11,"clone","","",135,[[["self"]],["add"]]],[11,"clone","","",136,[[["self"]],["addeq"]]],[11,"clone","","",137,[[["self"]],["and"]]],[11,"clone","","",138,[[["self"]],["andand"]]],[11,"clone","","",139,[[["self"]],["andeq"]]],[11,"clone","","",140,[[["self"]],["at"]]],[11,"clone","","",141,[[["self"]],["bang"]]],[11,"clone","","",142,[[["self"]],["caret"]]],[11,"clone","","",143,[[["self"]],["careteq"]]],[11,"clone","","",144,[[["self"]],["colon"]]],[11,"clone","","",145,[[["self"]],["colon2"]]],[11,"clone","","",146,[[["self"]],["comma"]]],[11,"clone","","",147,[[["self"]],["div"]]],[11,"clone","","",148,[[["self"]],["diveq"]]],[11,"clone","","",149,[[["self"]],["dollar"]]],[11,"clone","","",150,[[["self"]],["dot"]]],[11,"clone","","",151,[[["self"]],["dot2"]]],[11,"clone","","",152,[[["self"]],["dot3"]]],[11,"clone","","",153,[[["self"]],["dotdoteq"]]],[11,"clone","","",154,[[["self"]],["eq"]]],[11,"clone","","",155,[[["self"]],["eqeq"]]],[11,"clone","","",156,[[["self"]],["ge"]]],[11,"clone","","",157,[[["self"]],["gt"]]],[11,"clone","","",158,[[["self"]],["le"]]],[11,"clone","","",159,[[["self"]],["lt"]]],[11,"clone","","",160,[[["self"]],["muleq"]]],[11,"clone","","",161,[[["self"]],["ne"]]],[11,"clone","","",162,[[["self"]],["or"]]],[11,"clone","","",163,[[["self"]],["oreq"]]],[11,"clone","","",164,[[["self"]],["oror"]]],[11,"clone","","",165,[[["self"]],["pound"]]],[11,"clone","","",166,[[["self"]],["question"]]],[11,"clone","","",167,[[["self"]],["rarrow"]]],[11,"clone","","",168,[[["self"]],["larrow"]]],[11,"clone","","",169,[[["self"]],["rem"]]],[11,"clone","","",170,[[["self"]],["remeq"]]],[11,"clone","","",171,[[["self"]],["fatarrow"]]],[11,"clone","","",172,[[["self"]],["semi"]]],[11,"clone","","",173,[[["self"]],["shl"]]],[11,"clone","","",174,[[["self"]],["shleq"]]],[11,"clone","","",175,[[["self"]],["shr"]]],[11,"clone","","",176,[[["self"]],["shreq"]]],[11,"clone","","",177,[[["self"]],["star"]]],[11,"clone","","",178,[[["self"]],["sub"]]],[11,"clone","","",179,[[["self"]],["subeq"]]],[11,"clone","","",180,[[["self"]],["tilde"]]],[11,"clone","","",181,[[["self"]],["brace"]]],[11,"clone","","",182,[[["self"]],["bracket"]]],[11,"clone","","",183,[[["self"]],["paren"]]],[11,"clone","","",184,[[["self"]],["group"]]],[11,"clone","syn","",0,[[["self"]],["attribute"]]],[11,"clone","","",61,[[["self"]],["attrstyle"]]],[11,"clone","","",62,[[["self"]],["meta"]]],[11,"clone","","",1,[[["self"]],["metalist"]]],[11,"clone","","",2,[[["self"]],["metanamevalue"]]],[11,"clone","","",63,[[["self"]],["nestedmeta"]]],[11,"clone","","",6,[[["self"]],["variant"]]],[11,"clone","","",64,[[["self"]],["fields"]]],[11,"clone","","",4,[[["self"]],["fieldsnamed"]]],[11,"clone","","",5,[[["self"]],["fieldsunnamed"]]],[11,"clone","","",3,[[["self"]],["field"]]],[11,"clone","","",65,[[["self"]],["visibility"]]],[11,"clone","","",8,[[["self"]],["vispublic"]]],[11,"clone","","",7,[[["self"]],["viscrate"]]],[11,"clone","","",9,[[["self"]],["visrestricted"]]],[11,"clone","","",66,[[["self"]],["expr"]]],[11,"clone","","",206,[[["self"]],["exprarray"]]],[11,"clone","","",207,[[["self"]],["exprassign"]]],[11,"clone","","",208,[[["self"]],["exprassignop"]]],[11,"clone","","",209,[[["self"]],["exprasync"]]],[11,"clone","","",210,[[["self"]],["exprawait"]]],[11,"clone","","",10,[[["self"]],["exprbinary"]]],[11,"clone","","",211,[[["self"]],["exprblock"]]],[11,"clone","","",212,[[["self"]],["exprbox"]]],[11,"clone","","",213,[[["self"]],["exprbreak"]]],[11,"clone","","",11,[[["self"]],["exprcall"]]],[11,"clone","","",12,[[["self"]],["exprcast"]]],[11,"clone","","",214,[[["self"]],["exprclosure"]]],[11,"clone","","",215,[[["self"]],["exprcontinue"]]],[11,"clone","","",13,[[["self"]],["exprfield"]]],[11,"clone","","",216,[[["self"]],["exprforloop"]]],[11,"clone","","",217,[[["self"]],["exprgroup"]]],[11,"clone","","",218,[[["self"]],["exprif"]]],[11,"clone","","",14,[[["self"]],["exprindex"]]],[11,"clone","","",219,[[["self"]],["exprlet"]]],[11,"clone","","",15,[[["self"]],["exprlit"]]],[11,"clone","","",220,[[["self"]],["exprloop"]]],[11,"clone","","",221,[[["self"]],["exprmacro"]]],[11,"clone","","",222,[[["self"]],["exprmatch"]]],[11,"clone","","",223,[[["self"]],["exprmethodcall"]]],[11,"clone","","",16,[[["self"]],["exprparen"]]],[11,"clone","","",17,[[["self"]],["exprpath"]]],[11,"clone","","",224,[[["self"]],["exprrange"]]],[11,"clone","","",225,[[["self"]],["exprreference"]]],[11,"clone","","",226,[[["self"]],["exprrepeat"]]],[11,"clone","","",227,[[["self"]],["exprreturn"]]],[11,"clone","","",228,[[["self"]],["exprstruct"]]],[11,"clone","","",229,[[["self"]],["exprtry"]]],[11,"clone","","",230,[[["self"]],["exprtryblock"]]],[11,"clone","","",231,[[["self"]],["exprtuple"]]],[11,"clone","","",232,[[["self"]],["exprtype"]]],[11,"clone","","",18,[[["self"]],["exprunary"]]],[11,"clone","","",233,[[["self"]],["exprunsafe"]]],[11,"clone","","",234,[[["self"]],["exprwhile"]]],[11,"clone","","",235,[[["self"]],["expryield"]]],[11,"clone","","",67,[[["self"]],["member"]]],[11,"clone","","",19,[[["self"]],["index"]]],[11,"clone","","",22,[[["self"]],["generics"]]],[11,"clone","","",68,[[["self"]],["genericparam"]]],[11,"clone","","",28,[[["self"]],["typeparam"]]],[11,"clone","","",23,[[["self"]],["lifetimedef"]]],[11,"clone","","",21,[[["self"]],["constparam"]]],[11,"clone","","",236,[[["self"]],["implgenerics"]]],[11,"clone","","",185,[[["self"]],["typegenerics"]]],[11,"clone","","",237,[[["self"]],["turbofish"]]],[11,"clone","","",20,[[["self"]],["boundlifetimes"]]],[11,"clone","","",70,[[["self"]],["typeparambound"]]],[11,"clone","","",27,[[["self"]],["traitbound"]]],[11,"clone","","",69,[[["self"]],["traitboundmodifier"]]],[11,"clone","","",29,[[["self"]],["whereclause"]]],[11,"clone","","",71,[[["self"]],["wherepredicate"]]],[11,"clone","","",26,[[["self"]],["predicatetype"]]],[11,"clone","","",25,[[["self"]],["predicatelifetime"]]],[11,"clone","","",24,[[["self"]],["predicateeq"]]],[11,"clone","","",30,[[["self"]],["lifetime"]]],[11,"clone","","",72,[[["self"]],["lit"]]],[11,"clone","","",186,[[["self"]],["litstr"]]],[11,"clone","","",187,[[["self"]],["litbytestr"]]],[11,"clone","","",188,[[["self"]],["litbyte"]]],[11,"clone","","",189,[[["self"]],["litchar"]]],[11,"clone","","",190,[[["self"]],["litint"]]],[11,"clone","","",191,[[["self"]],["litfloat"]]],[11,"clone","","",31,[[["self"]],["litbool"]]],[11,"clone","","",73,[[["self"]],["strstyle"]]],[11,"clone","","",32,[[["self"]],["macro"]]],[11,"clone","","",74,[[["self"]],["macrodelimiter"]]],[11,"clone","","",36,[[["self"]],["deriveinput"]]],[11,"clone","","",75,[[["self"]],["data"]]],[11,"clone","","",34,[[["self"]],["datastruct"]]],[11,"clone","","",33,[[["self"]],["dataenum"]]],[11,"clone","","",35,[[["self"]],["dataunion"]]],[11,"clone","","",76,[[["self"]],["binop"]]],[11,"clone","","",77,[[["self"]],["unop"]]],[11,"clone","","",79,[[["self"]],["type"]]],[11,"clone","","",39,[[["self"]],["typearray"]]],[11,"clone","","",40,[[["self"]],["typebarefn"]]],[11,"clone","","",41,[[["self"]],["typegroup"]]],[11,"clone","","",42,[[["self"]],["typeimpltrait"]]],[11,"clone","","",43,[[["self"]],["typeinfer"]]],[11,"clone","","",44,[[["self"]],["typemacro"]]],[11,"clone","","",45,[[["self"]],["typenever"]]],[11,"clone","","",46,[[["self"]],["typeparen"]]],[11,"clone","","",47,[[["self"]],["typepath"]]],[11,"clone","","",48,[[["self"]],["typeptr"]]],[11,"clone","","",49,[[["self"]],["typereference"]]],[11,"clone","","",50,[[["self"]],["typeslice"]]],[11,"clone","","",51,[[["self"]],["typetraitobject"]]],[11,"clone","","",52,[[["self"]],["typetuple"]]],[11,"clone","","",37,[[["self"]],["abi"]]],[11,"clone","","",38,[[["self"]],["barefnarg"]]],[11,"clone","","",53,[[["self"]],["variadic"]]],[11,"clone","","",78,[[["self"]],["returntype"]]],[11,"clone","","",58,[[["self"]],["path"]]],[11,"clone","","",59,[[["self"]],["pathsegment"]]],[11,"clone","","",81,[[["self"]],["patharguments"]]],[11,"clone","","",80,[[["self"]],["genericargument"]]],[11,"clone","","",54,[[["self"]],["anglebracketedgenericarguments"]]],[11,"clone","","",55,[[["self"]],["binding"]]],[11,"clone","","",56,[[["self"]],["constraint"]]],[11,"clone","","",57,[[["self"]],["parenthesizedgenericarguments"]]],[11,"clone","","",60,[[["self"]],["qself"]]],[11,"clone","syn::buffer","",193,[[["self"]],["cursor"]]],[11,"clone","syn::punctuated","",196,[[["self"]],["punctuated"]]],[11,"clone","","",238,[[["self"]],["self"]]],[11,"clone","","",240,[[["self"]],["intopairs"]]],[11,"clone","","",241,[[["self"]],["intoiter"]]],[11,"clone","","",242,[[["self"]],["self"]]],[11,"clone","","",195,[[["self"]],["pair"]]],[11,"clone","syn::parse","",202,[[["self"]],["stepcursor"]]],[11,"clone","syn","",204,[[["self"]],["error"]]],[11,"default","syn::token","",82,[[],["self"]]],[11,"default","","",83,[[],["self"]]],[11,"default","","",84,[[],["self"]]],[11,"default","","",85,[[],["self"]]],[11,"default","","",86,[[],["self"]]],[11,"default","","",87,[[],["self"]]],[11,"default","","",88,[[],["self"]]],[11,"default","","",89,[[],["self"]]],[11,"default","","",90,[[],["self"]]],[11,"default","","",91,[[],["self"]]],[11,"default","","",92,[[],["self"]]],[11,"default","","",93,[[],["self"]]],[11,"default","","",94,[[],["self"]]],[11,"default","","",95,[[],["self"]]],[11,"default","","",96,[[],["self"]]],[11,"default","","",97,[[],["self"]]],[11,"default","","",98,[[],["self"]]],[11,"default","","",99,[[],["self"]]],[11,"default","","",100,[[],["self"]]],[11,"default","","",101,[[],["self"]]],[11,"default","","",102,[[],["self"]]],[11,"default","","",103,[[],["self"]]],[11,"default","","",104,[[],["self"]]],[11,"default","","",105,[[],["self"]]],[11,"default","","",106,[[],["self"]]],[11,"default","","",107,[[],["self"]]],[11,"default","","",108,[[],["self"]]],[11,"default","","",109,[[],["self"]]],[11,"default","","",110,[[],["self"]]],[11,"default","","",111,[[],["self"]]],[11,"default","","",112,[[],["self"]]],[11,"default","","",113,[[],["self"]]],[11,"default","","",114,[[],["self"]]],[11,"default","","",115,[[],["self"]]],[11,"default","","",116,[[],["self"]]],[11,"default","","",117,[[],["self"]]],[11,"default","","",118,[[],["self"]]],[11,"default","","",119,[[],["self"]]],[11,"default","","",120,[[],["self"]]],[11,"default","","",121,[[],["self"]]],[11,"default","","",122,[[],["self"]]],[11,"default","","",123,[[],["self"]]],[11,"default","","",124,[[],["self"]]],[11,"default","","",125,[[],["self"]]],[11,"default","","",126,[[],["self"]]],[11,"default","","",127,[[],["self"]]],[11,"default","","",128,[[],["self"]]],[11,"default","","",129,[[],["self"]]],[11,"default","","",130,[[],["self"]]],[11,"default","","",131,[[],["self"]]],[11,"default","","",132,[[],["self"]]],[11,"default","","",133,[[],["self"]]],[11,"default","","",134,[[],["self"]]],[11,"default","","",135,[[],["self"]]],[11,"default","","",136,[[],["self"]]],[11,"default","","",137,[[],["self"]]],[11,"default","","",138,[[],["self"]]],[11,"default","","",139,[[],["self"]]],[11,"default","","",140,[[],["self"]]],[11,"default","","",141,[[],["self"]]],[11,"default","","",142,[[],["self"]]],[11,"default","","",143,[[],["self"]]],[11,"default","","",144,[[],["self"]]],[11,"default","","",145,[[],["self"]]],[11,"default","","",146,[[],["self"]]],[11,"default","","",147,[[],["self"]]],[11,"default","","",148,[[],["self"]]],[11,"default","","",149,[[],["self"]]],[11,"default","","",150,[[],["self"]]],[11,"default","","",151,[[],["self"]]],[11,"default","","",152,[[],["self"]]],[11,"default","","",153,[[],["self"]]],[11,"default","","",154,[[],["self"]]],[11,"default","","",155,[[],["self"]]],[11,"default","","",156,[[],["self"]]],[11,"default","","",157,[[],["self"]]],[11,"default","","",158,[[],["self"]]],[11,"default","","",159,[[],["self"]]],[11,"default","","",160,[[],["self"]]],[11,"default","","",161,[[],["self"]]],[11,"default","","",162,[[],["self"]]],[11,"default","","",163,[[],["self"]]],[11,"default","","",164,[[],["self"]]],[11,"default","","",165,[[],["self"]]],[11,"default","","",166,[[],["self"]]],[11,"default","","",167,[[],["self"]]],[11,"default","","",168,[[],["self"]]],[11,"default","","",169,[[],["self"]]],[11,"default","","",170,[[],["self"]]],[11,"default","","",171,[[],["self"]]],[11,"default","","",172,[[],["self"]]],[11,"default","","",173,[[],["self"]]],[11,"default","","",174,[[],["self"]]],[11,"default","","",175,[[],["self"]]],[11,"default","","",176,[[],["self"]]],[11,"default","","",177,[[],["self"]]],[11,"default","","",178,[[],["self"]]],[11,"default","","",179,[[],["self"]]],[11,"default","","",180,[[],["self"]]],[11,"default","","",181,[[],["self"]]],[11,"default","","",182,[[],["self"]]],[11,"default","","",183,[[],["self"]]],[11,"default","","",184,[[],["self"]]],[11,"default","syn","",22,[[],["generics"]]],[11,"default","","",20,[[],["boundlifetimes"]]],[11,"default","","",81,[[],["self"]]],[11,"default","syn::punctuated","",196,[[],["self"]]],[11,"cmp","syn","",30,[[["self"],["lifetime"]],["ordering"]]],[11,"eq","","",67,[[["self"],["member"]],["bool"]]],[11,"ne","","",67,[[["self"],["member"]],["bool"]]],[11,"eq","","",19,[[["self"]],["bool"]]],[11,"eq","","",30,[[["self"],["lifetime"]],["bool"]]],[11,"eq","syn::buffer","",193,[[["self"],["cursor"]],["bool"]]],[11,"ne","","",193,[[["self"],["cursor"]],["bool"]]],[11,"partial_cmp","syn","",30,[[["self"],["lifetime"]],[["option",["ordering"]],["ordering"]]]],[11,"deref","syn::token","",82,[[["self"]]]],[11,"deref","","",135,[[["self"]]]],[11,"deref","","",137,[[["self"]]]],[11,"deref","","",140,[[["self"]]]],[11,"deref","","",141,[[["self"]]]],[11,"deref","","",142,[[["self"]]]],[11,"deref","","",144,[[["self"]]]],[11,"deref","","",146,[[["self"]]]],[11,"deref","","",147,[[["self"]]]],[11,"deref","","",149,[[["self"]]]],[11,"deref","","",150,[[["self"]]]],[11,"deref","","",154,[[["self"]]]],[11,"deref","","",157,[[["self"]]]],[11,"deref","","",159,[[["self"]]]],[11,"deref","","",162,[[["self"]]]],[11,"deref","","",165,[[["self"]]]],[11,"deref","","",166,[[["self"]]]],[11,"deref","","",169,[[["self"]]]],[11,"deref","","",172,[[["self"]]]],[11,"deref","","",177,[[["self"]]]],[11,"deref","","",178,[[["self"]]]],[11,"deref","","",180,[[["self"]]]],[11,"deref","syn::parse","",202,[[["self"]]]],[11,"deref_mut","syn::token","",82,[[["self"]]]],[11,"deref_mut","","",135,[[["self"]]]],[11,"deref_mut","","",137,[[["self"]]]],[11,"deref_mut","","",140,[[["self"]]]],[11,"deref_mut","","",141,[[["self"]]]],[11,"deref_mut","","",142,[[["self"]]]],[11,"deref_mut","","",144,[[["self"]]]],[11,"deref_mut","","",146,[[["self"]]]],[11,"deref_mut","","",147,[[["self"]]]],[11,"deref_mut","","",149,[[["self"]]]],[11,"deref_mut","","",150,[[["self"]]]],[11,"deref_mut","","",154,[[["self"]]]],[11,"deref_mut","","",157,[[["self"]]]],[11,"deref_mut","","",159,[[["self"]]]],[11,"deref_mut","","",162,[[["self"]]]],[11,"deref_mut","","",165,[[["self"]]]],[11,"deref_mut","","",166,[[["self"]]]],[11,"deref_mut","","",169,[[["self"]]]],[11,"deref_mut","","",172,[[["self"]]]],[11,"deref_mut","","",177,[[["self"]]]],[11,"deref_mut","","",178,[[["self"]]]],[11,"deref_mut","","",180,[[["self"]]]],[11,"fmt","syn::parse","",203,[[["formatter"],["self"]],["result"]]],[11,"fmt","syn","",204,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",30,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",190,[[["formatter"],["self"]],["result"]]],[11,"fmt","","",191,[[["formatter"],["self"]],["result"]]],[11,"fmt","syn::parse","",203,[[["formatter"],["self"]],["result"]]],[11,"fmt","syn","",204,[[["formatter"],["self"]],["result"]]],[11,"index","syn::punctuated","",196,[[["self"],["usize"]]]],[11,"index_mut","","",196,[[["self"],["usize"]]]],[11,"hash","syn","",67,[[["self"],["__h"]]]],[11,"hash","","",19,[[["self"],["h"]]]],[11,"hash","","",30,[[["self"],["h"]]]],[11,"from_iter","syn::punctuated","",196,[[["intoiterator"]],["self"]]],[11,"from_iter","","",196,[[["intoiterator"]],["self"]]],[11,"description","syn","",204,[[["self"]],["str"]]],[11,"to_tokens","syn::token","",82,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",83,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",84,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",85,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",86,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",87,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",88,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",89,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",90,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",91,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",92,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",93,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",94,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",95,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",96,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",97,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",98,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",99,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",100,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",101,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",102,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",103,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",104,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",105,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",106,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",107,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",108,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",109,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",110,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",111,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",112,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",113,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",114,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",115,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",116,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",117,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",118,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",119,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",120,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",121,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",122,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",123,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",124,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",125,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",126,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",127,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",128,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",129,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",130,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",131,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",132,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",133,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",134,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",135,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",136,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",137,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",138,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",139,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",140,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",141,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",142,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",143,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",144,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",145,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",146,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",147,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",148,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",149,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",150,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",151,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",152,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",153,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",154,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",155,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",156,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",157,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",158,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",159,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",160,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",161,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",162,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",163,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",164,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",165,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",166,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",167,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",168,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",169,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",170,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",171,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",172,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",173,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",174,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",175,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",176,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",177,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",178,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",179,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",180,[[["tokenstream"],["self"]]]],[11,"to_tokens","syn","",62,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",63,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",0,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",1,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",2,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",64,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",65,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",6,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",4,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",5,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",3,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",8,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",7,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",9,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",66,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",206,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",207,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",208,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",209,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",210,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",211,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",212,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",213,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",214,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",215,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",216,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",217,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",218,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",219,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",220,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",221,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",222,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",223,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",224,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",225,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",226,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",227,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",228,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",229,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",230,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",231,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",232,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",233,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",234,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",235,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",11,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",10,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",18,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",15,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",12,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",13,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",67,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",19,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",14,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",17,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",16,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",68,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",70,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",71,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",22,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",236,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",185,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",237,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",20,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",23,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",28,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",27,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",69,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",21,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",29,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",26,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",25,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",24,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",30,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",72,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",186,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",187,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",188,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",189,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",190,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",191,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",31,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",32,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",36,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",76,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",77,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",79,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",50,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",39,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",48,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",49,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",40,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",45,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",52,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",47,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",51,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",42,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",41,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",46,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",43,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",44,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",78,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",38,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",53,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",37,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",58,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",59,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",81,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",80,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",54,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",55,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",56,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",57,[[["tokenstream"],["self"]]]],[11,"to_tokens","syn::punctuated","",196,[[["tokenstream"],["self"]]]],[11,"to_tokens","","",195,[[["tokenstream"],["self"]]]],[11,"fmt","syn","",67,[[["formatter"],["self"]],["result"]]],[11,"span","","",67,[[["self"]],[["option",["span"]],["span"]]]],[11,"fmt","","",19,[[["formatter"],["self"]],["result"]]],[11,"span","","",19,[[["self"]],[["option",["span"]],["span"]]]],[11,"new","","Creates a new `Ident` with the given `string` as well as…",205,[[["str"],["span"]],["ident"]]],[11,"span","","Returns the span of this `Ident`.",205,[[["self"]],["span"]]],[11,"set_span","","Configures the span of this `Ident`, possibly changing its…",205,[[["self"],["span"]]]],[11,"visit_abi","syn::visit","",198,[[["self"],["abi"]]]],[11,"visit_angle_bracketed_generic_arguments","","",198,[[["anglebracketedgenericarguments"],["self"]]]],[11,"visit_attr_style","","",198,[[["attrstyle"],["self"]]]],[11,"visit_attribute","","",198,[[["self"],["attribute"]]]],[11,"visit_bare_fn_arg","","",198,[[["self"],["barefnarg"]]]],[11,"visit_bin_op","","",198,[[["self"],["binop"]]]],[11,"visit_binding","","",198,[[["self"],["binding"]]]],[11,"visit_bound_lifetimes","","",198,[[["self"],["boundlifetimes"]]]],[11,"visit_const_param","","",198,[[["self"],["constparam"]]]],[11,"visit_constraint","","",198,[[["self"],["constraint"]]]],[11,"visit_data","","",198,[[["self"],["data"]]]],[11,"visit_data_enum","","",198,[[["self"],["dataenum"]]]],[11,"visit_data_struct","","",198,[[["self"],["datastruct"]]]],[11,"visit_data_union","","",198,[[["self"],["dataunion"]]]],[11,"visit_derive_input","","",198,[[["self"],["deriveinput"]]]],[11,"visit_expr","","",198,[[["self"],["expr"]]]],[11,"visit_expr_binary","","",198,[[["exprbinary"],["self"]]]],[11,"visit_expr_call","","",198,[[["exprcall"],["self"]]]],[11,"visit_expr_cast","","",198,[[["self"],["exprcast"]]]],[11,"visit_expr_field","","",198,[[["self"],["exprfield"]]]],[11,"visit_expr_index","","",198,[[["self"],["exprindex"]]]],[11,"visit_expr_lit","","",198,[[["self"],["exprlit"]]]],[11,"visit_expr_paren","","",198,[[["self"],["exprparen"]]]],[11,"visit_expr_path","","",198,[[["self"],["exprpath"]]]],[11,"visit_expr_unary","","",198,[[["self"],["exprunary"]]]],[11,"visit_field","","",198,[[["field"],["self"]]]],[11,"visit_fields","","",198,[[["self"],["fields"]]]],[11,"visit_fields_named","","",198,[[["self"],["fieldsnamed"]]]],[11,"visit_fields_unnamed","","",198,[[["fieldsunnamed"],["self"]]]],[11,"visit_generic_argument","","",198,[[["genericargument"],["self"]]]],[11,"visit_generic_param","","",198,[[["self"],["genericparam"]]]],[11,"visit_generics","","",198,[[["self"],["generics"]]]],[11,"visit_ident","","",198,[[["self"],["ident"]]]],[11,"visit_index","","",198,[[["index"],["self"]]]],[11,"visit_lifetime","","",198,[[["lifetime"],["self"]]]],[11,"visit_lifetime_def","","",198,[[["self"],["lifetimedef"]]]],[11,"visit_lit","","",198,[[["self"],["lit"]]]],[11,"visit_lit_bool","","",198,[[["litbool"],["self"]]]],[11,"visit_lit_byte","","",198,[[["litbyte"],["self"]]]],[11,"visit_lit_byte_str","","",198,[[["self"],["litbytestr"]]]],[11,"visit_lit_char","","",198,[[["self"],["litchar"]]]],[11,"visit_lit_float","","",198,[[["self"],["litfloat"]]]],[11,"visit_lit_int","","",198,[[["litint"],["self"]]]],[11,"visit_lit_str","","",198,[[["self"],["litstr"]]]],[11,"visit_macro","","",198,[[["self"],["macro"]]]],[11,"visit_macro_delimiter","","",198,[[["self"],["macrodelimiter"]]]],[11,"visit_member","","",198,[[["member"],["self"]]]],[11,"visit_meta","","",198,[[["meta"],["self"]]]],[11,"visit_meta_list","","",198,[[["self"],["metalist"]]]],[11,"visit_meta_name_value","","",198,[[["self"],["metanamevalue"]]]],[11,"visit_nested_meta","","",198,[[["nestedmeta"],["self"]]]],[11,"visit_parenthesized_generic_arguments","","",198,[[["self"],["parenthesizedgenericarguments"]]]],[11,"visit_path","","",198,[[["self"],["path"]]]],[11,"visit_path_arguments","","",198,[[["self"],["patharguments"]]]],[11,"visit_path_segment","","",198,[[["self"],["pathsegment"]]]],[11,"visit_predicate_eq","","",198,[[["self"],["predicateeq"]]]],[11,"visit_predicate_lifetime","","",198,[[["self"],["predicatelifetime"]]]],[11,"visit_predicate_type","","",198,[[["self"],["predicatetype"]]]],[11,"visit_qself","","",198,[[["self"],["qself"]]]],[11,"visit_return_type","","",198,[[["returntype"],["self"]]]],[11,"visit_span","","",198,[[["self"],["span"]]]],[11,"visit_trait_bound","","",198,[[["self"],["traitbound"]]]],[11,"visit_trait_bound_modifier","","",198,[[["self"],["traitboundmodifier"]]]],[11,"visit_type","","",198,[[["self"],["type"]]]],[11,"visit_type_array","","",198,[[["self"],["typearray"]]]],[11,"visit_type_bare_fn","","",198,[[["self"],["typebarefn"]]]],[11,"visit_type_group","","",198,[[["self"],["typegroup"]]]],[11,"visit_type_impl_trait","","",198,[[["self"],["typeimpltrait"]]]],[11,"visit_type_infer","","",198,[[["self"],["typeinfer"]]]],[11,"visit_type_macro","","",198,[[["self"],["typemacro"]]]],[11,"visit_type_never","","",198,[[["self"],["typenever"]]]],[11,"visit_type_param","","",198,[[["typeparam"],["self"]]]],[11,"visit_type_param_bound","","",198,[[["self"],["typeparambound"]]]],[11,"visit_type_paren","","",198,[[["self"],["typeparen"]]]],[11,"visit_type_path","","",198,[[["self"],["typepath"]]]],[11,"visit_type_ptr","","",198,[[["self"],["typeptr"]]]],[11,"visit_type_reference","","",198,[[["self"],["typereference"]]]],[11,"visit_type_slice","","",198,[[["self"],["typeslice"]]]],[11,"visit_type_trait_object","","",198,[[["self"],["typetraitobject"]]]],[11,"visit_type_tuple","","",198,[[["self"],["typetuple"]]]],[11,"visit_un_op","","",198,[[["self"],["unop"]]]],[11,"visit_variadic","","",198,[[["self"],["variadic"]]]],[11,"visit_variant","","",198,[[["variant"],["self"]]]],[11,"visit_vis_crate","","",198,[[["self"],["viscrate"]]]],[11,"visit_vis_public","","",198,[[["self"],["vispublic"]]]],[11,"visit_vis_restricted","","",198,[[["self"],["visrestricted"]]]],[11,"visit_visibility","","",198,[[["self"],["visibility"]]]],[11,"visit_where_clause","","",198,[[["whereclause"],["self"]]]],[11,"visit_where_predicate","","",198,[[["wherepredicate"],["self"]]]],[11,"peek","syn::parse","Looks at the next token in the parse stream to determine…",244,[[["self"],["peek"]],["bool"]]],[11,"error","","Triggers an error at the current position of the parse…",244,[[],["error"]]]],"p":[[3,"Attribute"],[3,"MetaList"],[3,"MetaNameValue"],[3,"Field"],[3,"FieldsNamed"],[3,"FieldsUnnamed"],[3,"Variant"],[3,"VisCrate"],[3,"VisPublic"],[3,"VisRestricted"],[3,"ExprBinary"],[3,"ExprCall"],[3,"ExprCast"],[3,"ExprField"],[3,"ExprIndex"],[3,"ExprLit"],[3,"ExprParen"],[3,"ExprPath"],[3,"ExprUnary"],[3,"Index"],[3,"BoundLifetimes"],[3,"ConstParam"],[3,"Generics"],[3,"LifetimeDef"],[3,"PredicateEq"],[3,"PredicateLifetime"],[3,"PredicateType"],[3,"TraitBound"],[3,"TypeParam"],[3,"WhereClause"],[3,"Lifetime"],[3,"LitBool"],[3,"Macro"],[3,"DataEnum"],[3,"DataStruct"],[3,"DataUnion"],[3,"DeriveInput"],[3,"Abi"],[3,"BareFnArg"],[3,"TypeArray"],[3,"TypeBareFn"],[3,"TypeGroup"],[3,"TypeImplTrait"],[3,"TypeInfer"],[3,"TypeMacro"],[3,"TypeNever"],[3,"TypeParen"],[3,"TypePath"],[3,"TypePtr"],[3,"TypeReference"],[3,"TypeSlice"],[3,"TypeTraitObject"],[3,"TypeTuple"],[3,"Variadic"],[3,"AngleBracketedGenericArguments"],[3,"Binding"],[3,"Constraint"],[3,"ParenthesizedGenericArguments"],[3,"Path"],[3,"PathSegment"],[3,"QSelf"],[4,"AttrStyle"],[4,"Meta"],[4,"NestedMeta"],[4,"Fields"],[4,"Visibility"],[4,"Expr"],[4,"Member"],[4,"GenericParam"],[4,"TraitBoundModifier"],[4,"TypeParamBound"],[4,"WherePredicate"],[4,"Lit"],[4,"StrStyle"],[4,"MacroDelimiter"],[4,"Data"],[4,"BinOp"],[4,"UnOp"],[4,"ReturnType"],[4,"Type"],[4,"GenericArgument"],[4,"PathArguments"],[3,"Underscore"],[3,"Abstract"],[3,"As"],[3,"Async"],[3,"Auto"],[3,"Await"],[3,"Become"],[3,"Box"],[3,"Break"],[3,"Const"],[3,"Continue"],[3,"Crate"],[3,"Default"],[3,"Do"],[3,"Dyn"],[3,"Else"],[3,"Enum"],[3,"Extern"],[3,"Final"],[3,"Fn"],[3,"For"],[3,"If"],[3,"Impl"],[3,"In"],[3,"Let"],[3,"Loop"],[3,"Macro"],[3,"Match"],[3,"Mod"],[3,"Move"],[3,"Mut"],[3,"Override"],[3,"Priv"],[3,"Pub"],[3,"Ref"],[3,"Return"],[3,"SelfType"],[3,"SelfValue"],[3,"Static"],[3,"Struct"],[3,"Super"],[3,"Trait"],[3,"Try"],[3,"Type"],[3,"Typeof"],[3,"Union"],[3,"Unsafe"],[3,"Unsized"],[3,"Use"],[3,"Virtual"],[3,"Where"],[3,"While"],[3,"Yield"],[3,"Add"],[3,"AddEq"],[3,"And"],[3,"AndAnd"],[3,"AndEq"],[3,"At"],[3,"Bang"],[3,"Caret"],[3,"CaretEq"],[3,"Colon"],[3,"Colon2"],[3,"Comma"],[3,"Div"],[3,"DivEq"],[3,"Dollar"],[3,"Dot"],[3,"Dot2"],[3,"Dot3"],[3,"DotDotEq"],[3,"Eq"],[3,"EqEq"],[3,"Ge"],[3,"Gt"],[3,"Le"],[3,"Lt"],[3,"MulEq"],[3,"Ne"],[3,"Or"],[3,"OrEq"],[3,"OrOr"],[3,"Pound"],[3,"Question"],[3,"RArrow"],[3,"LArrow"],[3,"Rem"],[3,"RemEq"],[3,"FatArrow"],[3,"Semi"],[3,"Shl"],[3,"ShlEq"],[3,"Shr"],[3,"ShrEq"],[3,"Star"],[3,"Sub"],[3,"SubEq"],[3,"Tilde"],[3,"Brace"],[3,"Bracket"],[3,"Paren"],[3,"Group"],[3,"TypeGenerics"],[3,"LitStr"],[3,"LitByteStr"],[3,"LitByte"],[3,"LitChar"],[3,"LitInt"],[3,"LitFloat"],[3,"TokenBuffer"],[3,"Cursor"],[8,"IdentExt"],[4,"Pair"],[3,"Punctuated"],[8,"Spanned"],[8,"Visit"],[8,"Speculative"],[8,"Parse"],[8,"Parser"],[3,"StepCursor"],[3,"ParseBuffer"],[3,"Error"],[3,"Ident"],[3,"ExprArray"],[3,"ExprAssign"],[3,"ExprAssignOp"],[3,"ExprAsync"],[3,"ExprAwait"],[3,"ExprBlock"],[3,"ExprBox"],[3,"ExprBreak"],[3,"ExprClosure"],[3,"ExprContinue"],[3,"ExprForLoop"],[3,"ExprGroup"],[3,"ExprIf"],[3,"ExprLet"],[3,"ExprLoop"],[3,"ExprMacro"],[3,"ExprMatch"],[3,"ExprMethodCall"],[3,"ExprRange"],[3,"ExprReference"],[3,"ExprRepeat"],[3,"ExprReturn"],[3,"ExprStruct"],[3,"ExprTry"],[3,"ExprTryBlock"],[3,"ExprTuple"],[3,"ExprType"],[3,"ExprUnsafe"],[3,"ExprWhile"],[3,"ExprYield"],[3,"ImplGenerics"],[3,"Turbofish"],[3,"Pairs"],[3,"PairsMut"],[3,"IntoPairs"],[3,"IntoIter"],[3,"Iter"],[3,"IterMut"],[3,"Lookahead1"],[3,"Nothing"]]}; +searchIndex["unicode_xid"] = {"doc":"Determine if a `char` is a valid identifier for a parser…","i":[[17,"UNICODE_VERSION","unicode_xid","The version of Unicode that this version of unicode-xid is…",null,null],[8,"UnicodeXID","","Methods for determining if a character is a valid…",null,null],[10,"is_xid_start","","Returns whether the specified character satisfies the…",0,[[],["bool"]]],[10,"is_xid_continue","","Returns whether the specified `char` satisfies the…",0,[[],["bool"]]]],"p":[[8,"UnicodeXID"]]}; +addSearchOptions(searchIndex);initSearch(searchIndex); \ No newline at end of file diff --git a/serde/all.html b/serde/all.html new file mode 100644 index 0000000..8613f6a --- /dev/null +++ b/serde/all.html @@ -0,0 +1,3 @@ +List of all items in this crate

[] + + List of all items

Structs

Enums

Traits

Macros

\ No newline at end of file diff --git a/serde/de/enum.Unexpected.html b/serde/de/enum.Unexpected.html new file mode 100644 index 0000000..ae6ab35 --- /dev/null +++ b/serde/de/enum.Unexpected.html @@ -0,0 +1,78 @@ +serde::de::Unexpected - Rust

[][src]Enum serde::de::Unexpected

pub enum Unexpected<'a> {
+    Bool(bool),
+    Unsigned(u64),
+    Signed(i64),
+    Float(f64),
+    Char(char),
+    Str(&'a str),
+    Bytes(&'a [u8]),
+    Unit,
+    Option,
+    NewtypeStruct,
+    Seq,
+    Map,
+    Enum,
+    UnitVariant,
+    NewtypeVariant,
+    TupleVariant,
+    StructVariant,
+    Other(&'a str),
+}

Unexpected represents an unexpected invocation of any one of the Visitor +trait methods.

+

This is used as an argument to the invalid_type, invalid_value, and +invalid_length methods of the Error trait to build error messages.

+ +
This code runs with edition 2018
+fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
+where
+    E: de::Error,
+{
+    Err(de::Error::invalid_type(Unexpected::Bool(v), &self))
+}
+

+ Variants

+
Bool(bool)

The input contained a boolean value that was not expected.

+
Unsigned(u64)

The input contained an unsigned integer u8, u16, u32 or u64 that +was not expected.

+
Signed(i64)

The input contained a signed integer i8, i16, i32 or i64 that +was not expected.

+
Float(f64)

The input contained a floating point f32 or f64 that was not +expected.

+
Char(char)

The input contained a char that was not expected.

+
Str(&'a str)

The input contained a &str or String that was not expected.

+
Bytes(&'a [u8])

The input contained a &[u8] or Vec<u8> that was not expected.

+
Unit

The input contained a unit () that was not expected.

+
Option

The input contained an Option<T> that was not expected.

+
NewtypeStruct

The input contained a newtype struct that was not expected.

+
Seq

The input contained a sequence that was not expected.

+
Map

The input contained a map that was not expected.

+
Enum

The input contained an enum that was not expected.

+
UnitVariant

The input contained a unit variant that was not expected.

+
NewtypeVariant

The input contained a newtype variant that was not expected.

+
TupleVariant

The input contained a tuple variant that was not expected.

+
StructVariant

The input contained a struct variant that was not expected.

+
Other(&'a str)

A message stating what uncategorized thing the input contained that was +not expected.

+

The message should be a noun or noun phrase, not capitalized and without +a period. An example message is "unoriginal superhero".

+

Trait Implementations

impl<'a> Clone for Unexpected<'a>[src]

impl<'a> Copy for Unexpected<'a>[src]

impl<'a> Debug for Unexpected<'a>[src]

impl<'a> Display for Unexpected<'a>[src]

impl<'a> PartialEq<Unexpected<'a>> for Unexpected<'a>[src]

impl<'a> StructuralPartialEq for Unexpected<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Unexpected<'a>

impl<'a> Send for Unexpected<'a>

impl<'a> Sync for Unexpected<'a>

impl<'a> Unpin for Unexpected<'a>

impl<'a> UnwindSafe for Unexpected<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/ignored_any/struct.IgnoredAny.html b/serde/de/ignored_any/struct.IgnoredAny.html new file mode 100644 index 0000000..3192e2d --- /dev/null +++ b/serde/de/ignored_any/struct.IgnoredAny.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../serde/de/struct.IgnoredAny.html...

+ + + \ No newline at end of file diff --git a/serde/de/index.html b/serde/de/index.html new file mode 100644 index 0000000..fe6361b --- /dev/null +++ b/serde/de/index.html @@ -0,0 +1,153 @@ +serde::de - Rust

[][src]Module serde::de

Generic data structure deserialization framework.

+

The two most important traits in this module are Deserialize and +Deserializer.

+
    +
  • A type that implements Deserialize is a data structure that can be +deserialized from any data format supported by Serde, and conversely
  • +
  • A type that implements Deserializer is a data format that can +deserialize any data structure supported by Serde.
  • +
+

The Deserialize trait

+

Serde provides Deserialize 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.

+

Additionally, Serde provides a procedural macro called serde_derive to +automatically generate Deserialize implementations for structs and enums +in your program. See the derive section of the manual for how to use this.

+

In rare cases it may be necessary to implement Deserialize manually for +some type in your program. See the Implementing Deserialize section of +the manual for more about this.

+

Third-party crates may provide Deserialize implementations for types +that they expose. For example the linked-hash-map crate provides a +LinkedHashMap<K, V> type that is deserializable by Serde because the +crate provides an implementation of Deserialize for it.

+

The Deserializer trait

+

Deserializer implementations are provided by third-party crates, for +example serde_json, serde_yaml and bincode.

+

A partial list of well-maintained formats is given on the Serde +website.

+

Implementations of Deserialize provided by Serde

+

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 OsStr.

+
    +
  • Primitive types: +
      +
    • bool
    • +
    • i8, i16, i32, i64, i128, isize
    • +
    • u8, u16, u32, u64, u128, usize
    • +
    • f32, f64
    • +
    • char
    • +
    +
  • +
  • Compound types: +
      +
    • [T; 0] through [T; 32]
    • +
    • tuples up to size 16
    • +
    +
  • +
  • Common standard library types: +
      +
    • String
    • +
    • Option<T>
    • +
    • Result<T, E>
    • +
    • PhantomData<T>
    • +
    +
  • +
  • Wrapper types: +
      +
    • Box<T>
    • +
    • Box<[T]>
    • +
    • Box<str>
    • +
    • Cow<'a, T>
    • +
    • Cell<T>
    • +
    • RefCell<T>
    • +
    • Mutex<T>
    • +
    • RwLock<T>
    • +
    • Rc<T> (if features = ["rc"] is enabled)
    • +
    • Arc<T> (if features = ["rc"] is enabled)
    • +
    +
  • +
  • Collection types: +
      +
    • BTreeMap<K, V>
    • +
    • BTreeSet<T>
    • +
    • BinaryHeap<T>
    • +
    • HashMap<K, V, H>
    • +
    • HashSet<T, H>
    • +
    • LinkedList<T>
    • +
    • VecDeque<T>
    • +
    • Vec<T>
    • +
    +
  • +
  • Zero-copy types: +
      +
    • &str
    • +
    • &[u8]
    • +
    +
  • +
  • FFI types: +
      +
    • CString
    • +
    • Box<CStr>
    • +
    • OsString
    • +
    +
  • +
  • Miscellaneous standard library types: +
      +
    • Duration
    • +
    • SystemTime
    • +
    • Path
    • +
    • PathBuf
    • +
    • Range<T>
    • +
    • RangeInclusive<T>
    • +
    • Bound<T>
    • +
    • num::NonZero*
    • +
    • ! (unstable)
    • +
    +
  • +
  • Net types: +
      +
    • IpAddr
    • +
    • Ipv4Addr
    • +
    • Ipv6Addr
    • +
    • SocketAddr
    • +
    • SocketAddrV4
    • +
    • SocketAddrV6
    • +
    +
  • +
+

Re-exports

+
pub use std::error::Error as StdError;

Modules

+
value

Building blocks for deserializing basic values using the IntoDeserializer +trait.

+

Structs

+
IgnoredAny

An efficient way of discarding data from a deserializer.

+

Enums

+
Unexpected

Unexpected represents an unexpected invocation of any one of the Visitor +trait methods.

+

Traits

+
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.

+
\ No newline at end of file diff --git a/serde/de/sidebar-items.js b/serde/de/sidebar-items.js new file mode 100644 index 0000000..ea51ea0 --- /dev/null +++ b/serde/de/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"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."]]}); \ No newline at end of file diff --git a/serde/de/struct.IgnoredAny.html b/serde/de/struct.IgnoredAny.html new file mode 100644 index 0000000..5115d05 --- /dev/null +++ b/serde/de/struct.IgnoredAny.html @@ -0,0 +1,145 @@ +serde::de::IgnoredAny - Rust

[][src]Struct serde::de::IgnoredAny

pub struct IgnoredAny;

An efficient way of discarding data from a deserializer.

+

Think of this like serde_json::Value in that it can be deserialized from +any type, except that it does not store any information about the data that +gets deserialized.

+ +
This code runs with edition 2018
+use std::fmt;
+use std::marker::PhantomData;
+
+use serde::de::{
+    self, Deserialize, DeserializeSeed, Deserializer, IgnoredAny, SeqAccess, Visitor,
+};
+
+/// A seed that can be used to deserialize only the `n`th element of a sequence
+/// while efficiently discarding elements of any type before or after index `n`.
+///
+/// For example to deserialize only the element at index 3:
+///
+/// ```
+/// NthElement::new(3).deserialize(deserializer)
+/// ```
+pub struct NthElement<T> {
+    n: usize,
+    marker: PhantomData<T>,
+}
+
+impl<T> NthElement<T> {
+    pub fn new(n: usize) -> Self {
+        NthElement {
+            n: n,
+            marker: PhantomData,
+        }
+    }
+}
+
+impl<'de, T> Visitor<'de> for NthElement<T>
+where
+    T: Deserialize<'de>,
+{
+    type Value = T;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(
+            formatter,
+            "a sequence in which we care about element {}",
+            self.n
+        )
+    }
+
+    fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
+    where
+        A: SeqAccess<'de>,
+    {
+        // Skip over the first `n` elements.
+        for i in 0..self.n {
+            // It is an error if the sequence ends before we get to element `n`.
+            if seq.next_element::<IgnoredAny>()?.is_none() {
+                return Err(de::Error::invalid_length(i, &self));
+            }
+        }
+
+        // Deserialize the one we care about.
+        let nth = match seq.next_element()? {
+            Some(nth) => nth,
+            None => {
+                return Err(de::Error::invalid_length(self.n, &self));
+            }
+        };
+
+        // Skip over any remaining elements in the sequence after `n`.
+        while let Some(IgnoredAny) = seq.next_element()? {
+            // ignore
+        }
+
+        Ok(nth)
+    }
+}
+
+impl<'de, T> DeserializeSeed<'de> for NthElement<T>
+where
+    T: Deserialize<'de>,
+{
+    type Value = T;
+
+    fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_seq(self)
+    }
+}
+
+// Deserialize only the sequence element at index 3 from this deserializer.
+// The element at index 3 is required to be a string. Elements before and
+// after index 3 are allowed to be of any type.
+let s: String = NthElement::new(3).deserialize(deserializer)?;
+

Trait Implementations

impl Clone for IgnoredAny[src]

impl Copy for IgnoredAny[src]

impl Debug for IgnoredAny[src]

impl Default for IgnoredAny[src]

impl<'de> Deserialize<'de> for IgnoredAny[src]

impl<'de> Visitor<'de> for IgnoredAny[src]

type Value = IgnoredAny

The value produced by this visitor.

+

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Expected for T where
    T: Visitor<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/trait.Deserialize.html b/serde/de/trait.Deserialize.html new file mode 100644 index 0000000..ea0b90e --- /dev/null +++ b/serde/de/trait.Deserialize.html @@ -0,0 +1,29 @@ +serde::de::Deserialize - Rust

[][src]Trait serde::de::Deserialize

pub trait Deserialize<'de>: Sized {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: Deserializer<'de>
; +}

A data structure that can be deserialized from any data format supported +by Serde.

+

Serde provides Deserialize implementations for many Rust primitive and +standard library types. The complete list is here. All of these can +be deserialized using Serde out of the box.

+

Additionally, Serde provides a procedural macro called serde_derive to +automatically generate Deserialize implementations for structs and enums +in your program. See the derive section of the manual for how to +use this.

+

In rare cases it may be necessary to implement Deserialize manually for +some type in your program. See the Implementing +Deserialize section of the manual for more about this.

+

Third-party crates may provide Deserialize implementations for types that +they expose. For example the linked-hash-map crate provides a +LinkedHashMap<K, V> type that is deserializable by Serde because the crate +provides an implementation of Deserialize for it.

+

Lifetime

+

The 'de lifetime of this trait is the lifetime of data that may be +borrowed by Self when deserialized. See the page Understanding +deserializer lifetimes for a more detailed explanation of these lifetimes.

+
+

Required methods

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
    D: Deserializer<'de>, 

Deserialize this value from the given Serde deserializer.

+

See the Implementing Deserialize section of the +manual for more information about how to implement this method.

+
Loading content... +

Implementations on Foreign Types

impl<'de> Deserialize<'de> for ()[src]

impl<'de> Deserialize<'de> for bool[src]

impl<'de> Deserialize<'de> for i8[src]

impl<'de> Deserialize<'de> for i16[src]

impl<'de> Deserialize<'de> for i32[src]

impl<'de> Deserialize<'de> for i64[src]

impl<'de> Deserialize<'de> for isize[src]

impl<'de> Deserialize<'de> for u8[src]

impl<'de> Deserialize<'de> for u16[src]

impl<'de> Deserialize<'de> for u32[src]

impl<'de> Deserialize<'de> for u64[src]

impl<'de> Deserialize<'de> for usize[src]

impl<'de> Deserialize<'de> for f32[src]

impl<'de> Deserialize<'de> for f64[src]

impl<'de> Deserialize<'de> for i128[src]

impl<'de> Deserialize<'de> for u128[src]

impl<'de> Deserialize<'de> for char[src]

impl<'de> Deserialize<'de> for String[src]

impl<'de: 'a, 'a> Deserialize<'de> for &'a str[src]

impl<'de: 'a, 'a> Deserialize<'de> for &'a [u8][src]

impl<'de> Deserialize<'de> for CString[src]

impl<'de> Deserialize<'de> for Box<CStr>[src]

impl<'de, T: Deserialize<'de>> Deserialize<'de> for Reverse<T>[src]

impl<'de, T> Deserialize<'de> for Option<T> where
    T: Deserialize<'de>, 
[src]

impl<'de, T: ?Sized> Deserialize<'de> for PhantomData<T>[src]

impl<'de, T> Deserialize<'de> for BinaryHeap<T> where
    T: Deserialize<'de> + Ord
[src]

impl<'de, T> Deserialize<'de> for BTreeSet<T> where
    T: Deserialize<'de> + Eq + Ord
[src]

impl<'de, T> Deserialize<'de> for LinkedList<T> where
    T: Deserialize<'de>, 
[src]

impl<'de, T, S> Deserialize<'de> for HashSet<T, S> where
    T: Deserialize<'de> + Eq + Hash,
    S: BuildHasher + Default
[src]

impl<'de, T> Deserialize<'de> for VecDeque<T> where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for Vec<T> where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 0][src]

impl<'de, T> Deserialize<'de> for [T; 1] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 2] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 3] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 4] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 5] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 6] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 7] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 8] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 9] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 10] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 11] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 12] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 13] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 14] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 15] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 16] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 17] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 18] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 19] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 20] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 21] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 22] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 23] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 24] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 25] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 26] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 27] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 28] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 29] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 30] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 31] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 32] where
    T: Deserialize<'de>, 
[src]

impl<'de, T0: Deserialize<'de>> Deserialize<'de> for (T0,)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>> Deserialize<'de> for (T0, T1)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>, T9: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>, T9: Deserialize<'de>, T10: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>, T9: Deserialize<'de>, T10: Deserialize<'de>, T11: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>, T9: Deserialize<'de>, T10: Deserialize<'de>, T11: Deserialize<'de>, T12: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>, T9: Deserialize<'de>, T10: Deserialize<'de>, T11: Deserialize<'de>, T12: Deserialize<'de>, T13: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>, T9: Deserialize<'de>, T10: Deserialize<'de>, T11: Deserialize<'de>, T12: Deserialize<'de>, T13: Deserialize<'de>, T14: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>, T9: Deserialize<'de>, T10: Deserialize<'de>, T11: Deserialize<'de>, T12: Deserialize<'de>, T13: Deserialize<'de>, T14: Deserialize<'de>, T15: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)[src]

impl<'de, K, V> Deserialize<'de> for BTreeMap<K, V> where
    K: Deserialize<'de> + Ord,
    V: Deserialize<'de>, 
[src]

impl<'de, K, V, S> Deserialize<'de> for HashMap<K, V, S> where
    K: Deserialize<'de> + Eq + Hash,
    V: Deserialize<'de>,
    S: BuildHasher + Default
[src]

impl<'de> Deserialize<'de> for IpAddr[src]

impl<'de> Deserialize<'de> for Ipv4Addr[src]

impl<'de> Deserialize<'de> for Ipv6Addr[src]

impl<'de> Deserialize<'de> for SocketAddr[src]

impl<'de> Deserialize<'de> for SocketAddrV4[src]

impl<'de> Deserialize<'de> for SocketAddrV6[src]

impl<'de: 'a, 'a> Deserialize<'de> for &'a Path[src]

impl<'de> Deserialize<'de> for PathBuf[src]

impl<'de> Deserialize<'de> for Box<Path>[src]

impl<'de> Deserialize<'de> for OsString[src]

impl<'de, T: Deserialize<'de>> Deserialize<'de> for Box<T>[src]

impl<'de, T: Deserialize<'de>> Deserialize<'de> for Box<[T]>[src]

impl<'de> Deserialize<'de> for Box<str>[src]

impl<'de, 'a, T: ?Sized> Deserialize<'de> for Cow<'a, T> where
    T: ToOwned,
    T::Owned: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for Cell<T> where
    T: Deserialize<'de> + Copy
[src]

impl<'de, T: Deserialize<'de>> Deserialize<'de> for RefCell<T>[src]

impl<'de, T: Deserialize<'de>> Deserialize<'de> for Mutex<T>[src]

impl<'de, T: Deserialize<'de>> Deserialize<'de> for RwLock<T>[src]

impl<'de> Deserialize<'de> for Duration[src]

impl<'de> Deserialize<'de> for SystemTime[src]

impl<'de, Idx> Deserialize<'de> for Range<Idx> where
    Idx: Deserialize<'de>, 
[src]

impl<'de, Idx> Deserialize<'de> for RangeInclusive<Idx> where
    Idx: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for Bound<T> where
    T: Deserialize<'de>, 
[src]

impl<'de> Deserialize<'de> for NonZeroU8[src]

impl<'de> Deserialize<'de> for NonZeroU16[src]

impl<'de> Deserialize<'de> for NonZeroU32[src]

impl<'de> Deserialize<'de> for NonZeroU64[src]

impl<'de> Deserialize<'de> for NonZeroUsize[src]

impl<'de> Deserialize<'de> for NonZeroI8[src]

impl<'de> Deserialize<'de> for NonZeroI16[src]

impl<'de> Deserialize<'de> for NonZeroI32[src]

impl<'de> Deserialize<'de> for NonZeroI64[src]

impl<'de> Deserialize<'de> for NonZeroIsize[src]

impl<'de> Deserialize<'de> for NonZeroU128[src]

impl<'de> Deserialize<'de> for NonZeroI128[src]

impl<'de, T, E> Deserialize<'de> for Result<T, E> where
    T: Deserialize<'de>,
    E: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for Wrapping<T> where
    T: Deserialize<'de>, 
[src]

impl<'de> Deserialize<'de> for AtomicBool[src]

impl<'de> Deserialize<'de> for AtomicI8[src]

impl<'de> Deserialize<'de> for AtomicI16[src]

impl<'de> Deserialize<'de> for AtomicI32[src]

impl<'de> Deserialize<'de> for AtomicIsize[src]

impl<'de> Deserialize<'de> for AtomicU8[src]

impl<'de> Deserialize<'de> for AtomicU16[src]

impl<'de> Deserialize<'de> for AtomicU32[src]

impl<'de> Deserialize<'de> for AtomicUsize[src]

impl<'de> Deserialize<'de> for AtomicI64[src]

impl<'de> Deserialize<'de> for AtomicU64[src]

Loading content... +

Implementors

impl<'de> Deserialize<'de> for IgnoredAny[src]

Loading content...
\ No newline at end of file diff --git a/serde/de/trait.DeserializeOwned.html b/serde/de/trait.DeserializeOwned.html new file mode 100644 index 0000000..c2dcf28 --- /dev/null +++ b/serde/de/trait.DeserializeOwned.html @@ -0,0 +1,22 @@ +serde::de::DeserializeOwned - Rust

[][src]Trait serde::de::DeserializeOwned

pub trait DeserializeOwned: for<'de> Deserialize<'de> { }

A data structure that can be deserialized without borrowing any data from +the deserializer.

+

This is primarily useful for trait bounds on functions. For example a +from_str function may be able to deserialize a data structure that borrows +from the input string, but a from_reader function may only deserialize +owned data.

+ +
This code runs with edition 2018
+fn from_str<'a, T>(s: &'a str) -> Result<T>
+where
+    T: Deserialize<'a>;
+
+fn from_reader<R, T>(rdr: R) -> Result<T>
+where
+    R: Read,
+    T: DeserializeOwned;
+

Lifetime

+

The relationship between Deserialize and DeserializeOwned in trait +bounds is explained in more detail on the page Understanding deserializer +lifetimes.

+
+

Implementors

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

Loading content...
\ No newline at end of file diff --git a/serde/de/trait.DeserializeSeed.html b/serde/de/trait.DeserializeSeed.html new file mode 100644 index 0000000..dc6ac84 --- /dev/null +++ b/serde/de/trait.DeserializeSeed.html @@ -0,0 +1,135 @@ +serde::de::DeserializeSeed - Rust

[][src]Trait serde::de::DeserializeSeed

pub trait DeserializeSeed<'de>: Sized {
+    type Value;
+    fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
    where
        D: Deserializer<'de>
; +}

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.

+

As one example of stateful deserialization consider deserializing a JSON +array into an existing buffer. Using the Deserialize trait we could +deserialize a JSON array into a Vec<T> but it would be a freshly allocated +Vec<T>; there is no way for Deserialize to reuse a previously allocated +buffer. Using DeserializeSeed instead makes this possible as in the +example code below.

+

The canonical API for stateless deserialization looks like this:

+ +
This code runs with edition 2018
+fn func<'de, T: Deserialize<'de>>() -> Result<T, Error>
+

Adjusting an API like this to support stateful deserialization is a matter +of accepting a seed as input:

+ +
This code runs with edition 2018
+fn func_seed<'de, T: DeserializeSeed<'de>>(seed: T) -> Result<T::Value, Error>
+

In practice the majority of deserialization is stateless. An API expecting a +seed can be appeased by passing std::marker::PhantomData as a seed in the +case of stateless deserialization.

+

Lifetime

+

The 'de lifetime of this trait is the lifetime of data that may be +borrowed by Self::Value when deserialized. See the page Understanding +deserializer lifetimes for a more detailed explanation of these lifetimes.

+

Example

+

Suppose we have JSON that looks like [[1, 2], [3, 4, 5], [6]] and we need +to deserialize it into a flat representation like vec![1, 2, 3, 4, 5, 6]. +Allocating a brand new Vec<T> for each subarray would be slow. Instead we +would like to allocate a single Vec<T> and then deserialize each subarray +into it. This requires stateful deserialization using the DeserializeSeed +trait.

+ +
This code runs with edition 2018
+use std::fmt;
+use std::marker::PhantomData;
+
+use serde::de::{Deserialize, DeserializeSeed, Deserializer, SeqAccess, Visitor};
+
+// A DeserializeSeed implementation that uses stateful deserialization to
+// append array elements onto the end of an existing vector. The preexisting
+// state ("seed") in this case is the Vec<T>. The `deserialize` method of
+// `ExtendVec` will be traversing the inner arrays of the JSON input and
+// appending each integer into the existing Vec.
+struct ExtendVec<'a, T: 'a>(&'a mut Vec<T>);
+
+impl<'de, 'a, T> DeserializeSeed<'de> for ExtendVec<'a, T>
+where
+    T: Deserialize<'de>,
+{
+    // The return type of the `deserialize` method. This implementation
+    // appends onto an existing vector but does not create any new data
+    // structure, so the return type is ().
+    type Value = ();
+
+    fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        // Visitor implementation that will walk an inner array of the JSON
+        // input.
+        struct ExtendVecVisitor<'a, T: 'a>(&'a mut Vec<T>);
+
+        impl<'de, 'a, T> Visitor<'de> for ExtendVecVisitor<'a, T>
+        where
+            T: Deserialize<'de>,
+        {
+            type Value = ();
+
+            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                write!(formatter, "an array of integers")
+            }
+
+            fn visit_seq<A>(self, mut seq: A) -> Result<(), A::Error>
+            where
+                A: SeqAccess<'de>,
+            {
+                // Visit each element in the inner array and push it onto
+                // the existing vector.
+                while let Some(elem) = seq.next_element()? {
+                    self.0.push(elem);
+                }
+                Ok(())
+            }
+        }
+
+        deserializer.deserialize_seq(ExtendVecVisitor(self.0))
+    }
+}
+
+// Visitor implementation that will walk the outer array of the JSON input.
+struct FlattenedVecVisitor<T>(PhantomData<T>);
+
+impl<'de, T> Visitor<'de> for FlattenedVecVisitor<T>
+where
+    T: Deserialize<'de>,
+{
+    // This Visitor constructs a single Vec<T> to hold the flattened
+    // contents of the inner arrays.
+    type Value = Vec<T>;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "an array of arrays")
+    }
+
+    fn visit_seq<A>(self, mut seq: A) -> Result<Vec<T>, A::Error>
+    where
+        A: SeqAccess<'de>,
+    {
+        // Create a single Vec to hold the flattened contents.
+        let mut vec = Vec::new();
+
+        // Each iteration through this loop is one inner array.
+        while let Some(()) = seq.next_element_seed(ExtendVec(&mut vec))? {
+            // Nothing to do; inner array has been appended into `vec`.
+        }
+
+        // Return the finished vec.
+        Ok(vec)
+    }
+}
+
+let visitor = FlattenedVecVisitor(PhantomData);
+let flattened: Vec<u64> = deserializer.deserialize_seq(visitor)?;
+
+

Associated Types

type Value

The type produced by using this seed.

+
Loading content... +

Required methods

fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error> where
    D: Deserializer<'de>, 

Equivalent to the more common Deserialize::deserialize method, except +with some initial piece of data (the seed) passed in.

+
Loading content... +

Implementations on Foreign Types

impl<'de, T> DeserializeSeed<'de> for PhantomData<T> where
    T: Deserialize<'de>, 
[src]

type Value = T

Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/serde/de/trait.Deserializer.html b/serde/de/trait.Deserializer.html new file mode 100644 index 0000000..acb75da --- /dev/null +++ b/serde/de/trait.Deserializer.html @@ -0,0 +1,298 @@ +serde::de::Deserializer - Rust

[][src]Trait serde::de::Deserializer

pub trait Deserializer<'de>: Sized {
+    type Error: Error;
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_byte_buf<V>(
        self,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_unit_struct<V>(
        self,
        name: &'static str,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_newtype_struct<V>(
        self,
        name: &'static str,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_tuple<V>(
        self,
        len: usize,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_tuple_struct<V>(
        self,
        name: &'static str,
        len: usize,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_struct<V>(
        self,
        name: &'static str,
        fields: &'static [&'static str],
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_enum<V>(
        self,
        name: &'static str,
        variants: &'static [&'static str],
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_identifier<V>(
        self,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_ignored_any<V>(
        self,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; + + fn deserialize_i128<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
, + { ... } +
fn deserialize_u128<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
, + { ... } +
fn is_human_readable(&self) -> bool { ... } +}

A data format that can deserialize any data structure supported by +Serde.

+

The role of this trait is to define the deserialization half of the Serde +data model, which is a way to categorize every Rust data type into one of +29 possible types. Each method of the Deserializer trait corresponds to one +of the types of the data model.

+

Implementations of Deserialize map themselves into this data model by +passing to the Deserializer a Visitor implementation that can receive +these various types.

+

The types that make up the Serde data model are:

+
    +
  • 14 primitive types +
      +
    • bool
    • +
    • i8, i16, i32, i64, i128
    • +
    • u8, u16, u32, u64, u128
    • +
    • f32, f64
    • +
    • char
    • +
    +
  • +
  • string +
      +
    • UTF-8 bytes with a length and no null terminator.
    • +
    • When serializing, all strings are handled equally. When deserializing, +there are three flavors of strings: transient, owned, and borrowed.
    • +
    +
  • +
  • byte array - [u8] +
      +
    • Similar to strings, during deserialization byte arrays can be +transient, owned, or borrowed.
    • +
    +
  • +
  • option +
      +
    • Either none or some value.
    • +
    +
  • +
  • unit +
      +
    • The type of () in Rust. It represents an anonymous value containing +no data.
    • +
    +
  • +
  • unit_struct +
      +
    • For example struct Unit or PhantomData<T>. It represents a named +value containing no data.
    • +
    +
  • +
  • unit_variant +
      +
    • For example the E::A and E::B in enum E { A, B }.
    • +
    +
  • +
  • newtype_struct +
      +
    • For example struct Millimeters(u8).
    • +
    +
  • +
  • newtype_variant +
      +
    • For example the E::N in enum E { N(u8) }.
    • +
    +
  • +
  • seq +
      +
    • A variably sized heterogeneous sequence of values, for example Vec<T> +or HashSet<T>. When serializing, the length may or may not be known +before iterating through all the data. When deserializing, the length +is determined by looking at the serialized data.
    • +
    +
  • +
  • tuple +
      +
    • A statically sized heterogeneous sequence of values for which the +length will be known at deserialization time without looking at the +serialized data, for example (u8,) or (String, u64, Vec<T>) or +[u64; 10].
    • +
    +
  • +
  • tuple_struct +
      +
    • A named tuple, for example struct Rgb(u8, u8, u8).
    • +
    +
  • +
  • tuple_variant +
      +
    • For example the E::T in enum E { T(u8, u8) }.
    • +
    +
  • +
  • map +
      +
    • A heterogeneous key-value pairing, for example BTreeMap<K, V>.
    • +
    +
  • +
  • struct +
      +
    • A heterogeneous key-value pairing in which the keys are strings and +will be known at deserialization time without looking at the serialized +data, for example struct S { r: u8, g: u8, b: u8 }.
    • +
    +
  • +
  • struct_variant +
      +
    • For example the E::S in enum E { S { r: u8, g: u8, b: u8 } }.
    • +
    +
  • +
+

The Deserializer trait supports two entry point styles which enables +different kinds of deserialization.

+
    +
  1. +

    The deserialize method. Self-describing data formats like JSON are able +to look at the serialized data and tell what it represents. For example +the JSON deserializer may see an opening curly brace ({) and know that +it is seeing a map. If the data format supports +Deserializer::deserialize_any, it will drive the Visitor using whatever +type it sees in the input. JSON uses this approach when deserializing +serde_json::Value which is an enum that can represent any JSON +document. Without knowing what is in a JSON document, we can deserialize +it to serde_json::Value by going through +Deserializer::deserialize_any.

    +
  2. +
  3. +

    The various deserialize_* methods. Non-self-describing formats like +Bincode need to be told what is in the input in order to deserialize it. +The deserialize_* methods are hints to the deserializer for how to +interpret the next piece of input. Non-self-describing formats are not +able to deserialize something like serde_json::Value which relies on +Deserializer::deserialize_any.

    +
  4. +
+

When implementing Deserialize, you should avoid relying on +Deserializer::deserialize_any unless you need to be told by the +Deserializer what type is in the input. Know that relying on +Deserializer::deserialize_any means your data type will be able to +deserialize from self-describing formats only, ruling out Bincode and many +others.

+

Lifetime

+

The 'de lifetime of this trait is the lifetime of data that may be +borrowed from the input when deserializing. See the page Understanding +deserializer lifetimes for a more detailed explanation of these lifetimes.

+

Example implementation

+

The example data format presented on the website contains example code for +a basic JSON Deserializer.

+
+

Associated Types

type Error: Error

The error type that can be returned if some error occurs during +deserialization.

+
Loading content... +

Required methods

fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Require the Deserializer to figure out how to drive the visitor based +on what data type is in the input.

+

When implementing Deserialize, you should avoid relying on +Deserializer::deserialize_any unless you need to be told by the +Deserializer what type is in the input. Know that relying on +Deserializer::deserialize_any means your data type will be able to +deserialize from self-describing formats only, ruling out Bincode and +many others.

+

fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a bool value.

+

fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an i8 value.

+

fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an i16 value.

+

fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an i32 value.

+

fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an i64 value.

+

fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a u8 value.

+

fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a u16 value.

+

fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a u32 value.

+

fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a u64 value.

+

fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a f32 value.

+

fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a f64 value.

+

fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a char value.

+

fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a string value and does +not benefit from taking ownership of buffered data owned by the +Deserializer.

+

If the Visitor would benefit from taking ownership of String data, +indiciate this to the Deserializer by using deserialize_string +instead.

+

fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a string value and would +benefit from taking ownership of buffered data owned by the +Deserializer.

+

If the Visitor would not benefit from taking ownership of String +data, indicate that to the Deserializer by using deserialize_str +instead.

+

fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a byte array and does not +benefit from taking ownership of buffered data owned by the +Deserializer.

+

If the Visitor would benefit from taking ownership of Vec<u8> data, +indicate this to the Deserializer by using deserialize_byte_buf +instead.

+

fn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a byte array and would +benefit from taking ownership of buffered data owned by the +Deserializer.

+

If the Visitor would not benefit from taking ownership of Vec<u8> +data, indicate that to the Deserializer by using deserialize_bytes +instead.

+

fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an optional value.

+

This allows deserializers that encode an optional value as a nullable +value to convert the null value into None and a regular value into +Some(value).

+

fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a unit value.

+

fn deserialize_unit_struct<V>(
    self,
    name: &'static str,
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a unit struct with a +particular name.

+

fn deserialize_newtype_struct<V>(
    self,
    name: &'static str,
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a newtype struct with a +particular name.

+

fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a sequence of values.

+

fn deserialize_tuple<V>(
    self,
    len: usize,
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a sequence of values and +knows how many values there are without looking at the serialized data.

+

fn deserialize_tuple_struct<V>(
    self,
    name: &'static str,
    len: usize,
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a tuple struct with a +particular name and number of fields.

+

fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a map of key-value pairs.

+

fn deserialize_struct<V>(
    self,
    name: &'static str,
    fields: &'static [&'static str],
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a struct with a particular +name and fields.

+

fn deserialize_enum<V>(
    self,
    name: &'static str,
    variants: &'static [&'static str],
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an enum value with a +particular name and possible variants.

+

fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting the name of a struct +field or the discriminant of an enum variant.

+

fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type needs to deserialize a value whose type +doesn't matter because it is ignored.

+

Deserializers for non-self-describing formats may not support this mode.

+
Loading content... +

Provided methods

fn deserialize_i128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an i128 value.

+

This method is available only on Rust compiler versions >=1.26. The +default behavior unconditionally returns an error.

+

fn deserialize_u128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an u128 value.

+

This method is available only on Rust compiler versions >=1.26. The +default behavior unconditionally returns an error.

+

fn is_human_readable(&self) -> bool

Determine whether Deserialize implementations should expect to +deserialize their human-readable form.

+

Some types have a human-readable form that may be somewhat expensive to +construct, as well as a binary form that is compact and efficient. +Generally text-based formats like JSON and YAML will prefer to use the +human-readable one and binary formats like Bincode will prefer the +compact one.

+ +
This code runs with edition 2018
+use serde::de::{self, Deserialize, Deserializer};
+
+impl<'de> Deserialize<'de> for Timestamp {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        if deserializer.is_human_readable() {
+            // Deserialize from a human-readable string like "2015-05-15T17:01:00Z".
+            let s = String::deserialize(deserializer)?;
+            Timestamp::from_str(&s).map_err(de::Error::custom)
+        } else {
+            // Deserialize from a compact binary representation, seconds since
+            // the Unix epoch.
+            let n = u64::deserialize(deserializer)?;
+            Ok(Timestamp::EPOCH + Duration::seconds(n))
+        }
+    }
+}
+

The default implementation of this method returns true. Data formats +may override this to false to request a compact form for types that +support one. Note that modifying this method to change a format from +human-readable to compact or vice versa should be regarded as a breaking +change, as a value serialized in human-readable mode is not required to +deserialize from the same data in compact mode.

+
Loading content... +

Implementors

impl<'de, 'a, E> Deserializer<'de> for CowStrDeserializer<'a, E> where
    E: Error
[src]

type Error = E

impl<'de, 'a, E> Deserializer<'de> for StrDeserializer<'a, E> where
    E: Error
[src]

type Error = E

impl<'de, A> Deserializer<'de> for MapAccessDeserializer<A> where
    A: MapAccess<'de>, 
[src]

type Error = A::Error

impl<'de, A> Deserializer<'de> for SeqAccessDeserializer<A> where
    A: SeqAccess<'de>, 
[src]

type Error = A::Error

impl<'de, E> Deserializer<'de> for BoolDeserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for BorrowedBytesDeserializer<'de, E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for BorrowedStrDeserializer<'de, E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for CharDeserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for F32Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for F64Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for I128Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for I16Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for I32Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for I64Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for I8Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for IsizeDeserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for StringDeserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for U128Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for U16Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for U32Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for U64Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for U8Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for UnitDeserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for UsizeDeserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, I, E> Deserializer<'de> for MapDeserializer<'de, I, E> where
    I: Iterator,
    I::Item: Pair,
    <I::Item as Pair>::First: IntoDeserializer<'de, E>,
    <I::Item as Pair>::Second: IntoDeserializer<'de, E>,
    E: Error
[src]

type Error = E

impl<'de, I, T, E> Deserializer<'de> for SeqDeserializer<I, E> where
    I: Iterator<Item = T>,
    T: IntoDeserializer<'de, E>,
    E: Error
[src]

type Error = E

Loading content...
\ No newline at end of file diff --git a/serde/de/trait.EnumAccess.html b/serde/de/trait.EnumAccess.html new file mode 100644 index 0000000..dc1af04 --- /dev/null +++ b/serde/de/trait.EnumAccess.html @@ -0,0 +1,32 @@ +serde::de::EnumAccess - Rust

[][src]Trait serde::de::EnumAccess

pub trait EnumAccess<'de>: Sized {
+    type Error: Error;
+    type Variant: VariantAccess<'de, Error = Self::Error>;
+    fn variant_seed<V>(
        self,
        seed: V
    ) -> Result<(V::Value, Self::Variant), Self::Error>
    where
        V: DeserializeSeed<'de>
; + + fn variant<V>(self) -> Result<(V, Self::Variant), Self::Error>
    where
        V: Deserialize<'de>
, + { ... } +}

Provides a Visitor access to the data of an enum in the input.

+

EnumAccess is created by the Deserializer and passed to the +Visitor in order to identify which variant of an enum to deserialize.

+

Lifetime

+

The 'de lifetime of this trait is the lifetime of data that may be +borrowed by the deserialized enum variant. See the page Understanding +deserializer lifetimes for a more detailed explanation of these lifetimes.

+

Example implementation

+

The example data format presented on the website demonstrates an +implementation of EnumAccess for a basic JSON data format.

+
+

Associated Types

type Error: Error

The error type that can be returned if some error occurs during +deserialization.

+

type Variant: VariantAccess<'de, Error = Self::Error>

The Visitor that will be used to deserialize the content of the enum +variant.

+
Loading content... +

Required methods

fn variant_seed<V>(
    self,
    seed: V
) -> Result<(V::Value, Self::Variant), Self::Error> where
    V: DeserializeSeed<'de>, 

variant is called to identify which variant to deserialize.

+

Deserialize implementations should typically use EnumAccess::variant +instead.

+
Loading content... +

Provided methods

fn variant<V>(self) -> Result<(V, Self::Variant), Self::Error> where
    V: Deserialize<'de>, 

variant is called to identify which variant to deserialize.

+

This method exists as a convenience for Deserialize implementations. +EnumAccess implementations should not override the default behavior.

+
Loading content... +

Implementors

impl<'de, 'a, E> EnumAccess<'de> for CowStrDeserializer<'a, E> where
    E: Error
[src]

type Error = E

type Variant = UnitOnly<E>

impl<'de, 'a, E> EnumAccess<'de> for StrDeserializer<'a, E> where
    E: Error
[src]

type Error = E

type Variant = UnitOnly<E>

impl<'de, 'a, E> EnumAccess<'de> for StringDeserializer<E> where
    E: Error
[src]

type Error = E

type Variant = UnitOnly<E>

impl<'de, A> EnumAccess<'de> for MapAccessDeserializer<A> where
    A: MapAccess<'de>, 
[src]

type Error = A::Error

type Variant = MapAsEnum<A>

impl<'de, E> EnumAccess<'de> for BorrowedStrDeserializer<'de, E> where
    E: Error
[src]

type Error = E

type Variant = UnitOnly<E>

impl<'de, E> EnumAccess<'de> for U32Deserializer<E> where
    E: Error
[src]

type Error = E

type Variant = UnitOnly<E>

Loading content...
\ No newline at end of file diff --git a/serde/de/trait.Error.html b/serde/de/trait.Error.html new file mode 100644 index 0000000..d1f7b47 --- /dev/null +++ b/serde/de/trait.Error.html @@ -0,0 +1,79 @@ +serde::de::Error - Rust

[][src]Trait serde::de::Error

pub trait Error: Sized + StdError {
+    fn custom<T>(msg: T) -> Self
    where
        T: Display
; + + fn invalid_type(unexp: Unexpected, exp: &dyn Expected) -> Self { ... } +
fn invalid_value(unexp: Unexpected, exp: &dyn Expected) -> Self { ... } +
fn invalid_length(len: usize, exp: &dyn Expected) -> Self { ... } +
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self { ... } +
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self { ... } +
fn missing_field(field: &'static str) -> Self { ... } +
fn duplicate_field(field: &'static str) -> Self { ... } +}

The Error trait allows Deserialize implementations to create descriptive +error messages belonging to the Deserializer against which they are +currently running.

+

Every Deserializer declares an Error type that encompasses both +general-purpose deserialization errors as well as errors specific to the +particular deserialization format. For example the Error type of +serde_json can represent errors like an invalid JSON escape sequence or an +unterminated string literal, in addition to the error cases that are part of +this trait.

+

Most deserializers should only need to provide the Error::custom method +and inherit the default behavior for the other methods.

+

Example implementation

+

The example data format presented on the website shows an error +type appropriate for a basic JSON data format.

+
+

Required methods

fn custom<T>(msg: T) -> Self where
    T: Display

Raised when there is general error when deserializing a type.

+

The message should not be capitalized and should not end with a period.

+ +
This code runs with edition 2018
+use serde::de::{self, Deserialize, Deserializer};
+
+impl<'de> Deserialize<'de> for IpAddr {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        let s = String::deserialize(deserializer)?;
+        s.parse().map_err(de::Error::custom)
+    }
+}
+
Loading content... +

Provided methods

fn invalid_type(unexp: Unexpected, exp: &dyn Expected) -> Self

Raised when a Deserialize receives a type different from what it was +expecting.

+

The unexp argument provides information about what type was received. +This is the type that was present in the input file or other source data +of the Deserializer.

+

The exp argument provides information about what type was being +expected. This is the type that is written in the program.

+

For example if we try to deserialize a String out of a JSON file +containing an integer, the unexpected type is the integer and the +expected type is the string.

+

fn invalid_value(unexp: Unexpected, exp: &dyn Expected) -> Self

Raised when a Deserialize receives a value of the right type but that +is wrong for some other reason.

+

The unexp argument provides information about what value was received. +This is the value that was present in the input file or other source +data of the Deserializer.

+

The exp argument provides information about what value was being +expected. This is the type that is written in the program.

+

For example if we try to deserialize a String out of some binary data +that is not valid UTF-8, the unexpected value is the bytes and the +expected value is a string.

+

fn invalid_length(len: usize, exp: &dyn Expected) -> Self

Raised when deserializing a sequence or map and the input data contains +too many or too few elements.

+

The len argument is the number of elements encountered. The sequence +or map may have expected more arguments or fewer arguments.

+

The exp argument provides information about what data was being +expected. For example exp might say that a tuple of size 6 was +expected.

+

fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self

Raised when a Deserialize enum type received a variant with an +unrecognized name.

+

fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self

Raised when a Deserialize struct type received a field with an +unrecognized name.

+

fn missing_field(field: &'static str) -> Self

Raised when a Deserialize struct type expected to receive a required +field with a particular name but that field was not present in the +input.

+

fn duplicate_field(field: &'static str) -> Self

Raised when a Deserialize struct type received more than one of the +same field.

+
Loading content... +

Implementors

impl Error for Error[src]

Loading content...
\ No newline at end of file diff --git a/serde/de/trait.Expected.html b/serde/de/trait.Expected.html new file mode 100644 index 0000000..42d77c7 --- /dev/null +++ b/serde/de/trait.Expected.html @@ -0,0 +1,31 @@ +serde::de::Expected - Rust

[][src]Trait serde::de::Expected

pub trait Expected {
+    fn fmt(&self, formatter: &mut Formatter) -> Result;
+}

Expected represents an explanation of what data a Visitor was expecting +to receive.

+

This is used as an argument to the invalid_type, invalid_value, and +invalid_length methods of the Error 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.

+

Within the context of a Visitor implementation, the Visitor itself +(&self) is an implementation of this trait.

+ +
This code runs with edition 2018
+fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
+where
+    E: de::Error,
+{
+    Err(de::Error::invalid_type(Unexpected::Bool(v), &self))
+}
+

Outside of a Visitor, &"..." can be used.

+ +
This code runs with edition 2018
+return Err(de::Error::invalid_type(Unexpected::Bool(v), &"a negative integer"));
+
+

Required methods

fn fmt(&self, formatter: &mut Formatter) -> Result

Format an explanation of what data was being expected. Same signature as +the Display and Debug traits.

+
Loading content...

Trait Implementations

impl<'a> Display for dyn Expected + 'a[src]

+

Implementations on Foreign Types

impl<'a> Expected for &'a str[src]

Loading content... +

Implementors

impl<'de, T> Expected for T where
    T: Visitor<'de>, 
[src]

Loading content...
\ No newline at end of file diff --git a/serde/de/trait.IntoDeserializer.html b/serde/de/trait.IntoDeserializer.html new file mode 100644 index 0000000..822cae3 --- /dev/null +++ b/serde/de/trait.IntoDeserializer.html @@ -0,0 +1,35 @@ +serde::de::IntoDeserializer - Rust

[][src]Trait serde::de::IntoDeserializer

pub trait IntoDeserializer<'de, E: Error = Error> {
+    type Deserializer: Deserializer<'de, Error = E>;
+    fn into_deserializer(self) -> Self::Deserializer;
+}

Converts an existing value into a Deserializer from which other values can +be deserialized.

+

Lifetime

+

The 'de lifetime of this trait is the lifetime of data that may be +borrowed from the resulting Deserializer. See the page Understanding +deserializer lifetimes for a more detailed explanation of these lifetimes.

+

Example

+
This code runs with edition 2018
+use std::str::FromStr;
+use serde::Deserialize;
+use serde::de::{value, IntoDeserializer};
+
+#[derive(Deserialize)]
+enum Setting {
+    On,
+    Off,
+}
+
+impl FromStr for Setting {
+    type Err = value::Error;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        Self::deserialize(s.into_deserializer())
+    }
+}
+
+

Associated Types

type Deserializer: Deserializer<'de, Error = E>

The type of the deserializer being converted into.

+
Loading content... +

Required methods

fn into_deserializer(self) -> Self::Deserializer

Convert this value into a deserializer.

+
Loading content... +

Implementations on Foreign Types

impl<'de, E> IntoDeserializer<'de, E> for () where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for bool where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for i8 where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for i16 where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for i32 where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for i64 where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for isize where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for u8 where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for u16 where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for u64 where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for usize where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for f32 where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for f64 where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for char where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for i128 where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for u128 where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for u32 where
    E: Error
[src]

impl<'de, 'a, E> IntoDeserializer<'de, E> for &'a str where
    E: Error
[src]

impl<'de, E> IntoDeserializer<'de, E> for String where
    E: Error
[src]

impl<'de, 'a, E> IntoDeserializer<'de, E> for Cow<'a, str> where
    E: Error
[src]

impl<'de, T, E> IntoDeserializer<'de, E> for Vec<T> where
    T: IntoDeserializer<'de, E>,
    E: Error
[src]

impl<'de, T, E> IntoDeserializer<'de, E> for BTreeSet<T> where
    T: IntoDeserializer<'de, E> + Eq + Ord,
    E: Error
[src]

impl<'de, T, S, E> IntoDeserializer<'de, E> for HashSet<T, S> where
    T: IntoDeserializer<'de, E> + Eq + Hash,
    S: BuildHasher,
    E: Error
[src]

impl<'de, K, V, E> IntoDeserializer<'de, E> for BTreeMap<K, V> where
    K: IntoDeserializer<'de, E> + Eq + Ord,
    V: IntoDeserializer<'de, E>,
    E: Error
[src]

impl<'de, K, V, S, E> IntoDeserializer<'de, E> for HashMap<K, V, S> where
    K: IntoDeserializer<'de, E> + Eq + Hash,
    V: IntoDeserializer<'de, E>,
    S: BuildHasher,
    E: Error
[src]

Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/serde/de/trait.MapAccess.html b/serde/de/trait.MapAccess.html new file mode 100644 index 0000000..1817f8d --- /dev/null +++ b/serde/de/trait.MapAccess.html @@ -0,0 +1,62 @@ +serde::de::MapAccess - Rust

[][src]Trait serde::de::MapAccess

pub trait MapAccess<'de> {
+    type Error: Error;
+    fn next_key_seed<K>(
        &mut self,
        seed: K
    ) -> Result<Option<K::Value>, Self::Error>
    where
        K: DeserializeSeed<'de>
; +
fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value, Self::Error>
    where
        V: DeserializeSeed<'de>
; + + fn next_entry_seed<K, V>(
        &mut self,
        kseed: K,
        vseed: V
    ) -> Result<Option<(K::Value, V::Value)>, Self::Error>
    where
        K: DeserializeSeed<'de>,
        V: DeserializeSeed<'de>
, + { ... } +
fn next_key<K>(&mut self) -> Result<Option<K>, Self::Error>
    where
        K: Deserialize<'de>
, + { ... } +
fn next_value<V>(&mut self) -> Result<V, Self::Error>
    where
        V: Deserialize<'de>
, + { ... } +
fn next_entry<K, V>(&mut self) -> Result<Option<(K, V)>, Self::Error>
    where
        K: Deserialize<'de>,
        V: Deserialize<'de>
, + { ... } +
fn size_hint(&self) -> Option<usize> { ... } +}

Provides a Visitor access to each entry of a map in the input.

+

This is a trait that a Deserializer passes to a Visitor implementation.

+

Lifetime

+

The 'de lifetime of this trait is the lifetime of data that may be +borrowed by deserialized map entries. See the page Understanding +deserializer lifetimes for a more detailed explanation of these lifetimes.

+

Example implementation

+

The example data format presented on the website demonstrates an +implementation of MapAccess for a basic JSON data format.

+
+

Associated Types

type Error: Error

The error type that can be returned if some error occurs during +deserialization.

+
Loading content... +

Required methods

fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>, Self::Error> where
    K: DeserializeSeed<'de>, 

This returns Ok(Some(key)) for the next key in the map, or Ok(None) +if there are no more remaining entries.

+

Deserialize implementations should typically use +MapAccess::next_key or MapAccess::next_entry instead.

+

fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value, Self::Error> where
    V: DeserializeSeed<'de>, 

This returns a Ok(value) for the next value in the map.

+

Deserialize implementations should typically use +MapAccess::next_value instead.

+

Panics

+

Calling next_value_seed before next_key_seed is incorrect and is +allowed to panic or return bogus results.

+
Loading content... +

Provided methods

fn next_entry_seed<K, V>(
    &mut self,
    kseed: K,
    vseed: V
) -> Result<Option<(K::Value, V::Value)>, Self::Error> where
    K: DeserializeSeed<'de>,
    V: DeserializeSeed<'de>, 

This returns Ok(Some((key, value))) for the next (key-value) pair in +the map, or Ok(None) if there are no more remaining items.

+

MapAccess implementations should override the default behavior if a +more efficient implementation is possible.

+

Deserialize implementations should typically use +MapAccess::next_entry instead.

+

fn next_key<K>(&mut self) -> Result<Option<K>, Self::Error> where
    K: Deserialize<'de>, 

This returns Ok(Some(key)) for the next key in the map, or Ok(None) +if there are no more remaining entries.

+

This method exists as a convenience for Deserialize implementations. +MapAccess implementations should not override the default behavior.

+

fn next_value<V>(&mut self) -> Result<V, Self::Error> where
    V: Deserialize<'de>, 

This returns a Ok(value) for the next value in the map.

+

This method exists as a convenience for Deserialize implementations. +MapAccess implementations should not override the default behavior.

+

Panics

+

Calling next_value before next_key is incorrect and is allowed to +panic or return bogus results.

+

fn next_entry<K, V>(&mut self) -> Result<Option<(K, V)>, Self::Error> where
    K: Deserialize<'de>,
    V: Deserialize<'de>, 

This returns Ok(Some((key, value))) for the next (key-value) pair in +the map, or Ok(None) if there are no more remaining items.

+

This method exists as a convenience for Deserialize implementations. +MapAccess implementations should not override the default behavior.

+

fn size_hint(&self) -> Option<usize>

Returns the number of entries remaining in the map, if known.

+
Loading content... +

Implementations on Foreign Types

impl<'de, 'a, A> MapAccess<'de> for &'a mut A where
    A: MapAccess<'de>, 
[src]

type Error = A::Error

Loading content... +

Implementors

impl<'de, I, E> MapAccess<'de> for MapDeserializer<'de, I, E> where
    I: Iterator,
    I::Item: Pair,
    <I::Item as Pair>::First: IntoDeserializer<'de, E>,
    <I::Item as Pair>::Second: IntoDeserializer<'de, E>,
    E: Error
[src]

type Error = E

Loading content...
\ No newline at end of file diff --git a/serde/de/trait.SeqAccess.html b/serde/de/trait.SeqAccess.html new file mode 100644 index 0000000..538146e --- /dev/null +++ b/serde/de/trait.SeqAccess.html @@ -0,0 +1,34 @@ +serde::de::SeqAccess - Rust

[][src]Trait serde::de::SeqAccess

pub trait SeqAccess<'de> {
+    type Error: Error;
+    fn next_element_seed<T>(
        &mut self,
        seed: T
    ) -> Result<Option<T::Value>, Self::Error>
    where
        T: DeserializeSeed<'de>
; + + fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error>
    where
        T: Deserialize<'de>
, + { ... } +
fn size_hint(&self) -> Option<usize> { ... } +}

Provides a Visitor access to each element of a sequence in the input.

+

This is a trait that a Deserializer passes to a Visitor implementation, +which deserializes each item in a sequence.

+

Lifetime

+

The 'de lifetime of this trait is the lifetime of data that may be +borrowed by deserialized sequence elements. See the page Understanding +deserializer lifetimes for a more detailed explanation of these lifetimes.

+

Example implementation

+

The example data format presented on the website demonstrates an +implementation of SeqAccess for a basic JSON data format.

+
+

Associated Types

type Error: Error

The error type that can be returned if some error occurs during +deserialization.

+
Loading content... +

Required methods

fn next_element_seed<T>(
    &mut self,
    seed: T
) -> Result<Option<T::Value>, Self::Error> where
    T: DeserializeSeed<'de>, 

This returns Ok(Some(value)) for the next value in the sequence, or +Ok(None) if there are no more remaining items.

+

Deserialize implementations should typically use +SeqAccess::next_element instead.

+
Loading content... +

Provided methods

fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error> where
    T: Deserialize<'de>, 

This returns Ok(Some(value)) for the next value in the sequence, or +Ok(None) if there are no more remaining items.

+

This method exists as a convenience for Deserialize implementations. +SeqAccess implementations should not override the default behavior.

+

fn size_hint(&self) -> Option<usize>

Returns the number of elements remaining in the sequence, if known.

+
Loading content... +

Implementations on Foreign Types

impl<'de, 'a, A> SeqAccess<'de> for &'a mut A where
    A: SeqAccess<'de>, 
[src]

type Error = A::Error

Loading content... +

Implementors

impl<'de, I, E> SeqAccess<'de> for MapDeserializer<'de, I, E> where
    I: Iterator,
    I::Item: Pair,
    <I::Item as Pair>::First: IntoDeserializer<'de, E>,
    <I::Item as Pair>::Second: IntoDeserializer<'de, E>,
    E: Error
[src]

type Error = E

impl<'de, I, T, E> SeqAccess<'de> for SeqDeserializer<I, E> where
    I: Iterator<Item = T>,
    T: IntoDeserializer<'de, E>,
    E: Error
[src]

type Error = E

Loading content...
\ No newline at end of file diff --git a/serde/de/trait.VariantAccess.html b/serde/de/trait.VariantAccess.html new file mode 100644 index 0000000..b171aba --- /dev/null +++ b/serde/de/trait.VariantAccess.html @@ -0,0 +1,91 @@ +serde::de::VariantAccess - Rust

[][src]Trait serde::de::VariantAccess

pub trait VariantAccess<'de>: Sized {
+    type Error: Error;
+    fn unit_variant(self) -> Result<(), Self::Error>;
+
fn newtype_variant_seed<T>(self, seed: T) -> Result<T::Value, Self::Error>
    where
        T: DeserializeSeed<'de>
; +
fn tuple_variant<V>(
        self,
        len: usize,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn struct_variant<V>(
        self,
        fields: &'static [&'static str],
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; + + fn newtype_variant<T>(self) -> Result<T, Self::Error>
    where
        T: Deserialize<'de>
, + { ... } +}

VariantAccess is a visitor that is created by the Deserializer and +passed to the Deserialize to deserialize the content of a particular enum +variant.

+

Lifetime

+

The 'de lifetime of this trait is the lifetime of data that may be +borrowed by the deserialized enum variant. See the page Understanding +deserializer lifetimes for a more detailed explanation of these lifetimes.

+

Example implementation

+

The example data format presented on the website demonstrates an +implementation of VariantAccess for a basic JSON data format.

+
+

Associated Types

type Error: Error

The error type that can be returned if some error occurs during +deserialization. Must match the error type of our EnumAccess.

+
Loading content... +

Required methods

fn unit_variant(self) -> Result<(), Self::Error>

Called when deserializing a variant with no values.

+

If the data contains a different type of variant, the following +invalid_type error should be constructed:

+ +
This code runs with edition 2018
+fn unit_variant(self) -> Result<(), Self::Error> {
+    // What the data actually contained; suppose it is a tuple variant.
+    let unexp = Unexpected::TupleVariant;
+    Err(de::Error::invalid_type(unexp, &"unit variant"))
+}
+

fn newtype_variant_seed<T>(self, seed: T) -> Result<T::Value, Self::Error> where
    T: DeserializeSeed<'de>, 

Called when deserializing a variant with a single value.

+

Deserialize implementations should typically use +VariantAccess::newtype_variant instead.

+

If the data contains a different type of variant, the following +invalid_type error should be constructed:

+ +
This code runs with edition 2018
+fn newtype_variant_seed<T>(self, _seed: T) -> Result<T::Value, Self::Error>
+where
+    T: DeserializeSeed<'de>,
+{
+    // What the data actually contained; suppose it is a unit variant.
+    let unexp = Unexpected::UnitVariant;
+    Err(de::Error::invalid_type(unexp, &"newtype variant"))
+}
+

fn tuple_variant<V>(
    self,
    len: usize,
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Called when deserializing a tuple-like variant.

+

The len is the number of fields expected in the tuple variant.

+

If the data contains a different type of variant, the following +invalid_type error should be constructed:

+ +
This code runs with edition 2018
+fn tuple_variant<V>(
+    self,
+    _len: usize,
+    _visitor: V,
+) -> Result<V::Value, Self::Error>
+where
+    V: Visitor<'de>,
+{
+    // What the data actually contained; suppose it is a unit variant.
+    let unexp = Unexpected::UnitVariant;
+    Err(de::Error::invalid_type(unexp, &"tuple variant"))
+}
+

fn struct_variant<V>(
    self,
    fields: &'static [&'static str],
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Called when deserializing a struct-like variant.

+

The fields are the names of the fields of the struct variant.

+

If the data contains a different type of variant, the following +invalid_type error should be constructed:

+ +
This code runs with edition 2018
+fn struct_variant<V>(
+    self,
+    _fields: &'static [&'static str],
+    _visitor: V,
+) -> Result<V::Value, Self::Error>
+where
+    V: Visitor<'de>,
+{
+    // What the data actually contained; suppose it is a unit variant.
+    let unexp = Unexpected::UnitVariant;
+    Err(de::Error::invalid_type(unexp, &"struct variant"))
+}
+
Loading content... +

Provided methods

fn newtype_variant<T>(self) -> Result<T, Self::Error> where
    T: Deserialize<'de>, 

Called when deserializing a variant with a single value.

+

This method exists as a convenience for Deserialize implementations. +VariantAccess implementations should not override the default +behavior.

+
Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/serde/de/trait.Visitor.html b/serde/de/trait.Visitor.html new file mode 100644 index 0000000..1947ff8 --- /dev/null +++ b/serde/de/trait.Visitor.html @@ -0,0 +1,208 @@ +serde::de::Visitor - Rust

[][src]Trait serde::de::Visitor

pub trait Visitor<'de>: Sized {
+    type Value;
+    fn expecting(&self, formatter: &mut Formatter) -> Result;
+
+    fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_i8<E>(self, v: i8) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_i16<E>(self, v: i16) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_i32<E>(self, v: i32) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_i128<E>(self, v: i128) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_u8<E>(self, v: u8) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_u16<E>(self, v: u16) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_u32<E>(self, v: u32) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_u128<E>(self, v: u128) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_f32<E>(self, v: f32) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_char<E>(self, v: char) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_borrowed_str<E>(self, v: &'de str) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_string<E>(self, v: String) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_borrowed_bytes<E>(self, v: &'de [u8]) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_byte_buf<E>(self, v: Vec<u8>) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_none<E>(self) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_some<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
    where
        D: Deserializer<'de>
, + { ... } +
fn visit_unit<E>(self) -> Result<Self::Value, E>
    where
        E: Error
, + { ... } +
fn visit_newtype_struct<D>(
        self,
        deserializer: D
    ) -> Result<Self::Value, D::Error>
    where
        D: Deserializer<'de>
, + { ... } +
fn visit_seq<A>(self, seq: A) -> Result<Self::Value, A::Error>
    where
        A: SeqAccess<'de>
, + { ... } +
fn visit_map<A>(self, map: A) -> Result<Self::Value, A::Error>
    where
        A: MapAccess<'de>
, + { ... } +
fn visit_enum<A>(self, data: A) -> Result<Self::Value, A::Error>
    where
        A: EnumAccess<'de>
, + { ... } +}

This trait represents a visitor that walks through a deserializer.

+

Lifetime

+

The 'de lifetime of this trait is the requirement for lifetime of data +that may be borrowed by Self::Value. See the page Understanding +deserializer lifetimes for a more detailed explanation of these lifetimes.

+

Example

+
This code runs with edition 2018
+/// A visitor that deserializes a long string - a string containing at least
+/// some minimum number of bytes.
+struct LongString {
+    min: usize,
+}
+
+impl<'de> Visitor<'de> for LongString {
+    type Value = String;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        write!(formatter, "a string containing at least {} bytes", self.min)
+    }
+
+    fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
+    where
+        E: de::Error,
+    {
+        if s.len() >= self.min {
+            Ok(s.to_owned())
+        } else {
+            Err(de::Error::invalid_value(Unexpected::Str(s), &self))
+        }
+    }
+}
+
+

Associated Types

type Value

The value produced by this visitor.

+
Loading content... +

Required methods

fn expecting(&self, formatter: &mut Formatter) -> Result

Format a message stating what data this Visitor expects to receive.

+

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.

+ +
This code runs with edition 2018
+fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+    write!(formatter, "an integer between 0 and {}", self.max)
+}
+
Loading content... +

Provided methods

fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E> where
    E: Error

The input contains a boolean.

+

The default implementation fails with a type error.

+

fn visit_i8<E>(self, v: i8) -> Result<Self::Value, E> where
    E: Error

The input contains an i8.

+

The default implementation forwards to visit_i64.

+

fn visit_i16<E>(self, v: i16) -> Result<Self::Value, E> where
    E: Error

The input contains an i16.

+

The default implementation forwards to visit_i64.

+

fn visit_i32<E>(self, v: i32) -> Result<Self::Value, E> where
    E: Error

The input contains an i32.

+

The default implementation forwards to visit_i64.

+

fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E> where
    E: Error

The input contains an i64.

+

The default implementation fails with a type error.

+

fn visit_i128<E>(self, v: i128) -> Result<Self::Value, E> where
    E: Error

The input contains a i128.

+

This method is available only on Rust compiler versions >=1.26. The +default implementation fails with a type error.

+

fn visit_u8<E>(self, v: u8) -> Result<Self::Value, E> where
    E: Error

The input contains a u8.

+

The default implementation forwards to visit_u64.

+

fn visit_u16<E>(self, v: u16) -> Result<Self::Value, E> where
    E: Error

The input contains a u16.

+

The default implementation forwards to visit_u64.

+

fn visit_u32<E>(self, v: u32) -> Result<Self::Value, E> where
    E: Error

The input contains a u32.

+

The default implementation forwards to visit_u64.

+

fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E> where
    E: Error

The input contains a u64.

+

The default implementation fails with a type error.

+

fn visit_u128<E>(self, v: u128) -> Result<Self::Value, E> where
    E: Error

The input contains a u128.

+

This method is available only on Rust compiler versions >=1.26. The +default implementation fails with a type error.

+

fn visit_f32<E>(self, v: f32) -> Result<Self::Value, E> where
    E: Error

The input contains an f32.

+

The default implementation forwards to visit_f64.

+

fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E> where
    E: Error

The input contains an f64.

+

The default implementation fails with a type error.

+

fn visit_char<E>(self, v: char) -> Result<Self::Value, E> where
    E: Error

The input contains a char.

+

The default implementation forwards to visit_str as a one-character +string.

+

fn visit_str<E>(self, v: &str) -> Result<Self::Value, E> where
    E: Error

The input contains a string. The lifetime of the string is ephemeral and +it may be destroyed after this method returns.

+

This method allows the Deserializer to avoid a copy by retaining +ownership of any buffered data. Deserialize implementations that do +not benefit from taking ownership of String data should indicate that +to the deserializer by using Deserializer::deserialize_str rather than +Deserializer::deserialize_string.

+

It is never correct to implement visit_string without implementing +visit_str. Implement neither, both, or just visit_str.

+

fn visit_borrowed_str<E>(self, v: &'de str) -> Result<Self::Value, E> where
    E: Error

The input contains a string that lives at least as long as the +Deserializer.

+

This enables zero-copy deserialization of strings in some formats. For +example JSON input containing the JSON string "borrowed" can be +deserialized with zero copying into a &'a str as long as the input +data outlives 'a.

+

The default implementation forwards to visit_str.

+

fn visit_string<E>(self, v: String) -> Result<Self::Value, E> where
    E: Error

The input contains a string and ownership of the string is being given +to the Visitor.

+

This method allows the Visitor to avoid a copy by taking ownership of +a string created by the Deserializer. Deserialize implementations +that benefit from taking ownership of String data should indicate that +to the deserializer by using Deserializer::deserialize_string rather +than Deserializer::deserialize_str, although not every deserializer +will honor such a request.

+

It is never correct to implement visit_string without implementing +visit_str. Implement neither, both, or just visit_str.

+

The default implementation forwards to visit_str and then drops the +String.

+

fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E> where
    E: Error

The input contains a byte array. The lifetime of the byte array is +ephemeral and it may be destroyed after this method returns.

+

This method allows the Deserializer to avoid a copy by retaining +ownership of any buffered data. Deserialize implementations that do +not benefit from taking ownership of Vec<u8> data should indicate that +to the deserializer by using Deserializer::deserialize_bytes rather +than Deserializer::deserialize_byte_buf.

+

It is never correct to implement visit_byte_buf without implementing +visit_bytes. Implement neither, both, or just visit_bytes.

+

fn visit_borrowed_bytes<E>(self, v: &'de [u8]) -> Result<Self::Value, E> where
    E: Error

The input contains a byte array that lives at least as long as the +Deserializer.

+

This enables zero-copy deserialization of bytes in some formats. For +example Bincode data containing bytes can be deserialized with zero +copying into a &'a [u8] as long as the input data outlives 'a.

+

The default implementation forwards to visit_bytes.

+

fn visit_byte_buf<E>(self, v: Vec<u8>) -> Result<Self::Value, E> where
    E: Error

The input contains a byte array and ownership of the byte array is being +given to the Visitor.

+

This method allows the Visitor to avoid a copy by taking ownership of +a byte buffer created by the Deserializer. Deserialize +implementations that benefit from taking ownership of Vec<u8> data +should indicate that to the deserializer by using +Deserializer::deserialize_byte_buf rather than +Deserializer::deserialize_bytes, although not every deserializer will +honor such a request.

+

It is never correct to implement visit_byte_buf without implementing +visit_bytes. Implement neither, both, or just visit_bytes.

+

The default implementation forwards to visit_bytes and then drops the +Vec<u8>.

+

fn visit_none<E>(self) -> Result<Self::Value, E> where
    E: Error

The input contains an optional that is absent.

+

The default implementation fails with a type error.

+

fn visit_some<D>(self, deserializer: D) -> Result<Self::Value, D::Error> where
    D: Deserializer<'de>, 

The input contains an optional that is present.

+

The default implementation fails with a type error.

+

fn visit_unit<E>(self) -> Result<Self::Value, E> where
    E: Error

The input contains a unit ().

+

The default implementation fails with a type error.

+

fn visit_newtype_struct<D>(
    self,
    deserializer: D
) -> Result<Self::Value, D::Error> where
    D: Deserializer<'de>, 

The input contains a newtype struct.

+

The content of the newtype struct may be read from the given +Deserializer.

+

The default implementation fails with a type error.

+

fn visit_seq<A>(self, seq: A) -> Result<Self::Value, A::Error> where
    A: SeqAccess<'de>, 

The input contains a sequence of elements.

+

The default implementation fails with a type error.

+

fn visit_map<A>(self, map: A) -> Result<Self::Value, A::Error> where
    A: MapAccess<'de>, 

The input contains a key-value map.

+

The default implementation fails with a type error.

+

fn visit_enum<A>(self, data: A) -> Result<Self::Value, A::Error> where
    A: EnumAccess<'de>, 

The input contains an enum.

+

The default implementation fails with a type error.

+
Loading content... +

Implementors

impl<'de> Visitor<'de> for IgnoredAny[src]

type Value = IgnoredAny

Loading content...
\ No newline at end of file diff --git a/serde/de/value/index.html b/serde/de/value/index.html new file mode 100644 index 0000000..45f296f --- /dev/null +++ b/serde/de/value/index.html @@ -0,0 +1,68 @@ +serde::de::value - Rust

[][src]Module serde::de::value

Building blocks for deserializing basic values using the IntoDeserializer +trait.

+ +
This code runs with edition 2018
+use std::str::FromStr;
+use serde::Deserialize;
+use serde::de::{value, IntoDeserializer};
+
+#[derive(Deserialize)]
+enum Setting {
+    On,
+    Off,
+}
+
+impl FromStr for Setting {
+    type Err = value::Error;
+
+    fn from_str(s: &str) -> Result<Self, Self::Err> {
+        Self::deserialize(s.into_deserializer())
+    }
+}
+

Structs

+
BoolDeserializer

A deserializer holding +a bool.

+
BorrowedBytesDeserializer

A deserializer holding a &[u8] with a lifetime tied to another +deserializer.

+
BorrowedStrDeserializer

A deserializer holding a &str with a lifetime tied to another +deserializer.

+
CharDeserializer

A deserializer holding +a char.

+
CowStrDeserializer

A deserializer holding a Cow<str>.

+
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.

+
I8Deserializer

A deserializer holding +an i8.

+
I16Deserializer

A deserializer holding +an i16.

+
I32Deserializer

A deserializer holding +an i32.

+
I64Deserializer

A deserializer holding +an i64.

+
I128Deserializer

A deserializer holding +an i128.

+
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.

+
U8Deserializer

A deserializer holding +a u8.

+
U16Deserializer

A deserializer holding +a u16.

+
U32Deserializer

A deserializer holding a u32.

+
U64Deserializer

A deserializer holding +a u64.

+
U128Deserializer

A deserializer holding +a u128.

+
UnitDeserializer

A deserializer holding a ().

+
UsizeDeserializer

A deserializer holding +a usize.

+
\ No newline at end of file diff --git a/serde/de/value/sidebar-items.js b/serde/de/value/sidebar-items.js new file mode 100644 index 0000000..358a337 --- /dev/null +++ b/serde/de/value/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["BoolDeserializer","A deserializer holding a `bool`."],["BorrowedBytesDeserializer","A deserializer holding a `&[u8]` with a lifetime tied to another deserializer."],["BorrowedStrDeserializer","A deserializer holding a `&str` with a lifetime tied to another deserializer."],["CharDeserializer","A deserializer holding a `char`."],["CowStrDeserializer","A deserializer holding a `Cow`."],["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`."]]}); \ No newline at end of file diff --git a/serde/de/value/struct.BoolDeserializer.html b/serde/de/value/struct.BoolDeserializer.html new file mode 100644 index 0000000..55d8c14 --- /dev/null +++ b/serde/de/value/struct.BoolDeserializer.html @@ -0,0 +1,52 @@ +serde::de::value::BoolDeserializer - Rust

[][src]Struct serde::de::value::BoolDeserializer

pub struct BoolDeserializer<E> { /* fields omitted */ }

A deserializer holding +a bool.

+

Trait Implementations

impl<E> Clone for BoolDeserializer<E>[src]

impl<E> Copy for BoolDeserializer<E>[src]

impl<E: Debug> Debug for BoolDeserializer<E>[src]

impl<'de, E> Deserializer<'de> for BoolDeserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for BoolDeserializer<E> where
    E: RefUnwindSafe

impl<E> Send for BoolDeserializer<E> where
    E: Send

impl<E> Sync for BoolDeserializer<E> where
    E: Sync

impl<E> Unpin for BoolDeserializer<E> where
    E: Unpin

impl<E> UnwindSafe for BoolDeserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.BorrowedBytesDeserializer.html b/serde/de/value/struct.BorrowedBytesDeserializer.html new file mode 100644 index 0000000..da88f4a --- /dev/null +++ b/serde/de/value/struct.BorrowedBytesDeserializer.html @@ -0,0 +1,53 @@ +serde::de::value::BorrowedBytesDeserializer - Rust

[][src]Struct serde::de::value::BorrowedBytesDeserializer

pub struct BorrowedBytesDeserializer<'de, E> { /* fields omitted */ }

A deserializer holding a &[u8] with a lifetime tied to another +deserializer.

+

Methods

impl<'de, E> BorrowedBytesDeserializer<'de, E>[src]

pub fn new(value: &'de [u8]) -> BorrowedBytesDeserializer<'de, E>[src]

Create a new borrowed deserializer from the given byte slice.

+

Trait Implementations

impl<'de, E> Clone for BorrowedBytesDeserializer<'de, E>[src]

impl<'de, E> Copy for BorrowedBytesDeserializer<'de, E>[src]

impl<'de, E: Debug> Debug for BorrowedBytesDeserializer<'de, E>[src]

impl<'de, E> Deserializer<'de> for BorrowedBytesDeserializer<'de, E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<'de, E> RefUnwindSafe for BorrowedBytesDeserializer<'de, E> where
    E: RefUnwindSafe

impl<'de, E> Send for BorrowedBytesDeserializer<'de, E> where
    E: Send

impl<'de, E> Sync for BorrowedBytesDeserializer<'de, E> where
    E: Sync

impl<'de, E> Unpin for BorrowedBytesDeserializer<'de, E> where
    E: Unpin

impl<'de, E> UnwindSafe for BorrowedBytesDeserializer<'de, E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.BorrowedStrDeserializer.html b/serde/de/value/struct.BorrowedStrDeserializer.html new file mode 100644 index 0000000..9efa580 --- /dev/null +++ b/serde/de/value/struct.BorrowedStrDeserializer.html @@ -0,0 +1,57 @@ +serde::de::value::BorrowedStrDeserializer - Rust

[][src]Struct serde::de::value::BorrowedStrDeserializer

pub struct BorrowedStrDeserializer<'de, E> { /* fields omitted */ }

A deserializer holding a &str with a lifetime tied to another +deserializer.

+

Methods

impl<'de, E> BorrowedStrDeserializer<'de, E>[src]

pub fn new(value: &'de str) -> BorrowedStrDeserializer<'de, E>[src]

Create a new borrowed deserializer from the given string.

+

Trait Implementations

impl<'de, E> Clone for BorrowedStrDeserializer<'de, E>[src]

impl<'de, E> Copy for BorrowedStrDeserializer<'de, E>[src]

impl<'de, E: Debug> Debug for BorrowedStrDeserializer<'de, E>[src]

impl<'de, E> Deserializer<'de> for BorrowedStrDeserializer<'de, E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

impl<'de, E> EnumAccess<'de> for BorrowedStrDeserializer<'de, E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

type Variant = UnitOnly<E>

The Visitor that will be used to deserialize the content of the enum variant. Read more

+

Auto Trait Implementations

impl<'de, E> RefUnwindSafe for BorrowedStrDeserializer<'de, E> where
    E: RefUnwindSafe

impl<'de, E> Send for BorrowedStrDeserializer<'de, E> where
    E: Send

impl<'de, E> Sync for BorrowedStrDeserializer<'de, E> where
    E: Sync

impl<'de, E> Unpin for BorrowedStrDeserializer<'de, E> where
    E: Unpin

impl<'de, E> UnwindSafe for BorrowedStrDeserializer<'de, E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.CharDeserializer.html b/serde/de/value/struct.CharDeserializer.html new file mode 100644 index 0000000..2b112ce --- /dev/null +++ b/serde/de/value/struct.CharDeserializer.html @@ -0,0 +1,52 @@ +serde::de::value::CharDeserializer - Rust

[][src]Struct serde::de::value::CharDeserializer

pub struct CharDeserializer<E> { /* fields omitted */ }

A deserializer holding +a char.

+

Trait Implementations

impl<E> Clone for CharDeserializer<E>[src]

impl<E> Copy for CharDeserializer<E>[src]

impl<E: Debug> Debug for CharDeserializer<E>[src]

impl<'de, E> Deserializer<'de> for CharDeserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for CharDeserializer<E> where
    E: RefUnwindSafe

impl<E> Send for CharDeserializer<E> where
    E: Send

impl<E> Sync for CharDeserializer<E> where
    E: Sync

impl<E> Unpin for CharDeserializer<E> where
    E: Unpin

impl<E> UnwindSafe for CharDeserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.CowStrDeserializer.html b/serde/de/value/struct.CowStrDeserializer.html new file mode 100644 index 0000000..b908ad6 --- /dev/null +++ b/serde/de/value/struct.CowStrDeserializer.html @@ -0,0 +1,55 @@ +serde::de::value::CowStrDeserializer - Rust

[][src]Struct serde::de::value::CowStrDeserializer

pub struct CowStrDeserializer<'a, E> { /* fields omitted */ }

A deserializer holding a Cow<str>.

+

Trait Implementations

impl<'a, E> Clone for CowStrDeserializer<'a, E>[src]

impl<'a, E: Debug> Debug for CowStrDeserializer<'a, E>[src]

impl<'de, 'a, E> Deserializer<'de> for CowStrDeserializer<'a, E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

impl<'de, 'a, E> EnumAccess<'de> for CowStrDeserializer<'a, E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

type Variant = UnitOnly<E>

The Visitor that will be used to deserialize the content of the enum variant. Read more

+

Auto Trait Implementations

impl<'a, E> RefUnwindSafe for CowStrDeserializer<'a, E> where
    E: RefUnwindSafe

impl<'a, E> Send for CowStrDeserializer<'a, E> where
    E: Send

impl<'a, E> Sync for CowStrDeserializer<'a, E> where
    E: Sync

impl<'a, E> Unpin for CowStrDeserializer<'a, E> where
    E: Unpin

impl<'a, E> UnwindSafe for CowStrDeserializer<'a, E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.Error.html b/serde/de/value/struct.Error.html new file mode 100644 index 0000000..1245191 --- /dev/null +++ b/serde/de/value/struct.Error.html @@ -0,0 +1,37 @@ +serde::de::value::Error - Rust

[][src]Struct serde::de::value::Error

pub struct Error { /* fields omitted */ }

A minimal representation of all possible errors that can occur using the +IntoDeserializer trait.

+

Trait Implementations

impl Clone for Error[src]

impl Debug for Error[src]

impl Display for Error[src]

impl Error for Error[src]

impl Error for Error[src]

impl Error for Error[src]

impl PartialEq<Error> for Error[src]

impl StructuralPartialEq for Error[src]

Auto Trait Implementations

impl RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl UnwindSafe for Error

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.F32Deserializer.html b/serde/de/value/struct.F32Deserializer.html new file mode 100644 index 0000000..301d92d --- /dev/null +++ b/serde/de/value/struct.F32Deserializer.html @@ -0,0 +1,52 @@ +serde::de::value::F32Deserializer - Rust

[][src]Struct serde::de::value::F32Deserializer

pub struct F32Deserializer<E> { /* fields omitted */ }

A deserializer holding +an f32.

+

Trait Implementations

impl<E> Clone for F32Deserializer<E>[src]

impl<E> Copy for F32Deserializer<E>[src]

impl<E: Debug> Debug for F32Deserializer<E>[src]

impl<'de, E> Deserializer<'de> for F32Deserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for F32Deserializer<E> where
    E: RefUnwindSafe

impl<E> Send for F32Deserializer<E> where
    E: Send

impl<E> Sync for F32Deserializer<E> where
    E: Sync

impl<E> Unpin for F32Deserializer<E> where
    E: Unpin

impl<E> UnwindSafe for F32Deserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.F64Deserializer.html b/serde/de/value/struct.F64Deserializer.html new file mode 100644 index 0000000..50051b6 --- /dev/null +++ b/serde/de/value/struct.F64Deserializer.html @@ -0,0 +1,52 @@ +serde::de::value::F64Deserializer - Rust

[][src]Struct serde::de::value::F64Deserializer

pub struct F64Deserializer<E> { /* fields omitted */ }

A deserializer holding +an f64.

+

Trait Implementations

impl<E> Clone for F64Deserializer<E>[src]

impl<E> Copy for F64Deserializer<E>[src]

impl<E: Debug> Debug for F64Deserializer<E>[src]

impl<'de, E> Deserializer<'de> for F64Deserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for F64Deserializer<E> where
    E: RefUnwindSafe

impl<E> Send for F64Deserializer<E> where
    E: Send

impl<E> Sync for F64Deserializer<E> where
    E: Sync

impl<E> Unpin for F64Deserializer<E> where
    E: Unpin

impl<E> UnwindSafe for F64Deserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.I128Deserializer.html b/serde/de/value/struct.I128Deserializer.html new file mode 100644 index 0000000..9e7073a --- /dev/null +++ b/serde/de/value/struct.I128Deserializer.html @@ -0,0 +1,52 @@ +serde::de::value::I128Deserializer - Rust

[][src]Struct serde::de::value::I128Deserializer

pub struct I128Deserializer<E> { /* fields omitted */ }

A deserializer holding +an i128.

+

Trait Implementations

impl<E> Clone for I128Deserializer<E>[src]

impl<E> Copy for I128Deserializer<E>[src]

impl<E: Debug> Debug for I128Deserializer<E>[src]

impl<'de, E> Deserializer<'de> for I128Deserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for I128Deserializer<E> where
    E: RefUnwindSafe

impl<E> Send for I128Deserializer<E> where
    E: Send

impl<E> Sync for I128Deserializer<E> where
    E: Sync

impl<E> Unpin for I128Deserializer<E> where
    E: Unpin

impl<E> UnwindSafe for I128Deserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.I16Deserializer.html b/serde/de/value/struct.I16Deserializer.html new file mode 100644 index 0000000..b6c8ac7 --- /dev/null +++ b/serde/de/value/struct.I16Deserializer.html @@ -0,0 +1,52 @@ +serde::de::value::I16Deserializer - Rust

[][src]Struct serde::de::value::I16Deserializer

pub struct I16Deserializer<E> { /* fields omitted */ }

A deserializer holding +an i16.

+

Trait Implementations

impl<E> Clone for I16Deserializer<E>[src]

impl<E> Copy for I16Deserializer<E>[src]

impl<E: Debug> Debug for I16Deserializer<E>[src]

impl<'de, E> Deserializer<'de> for I16Deserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for I16Deserializer<E> where
    E: RefUnwindSafe

impl<E> Send for I16Deserializer<E> where
    E: Send

impl<E> Sync for I16Deserializer<E> where
    E: Sync

impl<E> Unpin for I16Deserializer<E> where
    E: Unpin

impl<E> UnwindSafe for I16Deserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.I32Deserializer.html b/serde/de/value/struct.I32Deserializer.html new file mode 100644 index 0000000..f88602e --- /dev/null +++ b/serde/de/value/struct.I32Deserializer.html @@ -0,0 +1,52 @@ +serde::de::value::I32Deserializer - Rust

[][src]Struct serde::de::value::I32Deserializer

pub struct I32Deserializer<E> { /* fields omitted */ }

A deserializer holding +an i32.

+

Trait Implementations

impl<E> Clone for I32Deserializer<E>[src]

impl<E> Copy for I32Deserializer<E>[src]

impl<E: Debug> Debug for I32Deserializer<E>[src]

impl<'de, E> Deserializer<'de> for I32Deserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for I32Deserializer<E> where
    E: RefUnwindSafe

impl<E> Send for I32Deserializer<E> where
    E: Send

impl<E> Sync for I32Deserializer<E> where
    E: Sync

impl<E> Unpin for I32Deserializer<E> where
    E: Unpin

impl<E> UnwindSafe for I32Deserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.I64Deserializer.html b/serde/de/value/struct.I64Deserializer.html new file mode 100644 index 0000000..d1bf703 --- /dev/null +++ b/serde/de/value/struct.I64Deserializer.html @@ -0,0 +1,52 @@ +serde::de::value::I64Deserializer - Rust

[][src]Struct serde::de::value::I64Deserializer

pub struct I64Deserializer<E> { /* fields omitted */ }

A deserializer holding +an i64.

+

Trait Implementations

impl<E> Clone for I64Deserializer<E>[src]

impl<E> Copy for I64Deserializer<E>[src]

impl<E: Debug> Debug for I64Deserializer<E>[src]

impl<'de, E> Deserializer<'de> for I64Deserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for I64Deserializer<E> where
    E: RefUnwindSafe

impl<E> Send for I64Deserializer<E> where
    E: Send

impl<E> Sync for I64Deserializer<E> where
    E: Sync

impl<E> Unpin for I64Deserializer<E> where
    E: Unpin

impl<E> UnwindSafe for I64Deserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.I8Deserializer.html b/serde/de/value/struct.I8Deserializer.html new file mode 100644 index 0000000..d7cf98a --- /dev/null +++ b/serde/de/value/struct.I8Deserializer.html @@ -0,0 +1,52 @@ +serde::de::value::I8Deserializer - Rust

[][src]Struct serde::de::value::I8Deserializer

pub struct I8Deserializer<E> { /* fields omitted */ }

A deserializer holding +an i8.

+

Trait Implementations

impl<E> Clone for I8Deserializer<E>[src]

impl<E> Copy for I8Deserializer<E>[src]

impl<E: Debug> Debug for I8Deserializer<E>[src]

impl<'de, E> Deserializer<'de> for I8Deserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for I8Deserializer<E> where
    E: RefUnwindSafe

impl<E> Send for I8Deserializer<E> where
    E: Send

impl<E> Sync for I8Deserializer<E> where
    E: Sync

impl<E> Unpin for I8Deserializer<E> where
    E: Unpin

impl<E> UnwindSafe for I8Deserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.IsizeDeserializer.html b/serde/de/value/struct.IsizeDeserializer.html new file mode 100644 index 0000000..c908be8 --- /dev/null +++ b/serde/de/value/struct.IsizeDeserializer.html @@ -0,0 +1,52 @@ +serde::de::value::IsizeDeserializer - Rust

[][src]Struct serde::de::value::IsizeDeserializer

pub struct IsizeDeserializer<E> { /* fields omitted */ }

A deserializer holding +an isize.

+

Trait Implementations

impl<E> Clone for IsizeDeserializer<E>[src]

impl<E> Copy for IsizeDeserializer<E>[src]

impl<E: Debug> Debug for IsizeDeserializer<E>[src]

impl<'de, E> Deserializer<'de> for IsizeDeserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for IsizeDeserializer<E> where
    E: RefUnwindSafe

impl<E> Send for IsizeDeserializer<E> where
    E: Send

impl<E> Sync for IsizeDeserializer<E> where
    E: Sync

impl<E> Unpin for IsizeDeserializer<E> where
    E: Unpin

impl<E> UnwindSafe for IsizeDeserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.MapAccessDeserializer.html b/serde/de/value/struct.MapAccessDeserializer.html new file mode 100644 index 0000000..0977808 --- /dev/null +++ b/serde/de/value/struct.MapAccessDeserializer.html @@ -0,0 +1,56 @@ +serde::de::value::MapAccessDeserializer - Rust

[][src]Struct serde::de::value::MapAccessDeserializer

pub struct MapAccessDeserializer<A> { /* fields omitted */ }

A deserializer holding a MapAccess.

+

Methods

impl<A> MapAccessDeserializer<A>[src]

pub fn new(map: A) -> Self[src]

Construct a new MapAccessDeserializer<A>.

+

Trait Implementations

impl<A: Clone> Clone for MapAccessDeserializer<A>[src]

impl<A: Debug> Debug for MapAccessDeserializer<A>[src]

impl<'de, A> Deserializer<'de> for MapAccessDeserializer<A> where
    A: MapAccess<'de>, 
[src]

type Error = A::Error

The error type that can be returned if some error occurs during deserialization. Read more

+

impl<'de, A> EnumAccess<'de> for MapAccessDeserializer<A> where
    A: MapAccess<'de>, 
[src]

type Error = A::Error

The error type that can be returned if some error occurs during deserialization. Read more

+

type Variant = MapAsEnum<A>

The Visitor that will be used to deserialize the content of the enum variant. Read more

+

Auto Trait Implementations

impl<A> RefUnwindSafe for MapAccessDeserializer<A> where
    A: RefUnwindSafe

impl<A> Send for MapAccessDeserializer<A> where
    A: Send

impl<A> Sync for MapAccessDeserializer<A> where
    A: Sync

impl<A> Unpin for MapAccessDeserializer<A> where
    A: Unpin

impl<A> UnwindSafe for MapAccessDeserializer<A> where
    A: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.MapDeserializer.html b/serde/de/value/struct.MapDeserializer.html new file mode 100644 index 0000000..16a08bc --- /dev/null +++ b/serde/de/value/struct.MapDeserializer.html @@ -0,0 +1,66 @@ +serde::de::value::MapDeserializer - Rust

[][src]Struct serde::de::value::MapDeserializer

pub struct MapDeserializer<'de, I, E> where
    I: Iterator,
    I::Item: Pair, 
{ /* fields omitted */ }

A deserializer that iterates over a map.

+

Methods

impl<'de, I, E> MapDeserializer<'de, I, E> where
    I: Iterator,
    I::Item: Pair, 
[src]

pub fn new(iter: I) -> Self[src]

Construct a new MapDeserializer<I, E>.

+

impl<'de, I, E> MapDeserializer<'de, I, E> where
    I: Iterator,
    I::Item: Pair,
    E: Error
[src]

pub fn end(self) -> Result<(), E>[src]

Check for remaining elements after passing a MapDeserializer to +Visitor::visit_map.

+

Trait Implementations

impl<'de, I, E> Clone for MapDeserializer<'de, I, E> where
    I: Iterator + Clone,
    I::Item: Pair,
    <I::Item as Pair>::Second: Clone
[src]

impl<'de, I, E> Debug for MapDeserializer<'de, I, E> where
    I: Iterator + Debug,
    I::Item: Pair,
    <I::Item as Pair>::Second: Debug
[src]

impl<'de, I, E> Deserializer<'de> for MapDeserializer<'de, I, E> where
    I: Iterator,
    I::Item: Pair,
    <I::Item as Pair>::First: IntoDeserializer<'de, E>,
    <I::Item as Pair>::Second: IntoDeserializer<'de, E>,
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

impl<'de, I, E> MapAccess<'de> for MapDeserializer<'de, I, E> where
    I: Iterator,
    I::Item: Pair,
    <I::Item as Pair>::First: IntoDeserializer<'de, E>,
    <I::Item as Pair>::Second: IntoDeserializer<'de, E>,
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

impl<'de, I, E> SeqAccess<'de> for MapDeserializer<'de, I, E> where
    I: Iterator,
    I::Item: Pair,
    <I::Item as Pair>::First: IntoDeserializer<'de, E>,
    <I::Item as Pair>::Second: IntoDeserializer<'de, E>,
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<'de, I, E> RefUnwindSafe for MapDeserializer<'de, I, E> where
    E: RefUnwindSafe,
    I: RefUnwindSafe,
    <<I as Iterator>::Item as Pair>::Second: RefUnwindSafe

impl<'de, I, E> Send for MapDeserializer<'de, I, E> where
    E: Send,
    I: Send,
    <<I as Iterator>::Item as Pair>::Second: Send

impl<'de, I, E> Sync for MapDeserializer<'de, I, E> where
    E: Sync,
    I: Sync,
    <<I as Iterator>::Item as Pair>::Second: Sync

impl<'de, I, E> Unpin for MapDeserializer<'de, I, E> where
    E: Unpin,
    I: Unpin,
    <<I as Iterator>::Item as Pair>::Second: Unpin

impl<'de, I, E> UnwindSafe for MapDeserializer<'de, I, E> where
    E: UnwindSafe,
    I: UnwindSafe,
    <<I as Iterator>::Item as Pair>::Second: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.SeqAccessDeserializer.html b/serde/de/value/struct.SeqAccessDeserializer.html new file mode 100644 index 0000000..70d7680 --- /dev/null +++ b/serde/de/value/struct.SeqAccessDeserializer.html @@ -0,0 +1,52 @@ +serde::de::value::SeqAccessDeserializer - Rust

[][src]Struct serde::de::value::SeqAccessDeserializer

pub struct SeqAccessDeserializer<A> { /* fields omitted */ }

A deserializer holding a SeqAccess.

+

Methods

impl<A> SeqAccessDeserializer<A>[src]

pub fn new(seq: A) -> Self[src]

Construct a new SeqAccessDeserializer<A>.

+

Trait Implementations

impl<A: Clone> Clone for SeqAccessDeserializer<A>[src]

impl<A: Debug> Debug for SeqAccessDeserializer<A>[src]

impl<'de, A> Deserializer<'de> for SeqAccessDeserializer<A> where
    A: SeqAccess<'de>, 
[src]

type Error = A::Error

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<A> RefUnwindSafe for SeqAccessDeserializer<A> where
    A: RefUnwindSafe

impl<A> Send for SeqAccessDeserializer<A> where
    A: Send

impl<A> Sync for SeqAccessDeserializer<A> where
    A: Sync

impl<A> Unpin for SeqAccessDeserializer<A> where
    A: Unpin

impl<A> UnwindSafe for SeqAccessDeserializer<A> where
    A: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.SeqDeserializer.html b/serde/de/value/struct.SeqDeserializer.html new file mode 100644 index 0000000..c6e5132 --- /dev/null +++ b/serde/de/value/struct.SeqDeserializer.html @@ -0,0 +1,58 @@ +serde::de::value::SeqDeserializer - Rust

[][src]Struct serde::de::value::SeqDeserializer

pub struct SeqDeserializer<I, E> { /* fields omitted */ }

A deserializer that iterates over a sequence.

+

Methods

impl<I, E> SeqDeserializer<I, E> where
    I: Iterator
[src]

pub fn new(iter: I) -> Self[src]

Construct a new SeqDeserializer<I, E>.

+

impl<I, E> SeqDeserializer<I, E> where
    I: Iterator,
    E: Error
[src]

pub fn end(self) -> Result<(), E>[src]

Check for remaining elements after passing a SeqDeserializer to +Visitor::visit_seq.

+

Trait Implementations

impl<I: Clone, E: Clone> Clone for SeqDeserializer<I, E>[src]

impl<I: Debug, E: Debug> Debug for SeqDeserializer<I, E>[src]

impl<'de, I, T, E> Deserializer<'de> for SeqDeserializer<I, E> where
    I: Iterator<Item = T>,
    T: IntoDeserializer<'de, E>,
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

impl<'de, I, T, E> SeqAccess<'de> for SeqDeserializer<I, E> where
    I: Iterator<Item = T>,
    T: IntoDeserializer<'de, E>,
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<I, E> RefUnwindSafe for SeqDeserializer<I, E> where
    E: RefUnwindSafe,
    I: RefUnwindSafe

impl<I, E> Send for SeqDeserializer<I, E> where
    E: Send,
    I: Send

impl<I, E> Sync for SeqDeserializer<I, E> where
    E: Sync,
    I: Sync

impl<I, E> Unpin for SeqDeserializer<I, E> where
    E: Unpin,
    I: Unpin

impl<I, E> UnwindSafe for SeqDeserializer<I, E> where
    E: UnwindSafe,
    I: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.StrDeserializer.html b/serde/de/value/struct.StrDeserializer.html new file mode 100644 index 0000000..5175b4d --- /dev/null +++ b/serde/de/value/struct.StrDeserializer.html @@ -0,0 +1,55 @@ +serde::de::value::StrDeserializer - Rust

[][src]Struct serde::de::value::StrDeserializer

pub struct StrDeserializer<'a, E> { /* fields omitted */ }

A deserializer holding a &str.

+

Trait Implementations

impl<'de, E> Clone for StrDeserializer<'de, E>[src]

impl<'de, E> Copy for StrDeserializer<'de, E>[src]

impl<'a, E: Debug> Debug for StrDeserializer<'a, E>[src]

impl<'de, 'a, E> Deserializer<'de> for StrDeserializer<'a, E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

impl<'de, 'a, E> EnumAccess<'de> for StrDeserializer<'a, E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

type Variant = UnitOnly<E>

The Visitor that will be used to deserialize the content of the enum variant. Read more

+

Auto Trait Implementations

impl<'a, E> RefUnwindSafe for StrDeserializer<'a, E> where
    E: RefUnwindSafe

impl<'a, E> Send for StrDeserializer<'a, E> where
    E: Send

impl<'a, E> Sync for StrDeserializer<'a, E> where
    E: Sync

impl<'a, E> Unpin for StrDeserializer<'a, E> where
    E: Unpin

impl<'a, E> UnwindSafe for StrDeserializer<'a, E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.StringDeserializer.html b/serde/de/value/struct.StringDeserializer.html new file mode 100644 index 0000000..4ad52a9 --- /dev/null +++ b/serde/de/value/struct.StringDeserializer.html @@ -0,0 +1,55 @@ +serde::de::value::StringDeserializer - Rust

[][src]Struct serde::de::value::StringDeserializer

pub struct StringDeserializer<E> { /* fields omitted */ }

A deserializer holding a String.

+

Trait Implementations

impl<E> Clone for StringDeserializer<E>[src]

impl<E: Debug> Debug for StringDeserializer<E>[src]

impl<'de, E> Deserializer<'de> for StringDeserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

impl<'de, 'a, E> EnumAccess<'de> for StringDeserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

type Variant = UnitOnly<E>

The Visitor that will be used to deserialize the content of the enum variant. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for StringDeserializer<E> where
    E: RefUnwindSafe

impl<E> Send for StringDeserializer<E> where
    E: Send

impl<E> Sync for StringDeserializer<E> where
    E: Sync

impl<E> Unpin for StringDeserializer<E> where
    E: Unpin

impl<E> UnwindSafe for StringDeserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.U128Deserializer.html b/serde/de/value/struct.U128Deserializer.html new file mode 100644 index 0000000..6482b8a --- /dev/null +++ b/serde/de/value/struct.U128Deserializer.html @@ -0,0 +1,52 @@ +serde::de::value::U128Deserializer - Rust

[][src]Struct serde::de::value::U128Deserializer

pub struct U128Deserializer<E> { /* fields omitted */ }

A deserializer holding +a u128.

+

Trait Implementations

impl<E> Clone for U128Deserializer<E>[src]

impl<E> Copy for U128Deserializer<E>[src]

impl<E: Debug> Debug for U128Deserializer<E>[src]

impl<'de, E> Deserializer<'de> for U128Deserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for U128Deserializer<E> where
    E: RefUnwindSafe

impl<E> Send for U128Deserializer<E> where
    E: Send

impl<E> Sync for U128Deserializer<E> where
    E: Sync

impl<E> Unpin for U128Deserializer<E> where
    E: Unpin

impl<E> UnwindSafe for U128Deserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.U16Deserializer.html b/serde/de/value/struct.U16Deserializer.html new file mode 100644 index 0000000..9e29468 --- /dev/null +++ b/serde/de/value/struct.U16Deserializer.html @@ -0,0 +1,52 @@ +serde::de::value::U16Deserializer - Rust

[][src]Struct serde::de::value::U16Deserializer

pub struct U16Deserializer<E> { /* fields omitted */ }

A deserializer holding +a u16.

+

Trait Implementations

impl<E> Clone for U16Deserializer<E>[src]

impl<E> Copy for U16Deserializer<E>[src]

impl<E: Debug> Debug for U16Deserializer<E>[src]

impl<'de, E> Deserializer<'de> for U16Deserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for U16Deserializer<E> where
    E: RefUnwindSafe

impl<E> Send for U16Deserializer<E> where
    E: Send

impl<E> Sync for U16Deserializer<E> where
    E: Sync

impl<E> Unpin for U16Deserializer<E> where
    E: Unpin

impl<E> UnwindSafe for U16Deserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.U32Deserializer.html b/serde/de/value/struct.U32Deserializer.html new file mode 100644 index 0000000..c66dda6 --- /dev/null +++ b/serde/de/value/struct.U32Deserializer.html @@ -0,0 +1,55 @@ +serde::de::value::U32Deserializer - Rust

[][src]Struct serde::de::value::U32Deserializer

pub struct U32Deserializer<E> { /* fields omitted */ }

A deserializer holding a u32.

+

Trait Implementations

impl<E> Clone for U32Deserializer<E>[src]

impl<E> Copy for U32Deserializer<E>[src]

impl<E: Debug> Debug for U32Deserializer<E>[src]

impl<'de, E> Deserializer<'de> for U32Deserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

impl<'de, E> EnumAccess<'de> for U32Deserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

type Variant = UnitOnly<E>

The Visitor that will be used to deserialize the content of the enum variant. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for U32Deserializer<E> where
    E: RefUnwindSafe

impl<E> Send for U32Deserializer<E> where
    E: Send

impl<E> Sync for U32Deserializer<E> where
    E: Sync

impl<E> Unpin for U32Deserializer<E> where
    E: Unpin

impl<E> UnwindSafe for U32Deserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.U64Deserializer.html b/serde/de/value/struct.U64Deserializer.html new file mode 100644 index 0000000..9eaccdc --- /dev/null +++ b/serde/de/value/struct.U64Deserializer.html @@ -0,0 +1,52 @@ +serde::de::value::U64Deserializer - Rust

[][src]Struct serde::de::value::U64Deserializer

pub struct U64Deserializer<E> { /* fields omitted */ }

A deserializer holding +a u64.

+

Trait Implementations

impl<E> Clone for U64Deserializer<E>[src]

impl<E> Copy for U64Deserializer<E>[src]

impl<E: Debug> Debug for U64Deserializer<E>[src]

impl<'de, E> Deserializer<'de> for U64Deserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for U64Deserializer<E> where
    E: RefUnwindSafe

impl<E> Send for U64Deserializer<E> where
    E: Send

impl<E> Sync for U64Deserializer<E> where
    E: Sync

impl<E> Unpin for U64Deserializer<E> where
    E: Unpin

impl<E> UnwindSafe for U64Deserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.U8Deserializer.html b/serde/de/value/struct.U8Deserializer.html new file mode 100644 index 0000000..a3e588c --- /dev/null +++ b/serde/de/value/struct.U8Deserializer.html @@ -0,0 +1,52 @@ +serde::de::value::U8Deserializer - Rust

[][src]Struct serde::de::value::U8Deserializer

pub struct U8Deserializer<E> { /* fields omitted */ }

A deserializer holding +a u8.

+

Trait Implementations

impl<E> Clone for U8Deserializer<E>[src]

impl<E> Copy for U8Deserializer<E>[src]

impl<E: Debug> Debug for U8Deserializer<E>[src]

impl<'de, E> Deserializer<'de> for U8Deserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for U8Deserializer<E> where
    E: RefUnwindSafe

impl<E> Send for U8Deserializer<E> where
    E: Send

impl<E> Sync for U8Deserializer<E> where
    E: Sync

impl<E> Unpin for U8Deserializer<E> where
    E: Unpin

impl<E> UnwindSafe for U8Deserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.UnitDeserializer.html b/serde/de/value/struct.UnitDeserializer.html new file mode 100644 index 0000000..0c351a7 --- /dev/null +++ b/serde/de/value/struct.UnitDeserializer.html @@ -0,0 +1,51 @@ +serde::de::value::UnitDeserializer - Rust

[][src]Struct serde::de::value::UnitDeserializer

pub struct UnitDeserializer<E> { /* fields omitted */ }

A deserializer holding a ().

+

Trait Implementations

impl<E> Clone for UnitDeserializer<E>[src]

impl<E> Copy for UnitDeserializer<E>[src]

impl<E: Debug> Debug for UnitDeserializer<E>[src]

impl<'de, E> Deserializer<'de> for UnitDeserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for UnitDeserializer<E> where
    E: RefUnwindSafe

impl<E> Send for UnitDeserializer<E> where
    E: Send

impl<E> Sync for UnitDeserializer<E> where
    E: Sync

impl<E> Unpin for UnitDeserializer<E> where
    E: Unpin

impl<E> UnwindSafe for UnitDeserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/de/value/struct.UsizeDeserializer.html b/serde/de/value/struct.UsizeDeserializer.html new file mode 100644 index 0000000..f9d81d7 --- /dev/null +++ b/serde/de/value/struct.UsizeDeserializer.html @@ -0,0 +1,52 @@ +serde::de::value::UsizeDeserializer - Rust

[][src]Struct serde::de::value::UsizeDeserializer

pub struct UsizeDeserializer<E> { /* fields omitted */ }

A deserializer holding +a usize.

+

Trait Implementations

impl<E> Clone for UsizeDeserializer<E>[src]

impl<E> Copy for UsizeDeserializer<E>[src]

impl<E: Debug> Debug for UsizeDeserializer<E>[src]

impl<'de, E> Deserializer<'de> for UsizeDeserializer<E> where
    E: Error
[src]

type Error = E

The error type that can be returned if some error occurs during deserialization. Read more

+

Auto Trait Implementations

impl<E> RefUnwindSafe for UsizeDeserializer<E> where
    E: RefUnwindSafe

impl<E> Send for UsizeDeserializer<E> where
    E: Send

impl<E> Sync for UsizeDeserializer<E> where
    E: Sync

impl<E> Unpin for UsizeDeserializer<E> where
    E: Unpin

impl<E> UnwindSafe for UsizeDeserializer<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/index.html b/serde/index.html new file mode 100644 index 0000000..ec242af --- /dev/null +++ b/serde/index.html @@ -0,0 +1,64 @@ +serde - Rust

[][src]Crate serde

Serde

+

Serde is a framework for serializing and deserializing Rust data +structures efficiently and generically.

+

The Serde ecosystem consists of data structures that know how to serialize +and deserialize themselves along with data formats that know how to +serialize and deserialize other things. Serde provides the layer by which +these two groups interact with each other, allowing any supported data +structure to be serialized and deserialized using any supported data format.

+

See the Serde website https://serde.rs/ for additional documentation and +usage examples.

+

Design

+

Where many other languages rely on runtime reflection for serializing data, +Serde is instead built on Rust's powerful trait system. A data structure +that knows how to serialize and deserialize itself is one that implements +Serde's Serialize and Deserialize traits (or uses Serde's derive +attribute to automatically generate implementations at compile time). This +avoids any overhead of reflection or runtime type information. In fact in +many situations the interaction between data structure and data format can +be completely optimized away by the Rust compiler, leaving Serde +serialization to perform the same speed as a handwritten serializer for the +specific selection of data structure and data format.

+

Data formats

+

The following is a partial list of data formats that have been implemented +for Serde by the community.

+
    +
  • JSON, the ubiquitous JavaScript Object Notation used by many HTTP APIs.
  • +
  • Bincode, a compact binary format +used for IPC within the Servo rendering engine.
  • +
  • CBOR, a Concise Binary Object Representation designed for small message +size without the need for version negotiation.
  • +
  • YAML, a popular human-friendly configuration language that ain't markup +language.
  • +
  • MessagePack, an efficient binary format that resembles a compact JSON.
  • +
  • TOML, a minimal configuration format used by Cargo.
  • +
  • Pickle, a format common in the Python world.
  • +
  • RON, a Rusty Object Notation.
  • +
  • BSON, the data storage and network transfer format used by MongoDB.
  • +
  • Avro, a binary format used within Apache Hadoop, with support for schema +definition.
  • +
  • JSON5, A superset of JSON including some productions from ES5.
  • +
  • Postcard, a no_std and embedded-systems friendly compact binary format.
  • +
  • URL, the x-www-form-urlencoded format.
  • +
  • Envy, a way to deserialize environment variables into Rust structs. +(deserialization only)
  • +
  • Envy Store, a way to deserialize AWS Parameter Store parameters into +Rust structs. (deserialization only)
  • +
+

Modules

+
de

Generic data structure deserialization framework.

+
ser

Generic data structure serialization framework.

+

Macros

+
forward_to_deserialize_any

Helper macro when implementing the Deserializer part of a new data format +for Serde.

+
serde_if_integer128

Conditional compilation depending on whether Serde is built with support for +128-bit integers.

+

Traits

+
Deserialize

A data structure that can be deserialized from any data format supported +by Serde.

+
Deserializer

A data format that can deserialize any data structure supported by +Serde.

+
Serialize

A data structure that can be serialized into any data format supported +by Serde.

+
Serializer

A data format that can serialize any data structure supported by Serde.

+
\ No newline at end of file diff --git a/serde/macro.forward_to_deserialize_any!.html b/serde/macro.forward_to_deserialize_any!.html new file mode 100644 index 0000000..a605588 --- /dev/null +++ b/serde/macro.forward_to_deserialize_any!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.forward_to_deserialize_any.html...

+ + + \ No newline at end of file diff --git a/serde/macro.forward_to_deserialize_any.html b/serde/macro.forward_to_deserialize_any.html new file mode 100644 index 0000000..6432e8c --- /dev/null +++ b/serde/macro.forward_to_deserialize_any.html @@ -0,0 +1,53 @@ +serde::forward_to_deserialize_any - Rust

[][src]Macro serde::forward_to_deserialize_any

+macro_rules! forward_to_deserialize_any {
+    (<$visitor:ident: Visitor<$lifetime:tt>> $($func:ident)*) => { ... };
+    ($($func:ident)*) => { ... };
+}
+

Helper macro when implementing the Deserializer part of a new data format +for Serde.

+

Some Deserializer implementations for self-describing formats do not +care what hint the Visitor gives them, they just want to blindly call +the Visitor method corresponding to the data they can tell is in the +input. This requires repetitive implementations of all the Deserializer +trait methods.

+ +
This code runs with edition 2018
+#[inline]
+fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+where
+    V: Visitor<'de>,
+{
+    self.deserialize_any(visitor)
+}
+

The forward_to_deserialize_any! macro implements these simple forwarding +methods so that they forward directly to Deserializer::deserialize_any. +You can choose which methods to forward.

+ +
This code runs with edition 2018
+impl<'de> Deserializer<'de> for MyDeserializer {
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>,
+    {
+        /* ... */
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct enum identifier ignored_any
+    }
+}
+

The macro assumes the convention that your Deserializer lifetime parameter +is called 'de and that the Visitor type parameters on each method are +called V. A different type parameter and a different lifetime can be +specified explicitly if necessary.

+ +
This code runs with edition 2018
+forward_to_deserialize_any! {
+    <W: Visitor<'q>>
+    bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+    bytes byte_buf option unit unit_struct newtype_struct seq tuple
+    tuple_struct map struct enum identifier ignored_any
+}
+
\ No newline at end of file diff --git a/serde/macro.serde_if_integer128!.html b/serde/macro.serde_if_integer128!.html new file mode 100644 index 0000000..1e2bad7 --- /dev/null +++ b/serde/macro.serde_if_integer128!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.serde_if_integer128.html...

+ + + \ No newline at end of file diff --git a/serde/macro.serde_if_integer128.html b/serde/macro.serde_if_integer128.html new file mode 100644 index 0000000..e0f1fb7 --- /dev/null +++ b/serde/macro.serde_if_integer128.html @@ -0,0 +1,53 @@ +serde::serde_if_integer128 - Rust

[][src]Macro serde::serde_if_integer128

+macro_rules! serde_if_integer128 {
+    ($($tt:tt)*) => { ... };
+}
+

Conditional compilation depending on whether Serde is built with support for +128-bit integers.

+

Data formats that wish to support Rust compiler versions older than 1.26 +(or targets that lack 128-bit integers) may place the i128 / u128 methods +of their Serializer and Deserializer behind this macro.

+

Data formats that require a minimum Rust compiler version of at least 1.26, +or do not target platforms that lack 128-bit integers, do not need to +bother with this macro and may assume support for 128-bit integers.

+ +
This code runs with edition 2018
+use serde::{serde_if_integer128, Serializer};
+
+impl Serializer for MySerializer {
+    type Ok = ();
+    type Error = Error;
+
+    fn serialize_i64(self, v: i64) -> Result<Self::Ok, Self::Error> {
+        /* ... */
+    }
+
+    /* ... */
+
+    serde_if_integer128! {
+        fn serialize_i128(self, v: i128) -> Result<Self::Ok, Self::Error> {
+            /* ... */
+        }
+
+        fn serialize_u128(self, v: u128) -> Result<Self::Ok, Self::Error> {
+            /* ... */
+        }
+    }
+}
+

When Serde is built with support for 128-bit integers, this macro expands +transparently into just the input tokens.

+ +
This code runs with edition 2018
+macro_rules! serde_if_integer128 {
+    ($($tt:tt)*) => {
+        $($tt)*
+    };
+}
+

When built without support for 128-bit integers, this macro expands to +nothing.

+ +
This code runs with edition 2018
+macro_rules! serde_if_integer128 {
+    ($($tt:tt)*) => {};
+}
+
\ No newline at end of file diff --git a/serde/ser/impossible/struct.Impossible.html b/serde/ser/impossible/struct.Impossible.html new file mode 100644 index 0000000..2c23fa9 --- /dev/null +++ b/serde/ser/impossible/struct.Impossible.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../serde/ser/struct.Impossible.html...

+ + + \ No newline at end of file diff --git a/serde/ser/index.html b/serde/ser/index.html new file mode 100644 index 0000000..e46de81 --- /dev/null +++ b/serde/ser/index.html @@ -0,0 +1,131 @@ +serde::ser - Rust

[][src]Module serde::ser

Generic data structure serialization framework.

+

The two most important traits in this module are Serialize and +Serializer.

+
    +
  • A type that implements Serialize is a data structure that can be +serialized to any data format supported by Serde, and conversely
  • +
  • A type that implements Serializer is a data format that can +serialize any data structure supported by Serde.
  • +
+

The Serialize trait

+

Serde provides Serialize implementations for many Rust primitive and +standard library types. The complete list is below. All of these can be +serialized using Serde out of the box.

+

Additionally, Serde provides a procedural macro called serde_derive to +automatically generate Serialize implementations for structs and enums +in your program. See the derive section of the manual for how to use this.

+

In rare cases it may be necessary to implement Serialize manually for +some type in your program. See the Implementing Serialize section of the +manual for more about this.

+

Third-party crates may provide Serialize implementations for types that +they expose. For example the linked-hash-map crate provides a +LinkedHashMap<K, V> type that is serializable by Serde because the crate +provides an implementation of Serialize for it.

+

The Serializer trait

+

Serializer implementations are provided by third-party crates, for +example serde_json, serde_yaml and bincode.

+

A partial list of well-maintained formats is given on the Serde +website.

+

Implementations of Serialize provided by Serde

+
    +
  • Primitive types: +
      +
    • bool
    • +
    • i8, i16, i32, i64, i128, isize
    • +
    • u8, u16, u32, u64, u128, usize
    • +
    • f32, f64
    • +
    • char
    • +
    • str
    • +
    • &T and &mut T
    • +
    +
  • +
  • Compound types: +
      +
    • [T]
    • +
    • [T; 0] through [T; 32]
    • +
    • tuples up to size 16
    • +
    +
  • +
  • Common standard library types: +
      +
    • String
    • +
    • Option<T>
    • +
    • Result<T, E>
    • +
    • PhantomData<T>
    • +
    +
  • +
  • Wrapper types: +
      +
    • Box<T>
    • +
    • Cow<'a, T>
    • +
    • Cell<T>
    • +
    • RefCell<T>
    • +
    • Mutex<T>
    • +
    • RwLock<T>
    • +
    • Rc<T> (if features = ["rc"] is enabled)
    • +
    • Arc<T> (if features = ["rc"] is enabled)
    • +
    +
  • +
  • Collection types: +
      +
    • BTreeMap<K, V>
    • +
    • BTreeSet<T>
    • +
    • BinaryHeap<T>
    • +
    • HashMap<K, V, H>
    • +
    • HashSet<T, H>
    • +
    • LinkedList<T>
    • +
    • VecDeque<T>
    • +
    • Vec<T>
    • +
    +
  • +
  • FFI types: +
      +
    • CStr
    • +
    • CString
    • +
    • OsStr
    • +
    • OsString
    • +
    +
  • +
  • Miscellaneous standard library types: +
      +
    • Duration
    • +
    • SystemTime
    • +
    • Path
    • +
    • PathBuf
    • +
    • Range<T>
    • +
    • RangeInclusive<T>
    • +
    • Bound<T>
    • +
    • num::NonZero*
    • +
    • ! (unstable)
    • +
    +
  • +
  • Net types: +
      +
    • IpAddr
    • +
    • Ipv4Addr
    • +
    • Ipv6Addr
    • +
    • SocketAddr
    • +
    • SocketAddrV4
    • +
    • SocketAddrV6
    • +
    +
  • +
+

Re-exports

+
pub use std::error::Error as StdError;

Structs

+
Impossible

Helper type for implementing a Serializer that does not support +serializing one of the compound types.

+

Traits

+
Error

Trait used by Serialize implementations to generically construct +errors belonging to the Serializer against which they are +currently running.

+
Serialize

A data structure that can be serialized into any data format supported +by Serde.

+
SerializeMap

Returned from Serializer::serialize_map.

+
SerializeSeq

Returned from Serializer::serialize_seq.

+
SerializeStruct

Returned from Serializer::serialize_struct.

+
SerializeStructVariant

Returned from Serializer::serialize_struct_variant.

+
SerializeTuple

Returned from Serializer::serialize_tuple.

+
SerializeTupleStruct

Returned from Serializer::serialize_tuple_struct.

+
SerializeTupleVariant

Returned from Serializer::serialize_tuple_variant.

+
Serializer

A data format that can serialize any data structure supported by Serde.

+
\ No newline at end of file diff --git a/serde/ser/sidebar-items.js b/serde/ser/sidebar-items.js new file mode 100644 index 0000000..37cc4e2 --- /dev/null +++ b/serde/ser/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["Impossible","Helper type for implementing a `Serializer` that does not support serializing one of the compound types."]],"trait":[["Error","Trait used by `Serialize` implementations to generically construct errors belonging to the `Serializer` against which they are currently running."],["Serialize","A data structure that can be serialized into any data format supported by Serde."],["SerializeMap","Returned from `Serializer::serialize_map`."],["SerializeSeq","Returned from `Serializer::serialize_seq`."],["SerializeStruct","Returned from `Serializer::serialize_struct`."],["SerializeStructVariant","Returned from `Serializer::serialize_struct_variant`."],["SerializeTuple","Returned from `Serializer::serialize_tuple`."],["SerializeTupleStruct","Returned from `Serializer::serialize_tuple_struct`."],["SerializeTupleVariant","Returned from `Serializer::serialize_tuple_variant`."],["Serializer","A data format that can serialize any data structure supported by Serde."]]}); \ No newline at end of file diff --git a/serde/ser/struct.Impossible.html b/serde/ser/struct.Impossible.html new file mode 100644 index 0000000..413326a --- /dev/null +++ b/serde/ser/struct.Impossible.html @@ -0,0 +1,68 @@ +serde::ser::Impossible - Rust

[][src]Struct serde::ser::Impossible

pub struct Impossible<Ok, Error> { /* fields omitted */ }

Helper type for implementing a Serializer that does not support +serializing one of the compound types.

+

This type cannot be instantiated, but implements every one of the traits +corresponding to the Serializer compound types: SerializeSeq, +SerializeTuple, SerializeTupleStruct, SerializeTupleVariant, +SerializeMap, SerializeStruct, and SerializeStructVariant.

+ +
This code runs with edition 2018
+impl Serializer for MySerializer {
+    type Ok = ();
+    type Error = Error;
+
+    type SerializeSeq = Impossible<(), Error>;
+    /* other associated types */
+
+    /// This data format does not support serializing sequences.
+    fn serialize_seq(self,
+                     len: Option<usize>)
+                     -> Result<Self::SerializeSeq, Error> {
+        // Given Impossible cannot be instantiated, the only
+        // thing we can do here is to return an error.
+        Err(...)
+    }
+
+    /* other Serializer methods */
+}
+

Trait Implementations

impl<Ok, Error> SerializeMap for Impossible<Ok, Error> where
    Error: Error
[src]

type Ok = Ok

Must match the Ok type of our Serializer.

+

type Error = Error

Must match the Error type of our Serializer.

+

impl<Ok, Error> SerializeSeq for Impossible<Ok, Error> where
    Error: Error
[src]

type Ok = Ok

Must match the Ok type of our Serializer.

+

type Error = Error

Must match the Error type of our Serializer.

+

impl<Ok, Error> SerializeStruct for Impossible<Ok, Error> where
    Error: Error
[src]

type Ok = Ok

Must match the Ok type of our Serializer.

+

type Error = Error

Must match the Error type of our Serializer.

+

impl<Ok, Error> SerializeStructVariant for Impossible<Ok, Error> where
    Error: Error
[src]

type Ok = Ok

Must match the Ok type of our Serializer.

+

type Error = Error

Must match the Error type of our Serializer.

+

impl<Ok, Error> SerializeTuple for Impossible<Ok, Error> where
    Error: Error
[src]

type Ok = Ok

Must match the Ok type of our Serializer.

+

type Error = Error

Must match the Error type of our Serializer.

+

impl<Ok, Error> SerializeTupleStruct for Impossible<Ok, Error> where
    Error: Error
[src]

type Ok = Ok

Must match the Ok type of our Serializer.

+

type Error = Error

Must match the Error type of our Serializer.

+

impl<Ok, Error> SerializeTupleVariant for Impossible<Ok, Error> where
    Error: Error
[src]

type Ok = Ok

Must match the Ok type of our Serializer.

+

type Error = Error

Must match the Error type of our Serializer.

+

Auto Trait Implementations

impl<Ok, Error> RefUnwindSafe for Impossible<Ok, Error> where
    Error: RefUnwindSafe,
    Ok: RefUnwindSafe

impl<Ok, Error> Send for Impossible<Ok, Error> where
    Error: Send,
    Ok: Send

impl<Ok, Error> Sync for Impossible<Ok, Error> where
    Error: Sync,
    Ok: Sync

impl<Ok, Error> Unpin for Impossible<Ok, Error> where
    Error: Unpin,
    Ok: Unpin

impl<Ok, Error> UnwindSafe for Impossible<Ok, Error> where
    Error: UnwindSafe,
    Ok: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/serde/ser/trait.Error.html b/serde/ser/trait.Error.html new file mode 100644 index 0000000..003d725 --- /dev/null +++ b/serde/ser/trait.Error.html @@ -0,0 +1,32 @@ +serde::ser::Error - Rust

[][src]Trait serde::ser::Error

pub trait Error: Sized + StdError {
+    fn custom<T>(msg: T) -> Self
    where
        T: Display
; +}

Trait used by Serialize implementations to generically construct +errors belonging to the Serializer against which they are +currently running.

+

Example implementation

+

The example data format presented on the website shows an error +type appropriate for a basic JSON data format.

+
+

Required methods

fn custom<T>(msg: T) -> Self where
    T: Display

Used when a Serialize implementation encounters any error +while serializing a type.

+

The message should not be capitalized and should not end with a +period.

+

For example, a filesystem Path may refuse to serialize +itself if it contains invalid UTF-8 data.

+ +
This code runs with edition 2018
+use serde::ser::{self, Serialize, Serializer};
+
+impl Serialize for Path {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match self.to_str() {
+            Some(s) => serializer.serialize_str(s),
+            None => Err(ser::Error::custom("path contains invalid UTF-8 characters")),
+        }
+    }
+}
+
Loading content... +

Implementors

impl Error for Error[src]

Loading content...
\ No newline at end of file diff --git a/serde/ser/trait.Serialize.html b/serde/ser/trait.Serialize.html new file mode 100644 index 0000000..5d1a9a0 --- /dev/null +++ b/serde/ser/trait.Serialize.html @@ -0,0 +1,47 @@ +serde::ser::Serialize - Rust

[][src]Trait serde::ser::Serialize

pub trait Serialize {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: Serializer
; +}

A data structure that can be serialized into any data format supported +by Serde.

+

Serde provides Serialize implementations for many Rust primitive and +standard library types. The complete list is here. All of these can +be serialized using Serde out of the box.

+

Additionally, Serde provides a procedural macro called serde_derive to +automatically generate Serialize implementations for structs and enums in +your program. See the derive section of the manual for how to use this.

+

In rare cases it may be necessary to implement Serialize manually for some +type in your program. See the Implementing Serialize section of the +manual for more about this.

+

Third-party crates may provide Serialize implementations for types that +they expose. For example the linked-hash-map crate provides a +LinkedHashMap<K, V> type that is serializable by Serde because the crate +provides an implementation of Serialize for it.

+
+

Required methods

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
    S: Serializer

Serialize this value into the given Serde serializer.

+

See the Implementing Serialize section of the manual for more +information about how to implement this method.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeStruct, Serializer};
+
+struct Person {
+    name: String,
+    age: u8,
+    phones: Vec<String>,
+}
+
+// This is what #[derive(Serialize)] would generate.
+impl Serialize for Person {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut s = serializer.serialize_struct("Person", 3)?;
+        s.serialize_field("name", &self.name)?;
+        s.serialize_field("age", &self.age)?;
+        s.serialize_field("phones", &self.phones)?;
+        s.end()
+    }
+}
+
Loading content... +

Implementations on Foreign Types

impl Serialize for bool[src]

impl Serialize for isize[src]

impl Serialize for i8[src]

impl Serialize for i16[src]

impl Serialize for i32[src]

impl Serialize for i64[src]

impl Serialize for usize[src]

impl Serialize for u8[src]

impl Serialize for u16[src]

impl Serialize for u32[src]

impl Serialize for u64[src]

impl Serialize for f32[src]

impl Serialize for f64[src]

impl Serialize for char[src]

impl Serialize for i128[src]

impl Serialize for u128[src]

impl Serialize for str[src]

impl Serialize for String[src]

impl<'a> Serialize for Arguments<'a>[src]

impl Serialize for CStr[src]

impl Serialize for CString[src]

impl<T> Serialize for Option<T> where
    T: Serialize
[src]

impl<T: ?Sized> Serialize for PhantomData<T>[src]

impl<T> Serialize for [T; 0][src]

impl<T> Serialize for [T; 1] where
    T: Serialize
[src]

impl<T> Serialize for [T; 2] where
    T: Serialize
[src]

impl<T> Serialize for [T; 3] where
    T: Serialize
[src]

impl<T> Serialize for [T; 4] where
    T: Serialize
[src]

impl<T> Serialize for [T; 5] where
    T: Serialize
[src]

impl<T> Serialize for [T; 6] where
    T: Serialize
[src]

impl<T> Serialize for [T; 7] where
    T: Serialize
[src]

impl<T> Serialize for [T; 8] where
    T: Serialize
[src]

impl<T> Serialize for [T; 9] where
    T: Serialize
[src]

impl<T> Serialize for [T; 10] where
    T: Serialize
[src]

impl<T> Serialize for [T; 11] where
    T: Serialize
[src]

impl<T> Serialize for [T; 12] where
    T: Serialize
[src]

impl<T> Serialize for [T; 13] where
    T: Serialize
[src]

impl<T> Serialize for [T; 14] where
    T: Serialize
[src]

impl<T> Serialize for [T; 15] where
    T: Serialize
[src]

impl<T> Serialize for [T; 16] where
    T: Serialize
[src]

impl<T> Serialize for [T; 17] where
    T: Serialize
[src]

impl<T> Serialize for [T; 18] where
    T: Serialize
[src]

impl<T> Serialize for [T; 19] where
    T: Serialize
[src]

impl<T> Serialize for [T; 20] where
    T: Serialize
[src]

impl<T> Serialize for [T; 21] where
    T: Serialize
[src]

impl<T> Serialize for [T; 22] where
    T: Serialize
[src]

impl<T> Serialize for [T; 23] where
    T: Serialize
[src]

impl<T> Serialize for [T; 24] where
    T: Serialize
[src]

impl<T> Serialize for [T; 25] where
    T: Serialize
[src]

impl<T> Serialize for [T; 26] where
    T: Serialize
[src]

impl<T> Serialize for [T; 27] where
    T: Serialize
[src]

impl<T> Serialize for [T; 28] where
    T: Serialize
[src]

impl<T> Serialize for [T; 29] where
    T: Serialize
[src]

impl<T> Serialize for [T; 30] where
    T: Serialize
[src]

impl<T> Serialize for [T; 31] where
    T: Serialize
[src]

impl<T> Serialize for [T; 32] where
    T: Serialize
[src]

impl<T> Serialize for [T] where
    T: Serialize
[src]

impl<T> Serialize for BinaryHeap<T> where
    T: Serialize + Ord
[src]

impl<T> Serialize for BTreeSet<T> where
    T: Serialize + Ord
[src]

impl<T, H> Serialize for HashSet<T, H> where
    T: Serialize + Eq + Hash,
    H: BuildHasher
[src]

impl<T> Serialize for LinkedList<T> where
    T: Serialize
[src]

impl<T> Serialize for Vec<T> where
    T: Serialize
[src]

impl<T> Serialize for VecDeque<T> where
    T: Serialize
[src]

impl<Idx> Serialize for Range<Idx> where
    Idx: Serialize
[src]

impl<Idx> Serialize for RangeInclusive<Idx> where
    Idx: Serialize
[src]

impl<T> Serialize for Bound<T> where
    T: Serialize
[src]

impl Serialize for ()[src]

impl<T0> Serialize for (T0,) where
    T0: Serialize
[src]

impl<T0, T1> Serialize for (T0, T1) where
    T0: Serialize,
    T1: Serialize
[src]

impl<T0, T1, T2> Serialize for (T0, T1, T2) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize
[src]

impl<T0, T1, T2, T3> Serialize for (T0, T1, T2, T3) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize
[src]

impl<T0, T1, T2, T3, T4> Serialize for (T0, T1, T2, T3, T4) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5> Serialize for (T0, T1, T2, T3, T4, T5) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6> Serialize for (T0, T1, T2, T3, T4, T5, T6) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize,
    T9: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize,
    T9: Serialize,
    T10: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize,
    T9: Serialize,
    T10: Serialize,
    T11: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize,
    T9: Serialize,
    T10: Serialize,
    T11: Serialize,
    T12: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize,
    T9: Serialize,
    T10: Serialize,
    T11: Serialize,
    T12: Serialize,
    T13: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize,
    T9: Serialize,
    T10: Serialize,
    T11: Serialize,
    T12: Serialize,
    T13: Serialize,
    T14: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize,
    T9: Serialize,
    T10: Serialize,
    T11: Serialize,
    T12: Serialize,
    T13: Serialize,
    T14: Serialize,
    T15: Serialize
[src]

impl<K, V> Serialize for BTreeMap<K, V> where
    K: Serialize + Ord,
    V: Serialize
[src]

impl<K, V, H> Serialize for HashMap<K, V, H> where
    K: Serialize + Eq + Hash,
    V: Serialize,
    H: BuildHasher
[src]

impl<'a, T: ?Sized> Serialize for &'a T where
    T: Serialize
[src]

impl<'a, T: ?Sized> Serialize for &'a mut T where
    T: Serialize
[src]

impl<T: ?Sized> Serialize for Box<T> where
    T: Serialize
[src]

impl<'a, T: ?Sized> Serialize for Cow<'a, T> where
    T: Serialize + ToOwned
[src]

impl Serialize for NonZeroU8[src]

impl Serialize for NonZeroU16[src]

impl Serialize for NonZeroU32[src]

impl Serialize for NonZeroU64[src]

impl Serialize for NonZeroUsize[src]

impl Serialize for NonZeroI8[src]

impl Serialize for NonZeroI16[src]

impl Serialize for NonZeroI32[src]

impl Serialize for NonZeroI64[src]

impl Serialize for NonZeroIsize[src]

impl Serialize for NonZeroU128[src]

impl Serialize for NonZeroI128[src]

impl<T> Serialize for Cell<T> where
    T: Serialize + Copy
[src]

impl<T> Serialize for RefCell<T> where
    T: Serialize
[src]

impl<T> Serialize for Mutex<T> where
    T: Serialize
[src]

impl<T> Serialize for RwLock<T> where
    T: Serialize
[src]

impl<T, E> Serialize for Result<T, E> where
    T: Serialize,
    E: Serialize
[src]

impl Serialize for Duration[src]

impl Serialize for SystemTime[src]

impl Serialize for IpAddr[src]

impl Serialize for Ipv4Addr[src]

impl Serialize for Ipv6Addr[src]

impl Serialize for SocketAddr[src]

impl Serialize for SocketAddrV4[src]

impl Serialize for SocketAddrV6[src]

impl Serialize for Path[src]

impl Serialize for PathBuf[src]

impl Serialize for OsStr[src]

impl Serialize for OsString[src]

impl<T> Serialize for Wrapping<T> where
    T: Serialize
[src]

impl<T> Serialize for Reverse<T> where
    T: Serialize
[src]

impl Serialize for AtomicBool[src]

impl Serialize for AtomicI8[src]

impl Serialize for AtomicI16[src]

impl Serialize for AtomicI32[src]

impl Serialize for AtomicIsize[src]

impl Serialize for AtomicU8[src]

impl Serialize for AtomicU16[src]

impl Serialize for AtomicU32[src]

impl Serialize for AtomicUsize[src]

impl Serialize for AtomicI64[src]

impl Serialize for AtomicU64[src]

Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/serde/ser/trait.SerializeMap.html b/serde/ser/trait.SerializeMap.html new file mode 100644 index 0000000..df919b6 --- /dev/null +++ b/serde/ser/trait.SerializeMap.html @@ -0,0 +1,61 @@ +serde::ser::SerializeMap - Rust

[][src]Trait serde::ser::SerializeMap

pub trait SerializeMap {
+    type Ok;
+    type Error: Error;
+    fn serialize_key<T: ?Sized>(&mut self, key: &T) -> Result<(), Self::Error>
    where
        T: Serialize
; +
fn serialize_value<T: ?Sized>(
        &mut self,
        value: &T
    ) -> Result<(), Self::Error>
    where
        T: Serialize
; +
fn end(self) -> Result<Self::Ok, Self::Error>; + + fn serialize_entry<K: ?Sized, V: ?Sized>(
        &mut self,
        key: &K,
        value: &V
    ) -> Result<(), Self::Error>
    where
        K: Serialize,
        V: Serialize
, + { ... } +}

Returned from Serializer::serialize_map.

+

Example use

+
This code runs with edition 2018
+use serde::ser::{Serialize, Serializer, SerializeMap};
+
+impl<K, V> Serialize for HashMap<K, V>
+where
+    K: Serialize,
+    V: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut map = serializer.serialize_map(Some(self.len()))?;
+        for (k, v) in self {
+            map.serialize_entry(k, v)?;
+        }
+        map.end()
+    }
+}
+

Example implementation

+

The example data format presented on the website demonstrates an +implementation of SerializeMap for a basic JSON data format.

+
+

Associated Types

type Ok

Must match the Ok type of our Serializer.

+

type Error: Error

Must match the Error type of our Serializer.

+
Loading content... +

Required methods

fn serialize_key<T: ?Sized>(&mut self, key: &T) -> Result<(), Self::Error> where
    T: Serialize

Serialize a map key.

+

If possible, Serialize implementations are encouraged to use +serialize_entry instead as it may be implemented more efficiently in +some formats compared to a pair of calls to serialize_key and +serialize_value.

+

fn serialize_value<T: ?Sized>(&mut self, value: &T) -> Result<(), Self::Error> where
    T: Serialize

Serialize a map value.

+

Panics

+

Calling serialize_value before serialize_key is incorrect and is +allowed to panic or produce bogus results.

+

fn end(self) -> Result<Self::Ok, Self::Error>

Finish serializing a map.

+
Loading content... +

Provided methods

fn serialize_entry<K: ?Sized, V: ?Sized>(
    &mut self,
    key: &K,
    value: &V
) -> Result<(), Self::Error> where
    K: Serialize,
    V: Serialize

Serialize a map entry consisting of a key and a value.

+

Some Serialize types are not able to hold a key and value in memory +at the same time so SerializeMap implementations are required to +support serialize_key and serialize_value individually. The +serialize_entry method allows serializers to optimize for the case +where key and value are both available. Serialize implementations +are encouraged to use serialize_entry if possible.

+

The default implementation delegates to serialize_key and +serialize_value. This is appropriate for serializers that do not +care about performance or are not able to optimize serialize_entry any +better than this.

+
Loading content... +

Implementors

impl<Ok, Error> SerializeMap for Impossible<Ok, Error> where
    Error: Error
[src]

type Ok = Ok

type Error = Error

Loading content...
\ No newline at end of file diff --git a/serde/ser/trait.SerializeSeq.html b/serde/ser/trait.SerializeSeq.html new file mode 100644 index 0000000..637ec94 --- /dev/null +++ b/serde/ser/trait.SerializeSeq.html @@ -0,0 +1,36 @@ +serde::ser::SerializeSeq - Rust

[][src]Trait serde::ser::SerializeSeq

pub trait SerializeSeq {
+    type Ok;
+    type Error: Error;
+    fn serialize_element<T: ?Sized>(
        &mut self,
        value: &T
    ) -> Result<(), Self::Error>
    where
        T: Serialize
; +
fn end(self) -> Result<Self::Ok, Self::Error>; +}

Returned from Serializer::serialize_seq.

+

Example use

+
This code runs with edition 2018
+use serde::ser::{Serialize, Serializer, SerializeSeq};
+
+impl<T> Serialize for Vec<T>
+where
+    T: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut seq = serializer.serialize_seq(Some(self.len()))?;
+        for element in self {
+            seq.serialize_element(element)?;
+        }
+        seq.end()
+    }
+}
+

Example implementation

+

The example data format presented on the website demonstrates an +implementation of SerializeSeq for a basic JSON data format.

+
+

Associated Types

type Ok

Must match the Ok type of our Serializer.

+

type Error: Error

Must match the Error type of our Serializer.

+
Loading content... +

Required methods

fn serialize_element<T: ?Sized>(&mut self, value: &T) -> Result<(), Self::Error> where
    T: Serialize

Serialize a sequence element.

+

fn end(self) -> Result<Self::Ok, Self::Error>

Finish serializing a sequence.

+
Loading content... +

Implementors

impl<Ok, Error> SerializeSeq for Impossible<Ok, Error> where
    Error: Error
[src]

type Ok = Ok

type Error = Error

Loading content...
\ No newline at end of file diff --git a/serde/ser/trait.SerializeStruct.html b/serde/ser/trait.SerializeStruct.html new file mode 100644 index 0000000..ffba20f --- /dev/null +++ b/serde/ser/trait.SerializeStruct.html @@ -0,0 +1,43 @@ +serde::ser::SerializeStruct - Rust

[][src]Trait serde::ser::SerializeStruct

pub trait SerializeStruct {
+    type Ok;
+    type Error: Error;
+    fn serialize_field<T: ?Sized>(
        &mut self,
        key: &'static str,
        value: &T
    ) -> Result<(), Self::Error>
    where
        T: Serialize
; +
fn end(self) -> Result<Self::Ok, Self::Error>; + + fn skip_field(&mut self, key: &'static str) -> Result<(), Self::Error> { ... } +}

Returned from Serializer::serialize_struct.

+

Example use

+
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeStruct, Serializer};
+
+struct Rgb {
+    r: u8,
+    g: u8,
+    b: u8,
+}
+
+impl Serialize for Rgb {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut rgb = serializer.serialize_struct("Rgb", 3)?;
+        rgb.serialize_field("r", &self.r)?;
+        rgb.serialize_field("g", &self.g)?;
+        rgb.serialize_field("b", &self.b)?;
+        rgb.end()
+    }
+}
+

Example implementation

+

The example data format presented on the website demonstrates an +implementation of SerializeStruct for a basic JSON data format.

+
+

Associated Types

type Ok

Must match the Ok type of our Serializer.

+

type Error: Error

Must match the Error type of our Serializer.

+
Loading content... +

Required methods

fn serialize_field<T: ?Sized>(
    &mut self,
    key: &'static str,
    value: &T
) -> Result<(), Self::Error> where
    T: Serialize

Serialize a struct field.

+

fn end(self) -> Result<Self::Ok, Self::Error>

Finish serializing a struct.

+
Loading content... +

Provided methods

fn skip_field(&mut self, key: &'static str) -> Result<(), Self::Error>

Indicate that a struct field has been skipped.

+
Loading content... +

Implementors

impl<Ok, Error> SerializeStruct for Impossible<Ok, Error> where
    Error: Error
[src]

type Ok = Ok

type Error = Error

Loading content...
\ No newline at end of file diff --git a/serde/ser/trait.SerializeStructVariant.html b/serde/ser/trait.SerializeStructVariant.html new file mode 100644 index 0000000..6bf68d8 --- /dev/null +++ b/serde/ser/trait.SerializeStructVariant.html @@ -0,0 +1,49 @@ +serde::ser::SerializeStructVariant - Rust

[][src]Trait serde::ser::SerializeStructVariant

pub trait SerializeStructVariant {
+    type Ok;
+    type Error: Error;
+    fn serialize_field<T: ?Sized>(
        &mut self,
        key: &'static str,
        value: &T
    ) -> Result<(), Self::Error>
    where
        T: Serialize
; +
fn end(self) -> Result<Self::Ok, Self::Error>; + + fn skip_field(&mut self, key: &'static str) -> Result<(), Self::Error> { ... } +}

Returned from Serializer::serialize_struct_variant.

+

Example use

+
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeStructVariant, Serializer};
+
+enum E {
+    S { r: u8, g: u8, b: u8 },
+}
+
+impl Serialize for E {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            E::S {
+                ref r,
+                ref g,
+                ref b,
+            } => {
+                let mut sv = serializer.serialize_struct_variant("E", 0, "S", 3)?;
+                sv.serialize_field("r", r)?;
+                sv.serialize_field("g", g)?;
+                sv.serialize_field("b", b)?;
+                sv.end()
+            }
+        }
+    }
+}
+

Example implementation

+

The example data format presented on the website demonstrates an +implementation of SerializeStructVariant for a basic JSON data format.

+
+

Associated Types

type Ok

Must match the Ok type of our Serializer.

+

type Error: Error

Must match the Error type of our Serializer.

+
Loading content... +

Required methods

fn serialize_field<T: ?Sized>(
    &mut self,
    key: &'static str,
    value: &T
) -> Result<(), Self::Error> where
    T: Serialize

Serialize a struct variant field.

+

fn end(self) -> Result<Self::Ok, Self::Error>

Finish serializing a struct variant.

+
Loading content... +

Provided methods

fn skip_field(&mut self, key: &'static str) -> Result<(), Self::Error>

Indicate that a struct variant field has been skipped.

+
Loading content... +

Implementors

impl<Ok, Error> SerializeStructVariant for Impossible<Ok, Error> where
    Error: Error
[src]

type Ok = Ok

type Error = Error

Loading content...
\ No newline at end of file diff --git a/serde/ser/trait.SerializeTuple.html b/serde/ser/trait.SerializeTuple.html new file mode 100644 index 0000000..53ebf36 --- /dev/null +++ b/serde/ser/trait.SerializeTuple.html @@ -0,0 +1,57 @@ +serde::ser::SerializeTuple - Rust

[][src]Trait serde::ser::SerializeTuple

pub trait SerializeTuple {
+    type Ok;
+    type Error: Error;
+    fn serialize_element<T: ?Sized>(
        &mut self,
        value: &T
    ) -> Result<(), Self::Error>
    where
        T: Serialize
; +
fn end(self) -> Result<Self::Ok, Self::Error>; +}

Returned from Serializer::serialize_tuple.

+

Example use

+
This code runs with edition 2018
+use serde::ser::{Serialize, Serializer, SerializeTuple};
+
+impl<A, B, C> Serialize for (A, B, C)
+where
+    A: Serialize,
+    B: Serialize,
+    C: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut tup = serializer.serialize_tuple(3)?;
+        tup.serialize_element(&self.0)?;
+        tup.serialize_element(&self.1)?;
+        tup.serialize_element(&self.2)?;
+        tup.end()
+    }
+}
+ +
This code runs with edition 2018
+use serde::ser::{Serialize, Serializer, SerializeTuple};
+
+impl<T> Serialize for [T; 16]
+where
+    T: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut seq = serializer.serialize_tuple(16)?;
+        for element in self {
+            seq.serialize_element(element)?;
+        }
+        seq.end()
+    }
+}
+

Example implementation

+

The example data format presented on the website demonstrates an +implementation of SerializeTuple for a basic JSON data format.

+
+

Associated Types

type Ok

Must match the Ok type of our Serializer.

+

type Error: Error

Must match the Error type of our Serializer.

+
Loading content... +

Required methods

fn serialize_element<T: ?Sized>(&mut self, value: &T) -> Result<(), Self::Error> where
    T: Serialize

Serialize a tuple element.

+

fn end(self) -> Result<Self::Ok, Self::Error>

Finish serializing a tuple.

+
Loading content... +

Implementors

impl<Ok, Error> SerializeTuple for Impossible<Ok, Error> where
    Error: Error
[src]

type Ok = Ok

type Error = Error

Loading content...
\ No newline at end of file diff --git a/serde/ser/trait.SerializeTupleStruct.html b/serde/ser/trait.SerializeTupleStruct.html new file mode 100644 index 0000000..bda28af --- /dev/null +++ b/serde/ser/trait.SerializeTupleStruct.html @@ -0,0 +1,35 @@ +serde::ser::SerializeTupleStruct - Rust

[][src]Trait serde::ser::SerializeTupleStruct

pub trait SerializeTupleStruct {
+    type Ok;
+    type Error: Error;
+    fn serialize_field<T: ?Sized>(
        &mut self,
        value: &T
    ) -> Result<(), Self::Error>
    where
        T: Serialize
; +
fn end(self) -> Result<Self::Ok, Self::Error>; +}

Returned from Serializer::serialize_tuple_struct.

+

Example use

+
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeTupleStruct, Serializer};
+
+struct Rgb(u8, u8, u8);
+
+impl Serialize for Rgb {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?;
+        ts.serialize_field(&self.0)?;
+        ts.serialize_field(&self.1)?;
+        ts.serialize_field(&self.2)?;
+        ts.end()
+    }
+}
+

Example implementation

+

The example data format presented on the website demonstrates an +implementation of SerializeTupleStruct for a basic JSON data format.

+
+

Associated Types

type Ok

Must match the Ok type of our Serializer.

+

type Error: Error

Must match the Error type of our Serializer.

+
Loading content... +

Required methods

fn serialize_field<T: ?Sized>(&mut self, value: &T) -> Result<(), Self::Error> where
    T: Serialize

Serialize a tuple struct field.

+

fn end(self) -> Result<Self::Ok, Self::Error>

Finish serializing a tuple struct.

+
Loading content... +

Implementors

impl<Ok, Error> SerializeTupleStruct for Impossible<Ok, Error> where
    Error: Error
[src]

type Ok = Ok

type Error = Error

Loading content...
\ No newline at end of file diff --git a/serde/ser/trait.SerializeTupleVariant.html b/serde/ser/trait.SerializeTupleVariant.html new file mode 100644 index 0000000..016b434 --- /dev/null +++ b/serde/ser/trait.SerializeTupleVariant.html @@ -0,0 +1,48 @@ +serde::ser::SerializeTupleVariant - Rust

[][src]Trait serde::ser::SerializeTupleVariant

pub trait SerializeTupleVariant {
+    type Ok;
+    type Error: Error;
+    fn serialize_field<T: ?Sized>(
        &mut self,
        value: &T
    ) -> Result<(), Self::Error>
    where
        T: Serialize
; +
fn end(self) -> Result<Self::Ok, Self::Error>; +}

Returned from Serializer::serialize_tuple_variant.

+

Example use

+
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeTupleVariant, Serializer};
+
+enum E {
+    T(u8, u8),
+    U(String, u32, u32),
+}
+
+impl Serialize for E {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            E::T(ref a, ref b) => {
+                let mut tv = serializer.serialize_tuple_variant("E", 0, "T", 2)?;
+                tv.serialize_field(a)?;
+                tv.serialize_field(b)?;
+                tv.end()
+            }
+            E::U(ref a, ref b, ref c) => {
+                let mut tv = serializer.serialize_tuple_variant("E", 1, "U", 3)?;
+                tv.serialize_field(a)?;
+                tv.serialize_field(b)?;
+                tv.serialize_field(c)?;
+                tv.end()
+            }
+        }
+    }
+}
+

Example implementation

+

The example data format presented on the website demonstrates an +implementation of SerializeTupleVariant for a basic JSON data format.

+
+

Associated Types

type Ok

Must match the Ok type of our Serializer.

+

type Error: Error

Must match the Error type of our Serializer.

+
Loading content... +

Required methods

fn serialize_field<T: ?Sized>(&mut self, value: &T) -> Result<(), Self::Error> where
    T: Serialize

Serialize a tuple variant field.

+

fn end(self) -> Result<Self::Ok, Self::Error>

Finish serializing a tuple variant.

+
Loading content... +

Implementors

impl<Ok, Error> SerializeTupleVariant for Impossible<Ok, Error> where
    Error: Error
[src]

type Ok = Ok

type Error = Error

Loading content...
\ No newline at end of file diff --git a/serde/ser/trait.Serializer.html b/serde/ser/trait.Serializer.html new file mode 100644 index 0000000..f168395 --- /dev/null +++ b/serde/ser/trait.Serializer.html @@ -0,0 +1,828 @@ +serde::ser::Serializer - Rust

[][src]Trait serde::ser::Serializer

pub trait Serializer: Sized {
+    type Ok;
+    type Error: Error;
+    type SerializeSeq: SerializeSeq<Ok = Self::Ok, Error = Self::Error>;
+    type SerializeTuple: SerializeTuple<Ok = Self::Ok, Error = Self::Error>;
+    type SerializeTupleStruct: SerializeTupleStruct<Ok = Self::Ok, Error = Self::Error>;
+    type SerializeTupleVariant: SerializeTupleVariant<Ok = Self::Ok, Error = Self::Error>;
+    type SerializeMap: SerializeMap<Ok = Self::Ok, Error = Self::Error>;
+    type SerializeStruct: SerializeStruct<Ok = Self::Ok, Error = Self::Error>;
+    type SerializeStructVariant: SerializeStructVariant<Ok = Self::Ok, Error = Self::Error>;
+    fn serialize_bool(self, v: bool) -> Result<Self::Ok, Self::Error>;
+
fn serialize_i8(self, v: i8) -> Result<Self::Ok, Self::Error>; +
fn serialize_i16(self, v: i16) -> Result<Self::Ok, Self::Error>; +
fn serialize_i32(self, v: i32) -> Result<Self::Ok, Self::Error>; +
fn serialize_i64(self, v: i64) -> Result<Self::Ok, Self::Error>; +
fn serialize_u8(self, v: u8) -> Result<Self::Ok, Self::Error>; +
fn serialize_u16(self, v: u16) -> Result<Self::Ok, Self::Error>; +
fn serialize_u32(self, v: u32) -> Result<Self::Ok, Self::Error>; +
fn serialize_u64(self, v: u64) -> Result<Self::Ok, Self::Error>; +
fn serialize_f32(self, v: f32) -> Result<Self::Ok, Self::Error>; +
fn serialize_f64(self, v: f64) -> Result<Self::Ok, Self::Error>; +
fn serialize_char(self, v: char) -> Result<Self::Ok, Self::Error>; +
fn serialize_str(self, v: &str) -> Result<Self::Ok, Self::Error>; +
fn serialize_bytes(self, v: &[u8]) -> Result<Self::Ok, Self::Error>; +
fn serialize_none(self) -> Result<Self::Ok, Self::Error>; +
fn serialize_some<T: ?Sized>(
        self,
        value: &T
    ) -> Result<Self::Ok, Self::Error>
    where
        T: Serialize
; +
fn serialize_unit(self) -> Result<Self::Ok, Self::Error>; +
fn serialize_unit_struct(
        self,
        name: &'static str
    ) -> Result<Self::Ok, Self::Error>; +
fn serialize_unit_variant(
        self,
        name: &'static str,
        variant_index: u32,
        variant: &'static str
    ) -> Result<Self::Ok, Self::Error>; +
fn serialize_newtype_struct<T: ?Sized>(
        self,
        name: &'static str,
        value: &T
    ) -> Result<Self::Ok, Self::Error>
    where
        T: Serialize
; +
fn serialize_newtype_variant<T: ?Sized>(
        self,
        name: &'static str,
        variant_index: u32,
        variant: &'static str,
        value: &T
    ) -> Result<Self::Ok, Self::Error>
    where
        T: Serialize
; +
fn serialize_seq(
        self,
        len: Option<usize>
    ) -> Result<Self::SerializeSeq, Self::Error>; +
fn serialize_tuple(
        self,
        len: usize
    ) -> Result<Self::SerializeTuple, Self::Error>; +
fn serialize_tuple_struct(
        self,
        name: &'static str,
        len: usize
    ) -> Result<Self::SerializeTupleStruct, Self::Error>; +
fn serialize_tuple_variant(
        self,
        name: &'static str,
        variant_index: u32,
        variant: &'static str,
        len: usize
    ) -> Result<Self::SerializeTupleVariant, Self::Error>; +
fn serialize_map(
        self,
        len: Option<usize>
    ) -> Result<Self::SerializeMap, Self::Error>; +
fn serialize_struct(
        self,
        name: &'static str,
        len: usize
    ) -> Result<Self::SerializeStruct, Self::Error>; +
fn serialize_struct_variant(
        self,
        name: &'static str,
        variant_index: u32,
        variant: &'static str,
        len: usize
    ) -> Result<Self::SerializeStructVariant, Self::Error>; + + fn serialize_i128(self, v: i128) -> Result<Self::Ok, Self::Error> { ... } +
fn serialize_u128(self, v: u128) -> Result<Self::Ok, Self::Error> { ... } +
fn collect_seq<I>(self, iter: I) -> Result<Self::Ok, Self::Error>
    where
        I: IntoIterator,
        <I as IntoIterator>::Item: Serialize
, + { ... } +
fn collect_map<K, V, I>(self, iter: I) -> Result<Self::Ok, Self::Error>
    where
        K: Serialize,
        V: Serialize,
        I: IntoIterator<Item = (K, V)>
, + { ... } +
fn collect_str<T: ?Sized>(self, value: &T) -> Result<Self::Ok, Self::Error>
    where
        T: Display
, + { ... } +
fn is_human_readable(&self) -> bool { ... } +}

A data format that can serialize any data structure supported by Serde.

+

The role of this trait is to define the serialization half of the Serde +data model, which is a way to categorize every Rust data structure into one +of 29 possible types. Each method of the Serializer trait corresponds to +one of the types of the data model.

+

Implementations of Serialize map themselves into this data model by +invoking exactly one of the Serializer methods.

+

The types that make up the Serde data model are:

+
    +
  • 14 primitive types +
      +
    • bool
    • +
    • i8, i16, i32, i64, i128
    • +
    • u8, u16, u32, u64, u128
    • +
    • f32, f64
    • +
    • char
    • +
    +
  • +
  • string +
      +
    • UTF-8 bytes with a length and no null terminator.
    • +
    • When serializing, all strings are handled equally. When deserializing, +there are three flavors of strings: transient, owned, and borrowed.
    • +
    +
  • +
  • byte array - [u8] +
      +
    • Similar to strings, during deserialization byte arrays can be +transient, owned, or borrowed.
    • +
    +
  • +
  • option +
      +
    • Either none or some value.
    • +
    +
  • +
  • unit +
      +
    • The type of () in Rust. It represents an anonymous value containing +no data.
    • +
    +
  • +
  • unit_struct +
      +
    • For example struct Unit or PhantomData<T>. It represents a named +value containing no data.
    • +
    +
  • +
  • unit_variant +
      +
    • For example the E::A and E::B in enum E { A, B }.
    • +
    +
  • +
  • newtype_struct +
      +
    • For example struct Millimeters(u8).
    • +
    +
  • +
  • newtype_variant +
      +
    • For example the E::N in enum E { N(u8) }.
    • +
    +
  • +
  • seq +
      +
    • A variably sized heterogeneous sequence of values, for example +Vec<T> or HashSet<T>. When serializing, the length may or may not +be known before iterating through all the data. When deserializing, +the length is determined by looking at the serialized data.
    • +
    +
  • +
  • tuple +
      +
    • A statically sized heterogeneous sequence of values for which the +length will be known at deserialization time without looking at the +serialized data, for example (u8,) or (String, u64, Vec<T>) or +[u64; 10].
    • +
    +
  • +
  • tuple_struct +
      +
    • A named tuple, for example struct Rgb(u8, u8, u8).
    • +
    +
  • +
  • tuple_variant +
      +
    • For example the E::T in enum E { T(u8, u8) }.
    • +
    +
  • +
  • map +
      +
    • A heterogeneous key-value pairing, for example BTreeMap<K, V>.
    • +
    +
  • +
  • struct +
      +
    • A heterogeneous key-value pairing in which the keys are strings and +will be known at deserialization time without looking at the +serialized data, for example struct S { r: u8, g: u8, b: u8 }.
    • +
    +
  • +
  • struct_variant +
      +
    • For example the E::S in enum E { S { r: u8, g: u8, b: u8 } }.
    • +
    +
  • +
+

Many Serde serializers produce text or binary data as output, for example +JSON or Bincode. This is not a requirement of the Serializer trait, and +there are serializers that do not produce text or binary output. One example +is the serde_json::value::Serializer (distinct from the main serde_json +serializer) that produces a serde_json::Value data structure in memory as +output.

+

Example implementation

+

The example data format presented on the website contains example code for +a basic JSON Serializer.

+
+

Associated Types

type Ok

The output type produced by this Serializer during successful +serialization. Most serializers that produce text or binary output +should set Ok = () and serialize into an io::Write or buffer +contained within the Serializer instance. Serializers that build +in-memory data structures may be simplified by using Ok to propagate +the data structure around.

+

type Error: Error

The error type when some error occurs during serialization.

+

type SerializeSeq: SerializeSeq<Ok = Self::Ok, Error = Self::Error>

Type returned from serialize_seq for serializing the content of the +sequence.

+

type SerializeTuple: SerializeTuple<Ok = Self::Ok, Error = Self::Error>

Type returned from serialize_tuple for serializing the content of +the tuple.

+

type SerializeTupleStruct: SerializeTupleStruct<Ok = Self::Ok, Error = Self::Error>

Type returned from serialize_tuple_struct for serializing the +content of the tuple struct.

+

type SerializeTupleVariant: SerializeTupleVariant<Ok = Self::Ok, Error = Self::Error>

Type returned from serialize_tuple_variant for serializing the +content of the tuple variant.

+

type SerializeMap: SerializeMap<Ok = Self::Ok, Error = Self::Error>

Type returned from serialize_map for serializing the content of the +map.

+

type SerializeStruct: SerializeStruct<Ok = Self::Ok, Error = Self::Error>

Type returned from serialize_struct for serializing the content of +the struct.

+

type SerializeStructVariant: SerializeStructVariant<Ok = Self::Ok, Error = Self::Error>

Type returned from serialize_struct_variant for serializing the +content of the struct variant.

+
Loading content... +

Required methods

fn serialize_bool(self, v: bool) -> Result<Self::Ok, Self::Error>

Serialize a bool value.

+ +
This code runs with edition 2018
+impl Serialize for bool {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_bool(*self)
+    }
+}
+

fn serialize_i8(self, v: i8) -> Result<Self::Ok, Self::Error>

Serialize an i8 value.

+

If the format does not differentiate between i8 and i64, a +reasonable implementation would be to cast the value to i64 and +forward to serialize_i64.

+ +
This code runs with edition 2018
+impl Serialize for i8 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_i8(*self)
+    }
+}
+

fn serialize_i16(self, v: i16) -> Result<Self::Ok, Self::Error>

Serialize an i16 value.

+

If the format does not differentiate between i16 and i64, a +reasonable implementation would be to cast the value to i64 and +forward to serialize_i64.

+ +
This code runs with edition 2018
+impl Serialize for i16 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_i16(*self)
+    }
+}
+

fn serialize_i32(self, v: i32) -> Result<Self::Ok, Self::Error>

Serialize an i32 value.

+

If the format does not differentiate between i32 and i64, a +reasonable implementation would be to cast the value to i64 and +forward to serialize_i64.

+ +
This code runs with edition 2018
+impl Serialize for i32 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_i32(*self)
+    }
+}
+

fn serialize_i64(self, v: i64) -> Result<Self::Ok, Self::Error>

Serialize an i64 value.

+ +
This code runs with edition 2018
+impl Serialize for i64 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_i64(*self)
+    }
+}
+

fn serialize_u8(self, v: u8) -> Result<Self::Ok, Self::Error>

Serialize a u8 value.

+

If the format does not differentiate between u8 and u64, a +reasonable implementation would be to cast the value to u64 and +forward to serialize_u64.

+ +
This code runs with edition 2018
+impl Serialize for u8 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_u8(*self)
+    }
+}
+

fn serialize_u16(self, v: u16) -> Result<Self::Ok, Self::Error>

Serialize a u16 value.

+

If the format does not differentiate between u16 and u64, a +reasonable implementation would be to cast the value to u64 and +forward to serialize_u64.

+ +
This code runs with edition 2018
+impl Serialize for u16 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_u16(*self)
+    }
+}
+

fn serialize_u32(self, v: u32) -> Result<Self::Ok, Self::Error>

Serialize a u32 value.

+

If the format does not differentiate between u32 and u64, a +reasonable implementation would be to cast the value to u64 and +forward to serialize_u64.

+ +
This code runs with edition 2018
+impl Serialize for u32 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_u32(*self)
+    }
+}
+

fn serialize_u64(self, v: u64) -> Result<Self::Ok, Self::Error>

Serialize a u64 value.

+ +
This code runs with edition 2018
+impl Serialize for u64 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_u64(*self)
+    }
+}
+

fn serialize_f32(self, v: f32) -> Result<Self::Ok, Self::Error>

Serialize an f32 value.

+

If the format does not differentiate between f32 and f64, a +reasonable implementation would be to cast the value to f64 and +forward to serialize_f64.

+ +
This code runs with edition 2018
+impl Serialize for f32 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_f32(*self)
+    }
+}
+

fn serialize_f64(self, v: f64) -> Result<Self::Ok, Self::Error>

Serialize an f64 value.

+ +
This code runs with edition 2018
+impl Serialize for f64 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_f64(*self)
+    }
+}
+

fn serialize_char(self, v: char) -> Result<Self::Ok, Self::Error>

Serialize a character.

+

If the format does not support characters, it is reasonable to serialize +it as a single element str or a u32.

+ +
This code runs with edition 2018
+impl Serialize for char {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_char(*self)
+    }
+}
+

fn serialize_str(self, v: &str) -> Result<Self::Ok, Self::Error>

Serialize a &str.

+ +
This code runs with edition 2018
+impl Serialize for str {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_str(self)
+    }
+}
+

fn serialize_bytes(self, v: &[u8]) -> Result<Self::Ok, Self::Error>

Serialize a chunk of raw byte data.

+

Enables serializers to serialize byte slices more compactly or more +efficiently than other types of slices. If no efficient implementation +is available, a reasonable implementation would be to forward to +serialize_seq. If forwarded, the implementation looks usually just +like this:

+ +
This code runs with edition 2018
+fn serialize_bytes(self, v: &[u8]) -> Result<Self::Ok, Self::Error> {
+    let mut seq = self.serialize_seq(Some(v.len()))?;
+    for b in v {
+        seq.serialize_element(b)?;
+    }
+    seq.end()
+}
+

fn serialize_none(self) -> Result<Self::Ok, Self::Error>

Serialize a None value.

+ +
This code runs with edition 2018
+impl<T> Serialize for Option<T>
+where
+    T: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            Some(ref value) => serializer.serialize_some(value),
+            None => serializer.serialize_none(),
+        }
+    }
+}
+

fn serialize_some<T: ?Sized>(self, value: &T) -> Result<Self::Ok, Self::Error> where
    T: Serialize

Serialize a Some(T) value.

+ +
This code runs with edition 2018
+impl<T> Serialize for Option<T>
+where
+    T: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            Some(ref value) => serializer.serialize_some(value),
+            None => serializer.serialize_none(),
+        }
+    }
+}
+

fn serialize_unit(self) -> Result<Self::Ok, Self::Error>

Serialize a () value.

+ +
This code runs with edition 2018
+impl Serialize for () {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_unit()
+    }
+}
+

fn serialize_unit_struct(
    self,
    name: &'static str
) -> Result<Self::Ok, Self::Error>

Serialize a unit struct like struct Unit or PhantomData<T>.

+

A reasonable implementation would be to forward to serialize_unit.

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+
+struct Nothing;
+
+impl Serialize for Nothing {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_unit_struct("Nothing")
+    }
+}
+

fn serialize_unit_variant(
    self,
    name: &'static str,
    variant_index: u32,
    variant: &'static str
) -> Result<Self::Ok, Self::Error>

Serialize a unit variant like E::A in enum E { A, B }.

+

The name is the name of the enum, the variant_index is the index of +this variant within the enum, and the variant is the name of the +variant.

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+
+enum E {
+    A,
+    B,
+}
+
+impl Serialize for E {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            E::A => serializer.serialize_unit_variant("E", 0, "A"),
+            E::B => serializer.serialize_unit_variant("E", 1, "B"),
+        }
+    }
+}
+

fn serialize_newtype_struct<T: ?Sized>(
    self,
    name: &'static str,
    value: &T
) -> Result<Self::Ok, Self::Error> where
    T: Serialize

Serialize a newtype struct like struct Millimeters(u8).

+

Serializers are encouraged to treat newtype structs as insignificant +wrappers around the data they contain. A reasonable implementation would +be to forward to value.serialize(self).

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+
+struct Millimeters(u8);
+
+impl Serialize for Millimeters {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_newtype_struct("Millimeters", &self.0)
+    }
+}
+

fn serialize_newtype_variant<T: ?Sized>(
    self,
    name: &'static str,
    variant_index: u32,
    variant: &'static str,
    value: &T
) -> Result<Self::Ok, Self::Error> where
    T: Serialize

Serialize a newtype variant like E::N in enum E { N(u8) }.

+

The name is the name of the enum, the variant_index is the index of +this variant within the enum, and the variant is the name of the +variant. The value is the data contained within this newtype variant.

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+
+enum E {
+    M(String),
+    N(u8),
+}
+
+impl Serialize for E {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            E::M(ref s) => serializer.serialize_newtype_variant("E", 0, "M", s),
+            E::N(n) => serializer.serialize_newtype_variant("E", 1, "N", &n),
+        }
+    }
+}
+

fn serialize_seq(
    self,
    len: Option<usize>
) -> Result<Self::SerializeSeq, Self::Error>

Begin to serialize a variably sized sequence. This call must be +followed by zero or more calls to serialize_element, then a call to +end.

+

The argument is the number of elements in the sequence, which may or may +not be computable before the sequence is iterated. Some serializers only +support sequences whose length is known up front.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, Serializer, SerializeSeq};
+
+impl<T> Serialize for Vec<T>
+where
+    T: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut seq = serializer.serialize_seq(Some(self.len()))?;
+        for element in self {
+            seq.serialize_element(element)?;
+        }
+        seq.end()
+    }
+}
+

fn serialize_tuple(
    self,
    len: usize
) -> Result<Self::SerializeTuple, Self::Error>

Begin to serialize a statically sized sequence whose length will be +known at deserialization time without looking at the serialized data. +This call must be followed by zero or more calls to serialize_element, +then a call to end.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, Serializer, SerializeTuple};
+
+impl<A, B, C> Serialize for (A, B, C)
+where
+    A: Serialize,
+    B: Serialize,
+    C: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut tup = serializer.serialize_tuple(3)?;
+        tup.serialize_element(&self.0)?;
+        tup.serialize_element(&self.1)?;
+        tup.serialize_element(&self.2)?;
+        tup.end()
+    }
+}
+ +
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeTuple, Serializer};
+
+const VRAM_SIZE: usize = 386;
+struct Vram([u16; VRAM_SIZE]);
+
+impl Serialize for Vram {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut seq = serializer.serialize_tuple(VRAM_SIZE)?;
+        for element in &self.0[..] {
+            seq.serialize_element(element)?;
+        }
+        seq.end()
+    }
+}
+

fn serialize_tuple_struct(
    self,
    name: &'static str,
    len: usize
) -> Result<Self::SerializeTupleStruct, Self::Error>

Begin to serialize a tuple struct like struct Rgb(u8, u8, u8). This +call must be followed by zero or more calls to serialize_field, then a +call to end.

+

The name is the name of the tuple struct and the len is the number +of data fields that will be serialized.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeTupleStruct, Serializer};
+
+struct Rgb(u8, u8, u8);
+
+impl Serialize for Rgb {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?;
+        ts.serialize_field(&self.0)?;
+        ts.serialize_field(&self.1)?;
+        ts.serialize_field(&self.2)?;
+        ts.end()
+    }
+}
+

fn serialize_tuple_variant(
    self,
    name: &'static str,
    variant_index: u32,
    variant: &'static str,
    len: usize
) -> Result<Self::SerializeTupleVariant, Self::Error>

Begin to serialize a tuple variant like E::T in enum E { T(u8, u8) }. This call must be followed by zero or more calls to +serialize_field, then a call to end.

+

The name is the name of the enum, the variant_index is the index of +this variant within the enum, the variant is the name of the variant, +and the len is the number of data fields that will be serialized.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeTupleVariant, Serializer};
+
+enum E {
+    T(u8, u8),
+    U(String, u32, u32),
+}
+
+impl Serialize for E {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            E::T(ref a, ref b) => {
+                let mut tv = serializer.serialize_tuple_variant("E", 0, "T", 2)?;
+                tv.serialize_field(a)?;
+                tv.serialize_field(b)?;
+                tv.end()
+            }
+            E::U(ref a, ref b, ref c) => {
+                let mut tv = serializer.serialize_tuple_variant("E", 1, "U", 3)?;
+                tv.serialize_field(a)?;
+                tv.serialize_field(b)?;
+                tv.serialize_field(c)?;
+                tv.end()
+            }
+        }
+    }
+}
+

fn serialize_map(
    self,
    len: Option<usize>
) -> Result<Self::SerializeMap, Self::Error>

Begin to serialize a map. This call must be followed by zero or more +calls to serialize_key and serialize_value, then a call to end.

+

The argument is the number of elements in the map, which may or may not +be computable before the map is iterated. Some serializers only support +maps whose length is known up front.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, Serializer, SerializeMap};
+
+impl<K, V> Serialize for HashMap<K, V>
+where
+    K: Serialize,
+    V: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut map = serializer.serialize_map(Some(self.len()))?;
+        for (k, v) in self {
+            map.serialize_entry(k, v)?;
+        }
+        map.end()
+    }
+}
+

fn serialize_struct(
    self,
    name: &'static str,
    len: usize
) -> Result<Self::SerializeStruct, Self::Error>

Begin to serialize a struct like struct Rgb { r: u8, g: u8, b: u8 }. +This call must be followed by zero or more calls to serialize_field, +then a call to end.

+

The name is the name of the struct and the len is the number of +data fields that will be serialized.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeStruct, Serializer};
+
+struct Rgb {
+    r: u8,
+    g: u8,
+    b: u8,
+}
+
+impl Serialize for Rgb {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut rgb = serializer.serialize_struct("Rgb", 3)?;
+        rgb.serialize_field("r", &self.r)?;
+        rgb.serialize_field("g", &self.g)?;
+        rgb.serialize_field("b", &self.b)?;
+        rgb.end()
+    }
+}
+

fn serialize_struct_variant(
    self,
    name: &'static str,
    variant_index: u32,
    variant: &'static str,
    len: usize
) -> Result<Self::SerializeStructVariant, Self::Error>

Begin to serialize a struct variant like E::S in enum E { S { r: u8, g: u8, b: u8 } }. This call must be followed by zero or more calls to +serialize_field, then a call to end.

+

The name is the name of the enum, the variant_index is the index of +this variant within the enum, the variant is the name of the variant, +and the len is the number of data fields that will be serialized.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeStructVariant, Serializer};
+
+enum E {
+    S { r: u8, g: u8, b: u8 },
+}
+
+impl Serialize for E {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            E::S {
+                ref r,
+                ref g,
+                ref b,
+            } => {
+                let mut sv = serializer.serialize_struct_variant("E", 0, "S", 3)?;
+                sv.serialize_field("r", r)?;
+                sv.serialize_field("g", g)?;
+                sv.serialize_field("b", b)?;
+                sv.end()
+            }
+        }
+    }
+}
+
Loading content... +

Provided methods

fn serialize_i128(self, v: i128) -> Result<Self::Ok, Self::Error>

Serialize an i128 value.

+ +
This code runs with edition 2018
+impl Serialize for i128 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_i128(*self)
+    }
+}
+

This method is available only on Rust compiler versions >=1.26. The +default behavior unconditionally returns an error.

+

fn serialize_u128(self, v: u128) -> Result<Self::Ok, Self::Error>

Serialize a u128 value.

+ +
This code runs with edition 2018
+impl Serialize for u128 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_u128(*self)
+    }
+}
+

This method is available only on Rust compiler versions >=1.26. The +default behavior unconditionally returns an error.

+

fn collect_seq<I>(self, iter: I) -> Result<Self::Ok, Self::Error> where
    I: IntoIterator,
    <I as IntoIterator>::Item: Serialize

Collect an iterator as a sequence.

+

The default implementation serializes each item yielded by the iterator +using serialize_seq. Implementors should not need to override this +method.

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+
+struct SecretlyOneHigher {
+    data: Vec<i32>,
+}
+
+impl Serialize for SecretlyOneHigher {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.collect_seq(self.data.iter().map(|x| x + 1))
+    }
+}
+

fn collect_map<K, V, I>(self, iter: I) -> Result<Self::Ok, Self::Error> where
    K: Serialize,
    V: Serialize,
    I: IntoIterator<Item = (K, V)>, 

Collect an iterator as a map.

+

The default implementation serializes each pair yielded by the iterator +using serialize_map. Implementors should not need to override this +method.

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+use std::collections::BTreeSet;
+
+struct MapToUnit {
+    keys: BTreeSet<i32>,
+}
+
+// Serializes as a map in which the values are all unit.
+impl Serialize for MapToUnit {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.collect_map(self.keys.iter().map(|k| (k, ())))
+    }
+}
+

fn collect_str<T: ?Sized>(self, value: &T) -> Result<Self::Ok, Self::Error> where
    T: Display

Serialize a string produced by an implementation of Display.

+

The default implementation builds a heap-allocated String and +delegates to serialize_str. Serializers are encouraged to provide a +more efficient implementation if possible.

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+
+impl Serialize for DateTime {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.collect_str(&format_args!("{:?}{:?}",
+                                             self.naive_local(),
+                                             self.offset()))
+    }
+}
+

fn is_human_readable(&self) -> bool

Determine whether Serialize implementations should serialize in +human-readable form.

+

Some types have a human-readable form that may be somewhat expensive to +construct, as well as a binary form that is compact and efficient. +Generally text-based formats like JSON and YAML will prefer to use the +human-readable one and binary formats like Bincode will prefer the +compact one.

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+
+impl Serialize for Timestamp {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        if serializer.is_human_readable() {
+            // Serialize to a human-readable string "2015-05-15T17:01:00Z".
+            self.to_string().serialize(serializer)
+        } else {
+            // Serialize to a compact binary representation.
+            self.seconds_since_epoch().serialize(serializer)
+        }
+    }
+}
+

The default implementation of this method returns true. Data formats +may override this to false to request a compact form for types that +support one. Note that modifying this method to change a format from +human-readable to compact or vice versa should be regarded as a breaking +change, as a value serialized in human-readable mode is not required to +deserialize from the same data in compact mode.

+
Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/serde/sidebar-items.js b/serde/sidebar-items.js new file mode 100644 index 0000000..d490b80 --- /dev/null +++ b/serde/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"macro":[["forward_to_deserialize_any","Helper macro when implementing the `Deserializer` part of a new data format for Serde."],["serde_if_integer128","Conditional compilation depending on whether Serde is built with support for 128-bit integers."]],"mod":[["de","Generic data structure deserialization framework."],["ser","Generic data structure serialization framework."]],"trait":[["Deserialize","A data structure that can be deserialized from any data format supported by Serde."],["Deserializer","A data format that can deserialize any data structure supported by Serde."],["Serialize","A data structure that can be serialized into any data format supported by Serde."],["Serializer","A data format that can serialize any data structure supported by Serde."]]}); \ No newline at end of file diff --git a/serde/trait.Deserialize.html b/serde/trait.Deserialize.html new file mode 100644 index 0000000..eab29f1 --- /dev/null +++ b/serde/trait.Deserialize.html @@ -0,0 +1,29 @@ +serde::Deserialize - Rust

[][src]Trait serde::Deserialize

pub trait Deserialize<'de>: Sized {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: Deserializer<'de>
; +}

A data structure that can be deserialized from any data format supported +by Serde.

+

Serde provides Deserialize implementations for many Rust primitive and +standard library types. The complete list is here. All of these can +be deserialized using Serde out of the box.

+

Additionally, Serde provides a procedural macro called serde_derive to +automatically generate Deserialize implementations for structs and enums +in your program. See the derive section of the manual for how to +use this.

+

In rare cases it may be necessary to implement Deserialize manually for +some type in your program. See the Implementing +Deserialize section of the manual for more about this.

+

Third-party crates may provide Deserialize implementations for types that +they expose. For example the linked-hash-map crate provides a +LinkedHashMap<K, V> type that is deserializable by Serde because the crate +provides an implementation of Deserialize for it.

+

Lifetime

+

The 'de lifetime of this trait is the lifetime of data that may be +borrowed by Self when deserialized. See the page Understanding +deserializer lifetimes for a more detailed explanation of these lifetimes.

+
+

Required methods

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
    D: Deserializer<'de>, 

Deserialize this value from the given Serde deserializer.

+

See the Implementing Deserialize section of the +manual for more information about how to implement this method.

+
Loading content... +

Implementations on Foreign Types

impl<'de> Deserialize<'de> for ()[src]

impl<'de> Deserialize<'de> for bool[src]

impl<'de> Deserialize<'de> for i8[src]

impl<'de> Deserialize<'de> for i16[src]

impl<'de> Deserialize<'de> for i32[src]

impl<'de> Deserialize<'de> for i64[src]

impl<'de> Deserialize<'de> for isize[src]

impl<'de> Deserialize<'de> for u8[src]

impl<'de> Deserialize<'de> for u16[src]

impl<'de> Deserialize<'de> for u32[src]

impl<'de> Deserialize<'de> for u64[src]

impl<'de> Deserialize<'de> for usize[src]

impl<'de> Deserialize<'de> for f32[src]

impl<'de> Deserialize<'de> for f64[src]

impl<'de> Deserialize<'de> for i128[src]

impl<'de> Deserialize<'de> for u128[src]

impl<'de> Deserialize<'de> for char[src]

impl<'de> Deserialize<'de> for String[src]

impl<'de: 'a, 'a> Deserialize<'de> for &'a str[src]

impl<'de: 'a, 'a> Deserialize<'de> for &'a [u8][src]

impl<'de> Deserialize<'de> for CString[src]

impl<'de> Deserialize<'de> for Box<CStr>[src]

impl<'de, T: Deserialize<'de>> Deserialize<'de> for Reverse<T>[src]

impl<'de, T> Deserialize<'de> for Option<T> where
    T: Deserialize<'de>, 
[src]

impl<'de, T: ?Sized> Deserialize<'de> for PhantomData<T>[src]

impl<'de, T> Deserialize<'de> for BinaryHeap<T> where
    T: Deserialize<'de> + Ord
[src]

impl<'de, T> Deserialize<'de> for BTreeSet<T> where
    T: Deserialize<'de> + Eq + Ord
[src]

impl<'de, T> Deserialize<'de> for LinkedList<T> where
    T: Deserialize<'de>, 
[src]

impl<'de, T, S> Deserialize<'de> for HashSet<T, S> where
    T: Deserialize<'de> + Eq + Hash,
    S: BuildHasher + Default
[src]

impl<'de, T> Deserialize<'de> for VecDeque<T> where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for Vec<T> where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 0][src]

impl<'de, T> Deserialize<'de> for [T; 1] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 2] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 3] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 4] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 5] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 6] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 7] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 8] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 9] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 10] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 11] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 12] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 13] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 14] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 15] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 16] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 17] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 18] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 19] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 20] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 21] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 22] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 23] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 24] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 25] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 26] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 27] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 28] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 29] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 30] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 31] where
    T: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for [T; 32] where
    T: Deserialize<'de>, 
[src]

impl<'de, T0: Deserialize<'de>> Deserialize<'de> for (T0,)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>> Deserialize<'de> for (T0, T1)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>, T9: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>, T9: Deserialize<'de>, T10: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>, T9: Deserialize<'de>, T10: Deserialize<'de>, T11: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>, T9: Deserialize<'de>, T10: Deserialize<'de>, T11: Deserialize<'de>, T12: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>, T9: Deserialize<'de>, T10: Deserialize<'de>, T11: Deserialize<'de>, T12: Deserialize<'de>, T13: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>, T9: Deserialize<'de>, T10: Deserialize<'de>, T11: Deserialize<'de>, T12: Deserialize<'de>, T13: Deserialize<'de>, T14: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)[src]

impl<'de, T0: Deserialize<'de>, T1: Deserialize<'de>, T2: Deserialize<'de>, T3: Deserialize<'de>, T4: Deserialize<'de>, T5: Deserialize<'de>, T6: Deserialize<'de>, T7: Deserialize<'de>, T8: Deserialize<'de>, T9: Deserialize<'de>, T10: Deserialize<'de>, T11: Deserialize<'de>, T12: Deserialize<'de>, T13: Deserialize<'de>, T14: Deserialize<'de>, T15: Deserialize<'de>> Deserialize<'de> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)[src]

impl<'de, K, V> Deserialize<'de> for BTreeMap<K, V> where
    K: Deserialize<'de> + Ord,
    V: Deserialize<'de>, 
[src]

impl<'de, K, V, S> Deserialize<'de> for HashMap<K, V, S> where
    K: Deserialize<'de> + Eq + Hash,
    V: Deserialize<'de>,
    S: BuildHasher + Default
[src]

impl<'de> Deserialize<'de> for IpAddr[src]

impl<'de> Deserialize<'de> for Ipv4Addr[src]

impl<'de> Deserialize<'de> for Ipv6Addr[src]

impl<'de> Deserialize<'de> for SocketAddr[src]

impl<'de> Deserialize<'de> for SocketAddrV4[src]

impl<'de> Deserialize<'de> for SocketAddrV6[src]

impl<'de: 'a, 'a> Deserialize<'de> for &'a Path[src]

impl<'de> Deserialize<'de> for PathBuf[src]

impl<'de> Deserialize<'de> for Box<Path>[src]

impl<'de> Deserialize<'de> for OsString[src]

impl<'de, T: Deserialize<'de>> Deserialize<'de> for Box<T>[src]

impl<'de, T: Deserialize<'de>> Deserialize<'de> for Box<[T]>[src]

impl<'de> Deserialize<'de> for Box<str>[src]

impl<'de, 'a, T: ?Sized> Deserialize<'de> for Cow<'a, T> where
    T: ToOwned,
    T::Owned: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for Cell<T> where
    T: Deserialize<'de> + Copy
[src]

impl<'de, T: Deserialize<'de>> Deserialize<'de> for RefCell<T>[src]

impl<'de, T: Deserialize<'de>> Deserialize<'de> for Mutex<T>[src]

impl<'de, T: Deserialize<'de>> Deserialize<'de> for RwLock<T>[src]

impl<'de> Deserialize<'de> for Duration[src]

impl<'de> Deserialize<'de> for SystemTime[src]

impl<'de, Idx> Deserialize<'de> for Range<Idx> where
    Idx: Deserialize<'de>, 
[src]

impl<'de, Idx> Deserialize<'de> for RangeInclusive<Idx> where
    Idx: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for Bound<T> where
    T: Deserialize<'de>, 
[src]

impl<'de> Deserialize<'de> for NonZeroU8[src]

impl<'de> Deserialize<'de> for NonZeroU16[src]

impl<'de> Deserialize<'de> for NonZeroU32[src]

impl<'de> Deserialize<'de> for NonZeroU64[src]

impl<'de> Deserialize<'de> for NonZeroUsize[src]

impl<'de> Deserialize<'de> for NonZeroI8[src]

impl<'de> Deserialize<'de> for NonZeroI16[src]

impl<'de> Deserialize<'de> for NonZeroI32[src]

impl<'de> Deserialize<'de> for NonZeroI64[src]

impl<'de> Deserialize<'de> for NonZeroIsize[src]

impl<'de> Deserialize<'de> for NonZeroU128[src]

impl<'de> Deserialize<'de> for NonZeroI128[src]

impl<'de, T, E> Deserialize<'de> for Result<T, E> where
    T: Deserialize<'de>,
    E: Deserialize<'de>, 
[src]

impl<'de, T> Deserialize<'de> for Wrapping<T> where
    T: Deserialize<'de>, 
[src]

impl<'de> Deserialize<'de> for AtomicBool[src]

impl<'de> Deserialize<'de> for AtomicI8[src]

impl<'de> Deserialize<'de> for AtomicI16[src]

impl<'de> Deserialize<'de> for AtomicI32[src]

impl<'de> Deserialize<'de> for AtomicIsize[src]

impl<'de> Deserialize<'de> for AtomicU8[src]

impl<'de> Deserialize<'de> for AtomicU16[src]

impl<'de> Deserialize<'de> for AtomicU32[src]

impl<'de> Deserialize<'de> for AtomicUsize[src]

impl<'de> Deserialize<'de> for AtomicI64[src]

impl<'de> Deserialize<'de> for AtomicU64[src]

Loading content... +

Implementors

impl<'de> Deserialize<'de> for IgnoredAny[src]

Loading content...
\ No newline at end of file diff --git a/serde/trait.Deserializer.html b/serde/trait.Deserializer.html new file mode 100644 index 0000000..dd689d6 --- /dev/null +++ b/serde/trait.Deserializer.html @@ -0,0 +1,298 @@ +serde::Deserializer - Rust

[][src]Trait serde::Deserializer

pub trait Deserializer<'de>: Sized {
+    type Error: Error;
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_byte_buf<V>(
        self,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_unit_struct<V>(
        self,
        name: &'static str,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_newtype_struct<V>(
        self,
        name: &'static str,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_tuple<V>(
        self,
        len: usize,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_tuple_struct<V>(
        self,
        name: &'static str,
        len: usize,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_struct<V>(
        self,
        name: &'static str,
        fields: &'static [&'static str],
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_enum<V>(
        self,
        name: &'static str,
        variants: &'static [&'static str],
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_identifier<V>(
        self,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; +
fn deserialize_ignored_any<V>(
        self,
        visitor: V
    ) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
; + + fn deserialize_i128<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
, + { ... } +
fn deserialize_u128<V>(self, visitor: V) -> Result<V::Value, Self::Error>
    where
        V: Visitor<'de>
, + { ... } +
fn is_human_readable(&self) -> bool { ... } +}

A data format that can deserialize any data structure supported by +Serde.

+

The role of this trait is to define the deserialization half of the Serde +data model, which is a way to categorize every Rust data type into one of +29 possible types. Each method of the Deserializer trait corresponds to one +of the types of the data model.

+

Implementations of Deserialize map themselves into this data model by +passing to the Deserializer a Visitor implementation that can receive +these various types.

+

The types that make up the Serde data model are:

+
    +
  • 14 primitive types +
      +
    • bool
    • +
    • i8, i16, i32, i64, i128
    • +
    • u8, u16, u32, u64, u128
    • +
    • f32, f64
    • +
    • char
    • +
    +
  • +
  • string +
      +
    • UTF-8 bytes with a length and no null terminator.
    • +
    • When serializing, all strings are handled equally. When deserializing, +there are three flavors of strings: transient, owned, and borrowed.
    • +
    +
  • +
  • byte array - [u8] +
      +
    • Similar to strings, during deserialization byte arrays can be +transient, owned, or borrowed.
    • +
    +
  • +
  • option +
      +
    • Either none or some value.
    • +
    +
  • +
  • unit +
      +
    • The type of () in Rust. It represents an anonymous value containing +no data.
    • +
    +
  • +
  • unit_struct +
      +
    • For example struct Unit or PhantomData<T>. It represents a named +value containing no data.
    • +
    +
  • +
  • unit_variant +
      +
    • For example the E::A and E::B in enum E { A, B }.
    • +
    +
  • +
  • newtype_struct +
      +
    • For example struct Millimeters(u8).
    • +
    +
  • +
  • newtype_variant +
      +
    • For example the E::N in enum E { N(u8) }.
    • +
    +
  • +
  • seq +
      +
    • A variably sized heterogeneous sequence of values, for example Vec<T> +or HashSet<T>. When serializing, the length may or may not be known +before iterating through all the data. When deserializing, the length +is determined by looking at the serialized data.
    • +
    +
  • +
  • tuple +
      +
    • A statically sized heterogeneous sequence of values for which the +length will be known at deserialization time without looking at the +serialized data, for example (u8,) or (String, u64, Vec<T>) or +[u64; 10].
    • +
    +
  • +
  • tuple_struct +
      +
    • A named tuple, for example struct Rgb(u8, u8, u8).
    • +
    +
  • +
  • tuple_variant +
      +
    • For example the E::T in enum E { T(u8, u8) }.
    • +
    +
  • +
  • map +
      +
    • A heterogeneous key-value pairing, for example BTreeMap<K, V>.
    • +
    +
  • +
  • struct +
      +
    • A heterogeneous key-value pairing in which the keys are strings and +will be known at deserialization time without looking at the serialized +data, for example struct S { r: u8, g: u8, b: u8 }.
    • +
    +
  • +
  • struct_variant +
      +
    • For example the E::S in enum E { S { r: u8, g: u8, b: u8 } }.
    • +
    +
  • +
+

The Deserializer trait supports two entry point styles which enables +different kinds of deserialization.

+
    +
  1. +

    The deserialize method. Self-describing data formats like JSON are able +to look at the serialized data and tell what it represents. For example +the JSON deserializer may see an opening curly brace ({) and know that +it is seeing a map. If the data format supports +Deserializer::deserialize_any, it will drive the Visitor using whatever +type it sees in the input. JSON uses this approach when deserializing +serde_json::Value which is an enum that can represent any JSON +document. Without knowing what is in a JSON document, we can deserialize +it to serde_json::Value by going through +Deserializer::deserialize_any.

    +
  2. +
  3. +

    The various deserialize_* methods. Non-self-describing formats like +Bincode need to be told what is in the input in order to deserialize it. +The deserialize_* methods are hints to the deserializer for how to +interpret the next piece of input. Non-self-describing formats are not +able to deserialize something like serde_json::Value which relies on +Deserializer::deserialize_any.

    +
  4. +
+

When implementing Deserialize, you should avoid relying on +Deserializer::deserialize_any unless you need to be told by the +Deserializer what type is in the input. Know that relying on +Deserializer::deserialize_any means your data type will be able to +deserialize from self-describing formats only, ruling out Bincode and many +others.

+

Lifetime

+

The 'de lifetime of this trait is the lifetime of data that may be +borrowed from the input when deserializing. See the page Understanding +deserializer lifetimes for a more detailed explanation of these lifetimes.

+

Example implementation

+

The example data format presented on the website contains example code for +a basic JSON Deserializer.

+
+

Associated Types

type Error: Error

The error type that can be returned if some error occurs during +deserialization.

+
Loading content... +

Required methods

fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Require the Deserializer to figure out how to drive the visitor based +on what data type is in the input.

+

When implementing Deserialize, you should avoid relying on +Deserializer::deserialize_any unless you need to be told by the +Deserializer what type is in the input. Know that relying on +Deserializer::deserialize_any means your data type will be able to +deserialize from self-describing formats only, ruling out Bincode and +many others.

+

fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a bool value.

+

fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an i8 value.

+

fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an i16 value.

+

fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an i32 value.

+

fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an i64 value.

+

fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a u8 value.

+

fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a u16 value.

+

fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a u32 value.

+

fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a u64 value.

+

fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a f32 value.

+

fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a f64 value.

+

fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a char value.

+

fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a string value and does +not benefit from taking ownership of buffered data owned by the +Deserializer.

+

If the Visitor would benefit from taking ownership of String data, +indiciate this to the Deserializer by using deserialize_string +instead.

+

fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a string value and would +benefit from taking ownership of buffered data owned by the +Deserializer.

+

If the Visitor would not benefit from taking ownership of String +data, indicate that to the Deserializer by using deserialize_str +instead.

+

fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a byte array and does not +benefit from taking ownership of buffered data owned by the +Deserializer.

+

If the Visitor would benefit from taking ownership of Vec<u8> data, +indicate this to the Deserializer by using deserialize_byte_buf +instead.

+

fn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a byte array and would +benefit from taking ownership of buffered data owned by the +Deserializer.

+

If the Visitor would not benefit from taking ownership of Vec<u8> +data, indicate that to the Deserializer by using deserialize_bytes +instead.

+

fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an optional value.

+

This allows deserializers that encode an optional value as a nullable +value to convert the null value into None and a regular value into +Some(value).

+

fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a unit value.

+

fn deserialize_unit_struct<V>(
    self,
    name: &'static str,
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a unit struct with a +particular name.

+

fn deserialize_newtype_struct<V>(
    self,
    name: &'static str,
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a newtype struct with a +particular name.

+

fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a sequence of values.

+

fn deserialize_tuple<V>(
    self,
    len: usize,
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a sequence of values and +knows how many values there are without looking at the serialized data.

+

fn deserialize_tuple_struct<V>(
    self,
    name: &'static str,
    len: usize,
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a tuple struct with a +particular name and number of fields.

+

fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a map of key-value pairs.

+

fn deserialize_struct<V>(
    self,
    name: &'static str,
    fields: &'static [&'static str],
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting a struct with a particular +name and fields.

+

fn deserialize_enum<V>(
    self,
    name: &'static str,
    variants: &'static [&'static str],
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an enum value with a +particular name and possible variants.

+

fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting the name of a struct +field or the discriminant of an enum variant.

+

fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type needs to deserialize a value whose type +doesn't matter because it is ignored.

+

Deserializers for non-self-describing formats may not support this mode.

+
Loading content... +

Provided methods

fn deserialize_i128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an i128 value.

+

This method is available only on Rust compiler versions >=1.26. The +default behavior unconditionally returns an error.

+

fn deserialize_u128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 

Hint that the Deserialize type is expecting an u128 value.

+

This method is available only on Rust compiler versions >=1.26. The +default behavior unconditionally returns an error.

+

fn is_human_readable(&self) -> bool

Determine whether Deserialize implementations should expect to +deserialize their human-readable form.

+

Some types have a human-readable form that may be somewhat expensive to +construct, as well as a binary form that is compact and efficient. +Generally text-based formats like JSON and YAML will prefer to use the +human-readable one and binary formats like Bincode will prefer the +compact one.

+ +
This code runs with edition 2018
+use serde::de::{self, Deserialize, Deserializer};
+
+impl<'de> Deserialize<'de> for Timestamp {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        if deserializer.is_human_readable() {
+            // Deserialize from a human-readable string like "2015-05-15T17:01:00Z".
+            let s = String::deserialize(deserializer)?;
+            Timestamp::from_str(&s).map_err(de::Error::custom)
+        } else {
+            // Deserialize from a compact binary representation, seconds since
+            // the Unix epoch.
+            let n = u64::deserialize(deserializer)?;
+            Ok(Timestamp::EPOCH + Duration::seconds(n))
+        }
+    }
+}
+

The default implementation of this method returns true. Data formats +may override this to false to request a compact form for types that +support one. Note that modifying this method to change a format from +human-readable to compact or vice versa should be regarded as a breaking +change, as a value serialized in human-readable mode is not required to +deserialize from the same data in compact mode.

+
Loading content... +

Implementors

impl<'de, 'a, E> Deserializer<'de> for CowStrDeserializer<'a, E> where
    E: Error
[src]

type Error = E

impl<'de, 'a, E> Deserializer<'de> for StrDeserializer<'a, E> where
    E: Error
[src]

type Error = E

impl<'de, A> Deserializer<'de> for MapAccessDeserializer<A> where
    A: MapAccess<'de>, 
[src]

type Error = A::Error

impl<'de, A> Deserializer<'de> for SeqAccessDeserializer<A> where
    A: SeqAccess<'de>, 
[src]

type Error = A::Error

impl<'de, E> Deserializer<'de> for BoolDeserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for BorrowedBytesDeserializer<'de, E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for BorrowedStrDeserializer<'de, E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for CharDeserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for F32Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for F64Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for I128Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for I16Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for I32Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for I64Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for I8Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for IsizeDeserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for StringDeserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for U128Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for U16Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for U32Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for U64Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for U8Deserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for UnitDeserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, E> Deserializer<'de> for UsizeDeserializer<E> where
    E: Error
[src]

type Error = E

impl<'de, I, E> Deserializer<'de> for MapDeserializer<'de, I, E> where
    I: Iterator,
    I::Item: Pair,
    <I::Item as Pair>::First: IntoDeserializer<'de, E>,
    <I::Item as Pair>::Second: IntoDeserializer<'de, E>,
    E: Error
[src]

type Error = E

impl<'de, I, T, E> Deserializer<'de> for SeqDeserializer<I, E> where
    I: Iterator<Item = T>,
    T: IntoDeserializer<'de, E>,
    E: Error
[src]

type Error = E

Loading content...
\ No newline at end of file diff --git a/serde/trait.Serialize.html b/serde/trait.Serialize.html new file mode 100644 index 0000000..b87a829 --- /dev/null +++ b/serde/trait.Serialize.html @@ -0,0 +1,47 @@ +serde::Serialize - Rust

[][src]Trait serde::Serialize

pub trait Serialize {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: Serializer
; +}

A data structure that can be serialized into any data format supported +by Serde.

+

Serde provides Serialize implementations for many Rust primitive and +standard library types. The complete list is here. All of these can +be serialized using Serde out of the box.

+

Additionally, Serde provides a procedural macro called serde_derive to +automatically generate Serialize implementations for structs and enums in +your program. See the derive section of the manual for how to use this.

+

In rare cases it may be necessary to implement Serialize manually for some +type in your program. See the Implementing Serialize section of the +manual for more about this.

+

Third-party crates may provide Serialize implementations for types that +they expose. For example the linked-hash-map crate provides a +LinkedHashMap<K, V> type that is serializable by Serde because the crate +provides an implementation of Serialize for it.

+
+

Required methods

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
    S: Serializer

Serialize this value into the given Serde serializer.

+

See the Implementing Serialize section of the manual for more +information about how to implement this method.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeStruct, Serializer};
+
+struct Person {
+    name: String,
+    age: u8,
+    phones: Vec<String>,
+}
+
+// This is what #[derive(Serialize)] would generate.
+impl Serialize for Person {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut s = serializer.serialize_struct("Person", 3)?;
+        s.serialize_field("name", &self.name)?;
+        s.serialize_field("age", &self.age)?;
+        s.serialize_field("phones", &self.phones)?;
+        s.end()
+    }
+}
+
Loading content... +

Implementations on Foreign Types

impl Serialize for bool[src]

impl Serialize for isize[src]

impl Serialize for i8[src]

impl Serialize for i16[src]

impl Serialize for i32[src]

impl Serialize for i64[src]

impl Serialize for usize[src]

impl Serialize for u8[src]

impl Serialize for u16[src]

impl Serialize for u32[src]

impl Serialize for u64[src]

impl Serialize for f32[src]

impl Serialize for f64[src]

impl Serialize for char[src]

impl Serialize for i128[src]

impl Serialize for u128[src]

impl Serialize for str[src]

impl Serialize for String[src]

impl<'a> Serialize for Arguments<'a>[src]

impl Serialize for CStr[src]

impl Serialize for CString[src]

impl<T> Serialize for Option<T> where
    T: Serialize
[src]

impl<T: ?Sized> Serialize for PhantomData<T>[src]

impl<T> Serialize for [T; 0][src]

impl<T> Serialize for [T; 1] where
    T: Serialize
[src]

impl<T> Serialize for [T; 2] where
    T: Serialize
[src]

impl<T> Serialize for [T; 3] where
    T: Serialize
[src]

impl<T> Serialize for [T; 4] where
    T: Serialize
[src]

impl<T> Serialize for [T; 5] where
    T: Serialize
[src]

impl<T> Serialize for [T; 6] where
    T: Serialize
[src]

impl<T> Serialize for [T; 7] where
    T: Serialize
[src]

impl<T> Serialize for [T; 8] where
    T: Serialize
[src]

impl<T> Serialize for [T; 9] where
    T: Serialize
[src]

impl<T> Serialize for [T; 10] where
    T: Serialize
[src]

impl<T> Serialize for [T; 11] where
    T: Serialize
[src]

impl<T> Serialize for [T; 12] where
    T: Serialize
[src]

impl<T> Serialize for [T; 13] where
    T: Serialize
[src]

impl<T> Serialize for [T; 14] where
    T: Serialize
[src]

impl<T> Serialize for [T; 15] where
    T: Serialize
[src]

impl<T> Serialize for [T; 16] where
    T: Serialize
[src]

impl<T> Serialize for [T; 17] where
    T: Serialize
[src]

impl<T> Serialize for [T; 18] where
    T: Serialize
[src]

impl<T> Serialize for [T; 19] where
    T: Serialize
[src]

impl<T> Serialize for [T; 20] where
    T: Serialize
[src]

impl<T> Serialize for [T; 21] where
    T: Serialize
[src]

impl<T> Serialize for [T; 22] where
    T: Serialize
[src]

impl<T> Serialize for [T; 23] where
    T: Serialize
[src]

impl<T> Serialize for [T; 24] where
    T: Serialize
[src]

impl<T> Serialize for [T; 25] where
    T: Serialize
[src]

impl<T> Serialize for [T; 26] where
    T: Serialize
[src]

impl<T> Serialize for [T; 27] where
    T: Serialize
[src]

impl<T> Serialize for [T; 28] where
    T: Serialize
[src]

impl<T> Serialize for [T; 29] where
    T: Serialize
[src]

impl<T> Serialize for [T; 30] where
    T: Serialize
[src]

impl<T> Serialize for [T; 31] where
    T: Serialize
[src]

impl<T> Serialize for [T; 32] where
    T: Serialize
[src]

impl<T> Serialize for [T] where
    T: Serialize
[src]

impl<T> Serialize for BinaryHeap<T> where
    T: Serialize + Ord
[src]

impl<T> Serialize for BTreeSet<T> where
    T: Serialize + Ord
[src]

impl<T, H> Serialize for HashSet<T, H> where
    T: Serialize + Eq + Hash,
    H: BuildHasher
[src]

impl<T> Serialize for LinkedList<T> where
    T: Serialize
[src]

impl<T> Serialize for Vec<T> where
    T: Serialize
[src]

impl<T> Serialize for VecDeque<T> where
    T: Serialize
[src]

impl<Idx> Serialize for Range<Idx> where
    Idx: Serialize
[src]

impl<Idx> Serialize for RangeInclusive<Idx> where
    Idx: Serialize
[src]

impl<T> Serialize for Bound<T> where
    T: Serialize
[src]

impl Serialize for ()[src]

impl<T0> Serialize for (T0,) where
    T0: Serialize
[src]

impl<T0, T1> Serialize for (T0, T1) where
    T0: Serialize,
    T1: Serialize
[src]

impl<T0, T1, T2> Serialize for (T0, T1, T2) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize
[src]

impl<T0, T1, T2, T3> Serialize for (T0, T1, T2, T3) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize
[src]

impl<T0, T1, T2, T3, T4> Serialize for (T0, T1, T2, T3, T4) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5> Serialize for (T0, T1, T2, T3, T4, T5) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6> Serialize for (T0, T1, T2, T3, T4, T5, T6) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize,
    T9: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize,
    T9: Serialize,
    T10: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize,
    T9: Serialize,
    T10: Serialize,
    T11: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize,
    T9: Serialize,
    T10: Serialize,
    T11: Serialize,
    T12: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize,
    T9: Serialize,
    T10: Serialize,
    T11: Serialize,
    T12: Serialize,
    T13: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize,
    T9: Serialize,
    T10: Serialize,
    T11: Serialize,
    T12: Serialize,
    T13: Serialize,
    T14: Serialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Serialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) where
    T0: Serialize,
    T1: Serialize,
    T2: Serialize,
    T3: Serialize,
    T4: Serialize,
    T5: Serialize,
    T6: Serialize,
    T7: Serialize,
    T8: Serialize,
    T9: Serialize,
    T10: Serialize,
    T11: Serialize,
    T12: Serialize,
    T13: Serialize,
    T14: Serialize,
    T15: Serialize
[src]

impl<K, V> Serialize for BTreeMap<K, V> where
    K: Serialize + Ord,
    V: Serialize
[src]

impl<K, V, H> Serialize for HashMap<K, V, H> where
    K: Serialize + Eq + Hash,
    V: Serialize,
    H: BuildHasher
[src]

impl<'a, T: ?Sized> Serialize for &'a T where
    T: Serialize
[src]

impl<'a, T: ?Sized> Serialize for &'a mut T where
    T: Serialize
[src]

impl<T: ?Sized> Serialize for Box<T> where
    T: Serialize
[src]

impl<'a, T: ?Sized> Serialize for Cow<'a, T> where
    T: Serialize + ToOwned
[src]

impl Serialize for NonZeroU8[src]

impl Serialize for NonZeroU16[src]

impl Serialize for NonZeroU32[src]

impl Serialize for NonZeroU64[src]

impl Serialize for NonZeroUsize[src]

impl Serialize for NonZeroI8[src]

impl Serialize for NonZeroI16[src]

impl Serialize for NonZeroI32[src]

impl Serialize for NonZeroI64[src]

impl Serialize for NonZeroIsize[src]

impl Serialize for NonZeroU128[src]

impl Serialize for NonZeroI128[src]

impl<T> Serialize for Cell<T> where
    T: Serialize + Copy
[src]

impl<T> Serialize for RefCell<T> where
    T: Serialize
[src]

impl<T> Serialize for Mutex<T> where
    T: Serialize
[src]

impl<T> Serialize for RwLock<T> where
    T: Serialize
[src]

impl<T, E> Serialize for Result<T, E> where
    T: Serialize,
    E: Serialize
[src]

impl Serialize for Duration[src]

impl Serialize for SystemTime[src]

impl Serialize for IpAddr[src]

impl Serialize for Ipv4Addr[src]

impl Serialize for Ipv6Addr[src]

impl Serialize for SocketAddr[src]

impl Serialize for SocketAddrV4[src]

impl Serialize for SocketAddrV6[src]

impl Serialize for Path[src]

impl Serialize for PathBuf[src]

impl Serialize for OsStr[src]

impl Serialize for OsString[src]

impl<T> Serialize for Wrapping<T> where
    T: Serialize
[src]

impl<T> Serialize for Reverse<T> where
    T: Serialize
[src]

impl Serialize for AtomicBool[src]

impl Serialize for AtomicI8[src]

impl Serialize for AtomicI16[src]

impl Serialize for AtomicI32[src]

impl Serialize for AtomicIsize[src]

impl Serialize for AtomicU8[src]

impl Serialize for AtomicU16[src]

impl Serialize for AtomicU32[src]

impl Serialize for AtomicUsize[src]

impl Serialize for AtomicI64[src]

impl Serialize for AtomicU64[src]

Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/serde/trait.Serializer.html b/serde/trait.Serializer.html new file mode 100644 index 0000000..b62f9a0 --- /dev/null +++ b/serde/trait.Serializer.html @@ -0,0 +1,828 @@ +serde::Serializer - Rust

[][src]Trait serde::Serializer

pub trait Serializer: Sized {
+    type Ok;
+    type Error: Error;
+    type SerializeSeq: SerializeSeq<Ok = Self::Ok, Error = Self::Error>;
+    type SerializeTuple: SerializeTuple<Ok = Self::Ok, Error = Self::Error>;
+    type SerializeTupleStruct: SerializeTupleStruct<Ok = Self::Ok, Error = Self::Error>;
+    type SerializeTupleVariant: SerializeTupleVariant<Ok = Self::Ok, Error = Self::Error>;
+    type SerializeMap: SerializeMap<Ok = Self::Ok, Error = Self::Error>;
+    type SerializeStruct: SerializeStruct<Ok = Self::Ok, Error = Self::Error>;
+    type SerializeStructVariant: SerializeStructVariant<Ok = Self::Ok, Error = Self::Error>;
+    fn serialize_bool(self, v: bool) -> Result<Self::Ok, Self::Error>;
+
fn serialize_i8(self, v: i8) -> Result<Self::Ok, Self::Error>; +
fn serialize_i16(self, v: i16) -> Result<Self::Ok, Self::Error>; +
fn serialize_i32(self, v: i32) -> Result<Self::Ok, Self::Error>; +
fn serialize_i64(self, v: i64) -> Result<Self::Ok, Self::Error>; +
fn serialize_u8(self, v: u8) -> Result<Self::Ok, Self::Error>; +
fn serialize_u16(self, v: u16) -> Result<Self::Ok, Self::Error>; +
fn serialize_u32(self, v: u32) -> Result<Self::Ok, Self::Error>; +
fn serialize_u64(self, v: u64) -> Result<Self::Ok, Self::Error>; +
fn serialize_f32(self, v: f32) -> Result<Self::Ok, Self::Error>; +
fn serialize_f64(self, v: f64) -> Result<Self::Ok, Self::Error>; +
fn serialize_char(self, v: char) -> Result<Self::Ok, Self::Error>; +
fn serialize_str(self, v: &str) -> Result<Self::Ok, Self::Error>; +
fn serialize_bytes(self, v: &[u8]) -> Result<Self::Ok, Self::Error>; +
fn serialize_none(self) -> Result<Self::Ok, Self::Error>; +
fn serialize_some<T: ?Sized>(
        self,
        value: &T
    ) -> Result<Self::Ok, Self::Error>
    where
        T: Serialize
; +
fn serialize_unit(self) -> Result<Self::Ok, Self::Error>; +
fn serialize_unit_struct(
        self,
        name: &'static str
    ) -> Result<Self::Ok, Self::Error>; +
fn serialize_unit_variant(
        self,
        name: &'static str,
        variant_index: u32,
        variant: &'static str
    ) -> Result<Self::Ok, Self::Error>; +
fn serialize_newtype_struct<T: ?Sized>(
        self,
        name: &'static str,
        value: &T
    ) -> Result<Self::Ok, Self::Error>
    where
        T: Serialize
; +
fn serialize_newtype_variant<T: ?Sized>(
        self,
        name: &'static str,
        variant_index: u32,
        variant: &'static str,
        value: &T
    ) -> Result<Self::Ok, Self::Error>
    where
        T: Serialize
; +
fn serialize_seq(
        self,
        len: Option<usize>
    ) -> Result<Self::SerializeSeq, Self::Error>; +
fn serialize_tuple(
        self,
        len: usize
    ) -> Result<Self::SerializeTuple, Self::Error>; +
fn serialize_tuple_struct(
        self,
        name: &'static str,
        len: usize
    ) -> Result<Self::SerializeTupleStruct, Self::Error>; +
fn serialize_tuple_variant(
        self,
        name: &'static str,
        variant_index: u32,
        variant: &'static str,
        len: usize
    ) -> Result<Self::SerializeTupleVariant, Self::Error>; +
fn serialize_map(
        self,
        len: Option<usize>
    ) -> Result<Self::SerializeMap, Self::Error>; +
fn serialize_struct(
        self,
        name: &'static str,
        len: usize
    ) -> Result<Self::SerializeStruct, Self::Error>; +
fn serialize_struct_variant(
        self,
        name: &'static str,
        variant_index: u32,
        variant: &'static str,
        len: usize
    ) -> Result<Self::SerializeStructVariant, Self::Error>; + + fn serialize_i128(self, v: i128) -> Result<Self::Ok, Self::Error> { ... } +
fn serialize_u128(self, v: u128) -> Result<Self::Ok, Self::Error> { ... } +
fn collect_seq<I>(self, iter: I) -> Result<Self::Ok, Self::Error>
    where
        I: IntoIterator,
        <I as IntoIterator>::Item: Serialize
, + { ... } +
fn collect_map<K, V, I>(self, iter: I) -> Result<Self::Ok, Self::Error>
    where
        K: Serialize,
        V: Serialize,
        I: IntoIterator<Item = (K, V)>
, + { ... } +
fn collect_str<T: ?Sized>(self, value: &T) -> Result<Self::Ok, Self::Error>
    where
        T: Display
, + { ... } +
fn is_human_readable(&self) -> bool { ... } +}

A data format that can serialize any data structure supported by Serde.

+

The role of this trait is to define the serialization half of the Serde +data model, which is a way to categorize every Rust data structure into one +of 29 possible types. Each method of the Serializer trait corresponds to +one of the types of the data model.

+

Implementations of Serialize map themselves into this data model by +invoking exactly one of the Serializer methods.

+

The types that make up the Serde data model are:

+
    +
  • 14 primitive types +
      +
    • bool
    • +
    • i8, i16, i32, i64, i128
    • +
    • u8, u16, u32, u64, u128
    • +
    • f32, f64
    • +
    • char
    • +
    +
  • +
  • string +
      +
    • UTF-8 bytes with a length and no null terminator.
    • +
    • When serializing, all strings are handled equally. When deserializing, +there are three flavors of strings: transient, owned, and borrowed.
    • +
    +
  • +
  • byte array - [u8] +
      +
    • Similar to strings, during deserialization byte arrays can be +transient, owned, or borrowed.
    • +
    +
  • +
  • option +
      +
    • Either none or some value.
    • +
    +
  • +
  • unit +
      +
    • The type of () in Rust. It represents an anonymous value containing +no data.
    • +
    +
  • +
  • unit_struct +
      +
    • For example struct Unit or PhantomData<T>. It represents a named +value containing no data.
    • +
    +
  • +
  • unit_variant +
      +
    • For example the E::A and E::B in enum E { A, B }.
    • +
    +
  • +
  • newtype_struct +
      +
    • For example struct Millimeters(u8).
    • +
    +
  • +
  • newtype_variant +
      +
    • For example the E::N in enum E { N(u8) }.
    • +
    +
  • +
  • seq +
      +
    • A variably sized heterogeneous sequence of values, for example +Vec<T> or HashSet<T>. When serializing, the length may or may not +be known before iterating through all the data. When deserializing, +the length is determined by looking at the serialized data.
    • +
    +
  • +
  • tuple +
      +
    • A statically sized heterogeneous sequence of values for which the +length will be known at deserialization time without looking at the +serialized data, for example (u8,) or (String, u64, Vec<T>) or +[u64; 10].
    • +
    +
  • +
  • tuple_struct +
      +
    • A named tuple, for example struct Rgb(u8, u8, u8).
    • +
    +
  • +
  • tuple_variant +
      +
    • For example the E::T in enum E { T(u8, u8) }.
    • +
    +
  • +
  • map +
      +
    • A heterogeneous key-value pairing, for example BTreeMap<K, V>.
    • +
    +
  • +
  • struct +
      +
    • A heterogeneous key-value pairing in which the keys are strings and +will be known at deserialization time without looking at the +serialized data, for example struct S { r: u8, g: u8, b: u8 }.
    • +
    +
  • +
  • struct_variant +
      +
    • For example the E::S in enum E { S { r: u8, g: u8, b: u8 } }.
    • +
    +
  • +
+

Many Serde serializers produce text or binary data as output, for example +JSON or Bincode. This is not a requirement of the Serializer trait, and +there are serializers that do not produce text or binary output. One example +is the serde_json::value::Serializer (distinct from the main serde_json +serializer) that produces a serde_json::Value data structure in memory as +output.

+

Example implementation

+

The example data format presented on the website contains example code for +a basic JSON Serializer.

+
+

Associated Types

type Ok

The output type produced by this Serializer during successful +serialization. Most serializers that produce text or binary output +should set Ok = () and serialize into an io::Write or buffer +contained within the Serializer instance. Serializers that build +in-memory data structures may be simplified by using Ok to propagate +the data structure around.

+

type Error: Error

The error type when some error occurs during serialization.

+

type SerializeSeq: SerializeSeq<Ok = Self::Ok, Error = Self::Error>

Type returned from serialize_seq for serializing the content of the +sequence.

+

type SerializeTuple: SerializeTuple<Ok = Self::Ok, Error = Self::Error>

Type returned from serialize_tuple for serializing the content of +the tuple.

+

type SerializeTupleStruct: SerializeTupleStruct<Ok = Self::Ok, Error = Self::Error>

Type returned from serialize_tuple_struct for serializing the +content of the tuple struct.

+

type SerializeTupleVariant: SerializeTupleVariant<Ok = Self::Ok, Error = Self::Error>

Type returned from serialize_tuple_variant for serializing the +content of the tuple variant.

+

type SerializeMap: SerializeMap<Ok = Self::Ok, Error = Self::Error>

Type returned from serialize_map for serializing the content of the +map.

+

type SerializeStruct: SerializeStruct<Ok = Self::Ok, Error = Self::Error>

Type returned from serialize_struct for serializing the content of +the struct.

+

type SerializeStructVariant: SerializeStructVariant<Ok = Self::Ok, Error = Self::Error>

Type returned from serialize_struct_variant for serializing the +content of the struct variant.

+
Loading content... +

Required methods

fn serialize_bool(self, v: bool) -> Result<Self::Ok, Self::Error>

Serialize a bool value.

+ +
This code runs with edition 2018
+impl Serialize for bool {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_bool(*self)
+    }
+}
+

fn serialize_i8(self, v: i8) -> Result<Self::Ok, Self::Error>

Serialize an i8 value.

+

If the format does not differentiate between i8 and i64, a +reasonable implementation would be to cast the value to i64 and +forward to serialize_i64.

+ +
This code runs with edition 2018
+impl Serialize for i8 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_i8(*self)
+    }
+}
+

fn serialize_i16(self, v: i16) -> Result<Self::Ok, Self::Error>

Serialize an i16 value.

+

If the format does not differentiate between i16 and i64, a +reasonable implementation would be to cast the value to i64 and +forward to serialize_i64.

+ +
This code runs with edition 2018
+impl Serialize for i16 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_i16(*self)
+    }
+}
+

fn serialize_i32(self, v: i32) -> Result<Self::Ok, Self::Error>

Serialize an i32 value.

+

If the format does not differentiate between i32 and i64, a +reasonable implementation would be to cast the value to i64 and +forward to serialize_i64.

+ +
This code runs with edition 2018
+impl Serialize for i32 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_i32(*self)
+    }
+}
+

fn serialize_i64(self, v: i64) -> Result<Self::Ok, Self::Error>

Serialize an i64 value.

+ +
This code runs with edition 2018
+impl Serialize for i64 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_i64(*self)
+    }
+}
+

fn serialize_u8(self, v: u8) -> Result<Self::Ok, Self::Error>

Serialize a u8 value.

+

If the format does not differentiate between u8 and u64, a +reasonable implementation would be to cast the value to u64 and +forward to serialize_u64.

+ +
This code runs with edition 2018
+impl Serialize for u8 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_u8(*self)
+    }
+}
+

fn serialize_u16(self, v: u16) -> Result<Self::Ok, Self::Error>

Serialize a u16 value.

+

If the format does not differentiate between u16 and u64, a +reasonable implementation would be to cast the value to u64 and +forward to serialize_u64.

+ +
This code runs with edition 2018
+impl Serialize for u16 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_u16(*self)
+    }
+}
+

fn serialize_u32(self, v: u32) -> Result<Self::Ok, Self::Error>

Serialize a u32 value.

+

If the format does not differentiate between u32 and u64, a +reasonable implementation would be to cast the value to u64 and +forward to serialize_u64.

+ +
This code runs with edition 2018
+impl Serialize for u32 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_u32(*self)
+    }
+}
+

fn serialize_u64(self, v: u64) -> Result<Self::Ok, Self::Error>

Serialize a u64 value.

+ +
This code runs with edition 2018
+impl Serialize for u64 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_u64(*self)
+    }
+}
+

fn serialize_f32(self, v: f32) -> Result<Self::Ok, Self::Error>

Serialize an f32 value.

+

If the format does not differentiate between f32 and f64, a +reasonable implementation would be to cast the value to f64 and +forward to serialize_f64.

+ +
This code runs with edition 2018
+impl Serialize for f32 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_f32(*self)
+    }
+}
+

fn serialize_f64(self, v: f64) -> Result<Self::Ok, Self::Error>

Serialize an f64 value.

+ +
This code runs with edition 2018
+impl Serialize for f64 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_f64(*self)
+    }
+}
+

fn serialize_char(self, v: char) -> Result<Self::Ok, Self::Error>

Serialize a character.

+

If the format does not support characters, it is reasonable to serialize +it as a single element str or a u32.

+ +
This code runs with edition 2018
+impl Serialize for char {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_char(*self)
+    }
+}
+

fn serialize_str(self, v: &str) -> Result<Self::Ok, Self::Error>

Serialize a &str.

+ +
This code runs with edition 2018
+impl Serialize for str {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_str(self)
+    }
+}
+

fn serialize_bytes(self, v: &[u8]) -> Result<Self::Ok, Self::Error>

Serialize a chunk of raw byte data.

+

Enables serializers to serialize byte slices more compactly or more +efficiently than other types of slices. If no efficient implementation +is available, a reasonable implementation would be to forward to +serialize_seq. If forwarded, the implementation looks usually just +like this:

+ +
This code runs with edition 2018
+fn serialize_bytes(self, v: &[u8]) -> Result<Self::Ok, Self::Error> {
+    let mut seq = self.serialize_seq(Some(v.len()))?;
+    for b in v {
+        seq.serialize_element(b)?;
+    }
+    seq.end()
+}
+

fn serialize_none(self) -> Result<Self::Ok, Self::Error>

Serialize a None value.

+ +
This code runs with edition 2018
+impl<T> Serialize for Option<T>
+where
+    T: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            Some(ref value) => serializer.serialize_some(value),
+            None => serializer.serialize_none(),
+        }
+    }
+}
+

fn serialize_some<T: ?Sized>(self, value: &T) -> Result<Self::Ok, Self::Error> where
    T: Serialize

Serialize a Some(T) value.

+ +
This code runs with edition 2018
+impl<T> Serialize for Option<T>
+where
+    T: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            Some(ref value) => serializer.serialize_some(value),
+            None => serializer.serialize_none(),
+        }
+    }
+}
+

fn serialize_unit(self) -> Result<Self::Ok, Self::Error>

Serialize a () value.

+ +
This code runs with edition 2018
+impl Serialize for () {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_unit()
+    }
+}
+

fn serialize_unit_struct(
    self,
    name: &'static str
) -> Result<Self::Ok, Self::Error>

Serialize a unit struct like struct Unit or PhantomData<T>.

+

A reasonable implementation would be to forward to serialize_unit.

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+
+struct Nothing;
+
+impl Serialize for Nothing {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_unit_struct("Nothing")
+    }
+}
+

fn serialize_unit_variant(
    self,
    name: &'static str,
    variant_index: u32,
    variant: &'static str
) -> Result<Self::Ok, Self::Error>

Serialize a unit variant like E::A in enum E { A, B }.

+

The name is the name of the enum, the variant_index is the index of +this variant within the enum, and the variant is the name of the +variant.

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+
+enum E {
+    A,
+    B,
+}
+
+impl Serialize for E {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            E::A => serializer.serialize_unit_variant("E", 0, "A"),
+            E::B => serializer.serialize_unit_variant("E", 1, "B"),
+        }
+    }
+}
+

fn serialize_newtype_struct<T: ?Sized>(
    self,
    name: &'static str,
    value: &T
) -> Result<Self::Ok, Self::Error> where
    T: Serialize

Serialize a newtype struct like struct Millimeters(u8).

+

Serializers are encouraged to treat newtype structs as insignificant +wrappers around the data they contain. A reasonable implementation would +be to forward to value.serialize(self).

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+
+struct Millimeters(u8);
+
+impl Serialize for Millimeters {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_newtype_struct("Millimeters", &self.0)
+    }
+}
+

fn serialize_newtype_variant<T: ?Sized>(
    self,
    name: &'static str,
    variant_index: u32,
    variant: &'static str,
    value: &T
) -> Result<Self::Ok, Self::Error> where
    T: Serialize

Serialize a newtype variant like E::N in enum E { N(u8) }.

+

The name is the name of the enum, the variant_index is the index of +this variant within the enum, and the variant is the name of the +variant. The value is the data contained within this newtype variant.

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+
+enum E {
+    M(String),
+    N(u8),
+}
+
+impl Serialize for E {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            E::M(ref s) => serializer.serialize_newtype_variant("E", 0, "M", s),
+            E::N(n) => serializer.serialize_newtype_variant("E", 1, "N", &n),
+        }
+    }
+}
+

fn serialize_seq(
    self,
    len: Option<usize>
) -> Result<Self::SerializeSeq, Self::Error>

Begin to serialize a variably sized sequence. This call must be +followed by zero or more calls to serialize_element, then a call to +end.

+

The argument is the number of elements in the sequence, which may or may +not be computable before the sequence is iterated. Some serializers only +support sequences whose length is known up front.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, Serializer, SerializeSeq};
+
+impl<T> Serialize for Vec<T>
+where
+    T: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut seq = serializer.serialize_seq(Some(self.len()))?;
+        for element in self {
+            seq.serialize_element(element)?;
+        }
+        seq.end()
+    }
+}
+

fn serialize_tuple(
    self,
    len: usize
) -> Result<Self::SerializeTuple, Self::Error>

Begin to serialize a statically sized sequence whose length will be +known at deserialization time without looking at the serialized data. +This call must be followed by zero or more calls to serialize_element, +then a call to end.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, Serializer, SerializeTuple};
+
+impl<A, B, C> Serialize for (A, B, C)
+where
+    A: Serialize,
+    B: Serialize,
+    C: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut tup = serializer.serialize_tuple(3)?;
+        tup.serialize_element(&self.0)?;
+        tup.serialize_element(&self.1)?;
+        tup.serialize_element(&self.2)?;
+        tup.end()
+    }
+}
+ +
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeTuple, Serializer};
+
+const VRAM_SIZE: usize = 386;
+struct Vram([u16; VRAM_SIZE]);
+
+impl Serialize for Vram {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut seq = serializer.serialize_tuple(VRAM_SIZE)?;
+        for element in &self.0[..] {
+            seq.serialize_element(element)?;
+        }
+        seq.end()
+    }
+}
+

fn serialize_tuple_struct(
    self,
    name: &'static str,
    len: usize
) -> Result<Self::SerializeTupleStruct, Self::Error>

Begin to serialize a tuple struct like struct Rgb(u8, u8, u8). This +call must be followed by zero or more calls to serialize_field, then a +call to end.

+

The name is the name of the tuple struct and the len is the number +of data fields that will be serialized.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeTupleStruct, Serializer};
+
+struct Rgb(u8, u8, u8);
+
+impl Serialize for Rgb {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?;
+        ts.serialize_field(&self.0)?;
+        ts.serialize_field(&self.1)?;
+        ts.serialize_field(&self.2)?;
+        ts.end()
+    }
+}
+

fn serialize_tuple_variant(
    self,
    name: &'static str,
    variant_index: u32,
    variant: &'static str,
    len: usize
) -> Result<Self::SerializeTupleVariant, Self::Error>

Begin to serialize a tuple variant like E::T in enum E { T(u8, u8) }. This call must be followed by zero or more calls to +serialize_field, then a call to end.

+

The name is the name of the enum, the variant_index is the index of +this variant within the enum, the variant is the name of the variant, +and the len is the number of data fields that will be serialized.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeTupleVariant, Serializer};
+
+enum E {
+    T(u8, u8),
+    U(String, u32, u32),
+}
+
+impl Serialize for E {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            E::T(ref a, ref b) => {
+                let mut tv = serializer.serialize_tuple_variant("E", 0, "T", 2)?;
+                tv.serialize_field(a)?;
+                tv.serialize_field(b)?;
+                tv.end()
+            }
+            E::U(ref a, ref b, ref c) => {
+                let mut tv = serializer.serialize_tuple_variant("E", 1, "U", 3)?;
+                tv.serialize_field(a)?;
+                tv.serialize_field(b)?;
+                tv.serialize_field(c)?;
+                tv.end()
+            }
+        }
+    }
+}
+

fn serialize_map(
    self,
    len: Option<usize>
) -> Result<Self::SerializeMap, Self::Error>

Begin to serialize a map. This call must be followed by zero or more +calls to serialize_key and serialize_value, then a call to end.

+

The argument is the number of elements in the map, which may or may not +be computable before the map is iterated. Some serializers only support +maps whose length is known up front.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, Serializer, SerializeMap};
+
+impl<K, V> Serialize for HashMap<K, V>
+where
+    K: Serialize,
+    V: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut map = serializer.serialize_map(Some(self.len()))?;
+        for (k, v) in self {
+            map.serialize_entry(k, v)?;
+        }
+        map.end()
+    }
+}
+

fn serialize_struct(
    self,
    name: &'static str,
    len: usize
) -> Result<Self::SerializeStruct, Self::Error>

Begin to serialize a struct like struct Rgb { r: u8, g: u8, b: u8 }. +This call must be followed by zero or more calls to serialize_field, +then a call to end.

+

The name is the name of the struct and the len is the number of +data fields that will be serialized.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeStruct, Serializer};
+
+struct Rgb {
+    r: u8,
+    g: u8,
+    b: u8,
+}
+
+impl Serialize for Rgb {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let mut rgb = serializer.serialize_struct("Rgb", 3)?;
+        rgb.serialize_field("r", &self.r)?;
+        rgb.serialize_field("g", &self.g)?;
+        rgb.serialize_field("b", &self.b)?;
+        rgb.end()
+    }
+}
+

fn serialize_struct_variant(
    self,
    name: &'static str,
    variant_index: u32,
    variant: &'static str,
    len: usize
) -> Result<Self::SerializeStructVariant, Self::Error>

Begin to serialize a struct variant like E::S in enum E { S { r: u8, g: u8, b: u8 } }. This call must be followed by zero or more calls to +serialize_field, then a call to end.

+

The name is the name of the enum, the variant_index is the index of +this variant within the enum, the variant is the name of the variant, +and the len is the number of data fields that will be serialized.

+ +
This code runs with edition 2018
+use serde::ser::{Serialize, SerializeStructVariant, Serializer};
+
+enum E {
+    S { r: u8, g: u8, b: u8 },
+}
+
+impl Serialize for E {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            E::S {
+                ref r,
+                ref g,
+                ref b,
+            } => {
+                let mut sv = serializer.serialize_struct_variant("E", 0, "S", 3)?;
+                sv.serialize_field("r", r)?;
+                sv.serialize_field("g", g)?;
+                sv.serialize_field("b", b)?;
+                sv.end()
+            }
+        }
+    }
+}
+
Loading content... +

Provided methods

fn serialize_i128(self, v: i128) -> Result<Self::Ok, Self::Error>

Serialize an i128 value.

+ +
This code runs with edition 2018
+impl Serialize for i128 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_i128(*self)
+    }
+}
+

This method is available only on Rust compiler versions >=1.26. The +default behavior unconditionally returns an error.

+

fn serialize_u128(self, v: u128) -> Result<Self::Ok, Self::Error>

Serialize a u128 value.

+ +
This code runs with edition 2018
+impl Serialize for u128 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_u128(*self)
+    }
+}
+

This method is available only on Rust compiler versions >=1.26. The +default behavior unconditionally returns an error.

+

fn collect_seq<I>(self, iter: I) -> Result<Self::Ok, Self::Error> where
    I: IntoIterator,
    <I as IntoIterator>::Item: Serialize

Collect an iterator as a sequence.

+

The default implementation serializes each item yielded by the iterator +using serialize_seq. Implementors should not need to override this +method.

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+
+struct SecretlyOneHigher {
+    data: Vec<i32>,
+}
+
+impl Serialize for SecretlyOneHigher {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.collect_seq(self.data.iter().map(|x| x + 1))
+    }
+}
+

fn collect_map<K, V, I>(self, iter: I) -> Result<Self::Ok, Self::Error> where
    K: Serialize,
    V: Serialize,
    I: IntoIterator<Item = (K, V)>, 

Collect an iterator as a map.

+

The default implementation serializes each pair yielded by the iterator +using serialize_map. Implementors should not need to override this +method.

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+use std::collections::BTreeSet;
+
+struct MapToUnit {
+    keys: BTreeSet<i32>,
+}
+
+// Serializes as a map in which the values are all unit.
+impl Serialize for MapToUnit {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.collect_map(self.keys.iter().map(|k| (k, ())))
+    }
+}
+

fn collect_str<T: ?Sized>(self, value: &T) -> Result<Self::Ok, Self::Error> where
    T: Display

Serialize a string produced by an implementation of Display.

+

The default implementation builds a heap-allocated String and +delegates to serialize_str. Serializers are encouraged to provide a +more efficient implementation if possible.

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+
+impl Serialize for DateTime {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.collect_str(&format_args!("{:?}{:?}",
+                                             self.naive_local(),
+                                             self.offset()))
+    }
+}
+

fn is_human_readable(&self) -> bool

Determine whether Serialize implementations should serialize in +human-readable form.

+

Some types have a human-readable form that may be somewhat expensive to +construct, as well as a binary form that is compact and efficient. +Generally text-based formats like JSON and YAML will prefer to use the +human-readable one and binary formats like Bincode will prefer the +compact one.

+ +
This code runs with edition 2018
+use serde::{Serialize, Serializer};
+
+impl Serialize for Timestamp {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        if serializer.is_human_readable() {
+            // Serialize to a human-readable string "2015-05-15T17:01:00Z".
+            self.to_string().serialize(serializer)
+        } else {
+            // Serialize to a compact binary representation.
+            self.seconds_since_epoch().serialize(serializer)
+        }
+    }
+}
+

The default implementation of this method returns true. Data formats +may override this to false to request a compact form for types that +support one. Note that modifying this method to change a format from +human-readable to compact or vice versa should be regarded as a breaking +change, as a value serialized in human-readable mode is not required to +deserialize from the same data in compact mode.

+
Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/serde_derive/all.html b/serde_derive/all.html new file mode 100644 index 0000000..60b36f5 --- /dev/null +++ b/serde_derive/all.html @@ -0,0 +1,3 @@ +List of all items in this crate

[] + + List of all items

Derive Macros

\ No newline at end of file diff --git a/serde_derive/derive.Deserialize.html b/serde_derive/derive.Deserialize.html new file mode 100644 index 0000000..cc6af09 --- /dev/null +++ b/serde_derive/derive.Deserialize.html @@ -0,0 +1,5 @@ +serde_derive::Deserialize - Rust

[][src]Derive Macro serde_derive::Deserialize

#[derive(Deserialize)]
+{
+    // Attributes available to this derive:
+    #[serde]
+}
\ No newline at end of file diff --git a/serde_derive/derive.Serialize.html b/serde_derive/derive.Serialize.html new file mode 100644 index 0000000..e84ffb2 --- /dev/null +++ b/serde_derive/derive.Serialize.html @@ -0,0 +1,5 @@ +serde_derive::Serialize - Rust

[][src]Derive Macro serde_derive::Serialize

#[derive(Serialize)]
+{
+    // Attributes available to this derive:
+    #[serde]
+}
\ No newline at end of file diff --git a/serde_derive/index.html b/serde_derive/index.html new file mode 100644 index 0000000..8b12c44 --- /dev/null +++ b/serde_derive/index.html @@ -0,0 +1,7 @@ +serde_derive - Rust

[][src]Crate serde_derive

This crate provides Serde's two derive macros.

+ +
This code runs with edition 2018
+#[derive(Serialize, Deserialize)]
+

Please refer to https://serde.rs/derive.html for how to set this up.

+

Derive Macros

+
Deserialize
Serialize
\ No newline at end of file diff --git a/serde_derive/sidebar-items.js b/serde_derive/sidebar-items.js new file mode 100644 index 0000000..986ba20 --- /dev/null +++ b/serde_derive/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"derive":[["Deserialize",""],["Serialize",""]]}); \ No newline at end of file diff --git a/settings.css b/settings.css new file mode 100644 index 0000000..6ce7665 --- /dev/null +++ b/settings.css @@ -0,0 +1 @@ +.setting-line{padding:5px;position:relative;}.setting-line>div{max-width:calc(100% - 74px);display:inline-block;vertical-align:top;font-size:17px;padding-top:2px;}.setting-line>.title{font-size:19px;width:100%;max-width:none;border-bottom:1px solid;}.toggle{position:relative;display:inline-block;width:45px;height:27px;margin-right:20px;}.toggle input{display:none;}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.3s;transition:.3s;}.slider:before{position:absolute;content:"";height:19px;width:19px;left:4px;bottom:4px;background-color:white;-webkit-transition:.3s;transition:.3s;}input:checked+.slider{background-color:#2196F3;}input:focus+.slider{box-shadow:0 0 1px #2196F3;}input:checked+.slider:before{-webkit-transform:translateX(19px);-ms-transform:translateX(19px);transform:translateX(19px);}.setting-line>.sub-settings{padding-left:42px;width:100%;display:block;} \ No newline at end of file diff --git a/settings.html b/settings.html new file mode 100644 index 0000000..0316add --- /dev/null +++ b/settings.html @@ -0,0 +1,2 @@ +Rustdoc settings

Rustdoc settings

Auto-hide item declarations
Auto-hide structs declaration
Auto-hide enums declaration
Auto-hide unions declaration
Auto-hide traits declaration
Auto-hide macros declaration
+
Auto-hide item attributes.
Auto-hide item methods' documentation
Auto-hide trait implementations documentation
Directly go to item in search if there is only one result
Show line numbers on code examples
Disable keyboard shortcuts
\ No newline at end of file diff --git a/settings.js b/settings.js new file mode 100644 index 0000000..9930309 --- /dev/null +++ b/settings.js @@ -0,0 +1 @@ +(function(){function changeSetting(settingName,isEnabled){updateLocalStorage('rustdoc-'+settingName,isEnabled)}function getSettingValue(settingName){return getCurrentValue('rustdoc-'+settingName)}function setEvents(){var elems=document.getElementsByClassName("slider");if(!elems||elems.length===0){return}for(var i=0;i"){sidebar.style.left="";this.style.left="";child.innerText="<";updateLocalStorage("rustdoc-source-sidebar-show","true")}else{sidebar.style.left="-300px";this.style.left="0";child.innerText=">";updateLocalStorage("rustdoc-source-sidebar-show","false")}}function createSidebarToggle(){var sidebarToggle=document.createElement("div");sidebarToggle.id="sidebar-toggle";sidebarToggle.onclick=toggleSidebar;var inner1=document.createElement("div");inner1.style.position="relative";var inner2=document.createElement("div");inner2.style.paddingTop="3px";if(getCurrentValue("rustdoc-source-sidebar-show")==="true"){inner2.innerText="<"}else{inner2.innerText=">";sidebarToggle.style.left="0"}inner1.appendChild(inner2);sidebarToggle.appendChild(inner1);return sidebarToggle}function createSourceSidebar(){if(window.rootPath.endsWith("/")===false){window.rootPath+="/"}var main=document.getElementById("main");var sidebarToggle=createSidebarToggle();main.insertBefore(sidebarToggle,main.firstChild);var sidebar=document.createElement("div");sidebar.id="source-sidebar";if(getCurrentValue("rustdoc-source-sidebar-show")!=="true"){sidebar.style.left="-300px"}var currentFile=getCurrentFilePath();var hasFoundFile=false;var title=document.createElement("div");title.className="title";title.innerText="Files";sidebar.appendChild(title);Object.keys(sourcesIndex).forEach(function(key){sourcesIndex[key].name=key;hasFoundFile=createDirEntry(sourcesIndex[key],sidebar,"",currentFile,hasFoundFile)});main.insertBefore(sidebar,main.firstChild)} \ No newline at end of file diff --git a/src/arrayref/lib.rs.html b/src/arrayref/lib.rs.html new file mode 100644 index 0000000..ddc51d7 --- /dev/null +++ b/src/arrayref/lib.rs.html @@ -0,0 +1,947 @@ +lib.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+
+//! This package contains just four macros, which enable the creation
+//! of array references to portions of arrays or slices (or things
+//! that can be sliced).
+//!
+//! # Examples
+//!
+//! Here is a simple example of slicing and dicing a slice into array
+//! references with these macros.  Here we implement a simple
+//! little-endian conversion from bytes to `u16`, and demonstrate code
+//! that uses `array_ref!` to extract an array reference from a larger
+//! array.  Note that the documentation for each macro also has an
+//! example of its use.
+//!
+//! ```
+//! #[macro_use]
+//! extern crate arrayref;
+//!
+//! fn read_u16(bytes: &[u8; 2]) -> u16 {
+//!      bytes[0] as u16 + ((bytes[1] as u16) << 8)
+//! }
+//! // ...
+//! # fn main() {
+//! let data = [0,1,2,3,4,0,6,7,8,9];
+//! assert_eq!(256, read_u16(array_ref![data,0,2]));
+//! assert_eq!(4, read_u16(array_ref![data,4,2]));
+//! # }
+//! ```
+#![deny(warnings)]
+#![no_std]
+
+#[cfg(test)]
+#[macro_use]
+extern crate std;
+
+/// You can use `array_ref` to generate an array reference to a subset
+/// of a sliceable bit of data (which could be an array, or a slice,
+/// or a Vec).
+///
+/// **Panics** if the slice is out of bounds.
+///
+/// ```
+/// #[macro_use]
+/// extern crate arrayref;
+///
+/// fn read_u16(bytes: &[u8; 2]) -> u16 {
+///      bytes[0] as u16 + ((bytes[1] as u16) << 8)
+/// }
+/// // ...
+/// # fn main() {
+/// let data = [0,1,2,3,4,0,6,7,8,9];
+/// assert_eq!(256, read_u16(array_ref![data,0,2]));
+/// assert_eq!(4, read_u16(array_ref![data,4,2]));
+/// # }
+/// ```
+
+#[macro_export]
+macro_rules! array_ref {
+    ($arr:expr, $offset:expr, $len:expr) => {{
+        {
+            #[inline]
+            unsafe fn as_array<T>(slice: &[T]) -> &[T; $len] {
+                &*(slice.as_ptr() as *const [_; $len])
+            }
+            let offset = $offset;
+            let slice = & $arr[offset..offset + $len];
+            #[allow(unused_unsafe)]
+            unsafe {
+                as_array(slice)
+            }
+        }
+    }}
+}
+
+/// You can use `array_refs` to generate a series of array references
+/// to an input array reference.  The idea is if you want to break an
+/// array into a series of contiguous and non-overlapping arrays.
+/// `array_refs` is a bit funny in that it insists on slicing up the
+/// *entire* array.  This is intentional, as I find it handy to make
+/// me ensure that my sub-arrays add up to the entire array.  This
+/// macro will *never* panic, since the sizes are all checked at
+/// compile time.
+///
+/// Note that unlike `array_ref!`, `array_refs` *requires* that the
+/// first argument be an array reference.  The following arguments are
+/// the lengths of each subarray you wish a reference to.  The total
+/// of these arguments *must* equal the size of the array itself.
+///
+/// ```
+/// #[macro_use]
+/// extern crate arrayref;
+///
+/// fn read_u16(bytes: &[u8; 2]) -> u16 {
+///      bytes[0] as u16 + ((bytes[1] as u16) << 8)
+/// }
+/// // ...
+/// # fn main() {
+/// let data = [0,1,2,3,4,0,6,7];
+/// let (a,b,c) = array_refs![&data,2,2,4];
+/// assert_eq!(read_u16(a), 256);
+/// assert_eq!(read_u16(b), 3*256+2);
+/// assert_eq!(*c, [4,0,6,7]);
+/// # }
+/// ```
+#[macro_export]
+macro_rules! array_refs {
+    ( $arr:expr, $( $pre:expr ),* ; .. ;  $( $post:expr ),* ) => {{
+        {
+            use std::slice;
+            #[inline]
+            #[allow(unused_assignments)]
+            unsafe fn as_arrays<T>(a: &[T]) -> ( $( &[T; $pre], )* &[T],  $( &[T; $post], )*) {
+                let min_len = $( $pre + )* $( $post + )* 0;
+                let var_len = a.len() - min_len;
+                assert!(a.len() >= min_len);
+                let mut p = a.as_ptr();
+                ( $( {
+                    let aref = & *(p as *const [T; $pre]);
+                    p = p.offset($pre as isize);
+                    aref
+                } ),* , {
+                    let sl = slice::from_raw_parts(p as *const T, var_len);
+                    p = p.offset(var_len as isize);
+                    sl
+                }, $( {
+                    let aref = & *(p as *const [T; $post]);
+                    p = p.offset($post as isize);
+                    aref
+                } ),*)
+            }
+            let input = $arr;
+            #[allow(unused_unsafe)]
+            unsafe {
+                as_arrays(input)
+            }
+        }
+    }};
+    ( $arr:expr, $( $len:expr ),* ) => {{
+        {
+            #[inline]
+            #[allow(unused_assignments)]
+            unsafe fn as_arrays<T>(a: &[T; $( $len + )* 0 ]) -> ( $( &[T; $len], )* ) {
+                let mut p = a.as_ptr();
+                ( $( {
+                    let aref = &*(p as *const [T; $len]);
+                    p = p.offset($len as isize);
+                    aref
+                } ),* )
+            }
+            let input = $arr;
+            #[allow(unused_unsafe)]
+            unsafe {
+                as_arrays(input)
+            }
+        }
+    }}
+}
+
+
+/// You can use `mut_array_refs` to generate a series of mutable array
+/// references to an input mutable array reference.  The idea is if
+/// you want to break an array into a series of contiguous and
+/// non-overlapping mutable array references.  Like `array_refs!`,
+/// `mut_array_refs!` is a bit funny in that it insists on slicing up
+/// the *entire* array.  This is intentional, as I find it handy to
+/// make me ensure that my sub-arrays add up to the entire array.
+/// This macro will *never* panic, since the sizes are all checked at
+/// compile time.
+///
+/// Note that unlike `array_mut_ref!`, `mut_array_refs` *requires*
+/// that the first argument be a mutable array reference.  The
+/// following arguments are the lengths of each subarray you wish a
+/// reference to.  The total of these arguments *must* equal the size
+/// of the array itself.  Also note that this macro allows you to take
+/// out multiple mutable references to a single object, which is both
+/// weird and powerful.
+///
+/// ```
+/// #[macro_use]
+/// extern crate arrayref;
+///
+/// fn write_u16(bytes: &mut [u8; 2], num: u16) {
+///      bytes[0] = num as u8;
+///      bytes[1] = (num >> 8) as u8;
+/// }
+/// fn write_u32(bytes: &mut [u8; 4], num: u32) {
+///      bytes[0] = num as u8;
+///      bytes[1] = (num >> 8) as u8; // this is buggy to save space...
+/// }
+/// // ...
+/// # fn main() {
+/// let mut data = [0,1,2,3,4,0,6,7];
+/// let (a,b,c) = mut_array_refs![&mut data,2,2,4];
+/// // let's write out some nice prime numbers!
+/// write_u16(a, 37);
+/// write_u16(b, 73);
+/// write_u32(c, 137); // approximate inverse of the fine structure constant!
+/// # }
+/// ```
+#[macro_export]
+macro_rules! mut_array_refs {
+    ( $arr:expr, $( $pre:expr ),* ; .. ;  $( $post:expr ),* ) => {{
+        {
+            use std::slice;
+            #[inline]
+            #[allow(unused_assignments)]
+            unsafe fn as_arrays<T>(a: &mut [T]) -> ( $( &mut [T; $pre], )* &mut [T],  $( &mut [T; $post], )*) {
+                let min_len = $( $pre + )* $( $post + )* 0;
+                let var_len = a.len() - min_len;
+                assert!(a.len() >= min_len);
+                let mut p = a.as_mut_ptr();
+                ( $( {
+                    let aref = &mut *(p as *mut [T; $pre]);
+                    p = p.offset($pre as isize);
+                    aref
+                } ),* , {
+                    let sl = slice::from_raw_parts_mut(p as *mut T, var_len);
+                    p = p.offset(var_len as isize);
+                    sl
+                }, $( {
+                    let aref = &mut *(p as *mut [T; $post]);
+                    p = p.offset($post as isize);
+                    aref
+                } ),*)
+            }
+            let input = $arr;
+            #[allow(unused_unsafe)]
+            unsafe {
+                as_arrays(input)
+            }
+        }
+    }};
+    ( $arr:expr, $( $len:expr ),* ) => {{
+        {
+            #[inline]
+            #[allow(unused_assignments)]
+            unsafe fn as_arrays<T>(a: &mut [T; $( $len + )* 0 ]) -> ( $( &mut [T; $len], )* ) {
+                let mut p = a.as_mut_ptr();
+                ( $( {
+                    let aref = &mut *(p as *mut [T; $len]);
+                    p = p.offset($len as isize);
+                    aref
+                } ),* )
+            }
+            let input = $arr;
+            #[allow(unused_unsafe)]
+            unsafe {
+                as_arrays(input)
+            }
+        }
+    }};
+}
+
+/// You can use `array_mut_ref` to generate a mutable array reference
+/// to a subset of a sliceable bit of data (which could be an array,
+/// or a slice, or a Vec).
+///
+/// **Panics** if the slice is out of bounds.
+///
+/// ```
+/// #[macro_use]
+/// extern crate arrayref;
+///
+/// fn write_u16(bytes: &mut [u8; 2], num: u16) {
+///      bytes[0] = num as u8;
+///      bytes[1] = (num >> 8) as u8;
+/// }
+/// // ...
+/// # fn main() {
+/// let mut data = [0,1,2,3,4,0,6,7,8,9];
+/// write_u16(array_mut_ref![data,0,2], 1);
+/// write_u16(array_mut_ref![data,2,2], 5);
+/// assert_eq!(*array_ref![data,0,4], [1,0,5,0]);
+/// *array_mut_ref![data,4,5] = [4,3,2,1,0];
+/// assert_eq!(data, [1,0,5,0,4,3,2,1,0,9]);
+/// # }
+/// ```
+#[macro_export]
+macro_rules! array_mut_ref {
+    ($arr:expr, $offset:expr, $len:expr) => {{
+        {
+            #[inline]
+            unsafe fn as_array<T>(slice: &mut [T]) -> &mut [T; $len] {
+                &mut *(slice.as_mut_ptr() as *mut [_; $len])
+            }
+            let offset = $offset;
+            let slice = &mut $arr[offset..offset + $len];
+            #[allow(unused_unsafe)]
+            unsafe {
+                as_array(slice)
+            }
+        }
+    }}
+}
+
+
+#[cfg(test)]
+mod test {
+
+extern crate quickcheck;
+
+use std::vec::Vec;
+
+// use super::*;
+
+#[test]
+#[should_panic]
+fn checks_bounds() {
+    let foo: [u8; 11] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
+    let bar = array_ref!(foo, 1, 11);
+    println!("I am checking that I can dereference bar[0] = {}", bar[0]);
+}
+
+#[test]
+fn simple_case_works() {
+    fn check(expected: [u8; 3], actual: &[u8; 3]) {
+        for (e, a) in (&expected).iter().zip(actual.iter()) {
+            assert_eq!(e, a)
+        }
+    }
+    let mut foo: [u8; 11] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
+    {
+        let bar = array_ref!(foo, 2, 3);
+        check([2, 3, 4], bar);
+    }
+    check([0, 1, 2], array_ref!(foo, 0, 3));
+    fn zero2(x: &mut [u8; 2]) {
+        x[0] = 0;
+        x[1] = 0;
+    }
+    zero2(array_mut_ref!(foo, 8, 2));
+    check([0, 0, 10], array_ref!(foo, 8, 3));
+}
+
+
+#[test]
+fn check_array_ref_5() {
+    fn f(data: Vec<u8>, offset: usize) -> quickcheck::TestResult {
+        if data.len() < offset + 5 {
+            return quickcheck::TestResult::discard();
+        }
+        let out = array_ref!(data, offset, 5);
+        quickcheck::TestResult::from_bool(out.len() == 5)
+    }
+    quickcheck::quickcheck(f as fn(Vec<u8>, usize) -> quickcheck::TestResult);
+}
+
+#[test]
+fn check_array_ref_out_of_bounds_5() {
+    fn f(data: Vec<u8>, offset: usize) -> quickcheck::TestResult {
+        if data.len() >= offset + 5 {
+            return quickcheck::TestResult::discard();
+        }
+        quickcheck::TestResult::must_fail(move || {
+            array_ref!(data, offset, 5);
+        })
+    }
+    quickcheck::quickcheck(f as fn(Vec<u8>, usize) -> quickcheck::TestResult);
+}
+
+#[test]
+fn check_array_mut_ref_7() {
+    fn f(mut data: Vec<u8>, offset: usize) -> quickcheck::TestResult {
+        if data.len() < offset + 7 {
+            return quickcheck::TestResult::discard();
+        }
+        let out = array_mut_ref!(data, offset, 7);
+        out[6] = 3;
+        quickcheck::TestResult::from_bool(out.len() == 7)
+    }
+    quickcheck::quickcheck(f as fn(Vec<u8>, usize) -> quickcheck::TestResult);
+}
+
+
+#[test]
+fn check_array_mut_ref_out_of_bounds_32() {
+    fn f(mut data: Vec<u8>, offset: usize) -> quickcheck::TestResult {
+        if data.len() >= offset + 32 {
+            return quickcheck::TestResult::discard();
+        }
+        quickcheck::TestResult::must_fail(move || {
+            array_mut_ref!(data, offset, 32);
+        })
+    }
+    quickcheck::quickcheck(f as fn(Vec<u8>, usize) -> quickcheck::TestResult);
+}
+
+
+#[test]
+fn test_5_array_refs() {
+    let mut data: [usize; 128] = [0; 128];
+    for i in 0..128 {
+        data[i] = i;
+    }
+    let data = data;
+    let (a,b,c,d,e) = array_refs!(&data, 1, 14, 3, 100, 10);
+    assert_eq!(a.len(), 1 as usize);
+    assert_eq!(b.len(), 14 as usize);
+    assert_eq!(c.len(), 3 as usize);
+    assert_eq!(d.len(), 100 as usize);
+    assert_eq!(e.len(), 10 as usize);
+    assert_eq!(a, array_ref![data, 0, 1]);
+    assert_eq!(b, array_ref![data, 1, 14]);
+    assert_eq!(c, array_ref![data, 15, 3]);
+    assert_eq!(e, array_ref![data, 118, 10]);
+}
+
+#[test]
+fn test_5_array_refs_dotdot() {
+    let mut data: [usize; 128] = [0; 128];
+    for i in 0..128 {
+        data[i] = i;
+    }
+    let data = data;
+    let (a,b,c,d,e) = array_refs!(&data, 1, 14, 3; ..; 10);
+    assert_eq!(a.len(), 1 as usize);
+    assert_eq!(b.len(), 14 as usize);
+    assert_eq!(c.len(), 3 as usize);
+    assert_eq!(d.len(), 100 as usize);
+    assert_eq!(e.len(), 10 as usize);
+    assert_eq!(a, array_ref![data, 0, 1]);
+    assert_eq!(b, array_ref![data, 1, 14]);
+    assert_eq!(c, array_ref![data, 15, 3]);
+    assert_eq!(e, array_ref![data, 118, 10]);
+}
+
+
+#[test]
+fn test_5_mut_xarray_refs() {
+    let mut data: [usize; 128] = [0; 128];
+    {
+        // temporarily borrow the data to modify it.
+        let (a,b,c,d,e) = mut_array_refs!(&mut data, 1, 14, 3, 100, 10);
+        assert_eq!(a.len(), 1 as usize);
+        assert_eq!(b.len(), 14 as usize);
+        assert_eq!(c.len(), 3 as usize);
+        assert_eq!(d.len(), 100 as usize);
+        assert_eq!(e.len(), 10 as usize);
+        *a = [1; 1];
+        *b = [14; 14];
+        *c = [3; 3];
+        *d = [100; 100];
+        *e = [10; 10];
+    }
+    assert_eq!(&[1;1], array_ref![data, 0, 1]);
+    assert_eq!(&[14;14], array_ref![data, 1, 14]);
+    assert_eq!(&[3;3], array_ref![data, 15, 3]);
+    assert_eq!(&[10;10], array_ref![data, 118, 10]);
+}
+
+#[test]
+fn test_5_mut_xarray_refs_with_dotdot() {
+    let mut data: [usize; 128] = [0; 128];
+    {
+        // temporarily borrow the data to modify it.
+        let (a,b,c,d,e) = mut_array_refs!(&mut data, 1, 14, 3; ..; 10);
+        assert_eq!(a.len(), 1 as usize);
+        assert_eq!(b.len(), 14 as usize);
+        assert_eq!(c.len(), 3 as usize);
+        assert_eq!(d.len(), 100 as usize);
+        assert_eq!(e.len(), 10 as usize);
+        *a = [1; 1];
+        *b = [14; 14];
+        *c = [3; 3];
+        *e = [10; 10];
+    }
+    assert_eq!(&[1;1], array_ref![data, 0, 1]);
+    assert_eq!(&[14;14], array_ref![data, 1, 14]);
+    assert_eq!(&[3;3], array_ref![data, 15, 3]);
+    assert_eq!(&[10;10], array_ref![data, 118, 10]);
+}
+
+} // mod test
+
+
\ No newline at end of file diff --git a/src/bincode/config.rs.html b/src/bincode/config.rs.html new file mode 100644 index 0000000..b190419 --- /dev/null +++ b/src/bincode/config.rs.html @@ -0,0 +1,731 @@ +config.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+
+use super::internal::{Bounded, Infinite, SizeLimit};
+use byteorder::{BigEndian, ByteOrder, LittleEndian, NativeEndian};
+use de::read::BincodeRead;
+use error::Result;
+use serde;
+use std::io::{Read, Write};
+use std::marker::PhantomData;
+use {DeserializerAcceptor, SerializerAcceptor};
+
+use self::EndianOption::*;
+use self::LimitOption::*;
+
+struct DefaultOptions(Infinite);
+
+pub(crate) trait Options {
+    type Limit: SizeLimit + 'static;
+    type Endian: ByteOrder + 'static;
+
+    fn limit(&mut self) -> &mut Self::Limit;
+}
+
+pub(crate) trait OptionsExt: Options + Sized {
+    fn with_no_limit(self) -> WithOtherLimit<Self, Infinite> {
+        WithOtherLimit::new(self, Infinite)
+    }
+
+    fn with_limit(self, limit: u64) -> WithOtherLimit<Self, Bounded> {
+        WithOtherLimit::new(self, Bounded(limit))
+    }
+
+    fn with_little_endian(self) -> WithOtherEndian<Self, LittleEndian> {
+        WithOtherEndian::new(self)
+    }
+
+    fn with_big_endian(self) -> WithOtherEndian<Self, BigEndian> {
+        WithOtherEndian::new(self)
+    }
+
+    fn with_native_endian(self) -> WithOtherEndian<Self, NativeEndian> {
+        WithOtherEndian::new(self)
+    }
+}
+
+impl<'a, O: Options> Options for &'a mut O {
+    type Limit = O::Limit;
+    type Endian = O::Endian;
+
+    #[inline(always)]
+    fn limit(&mut self) -> &mut Self::Limit {
+        (*self).limit()
+    }
+}
+
+impl<T: Options> OptionsExt for T {}
+
+impl DefaultOptions {
+    fn new() -> DefaultOptions {
+        DefaultOptions(Infinite)
+    }
+}
+
+impl Options for DefaultOptions {
+    type Limit = Infinite;
+    type Endian = LittleEndian;
+
+    #[inline(always)]
+    fn limit(&mut self) -> &mut Infinite {
+        &mut self.0
+    }
+}
+
+#[derive(Clone, Copy)]
+enum LimitOption {
+    Unlimited,
+    Limited(u64),
+}
+
+#[derive(Clone, Copy)]
+enum EndianOption {
+    Big,
+    Little,
+    Native,
+}
+
+/// A configuration builder whose options Bincode will use
+/// while serializing and deserializing.
+///
+/// ### Options
+/// Endianness: The endianness with which multi-byte integers will be read/written.  *default: little endian*
+/// Limit: The maximum number of bytes that will be read/written in a bincode serialize/deserialize. *default: unlimited*
+///
+/// ### Byte Limit Details
+/// The purpose of byte-limiting is to prevent Denial-Of-Service attacks whereby malicious attackers get bincode
+/// deserialization to crash your process by allocating too much memory or keeping a connection open for too long.
+///
+/// When a byte limit is set, bincode will return `Err` on any deserialization that goes over the limit, or any
+/// serialization that goes over the limit.
+#[derive(Clone)]
+pub struct Config {
+    limit: LimitOption,
+    endian: EndianOption,
+}
+
+pub(crate) struct WithOtherLimit<O: Options, L: SizeLimit> {
+    _options: O,
+    pub(crate) new_limit: L,
+}
+
+pub(crate) struct WithOtherEndian<O: Options, E: ByteOrder> {
+    options: O,
+    _endian: PhantomData<E>,
+}
+
+impl<O: Options, L: SizeLimit> WithOtherLimit<O, L> {
+    #[inline(always)]
+    pub(crate) fn new(options: O, limit: L) -> WithOtherLimit<O, L> {
+        WithOtherLimit {
+            _options: options,
+            new_limit: limit,
+        }
+    }
+}
+
+impl<O: Options, E: ByteOrder> WithOtherEndian<O, E> {
+    #[inline(always)]
+    pub(crate) fn new(options: O) -> WithOtherEndian<O, E> {
+        WithOtherEndian {
+            options: options,
+            _endian: PhantomData,
+        }
+    }
+}
+
+impl<O: Options, E: ByteOrder + 'static> Options for WithOtherEndian<O, E> {
+    type Limit = O::Limit;
+    type Endian = E;
+
+    #[inline(always)]
+    fn limit(&mut self) -> &mut O::Limit {
+        self.options.limit()
+    }
+}
+
+impl<O: Options, L: SizeLimit + 'static> Options for WithOtherLimit<O, L> {
+    type Limit = L;
+    type Endian = O::Endian;
+
+    fn limit(&mut self) -> &mut L {
+        &mut self.new_limit
+    }
+}
+
+macro_rules! config_map {
+    ($self:expr, $opts:ident => $call:expr) => {
+        match ($self.limit, $self.endian) {
+            (Unlimited, Little) => {
+                let $opts = DefaultOptions::new().with_no_limit().with_little_endian();
+                $call
+            }
+            (Unlimited, Big) => {
+                let $opts = DefaultOptions::new().with_no_limit().with_big_endian();
+                $call
+            }
+            (Unlimited, Native) => {
+                let $opts = DefaultOptions::new().with_no_limit().with_native_endian();
+                $call
+            }
+
+            (Limited(l), Little) => {
+                let $opts = DefaultOptions::new().with_limit(l).with_little_endian();
+                $call
+            }
+            (Limited(l), Big) => {
+                let $opts = DefaultOptions::new().with_limit(l).with_big_endian();
+                $call
+            }
+            (Limited(l), Native) => {
+                let $opts = DefaultOptions::new().with_limit(l).with_native_endian();
+                $call
+            }
+        }
+    };
+}
+
+impl Config {
+    #[inline(always)]
+    pub(crate) fn new() -> Config {
+        Config {
+            limit: LimitOption::Unlimited,
+            endian: EndianOption::Little,
+        }
+    }
+
+    /// Sets the byte limit to be unlimited.
+    /// This is the default.
+    #[inline(always)]
+    pub fn no_limit(&mut self) -> &mut Self {
+        self.limit = LimitOption::Unlimited;
+        self
+    }
+
+    /// Sets the byte limit to `limit`.
+    #[inline(always)]
+    pub fn limit(&mut self, limit: u64) -> &mut Self {
+        self.limit = LimitOption::Limited(limit);
+        self
+    }
+
+    /// Sets the endianness to little-endian
+    /// This is the default.
+    #[inline(always)]
+    pub fn little_endian(&mut self) -> &mut Self {
+        self.endian = EndianOption::Little;
+        self
+    }
+
+    /// Sets the endianness to big-endian
+    #[inline(always)]
+    pub fn big_endian(&mut self) -> &mut Self {
+        self.endian = EndianOption::Big;
+        self
+    }
+
+    /// Sets the endianness to the the machine-native endianness
+    #[inline(always)]
+    pub fn native_endian(&mut self) -> &mut Self {
+        self.endian = EndianOption::Native;
+        self
+    }
+
+    /// Serializes a serializable object into a `Vec` of bytes using this configuration
+    #[inline(always)]
+    pub fn serialize<T: ?Sized + serde::Serialize>(&self, t: &T) -> Result<Vec<u8>> {
+        config_map!(self, opts => ::internal::serialize(t, opts))
+    }
+
+    /// Returns the size that an object would be if serialized using Bincode with this configuration
+    #[inline(always)]
+    pub fn serialized_size<T: ?Sized + serde::Serialize>(&self, t: &T) -> Result<u64> {
+        config_map!(self, opts => ::internal::serialized_size(t, opts))
+    }
+
+    /// Serializes an object directly into a `Writer` using this configuration
+    ///
+    /// If the serialization would take more bytes than allowed by the size limit, an error
+    /// is returned and *no bytes* will be written into the `Writer`
+    #[inline(always)]
+    pub fn serialize_into<W: Write, T: ?Sized + serde::Serialize>(
+        &self,
+        w: W,
+        t: &T,
+    ) -> Result<()> {
+        config_map!(self, opts => ::internal::serialize_into(w, t, opts))
+    }
+
+    /// Deserializes a slice of bytes into an instance of `T` using this configuration
+    #[inline(always)]
+    pub fn deserialize<'a, T: serde::Deserialize<'a>>(&self, bytes: &'a [u8]) -> Result<T> {
+        config_map!(self, opts => ::internal::deserialize(bytes, opts))
+    }
+
+    /// TODO: document
+    #[doc(hidden)]
+    #[inline(always)]
+    pub fn deserialize_in_place<'a, R, T>(&self, reader: R, place: &mut T) -> Result<()>
+    where
+        R: BincodeRead<'a>,
+        T: serde::de::Deserialize<'a>,
+    {
+        config_map!(self, opts => ::internal::deserialize_in_place(reader, opts, place))
+    }
+
+    /// Deserializes a slice of bytes with state `seed` using this configuration.
+    #[inline(always)]
+    pub fn deserialize_seed<'a, T: serde::de::DeserializeSeed<'a>>(
+        &self,
+        seed: T,
+        bytes: &'a [u8],
+    ) -> Result<T::Value> {
+        config_map!(self, opts => ::internal::deserialize_seed(seed, bytes, opts))
+    }
+
+    /// Deserializes an object directly from a `Read`er using this configuration
+    ///
+    /// If this returns an `Error`, `reader` may be in an invalid state.
+    #[inline(always)]
+    pub fn deserialize_from<R: Read, T: serde::de::DeserializeOwned>(
+        &self,
+        reader: R,
+    ) -> Result<T> {
+        config_map!(self, opts => ::internal::deserialize_from(reader, opts))
+    }
+
+    /// Deserializes an object directly from a `Read`er with state `seed` using this configuration
+    ///
+    /// If this returns an `Error`, `reader` may be in an invalid state.
+    #[inline(always)]
+    pub fn deserialize_from_seed<'a, R: Read, T: serde::de::DeserializeSeed<'a>>(
+        &self,
+        seed: T,
+        reader: R,
+    ) -> Result<T::Value> {
+        config_map!(self, opts => ::internal::deserialize_from_seed(seed, reader, opts))
+    }
+
+    /// Deserializes an object from a custom `BincodeRead`er using the default configuration.
+    /// It is highly recommended to use `deserialize_from` unless you need to implement
+    /// `BincodeRead` for performance reasons.
+    ///
+    /// If this returns an `Error`, `reader` may be in an invalid state.
+    #[inline(always)]
+    pub fn deserialize_from_custom<'a, R: BincodeRead<'a>, T: serde::de::DeserializeOwned>(
+        &self,
+        reader: R,
+    ) -> Result<T> {
+        config_map!(self, opts => ::internal::deserialize_from_custom(reader, opts))
+    }
+
+    /// Deserializes an object from a custom `BincodeRead`er with state `seed` using the default
+    /// configuration. It is highly recommended to use `deserialize_from` unless you need to
+    /// implement `BincodeRead` for performance reasons.
+    ///
+    /// If this returns an `Error`, `reader` may be in an invalid state.
+    #[inline(always)]
+    pub fn deserialize_from_custom_seed<
+        'a,
+        R: BincodeRead<'a>,
+        T: serde::de::DeserializeSeed<'a>,
+    >(
+        &self,
+        seed: T,
+        reader: R,
+    ) -> Result<T::Value> {
+        config_map!(self, opts => ::internal::deserialize_from_custom_seed(seed, reader, opts))
+    }
+
+    /// Executes the acceptor with a serde::Deserializer instance.
+    /// NOT A PART OF THE STABLE PUBLIC API
+    #[doc(hidden)]
+    pub fn with_deserializer<'a, A, R>(&self, reader: R, acceptor: A) -> A::Output
+    where
+        A: DeserializerAcceptor<'a>,
+        R: BincodeRead<'a>,
+    {
+        config_map!(self, opts => {
+            let mut deserializer = ::de::Deserializer::new(reader, opts);
+            acceptor.accept(&mut deserializer)
+        })
+    }
+
+    /// Executes the acceptor with a serde::Serializer instance.
+    /// NOT A PART OF THE STABLE PUBLIC API
+    #[doc(hidden)]
+    pub fn with_serializer<A, W>(&self, writer: W, acceptor: A) -> A::Output
+    where
+        A: SerializerAcceptor,
+        W: Write,
+    {
+        config_map!(self, opts => {
+            let mut serializer = ::ser::Serializer::new(writer, opts);
+            acceptor.accept(&mut serializer)
+        })
+    }
+}
+
+
\ No newline at end of file diff --git a/src/bincode/de/mod.rs.html b/src/bincode/de/mod.rs.html new file mode 100644 index 0000000..f7b0869 --- /dev/null +++ b/src/bincode/de/mod.rs.html @@ -0,0 +1,933 @@ +mod.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+
+use config::Options;
+use std::io::Read;
+
+use self::read::BincodeRead;
+use byteorder::ReadBytesExt;
+use internal::SizeLimit;
+use serde;
+use serde::de::Error as DeError;
+use serde::de::IntoDeserializer;
+use {Error, ErrorKind, Result};
+
+pub mod read;
+
+/// A Deserializer that reads bytes from a buffer.
+///
+/// This struct should rarely be used.
+/// In most cases, prefer the `deserialize_from` function.
+///
+/// The ByteOrder that is chosen will impact the endianness that
+/// is used to read integers out of the reader.
+///
+/// ```ignore
+/// let d = Deserializer::new(&mut some_reader, SizeLimit::new());
+/// serde::Deserialize::deserialize(&mut deserializer);
+/// let bytes_read = d.bytes_read();
+/// ```
+pub(crate) struct Deserializer<R, O: Options> {
+    reader: R,
+    options: O,
+}
+
+impl<'de, R: BincodeRead<'de>, O: Options> Deserializer<R, O> {
+    /// Creates a new Deserializer with a given `Read`er and a size_limit.
+    pub(crate) fn new(r: R, options: O) -> Deserializer<R, O> {
+        Deserializer {
+            reader: r,
+            options: options,
+        }
+    }
+
+    fn read_bytes(&mut self, count: u64) -> Result<()> {
+        self.options.limit().add(count)
+    }
+
+    fn read_type<T>(&mut self) -> Result<()> {
+        use std::mem::size_of;
+        self.read_bytes(size_of::<T>() as u64)
+    }
+
+    fn read_vec(&mut self) -> Result<Vec<u8>> {
+        let len: usize = try!(serde::Deserialize::deserialize(&mut *self));
+        self.read_bytes(len as u64)?;
+        self.reader.get_byte_buffer(len)
+    }
+
+    fn read_string(&mut self) -> Result<String> {
+        let vec = self.read_vec()?;
+        String::from_utf8(vec).map_err(|e| ErrorKind::InvalidUtf8Encoding(e.utf8_error()).into())
+    }
+}
+
+macro_rules! impl_nums {
+    ($ty:ty, $dser_method:ident, $visitor_method:ident, $reader_method:ident) => {
+        #[inline]
+        fn $dser_method<V>(self, visitor: V) -> Result<V::Value>
+            where V: serde::de::Visitor<'de>,
+        {
+            try!(self.read_type::<$ty>());
+            let value = try!(self.reader.$reader_method::<O::Endian>());
+            visitor.$visitor_method(value)
+        }
+    }
+}
+
+impl<'de, 'a, R, O> serde::Deserializer<'de> for &'a mut Deserializer<R, O>
+where
+    R: BincodeRead<'de>,
+    O: Options,
+{
+    type Error = Error;
+
+    #[inline]
+    fn deserialize_any<V>(self, _visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        Err(Box::new(ErrorKind::DeserializeAnyNotSupported))
+    }
+
+    fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        let value: u8 = try!(serde::Deserialize::deserialize(self));
+        match value {
+            1 => visitor.visit_bool(true),
+            0 => visitor.visit_bool(false),
+            value => Err(ErrorKind::InvalidBoolEncoding(value).into()),
+        }
+    }
+
+    impl_nums!(u16, deserialize_u16, visit_u16, read_u16);
+    impl_nums!(u32, deserialize_u32, visit_u32, read_u32);
+    impl_nums!(u64, deserialize_u64, visit_u64, read_u64);
+    impl_nums!(i16, deserialize_i16, visit_i16, read_i16);
+    impl_nums!(i32, deserialize_i32, visit_i32, read_i32);
+    impl_nums!(i64, deserialize_i64, visit_i64, read_i64);
+    impl_nums!(f32, deserialize_f32, visit_f32, read_f32);
+    impl_nums!(f64, deserialize_f64, visit_f64, read_f64);
+
+    serde_if_integer128! {
+        impl_nums!(u128, deserialize_u128, visit_u128, read_u128);
+        impl_nums!(i128, deserialize_i128, visit_i128, read_i128);
+    }
+
+    #[inline]
+    fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        try!(self.read_type::<u8>());
+        visitor.visit_u8(try!(self.reader.read_u8()))
+    }
+
+    #[inline]
+    fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        try!(self.read_type::<i8>());
+        visitor.visit_i8(try!(self.reader.read_i8()))
+    }
+
+    fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        visitor.visit_unit()
+    }
+
+    fn deserialize_char<V>(self, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        use std::str;
+
+        let error = || ErrorKind::InvalidCharEncoding.into();
+
+        let mut buf = [0u8; 4];
+
+        // Look at the first byte to see how many bytes must be read
+        let _ = try!(self.reader.read_exact(&mut buf[..1]));
+        let width = utf8_char_width(buf[0]);
+        if width == 1 {
+            return visitor.visit_char(buf[0] as char);
+        }
+        if width == 0 {
+            return Err(error());
+        }
+
+        if self.reader.read_exact(&mut buf[1..width]).is_err() {
+            return Err(error());
+        }
+
+        let res = try!(
+            str::from_utf8(&buf[..width])
+                .ok()
+                .and_then(|s| s.chars().next())
+                .ok_or(error())
+        );
+        visitor.visit_char(res)
+    }
+
+    fn deserialize_str<V>(self, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        let len: usize = try!(serde::Deserialize::deserialize(&mut *self));
+        try!(self.read_bytes(len as u64));
+        self.reader.forward_read_str(len, visitor)
+    }
+
+    fn deserialize_string<V>(self, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        visitor.visit_string(try!(self.read_string()))
+    }
+
+    fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        let len: usize = try!(serde::Deserialize::deserialize(&mut *self));
+        try!(self.read_bytes(len as u64));
+        self.reader.forward_read_bytes(len, visitor)
+    }
+
+    fn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        visitor.visit_byte_buf(try!(self.read_vec()))
+    }
+
+    fn deserialize_enum<V>(
+        self,
+        _enum: &'static str,
+        _variants: &'static [&'static str],
+        visitor: V,
+    ) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        impl<'de, 'a, R: 'a, O> serde::de::EnumAccess<'de> for &'a mut Deserializer<R, O>
+        where
+            R: BincodeRead<'de>,
+            O: Options,
+        {
+            type Error = Error;
+            type Variant = Self;
+
+            fn variant_seed<V>(self, seed: V) -> Result<(V::Value, Self::Variant)>
+            where
+                V: serde::de::DeserializeSeed<'de>,
+            {
+                let idx: u32 = try!(serde::de::Deserialize::deserialize(&mut *self));
+                let val: Result<_> = seed.deserialize(idx.into_deserializer());
+                Ok((try!(val), self))
+            }
+        }
+
+        visitor.visit_enum(self)
+    }
+
+    fn deserialize_tuple<V>(self, len: usize, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        struct Access<'a, R: Read + 'a, O: Options + 'a> {
+            deserializer: &'a mut Deserializer<R, O>,
+            len: usize,
+        }
+
+        impl<'de, 'a, 'b: 'a, R: BincodeRead<'de> + 'b, O: Options> serde::de::SeqAccess<'de>
+            for Access<'a, R, O>
+        {
+            type Error = Error;
+
+            fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>>
+            where
+                T: serde::de::DeserializeSeed<'de>,
+            {
+                if self.len > 0 {
+                    self.len -= 1;
+                    let value = try!(serde::de::DeserializeSeed::deserialize(
+                        seed,
+                        &mut *self.deserializer,
+                    ));
+                    Ok(Some(value))
+                } else {
+                    Ok(None)
+                }
+            }
+
+            fn size_hint(&self) -> Option<usize> {
+                Some(self.len)
+            }
+        }
+
+        visitor.visit_seq(Access {
+            deserializer: self,
+            len: len,
+        })
+    }
+
+    fn deserialize_option<V>(self, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        let value: u8 = try!(serde::de::Deserialize::deserialize(&mut *self));
+        match value {
+            0 => visitor.visit_none(),
+            1 => visitor.visit_some(&mut *self),
+            v => Err(ErrorKind::InvalidTagEncoding(v as usize).into()),
+        }
+    }
+
+    fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        let len = try!(serde::Deserialize::deserialize(&mut *self));
+
+        self.deserialize_tuple(len, visitor)
+    }
+
+    fn deserialize_map<V>(self, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        struct Access<'a, R: Read + 'a, O: Options + 'a> {
+            deserializer: &'a mut Deserializer<R, O>,
+            len: usize,
+        }
+
+        impl<'de, 'a, 'b: 'a, R: BincodeRead<'de> + 'b, O: Options> serde::de::MapAccess<'de>
+            for Access<'a, R, O>
+        {
+            type Error = Error;
+
+            fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>>
+            where
+                K: serde::de::DeserializeSeed<'de>,
+            {
+                if self.len > 0 {
+                    self.len -= 1;
+                    let key = try!(serde::de::DeserializeSeed::deserialize(
+                        seed,
+                        &mut *self.deserializer,
+                    ));
+                    Ok(Some(key))
+                } else {
+                    Ok(None)
+                }
+            }
+
+            fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value>
+            where
+                V: serde::de::DeserializeSeed<'de>,
+            {
+                let value = try!(serde::de::DeserializeSeed::deserialize(
+                    seed,
+                    &mut *self.deserializer,
+                ));
+                Ok(value)
+            }
+
+            fn size_hint(&self) -> Option<usize> {
+                Some(self.len)
+            }
+        }
+
+        let len = try!(serde::Deserialize::deserialize(&mut *self));
+
+        visitor.visit_map(Access {
+            deserializer: self,
+            len: len,
+        })
+    }
+
+    fn deserialize_struct<V>(
+        self,
+        _name: &str,
+        fields: &'static [&'static str],
+        visitor: V,
+    ) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        self.deserialize_tuple(fields.len(), visitor)
+    }
+
+    fn deserialize_identifier<V>(self, _visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        let message = "Bincode does not support Deserializer::deserialize_identifier";
+        Err(Error::custom(message))
+    }
+
+    fn deserialize_newtype_struct<V>(self, _name: &str, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        visitor.visit_newtype_struct(self)
+    }
+
+    fn deserialize_unit_struct<V>(self, _name: &'static str, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        visitor.visit_unit()
+    }
+
+    fn deserialize_tuple_struct<V>(
+        self,
+        _name: &'static str,
+        len: usize,
+        visitor: V,
+    ) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        self.deserialize_tuple(len, visitor)
+    }
+
+    fn deserialize_ignored_any<V>(self, _visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        let message = "Bincode does not support Deserializer::deserialize_ignored_any";
+        Err(Error::custom(message))
+    }
+
+    fn is_human_readable(&self) -> bool {
+        false
+    }
+}
+
+impl<'de, 'a, R, O> serde::de::VariantAccess<'de> for &'a mut Deserializer<R, O>
+where
+    R: BincodeRead<'de>,
+    O: Options,
+{
+    type Error = Error;
+
+    fn unit_variant(self) -> Result<()> {
+        Ok(())
+    }
+
+    fn newtype_variant_seed<T>(self, seed: T) -> Result<T::Value>
+    where
+        T: serde::de::DeserializeSeed<'de>,
+    {
+        serde::de::DeserializeSeed::deserialize(seed, self)
+    }
+
+    fn tuple_variant<V>(self, len: usize, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        serde::de::Deserializer::deserialize_tuple(self, len, visitor)
+    }
+
+    fn struct_variant<V>(self, fields: &'static [&'static str], visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'de>,
+    {
+        serde::de::Deserializer::deserialize_tuple(self, fields.len(), visitor)
+    }
+}
+static UTF8_CHAR_WIDTH: [u8; 256] = [
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, // 0x1F
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, // 0x3F
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, // 0x5F
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, // 0x7F
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, // 0x9F
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, // 0xBF
+    0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+    2, // 0xDF
+    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xEF
+    4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0xFF
+];
+
+// This function is a copy of core::str::utf8_char_width
+fn utf8_char_width(b: u8) -> usize {
+    UTF8_CHAR_WIDTH[b as usize] as usize
+}
+
+
\ No newline at end of file diff --git a/src/bincode/de/read.rs.html b/src/bincode/de/read.rs.html new file mode 100644 index 0000000..1c08e3a --- /dev/null +++ b/src/bincode/de/read.rs.html @@ -0,0 +1,405 @@ +read.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+
+use error::Result;
+use serde;
+use std::{io, slice};
+
+/// An optional Read trait for advanced Bincode usage.
+///
+/// It is highly recommended to use bincode with `io::Read` or `&[u8]` before
+/// implementing a custom `BincodeRead`.
+pub trait BincodeRead<'storage>: io::Read {
+    /// Forwards reading `length` bytes of a string on to the serde reader.
+    fn forward_read_str<V>(&mut self, length: usize, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'storage>;
+
+    /// Return the first `length` bytes of the internal byte buffer.
+    fn get_byte_buffer(&mut self, length: usize) -> Result<Vec<u8>>;
+
+    /// Forwards reading `length` bytes on to the serde reader.
+    fn forward_read_bytes<V>(&mut self, length: usize, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'storage>;
+}
+
+/// A BincodeRead implementation for byte slices
+/// NOT A PART OF THE STABLE PUBLIC API
+#[doc(hidden)]
+pub struct SliceReader<'storage> {
+    slice: &'storage [u8],
+}
+
+/// A BincodeRead implementation for io::Readers
+/// NOT A PART OF THE STABLE PUBLIC API
+#[doc(hidden)]
+pub struct IoReader<R> {
+    reader: R,
+    temp_buffer: Vec<u8>,
+}
+
+impl<'storage> SliceReader<'storage> {
+    /// Constructs a slice reader
+    pub fn new(bytes: &'storage [u8]) -> SliceReader<'storage> {
+        SliceReader { slice: bytes }
+    }
+}
+
+impl<R> IoReader<R> {
+    /// Constructs an IoReadReader
+    pub fn new(r: R) -> IoReader<R> {
+        IoReader {
+            reader: r,
+            temp_buffer: vec![],
+        }
+    }
+}
+
+impl<'storage> io::Read for SliceReader<'storage> {
+    #[inline(always)]
+    fn read(&mut self, out: &mut [u8]) -> io::Result<usize> {
+        (&mut self.slice).read(out)
+    }
+    #[inline(always)]
+    fn read_exact(&mut self, out: &mut [u8]) -> io::Result<()> {
+        (&mut self.slice).read_exact(out)
+    }
+}
+
+impl<R: io::Read> io::Read for IoReader<R> {
+    #[inline(always)]
+    fn read(&mut self, out: &mut [u8]) -> io::Result<usize> {
+        self.reader.read(out)
+    }
+    #[inline(always)]
+    fn read_exact(&mut self, out: &mut [u8]) -> io::Result<()> {
+        self.reader.read_exact(out)
+    }
+}
+
+impl<'storage> SliceReader<'storage> {
+    #[inline(always)]
+    fn unexpected_eof() -> Box<::ErrorKind> {
+        return Box::new(::ErrorKind::Io(io::Error::new(
+            io::ErrorKind::UnexpectedEof,
+            "",
+        )));
+    }
+}
+
+impl<'storage> BincodeRead<'storage> for SliceReader<'storage> {
+    #[inline(always)]
+    fn forward_read_str<V>(&mut self, length: usize, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'storage>,
+    {
+        use ErrorKind;
+        if length > self.slice.len() {
+            return Err(SliceReader::unexpected_eof());
+        }
+
+        let string = match ::std::str::from_utf8(&self.slice[..length]) {
+            Ok(s) => s,
+            Err(e) => return Err(ErrorKind::InvalidUtf8Encoding(e).into()),
+        };
+        let r = visitor.visit_borrowed_str(string);
+        self.slice = &self.slice[length..];
+        r
+    }
+
+    #[inline(always)]
+    fn get_byte_buffer(&mut self, length: usize) -> Result<Vec<u8>> {
+        if length > self.slice.len() {
+            return Err(SliceReader::unexpected_eof());
+        }
+
+        let r = &self.slice[..length];
+        self.slice = &self.slice[length..];
+        Ok(r.to_vec())
+    }
+
+    #[inline(always)]
+    fn forward_read_bytes<V>(&mut self, length: usize, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'storage>,
+    {
+        if length > self.slice.len() {
+            return Err(SliceReader::unexpected_eof());
+        }
+
+        let r = visitor.visit_borrowed_bytes(&self.slice[..length]);
+        self.slice = &self.slice[length..];
+        r
+    }
+}
+
+impl<R> IoReader<R>
+where
+    R: io::Read,
+{
+    fn fill_buffer(&mut self, length: usize) -> Result<()> {
+        // We first reserve the space needed in our buffer.
+        let current_length = self.temp_buffer.len();
+        if length > current_length {
+            self.temp_buffer.reserve_exact(length - current_length);
+        }
+
+        // Then create a slice with the length as our desired length. This is
+        // safe as long as we only write (no reads) to this buffer, because
+        // `reserve_exact` above has allocated this space.
+        let buf = unsafe {
+            slice::from_raw_parts_mut(self.temp_buffer.as_mut_ptr(), length)
+        };
+
+        // This method is assumed to properly handle slices which include
+        // uninitialized bytes (as ours does). See discussion at the link below.
+        // https://github.com/servo/bincode/issues/260
+        self.reader.read_exact(buf)?;
+
+        // Only after `read_exact` successfully returns do we set the buffer
+        // length. By doing this after the call to `read_exact`, we can avoid
+        // exposing uninitialized memory in the case of `read_exact` returning
+        // an error.
+        unsafe {
+            self.temp_buffer.set_len(length);
+        }
+
+        Ok(())
+    }
+}
+
+impl<'a, R> BincodeRead<'a> for IoReader<R>
+where
+    R: io::Read,
+{
+    fn forward_read_str<V>(&mut self, length: usize, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'a>,
+    {
+        self.fill_buffer(length)?;
+
+        let string = match ::std::str::from_utf8(&self.temp_buffer[..]) {
+            Ok(s) => s,
+            Err(e) => return Err(::ErrorKind::InvalidUtf8Encoding(e).into()),
+        };
+
+        let r = visitor.visit_str(string);
+        r
+    }
+
+    fn get_byte_buffer(&mut self, length: usize) -> Result<Vec<u8>> {
+        self.fill_buffer(length)?;
+        Ok(::std::mem::replace(&mut self.temp_buffer, Vec::new()))
+    }
+
+    fn forward_read_bytes<V>(&mut self, length: usize, visitor: V) -> Result<V::Value>
+    where
+        V: serde::de::Visitor<'a>,
+    {
+        self.fill_buffer(length)?;
+        let r = visitor.visit_bytes(&self.temp_buffer[..]);
+        r
+    }
+}
+
+
\ No newline at end of file diff --git a/src/bincode/error.rs.html b/src/bincode/error.rs.html new file mode 100644 index 0000000..7f38fb9 --- /dev/null +++ b/src/bincode/error.rs.html @@ -0,0 +1,233 @@ +error.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+
+use std::error::Error as StdError;
+use std::io;
+use std::str::Utf8Error;
+use std::{error, fmt};
+
+use serde;
+
+/// The result of a serialization or deserialization operation.
+pub type Result<T> = ::std::result::Result<T, Error>;
+
+/// An error that can be produced during (de)serializing.
+pub type Error = Box<ErrorKind>;
+
+/// The kind of error that can be produced during a serialization or deserialization.
+#[derive(Debug)]
+pub enum ErrorKind {
+    /// If the error stems from the reader/writer that is being used
+    /// during (de)serialization, that error will be stored and returned here.
+    Io(io::Error),
+    /// Returned if the deserializer attempts to deserialize a string that is not valid utf8
+    InvalidUtf8Encoding(Utf8Error),
+    /// Returned if the deserializer attempts to deserialize a bool that was
+    /// not encoded as either a 1 or a 0
+    InvalidBoolEncoding(u8),
+    /// Returned if the deserializer attempts to deserialize a char that is not in the correct format.
+    InvalidCharEncoding,
+    /// Returned if the deserializer attempts to deserialize the tag of an enum that is
+    /// not in the expected ranges
+    InvalidTagEncoding(usize),
+    /// Serde has a deserialize_any method that lets the format hint to the
+    /// object which route to take in deserializing.
+    DeserializeAnyNotSupported,
+    /// If (de)serializing a message takes more than the provided size limit, this
+    /// error is returned.
+    SizeLimit,
+    /// Bincode can not encode sequences of unknown length (like iterators).
+    SequenceMustHaveLength,
+    /// A custom error message from Serde.
+    Custom(String),
+}
+
+impl StdError for ErrorKind {
+    fn description(&self) -> &str {
+        match *self {
+            ErrorKind::Io(ref err) => error::Error::description(err),
+            ErrorKind::InvalidUtf8Encoding(_) => "string is not valid utf8",
+            ErrorKind::InvalidBoolEncoding(_) => "invalid u8 while decoding bool",
+            ErrorKind::InvalidCharEncoding => "char is not valid",
+            ErrorKind::InvalidTagEncoding(_) => "tag for enum is not valid",
+            ErrorKind::SequenceMustHaveLength => {
+                "Bincode can only encode sequences and maps that have a knowable size ahead of time"
+            }
+            ErrorKind::DeserializeAnyNotSupported => {
+                "Bincode doesn't support serde::Deserializer::deserialize_any"
+            }
+            ErrorKind::SizeLimit => "the size limit has been reached",
+            ErrorKind::Custom(ref msg) => msg,
+        }
+    }
+
+    fn cause(&self) -> Option<&error::Error> {
+        match *self {
+            ErrorKind::Io(ref err) => Some(err),
+            ErrorKind::InvalidUtf8Encoding(_) => None,
+            ErrorKind::InvalidBoolEncoding(_) => None,
+            ErrorKind::InvalidCharEncoding => None,
+            ErrorKind::InvalidTagEncoding(_) => None,
+            ErrorKind::SequenceMustHaveLength => None,
+            ErrorKind::DeserializeAnyNotSupported => None,
+            ErrorKind::SizeLimit => None,
+            ErrorKind::Custom(_) => None,
+        }
+    }
+}
+
+impl From<io::Error> for Error {
+    fn from(err: io::Error) -> Error {
+        ErrorKind::Io(err).into()
+    }
+}
+
+impl fmt::Display for ErrorKind {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        match *self {
+            ErrorKind::Io(ref ioerr) => write!(fmt, "io error: {}", ioerr),
+            ErrorKind::InvalidUtf8Encoding(ref e) => write!(fmt, "{}: {}", self.description(), e),
+            ErrorKind::InvalidBoolEncoding(b) => {
+                write!(fmt, "{}, expected 0 or 1, found {}", self.description(), b)
+            }
+            ErrorKind::InvalidCharEncoding => write!(fmt, "{}", self.description()),
+            ErrorKind::InvalidTagEncoding(tag) => {
+                write!(fmt, "{}, found {}", self.description(), tag)
+            }
+            ErrorKind::SequenceMustHaveLength => write!(fmt, "{}", self.description()),
+            ErrorKind::SizeLimit => write!(fmt, "{}", self.description()),
+            ErrorKind::DeserializeAnyNotSupported => write!(
+                fmt,
+                "Bincode does not support the serde::Deserializer::deserialize_any method"
+            ),
+            ErrorKind::Custom(ref s) => s.fmt(fmt),
+        }
+    }
+}
+
+impl serde::de::Error for Error {
+    fn custom<T: fmt::Display>(desc: T) -> Error {
+        ErrorKind::Custom(desc.to_string()).into()
+    }
+}
+
+impl serde::ser::Error for Error {
+    fn custom<T: fmt::Display>(msg: T) -> Self {
+        ErrorKind::Custom(msg.to_string()).into()
+    }
+}
+
+
\ No newline at end of file diff --git a/src/bincode/internal.rs.html b/src/bincode/internal.rs.html new file mode 100644 index 0000000..52a2d53 --- /dev/null +++ b/src/bincode/internal.rs.html @@ -0,0 +1,385 @@ +internal.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+
+use serde;
+use std::io::{Read, Write};
+use std::marker::PhantomData;
+
+use config::{Options, OptionsExt};
+use de::read::BincodeRead;
+use {ErrorKind, Result};
+
+#[derive(Clone)]
+struct CountSize<L: SizeLimit> {
+    total: u64,
+    other_limit: L,
+}
+
+pub(crate) fn serialize_into<W, T: ?Sized, O>(writer: W, value: &T, mut options: O) -> Result<()>
+where
+    W: Write,
+    T: serde::Serialize,
+    O: Options,
+{
+    if options.limit().limit().is_some() {
+        // "compute" the size for the side-effect
+        // of returning Err if the bound was reached.
+        serialized_size(value, &mut options)?;
+    }
+
+    let mut serializer = ::ser::Serializer::<_, O>::new(writer, options);
+    serde::Serialize::serialize(value, &mut serializer)
+}
+
+pub(crate) fn serialize<T: ?Sized, O>(value: &T, mut options: O) -> Result<Vec<u8>>
+where
+    T: serde::Serialize,
+    O: Options,
+{
+    let mut writer = {
+        let actual_size = serialized_size(value, &mut options)?;
+        Vec::with_capacity(actual_size as usize)
+    };
+
+    serialize_into(&mut writer, value, options.with_no_limit())?;
+    Ok(writer)
+}
+
+impl<L: SizeLimit> SizeLimit for CountSize<L> {
+    fn add(&mut self, c: u64) -> Result<()> {
+        self.other_limit.add(c)?;
+        self.total += c;
+        Ok(())
+    }
+
+    fn limit(&self) -> Option<u64> {
+        unreachable!();
+    }
+}
+
+pub(crate) fn serialized_size<T: ?Sized, O: Options>(value: &T, mut options: O) -> Result<u64>
+where
+    T: serde::Serialize,
+{
+    let old_limiter = options.limit().clone();
+    let mut size_counter = ::ser::SizeChecker {
+        options: ::config::WithOtherLimit::new(
+            options,
+            CountSize {
+                total: 0,
+                other_limit: old_limiter,
+            },
+        ),
+    };
+
+    let result = value.serialize(&mut size_counter);
+    result.map(|_| size_counter.options.new_limit.total)
+}
+
+pub(crate) fn deserialize_from<R, T, O>(reader: R, options: O) -> Result<T>
+where
+    R: Read,
+    T: serde::de::DeserializeOwned,
+    O: Options,
+{
+    deserialize_from_seed(PhantomData, reader, options)
+}
+
+pub(crate) fn deserialize_from_seed<'a, R, T, O>(seed: T, reader: R, options: O) -> Result<T::Value>
+where
+    R: Read,
+    T: serde::de::DeserializeSeed<'a>,
+    O: Options,
+{
+    let reader = ::de::read::IoReader::new(reader);
+    deserialize_from_custom_seed(seed, reader, options)
+}
+
+pub(crate) fn deserialize_from_custom<'a, R, T, O>(reader: R, options: O) -> Result<T>
+where
+    R: BincodeRead<'a>,
+    T: serde::de::DeserializeOwned,
+    O: Options,
+{
+    deserialize_from_custom_seed(PhantomData, reader, options)
+}
+
+pub(crate) fn deserialize_from_custom_seed<'a, R, T, O>(
+    seed: T,
+    reader: R,
+    options: O,
+) -> Result<T::Value>
+where
+    R: BincodeRead<'a>,
+    T: serde::de::DeserializeSeed<'a>,
+    O: Options,
+{
+    let mut deserializer = ::de::Deserializer::<_, O>::new(reader, options);
+    seed.deserialize(&mut deserializer)
+}
+
+pub(crate) fn deserialize_in_place<'a, R, T, O>(reader: R, options: O, place: &mut T) -> Result<()>
+where
+    R: BincodeRead<'a>,
+    T: serde::de::Deserialize<'a>,
+    O: Options,
+{
+    let mut deserializer = ::de::Deserializer::<_, _>::new(reader, options);
+    serde::Deserialize::deserialize_in_place(&mut deserializer, place)
+}
+
+pub(crate) fn deserialize<'a, T, O>(bytes: &'a [u8], options: O) -> Result<T>
+where
+    T: serde::de::Deserialize<'a>,
+    O: Options,
+{
+    deserialize_seed(PhantomData, bytes, options)
+}
+
+pub(crate) fn deserialize_seed<'a, T, O>(seed: T, bytes: &'a [u8], options: O) -> Result<T::Value>
+where
+    T: serde::de::DeserializeSeed<'a>,
+    O: Options,
+{
+    let reader = ::de::read::SliceReader::new(bytes);
+    let options = ::config::WithOtherLimit::new(options, Infinite);
+    deserialize_from_custom_seed(seed, reader, options)
+}
+
+pub(crate) trait SizeLimit: Clone {
+    /// Tells the SizeLimit that a certain number of bytes has been
+    /// read or written.  Returns Err if the limit has been exceeded.
+    fn add(&mut self, n: u64) -> Result<()>;
+    /// Returns the hard limit (if one exists)
+    fn limit(&self) -> Option<u64>;
+}
+
+/// A SizeLimit that restricts serialized or deserialized messages from
+/// exceeding a certain byte length.
+#[derive(Copy, Clone)]
+pub struct Bounded(pub u64);
+
+/// A SizeLimit without a limit!
+/// Use this if you don't care about the size of encoded or decoded messages.
+#[derive(Copy, Clone)]
+pub struct Infinite;
+
+impl SizeLimit for Bounded {
+    #[inline(always)]
+    fn add(&mut self, n: u64) -> Result<()> {
+        if self.0 >= n {
+            self.0 -= n;
+            Ok(())
+        } else {
+            Err(Box::new(ErrorKind::SizeLimit))
+        }
+    }
+
+    #[inline(always)]
+    fn limit(&self) -> Option<u64> {
+        Some(self.0)
+    }
+}
+
+impl SizeLimit for Infinite {
+    #[inline(always)]
+    fn add(&mut self, _: u64) -> Result<()> {
+        Ok(())
+    }
+
+    #[inline(always)]
+    fn limit(&self) -> Option<u64> {
+        None
+    }
+}
+
+
\ No newline at end of file diff --git a/src/bincode/lib.rs.html b/src/bincode/lib.rs.html new file mode 100644 index 0000000..75dcb4a --- /dev/null +++ b/src/bincode/lib.rs.html @@ -0,0 +1,349 @@ +lib.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+
+#![deny(missing_docs)]
+
+//! Bincode is a crate for encoding and decoding using a tiny binary
+//! serialization strategy.  Using it, you can easily go from having
+//! an object in memory, quickly serialize it to bytes, and then
+//! deserialize it back just as fast!
+//!
+//! ### Using Basic Functions
+//!
+//! ```edition2018
+//! fn main() {
+//!     // The object that we will serialize.
+//!     let target: Option<String>  = Some("hello world".to_string());
+//!
+//!     let encoded: Vec<u8> = bincode::serialize(&target).unwrap();
+//!     let decoded: Option<String> = bincode::deserialize(&encoded[..]).unwrap();
+//!     assert_eq!(target, decoded);
+//! }
+//! ```
+//!
+//! ### 128bit numbers
+//!
+//! Support for `i128` and `u128` is automatically enabled on Rust toolchains
+//! greater than or equal to `1.26.0` and disabled for targets which do not support it
+
+#![doc(html_root_url = "https://docs.rs/bincode/1.2.1")]
+#![crate_name = "bincode"]
+#![crate_type = "rlib"]
+#![crate_type = "dylib"]
+
+extern crate byteorder;
+#[macro_use]
+extern crate serde;
+
+mod config;
+mod de;
+mod error;
+mod internal;
+mod ser;
+
+pub use config::Config;
+pub use de::read::{BincodeRead, IoReader, SliceReader};
+pub use error::{Error, ErrorKind, Result};
+
+/// An object that implements this trait can be passed a
+/// serde::Deserializer without knowing its concrete type.
+///
+/// This trait should be used only for `with_deserializer` functions.
+#[doc(hidden)]
+pub trait DeserializerAcceptor<'a> {
+    /// The return type for the accept method
+    type Output;
+    /// Accept a serde::Deserializer and do whatever you want with it.
+    fn accept<T: serde::Deserializer<'a>>(self, T) -> Self::Output;
+}
+
+/// An object that implements this trait can be passed a
+/// serde::Serializer without knowing its concrete type.
+///
+/// This trait should be used only for `with_serializer` functions.
+#[doc(hidden)]
+pub trait SerializerAcceptor {
+    /// The return type for the accept method
+    type Output;
+    /// Accept a serde::Serializer and do whatever you want with it.
+    fn accept<T: serde::Serializer>(self, T) -> Self::Output;
+}
+
+/// Get a default configuration object.
+///
+/// ### Default Configuration:
+///
+/// | Byte limit | Endianness |
+/// |------------|------------|
+/// | Unlimited  | Little     |
+#[inline(always)]
+pub fn config() -> Config {
+    Config::new()
+}
+
+/// Serializes an object directly into a `Writer` using the default configuration.
+///
+/// If the serialization would take more bytes than allowed by the size limit, an error
+/// is returned and *no bytes* will be written into the `Writer`.
+pub fn serialize_into<W, T: ?Sized>(writer: W, value: &T) -> Result<()>
+where
+    W: std::io::Write,
+    T: serde::Serialize,
+{
+    config().serialize_into(writer, value)
+}
+
+/// Serializes a serializable object into a `Vec` of bytes using the default configuration.
+pub fn serialize<T: ?Sized>(value: &T) -> Result<Vec<u8>>
+where
+    T: serde::Serialize,
+{
+    config().serialize(value)
+}
+
+/// Deserializes an object directly from a `Read`er using the default configuration.
+///
+/// If this returns an `Error`, `reader` may be in an invalid state.
+pub fn deserialize_from<R, T>(reader: R) -> Result<T>
+where
+    R: std::io::Read,
+    T: serde::de::DeserializeOwned,
+{
+    config().deserialize_from(reader)
+}
+
+/// Deserializes an object from a custom `BincodeRead`er using the default configuration.
+/// It is highly recommended to use `deserialize_from` unless you need to implement
+/// `BincodeRead` for performance reasons.
+///
+/// If this returns an `Error`, `reader` may be in an invalid state.
+pub fn deserialize_from_custom<'a, R, T>(reader: R) -> Result<T>
+where
+    R: de::read::BincodeRead<'a>,
+    T: serde::de::DeserializeOwned,
+{
+    config().deserialize_from_custom(reader)
+}
+
+/// Only use this if you know what you're doing.
+///
+/// This is part of the public API.
+#[doc(hidden)]
+pub fn deserialize_in_place<'a, R, T>(reader: R, place: &mut T) -> Result<()>
+where
+    T: serde::de::Deserialize<'a>,
+    R: BincodeRead<'a>,
+{
+    config().deserialize_in_place(reader, place)
+}
+
+/// Deserializes a slice of bytes into an instance of `T` using the default configuration.
+pub fn deserialize<'a, T>(bytes: &'a [u8]) -> Result<T>
+where
+    T: serde::de::Deserialize<'a>,
+{
+    config().deserialize(bytes)
+}
+
+/// Returns the size that an object would be if serialized using Bincode with the default configuration.
+pub fn serialized_size<T: ?Sized>(value: &T) -> Result<u64>
+where
+    T: serde::Serialize,
+{
+    config().serialized_size(value)
+}
+
+/// Executes the acceptor with a serde::Deserializer instance.
+/// NOT A PART OF THE STABLE PUBLIC API
+#[doc(hidden)]
+pub fn with_deserializer<'a, A, R>(reader: R, acceptor: A) -> A::Output
+where
+    A: DeserializerAcceptor<'a>,
+    R: BincodeRead<'a>,
+{
+    config().with_deserializer(reader, acceptor)
+}
+
+/// Executes the acceptor with a serde::Serializer instance.
+/// NOT A PART OF THE STABLE PUBLIC API
+#[doc(hidden)]
+pub fn with_serializer<A, W>(writer: W, acceptor: A) -> A::Output
+where
+    A: SerializerAcceptor,
+    W: std::io::Write,
+{
+    config().with_serializer(writer, acceptor)
+}
+
+
\ No newline at end of file diff --git a/src/bincode/ser/mod.rs.html b/src/bincode/ser/mod.rs.html new file mode 100644 index 0000000..dfeabe3 --- /dev/null +++ b/src/bincode/ser/mod.rs.html @@ -0,0 +1,1543 @@ +mod.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+
+use std::io::Write;
+use std::u32;
+
+use serde;
+
+use byteorder::WriteBytesExt;
+
+use super::internal::SizeLimit;
+use super::{Error, ErrorKind, Result};
+use config::Options;
+
+/// An Serializer that encodes values directly into a Writer.
+///
+/// The specified byte-order will impact the endianness that is
+/// used during the encoding.
+///
+/// This struct should not be used often.
+/// For most cases, prefer the `encode_into` function.
+pub(crate) struct Serializer<W, O: Options> {
+    writer: W,
+    _options: O,
+}
+
+impl<W: Write, O: Options> Serializer<W, O> {
+    /// Creates a new Serializer with the given `Write`r.
+    pub fn new(w: W, options: O) -> Serializer<W, O> {
+        Serializer {
+            writer: w,
+            _options: options,
+        }
+    }
+}
+
+impl<'a, W: Write, O: Options> serde::Serializer for &'a mut Serializer<W, O> {
+    type Ok = ();
+    type Error = Error;
+    type SerializeSeq = Compound<'a, W, O>;
+    type SerializeTuple = Compound<'a, W, O>;
+    type SerializeTupleStruct = Compound<'a, W, O>;
+    type SerializeTupleVariant = Compound<'a, W, O>;
+    type SerializeMap = Compound<'a, W, O>;
+    type SerializeStruct = Compound<'a, W, O>;
+    type SerializeStructVariant = Compound<'a, W, O>;
+
+    fn serialize_unit(self) -> Result<()> {
+        Ok(())
+    }
+
+    fn serialize_unit_struct(self, _: &'static str) -> Result<()> {
+        Ok(())
+    }
+
+    fn serialize_bool(self, v: bool) -> Result<()> {
+        self.writer
+            .write_u8(if v { 1 } else { 0 })
+            .map_err(Into::into)
+    }
+
+    fn serialize_u8(self, v: u8) -> Result<()> {
+        self.writer.write_u8(v).map_err(Into::into)
+    }
+
+    fn serialize_u16(self, v: u16) -> Result<()> {
+        self.writer.write_u16::<O::Endian>(v).map_err(Into::into)
+    }
+
+    fn serialize_u32(self, v: u32) -> Result<()> {
+        self.writer.write_u32::<O::Endian>(v).map_err(Into::into)
+    }
+
+    fn serialize_u64(self, v: u64) -> Result<()> {
+        self.writer.write_u64::<O::Endian>(v).map_err(Into::into)
+    }
+
+    fn serialize_i8(self, v: i8) -> Result<()> {
+        self.writer.write_i8(v).map_err(Into::into)
+    }
+
+    fn serialize_i16(self, v: i16) -> Result<()> {
+        self.writer.write_i16::<O::Endian>(v).map_err(Into::into)
+    }
+
+    fn serialize_i32(self, v: i32) -> Result<()> {
+        self.writer.write_i32::<O::Endian>(v).map_err(Into::into)
+    }
+
+    fn serialize_i64(self, v: i64) -> Result<()> {
+        self.writer.write_i64::<O::Endian>(v).map_err(Into::into)
+    }
+
+    serde_if_integer128! {
+        fn serialize_u128(self, v: u128) -> Result<()> {
+            self.writer.write_u128::<O::Endian>(v).map_err(Into::into)
+        }
+
+        fn serialize_i128(self, v: i128) -> Result<()> {
+            self.writer.write_i128::<O::Endian>(v).map_err(Into::into)
+        }
+    }
+
+    fn serialize_f32(self, v: f32) -> Result<()> {
+        self.writer.write_f32::<O::Endian>(v).map_err(Into::into)
+    }
+
+    fn serialize_f64(self, v: f64) -> Result<()> {
+        self.writer.write_f64::<O::Endian>(v).map_err(Into::into)
+    }
+
+    fn serialize_str(self, v: &str) -> Result<()> {
+        try!(self.serialize_u64(v.len() as u64));
+        self.writer.write_all(v.as_bytes()).map_err(Into::into)
+    }
+
+    fn serialize_char(self, c: char) -> Result<()> {
+        self.writer
+            .write_all(encode_utf8(c).as_slice())
+            .map_err(Into::into)
+    }
+
+    fn serialize_bytes(self, v: &[u8]) -> Result<()> {
+        try!(self.serialize_u64(v.len() as u64));
+        self.writer.write_all(v).map_err(Into::into)
+    }
+
+    fn serialize_none(self) -> Result<()> {
+        self.writer.write_u8(0).map_err(Into::into)
+    }
+
+    fn serialize_some<T: ?Sized>(self, v: &T) -> Result<()>
+    where
+        T: serde::Serialize,
+    {
+        try!(self.writer.write_u8(1));
+        v.serialize(self)
+    }
+
+    fn serialize_seq(self, len: Option<usize>) -> Result<Self::SerializeSeq> {
+        let len = try!(len.ok_or(ErrorKind::SequenceMustHaveLength));
+        try!(self.serialize_u64(len as u64));
+        Ok(Compound { ser: self })
+    }
+
+    fn serialize_tuple(self, _len: usize) -> Result<Self::SerializeTuple> {
+        Ok(Compound { ser: self })
+    }
+
+    fn serialize_tuple_struct(
+        self,
+        _name: &'static str,
+        _len: usize,
+    ) -> Result<Self::SerializeTupleStruct> {
+        Ok(Compound { ser: self })
+    }
+
+    fn serialize_tuple_variant(
+        self,
+        _name: &'static str,
+        variant_index: u32,
+        _variant: &'static str,
+        _len: usize,
+    ) -> Result<Self::SerializeTupleVariant> {
+        try!(self.serialize_u32(variant_index));
+        Ok(Compound { ser: self })
+    }
+
+    fn serialize_map(self, len: Option<usize>) -> Result<Self::SerializeMap> {
+        let len = try!(len.ok_or(ErrorKind::SequenceMustHaveLength));
+        try!(self.serialize_u64(len as u64));
+        Ok(Compound { ser: self })
+    }
+
+    fn serialize_struct(self, _name: &'static str, _len: usize) -> Result<Self::SerializeStruct> {
+        Ok(Compound { ser: self })
+    }
+
+    fn serialize_struct_variant(
+        self,
+        _name: &'static str,
+        variant_index: u32,
+        _variant: &'static str,
+        _len: usize,
+    ) -> Result<Self::SerializeStructVariant> {
+        try!(self.serialize_u32(variant_index));
+        Ok(Compound { ser: self })
+    }
+
+    fn serialize_newtype_struct<T: ?Sized>(self, _name: &'static str, value: &T) -> Result<()>
+    where
+        T: serde::ser::Serialize,
+    {
+        value.serialize(self)
+    }
+
+    fn serialize_newtype_variant<T: ?Sized>(
+        self,
+        _name: &'static str,
+        variant_index: u32,
+        _variant: &'static str,
+        value: &T,
+    ) -> Result<()>
+    where
+        T: serde::ser::Serialize,
+    {
+        try!(self.serialize_u32(variant_index));
+        value.serialize(self)
+    }
+
+    fn serialize_unit_variant(
+        self,
+        _name: &'static str,
+        variant_index: u32,
+        _variant: &'static str,
+    ) -> Result<()> {
+        self.serialize_u32(variant_index)
+    }
+
+    fn is_human_readable(&self) -> bool {
+        false
+    }
+}
+
+pub(crate) struct SizeChecker<O: Options> {
+    pub options: O,
+}
+
+impl<O: Options> SizeChecker<O> {
+    pub fn new(options: O) -> SizeChecker<O> {
+        SizeChecker { options: options }
+    }
+
+    fn add_raw(&mut self, size: u64) -> Result<()> {
+        self.options.limit().add(size)
+    }
+
+    fn add_value<T>(&mut self, t: T) -> Result<()> {
+        use std::mem::size_of_val;
+        self.add_raw(size_of_val(&t) as u64)
+    }
+}
+
+impl<'a, O: Options> serde::Serializer for &'a mut SizeChecker<O> {
+    type Ok = ();
+    type Error = Error;
+    type SerializeSeq = SizeCompound<'a, O>;
+    type SerializeTuple = SizeCompound<'a, O>;
+    type SerializeTupleStruct = SizeCompound<'a, O>;
+    type SerializeTupleVariant = SizeCompound<'a, O>;
+    type SerializeMap = SizeCompound<'a, O>;
+    type SerializeStruct = SizeCompound<'a, O>;
+    type SerializeStructVariant = SizeCompound<'a, O>;
+
+    fn serialize_unit(self) -> Result<()> {
+        Ok(())
+    }
+
+    fn serialize_unit_struct(self, _: &'static str) -> Result<()> {
+        Ok(())
+    }
+
+    fn serialize_bool(self, _: bool) -> Result<()> {
+        self.add_value(0 as u8)
+    }
+
+    fn serialize_u8(self, v: u8) -> Result<()> {
+        self.add_value(v)
+    }
+
+    fn serialize_u16(self, v: u16) -> Result<()> {
+        self.add_value(v)
+    }
+
+    fn serialize_u32(self, v: u32) -> Result<()> {
+        self.add_value(v)
+    }
+
+    fn serialize_u64(self, v: u64) -> Result<()> {
+        self.add_value(v)
+    }
+
+    fn serialize_i8(self, v: i8) -> Result<()> {
+        self.add_value(v)
+    }
+
+    fn serialize_i16(self, v: i16) -> Result<()> {
+        self.add_value(v)
+    }
+
+    fn serialize_i32(self, v: i32) -> Result<()> {
+        self.add_value(v)
+    }
+
+    fn serialize_i64(self, v: i64) -> Result<()> {
+        self.add_value(v)
+    }
+
+    serde_if_integer128! {
+        fn serialize_u128(self, v: u128) -> Result<()> {
+            self.add_value(v)
+        }
+
+        fn serialize_i128(self, v: i128) -> Result<()> {
+            self.add_value(v)
+        }
+    }
+
+    fn serialize_f32(self, v: f32) -> Result<()> {
+        self.add_value(v)
+    }
+
+    fn serialize_f64(self, v: f64) -> Result<()> {
+        self.add_value(v)
+    }
+
+    fn serialize_str(self, v: &str) -> Result<()> {
+        try!(self.add_value(0 as u64));
+        self.add_raw(v.len() as u64)
+    }
+
+    fn serialize_char(self, c: char) -> Result<()> {
+        self.add_raw(encode_utf8(c).as_slice().len() as u64)
+    }
+
+    fn serialize_bytes(self, v: &[u8]) -> Result<()> {
+        try!(self.add_value(0 as u64));
+        self.add_raw(v.len() as u64)
+    }
+
+    fn serialize_none(self) -> Result<()> {
+        self.add_value(0 as u8)
+    }
+
+    fn serialize_some<T: ?Sized>(self, v: &T) -> Result<()>
+    where
+        T: serde::Serialize,
+    {
+        try!(self.add_value(1 as u8));
+        v.serialize(self)
+    }
+
+    fn serialize_seq(self, len: Option<usize>) -> Result<Self::SerializeSeq> {
+        let len = try!(len.ok_or(ErrorKind::SequenceMustHaveLength));
+
+        try!(self.serialize_u64(len as u64));
+        Ok(SizeCompound { ser: self })
+    }
+
+    fn serialize_tuple(self, _len: usize) -> Result<Self::SerializeTuple> {
+        Ok(SizeCompound { ser: self })
+    }
+
+    fn serialize_tuple_struct(
+        self,
+        _name: &'static str,
+        _len: usize,
+    ) -> Result<Self::SerializeTupleStruct> {
+        Ok(SizeCompound { ser: self })
+    }
+
+    fn serialize_tuple_variant(
+        self,
+        _name: &'static str,
+        variant_index: u32,
+        _variant: &'static str,
+        _len: usize,
+    ) -> Result<Self::SerializeTupleVariant> {
+        try!(self.add_value(variant_index));
+        Ok(SizeCompound { ser: self })
+    }
+
+    fn serialize_map(self, len: Option<usize>) -> Result<Self::SerializeMap> {
+        let len = try!(len.ok_or(ErrorKind::SequenceMustHaveLength));
+
+        try!(self.serialize_u64(len as u64));
+        Ok(SizeCompound { ser: self })
+    }
+
+    fn serialize_struct(self, _name: &'static str, _len: usize) -> Result<Self::SerializeStruct> {
+        Ok(SizeCompound { ser: self })
+    }
+
+    fn serialize_struct_variant(
+        self,
+        _name: &'static str,
+        variant_index: u32,
+        _variant: &'static str,
+        _len: usize,
+    ) -> Result<Self::SerializeStructVariant> {
+        try!(self.add_value(variant_index));
+        Ok(SizeCompound { ser: self })
+    }
+
+    fn serialize_newtype_struct<V: serde::Serialize + ?Sized>(
+        self,
+        _name: &'static str,
+        v: &V,
+    ) -> Result<()> {
+        v.serialize(self)
+    }
+
+    fn serialize_unit_variant(
+        self,
+        _name: &'static str,
+        variant_index: u32,
+        _variant: &'static str,
+    ) -> Result<()> {
+        self.add_value(variant_index)
+    }
+
+    fn serialize_newtype_variant<V: serde::Serialize + ?Sized>(
+        self,
+        _name: &'static str,
+        variant_index: u32,
+        _variant: &'static str,
+        value: &V,
+    ) -> Result<()> {
+        try!(self.add_value(variant_index));
+        value.serialize(self)
+    }
+
+    fn is_human_readable(&self) -> bool {
+        false
+    }
+}
+
+pub(crate) struct Compound<'a, W: 'a, O: Options + 'a> {
+    ser: &'a mut Serializer<W, O>,
+}
+
+impl<'a, W, O> serde::ser::SerializeSeq for Compound<'a, W, O>
+where
+    W: Write,
+    O: Options,
+{
+    type Ok = ();
+    type Error = Error;
+
+    #[inline]
+    fn serialize_element<T: ?Sized>(&mut self, value: &T) -> Result<()>
+    where
+        T: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn end(self) -> Result<()> {
+        Ok(())
+    }
+}
+
+impl<'a, W, O> serde::ser::SerializeTuple for Compound<'a, W, O>
+where
+    W: Write,
+    O: Options,
+{
+    type Ok = ();
+    type Error = Error;
+
+    #[inline]
+    fn serialize_element<T: ?Sized>(&mut self, value: &T) -> Result<()>
+    where
+        T: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn end(self) -> Result<()> {
+        Ok(())
+    }
+}
+
+impl<'a, W, O> serde::ser::SerializeTupleStruct for Compound<'a, W, O>
+where
+    W: Write,
+    O: Options,
+{
+    type Ok = ();
+    type Error = Error;
+
+    #[inline]
+    fn serialize_field<T: ?Sized>(&mut self, value: &T) -> Result<()>
+    where
+        T: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn end(self) -> Result<()> {
+        Ok(())
+    }
+}
+
+impl<'a, W, O> serde::ser::SerializeTupleVariant for Compound<'a, W, O>
+where
+    W: Write,
+    O: Options,
+{
+    type Ok = ();
+    type Error = Error;
+
+    #[inline]
+    fn serialize_field<T: ?Sized>(&mut self, value: &T) -> Result<()>
+    where
+        T: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn end(self) -> Result<()> {
+        Ok(())
+    }
+}
+
+impl<'a, W, O> serde::ser::SerializeMap for Compound<'a, W, O>
+where
+    W: Write,
+    O: Options,
+{
+    type Ok = ();
+    type Error = Error;
+
+    #[inline]
+    fn serialize_key<K: ?Sized>(&mut self, value: &K) -> Result<()>
+    where
+        K: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn serialize_value<V: ?Sized>(&mut self, value: &V) -> Result<()>
+    where
+        V: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn end(self) -> Result<()> {
+        Ok(())
+    }
+}
+
+impl<'a, W, O> serde::ser::SerializeStruct for Compound<'a, W, O>
+where
+    W: Write,
+    O: Options,
+{
+    type Ok = ();
+    type Error = Error;
+
+    #[inline]
+    fn serialize_field<T: ?Sized>(&mut self, _key: &'static str, value: &T) -> Result<()>
+    where
+        T: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn end(self) -> Result<()> {
+        Ok(())
+    }
+}
+
+impl<'a, W, O> serde::ser::SerializeStructVariant for Compound<'a, W, O>
+where
+    W: Write,
+    O: Options,
+{
+    type Ok = ();
+    type Error = Error;
+
+    #[inline]
+    fn serialize_field<T: ?Sized>(&mut self, _key: &'static str, value: &T) -> Result<()>
+    where
+        T: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn end(self) -> Result<()> {
+        Ok(())
+    }
+}
+
+pub(crate) struct SizeCompound<'a, S: Options + 'a> {
+    ser: &'a mut SizeChecker<S>,
+}
+
+impl<'a, O: Options> serde::ser::SerializeSeq for SizeCompound<'a, O> {
+    type Ok = ();
+    type Error = Error;
+
+    #[inline]
+    fn serialize_element<T: ?Sized>(&mut self, value: &T) -> Result<()>
+    where
+        T: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn end(self) -> Result<()> {
+        Ok(())
+    }
+}
+
+impl<'a, O: Options> serde::ser::SerializeTuple for SizeCompound<'a, O> {
+    type Ok = ();
+    type Error = Error;
+
+    #[inline]
+    fn serialize_element<T: ?Sized>(&mut self, value: &T) -> Result<()>
+    where
+        T: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn end(self) -> Result<()> {
+        Ok(())
+    }
+}
+
+impl<'a, O: Options> serde::ser::SerializeTupleStruct for SizeCompound<'a, O> {
+    type Ok = ();
+    type Error = Error;
+
+    #[inline]
+    fn serialize_field<T: ?Sized>(&mut self, value: &T) -> Result<()>
+    where
+        T: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn end(self) -> Result<()> {
+        Ok(())
+    }
+}
+
+impl<'a, O: Options> serde::ser::SerializeTupleVariant for SizeCompound<'a, O> {
+    type Ok = ();
+    type Error = Error;
+
+    #[inline]
+    fn serialize_field<T: ?Sized>(&mut self, value: &T) -> Result<()>
+    where
+        T: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn end(self) -> Result<()> {
+        Ok(())
+    }
+}
+
+impl<'a, O: Options + 'a> serde::ser::SerializeMap for SizeCompound<'a, O> {
+    type Ok = ();
+    type Error = Error;
+
+    #[inline]
+    fn serialize_key<K: ?Sized>(&mut self, value: &K) -> Result<()>
+    where
+        K: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn serialize_value<V: ?Sized>(&mut self, value: &V) -> Result<()>
+    where
+        V: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn end(self) -> Result<()> {
+        Ok(())
+    }
+}
+
+impl<'a, O: Options> serde::ser::SerializeStruct for SizeCompound<'a, O> {
+    type Ok = ();
+    type Error = Error;
+
+    #[inline]
+    fn serialize_field<T: ?Sized>(&mut self, _key: &'static str, value: &T) -> Result<()>
+    where
+        T: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn end(self) -> Result<()> {
+        Ok(())
+    }
+}
+
+impl<'a, O: Options> serde::ser::SerializeStructVariant for SizeCompound<'a, O> {
+    type Ok = ();
+    type Error = Error;
+
+    #[inline]
+    fn serialize_field<T: ?Sized>(&mut self, _key: &'static str, value: &T) -> Result<()>
+    where
+        T: serde::ser::Serialize,
+    {
+        value.serialize(&mut *self.ser)
+    }
+
+    #[inline]
+    fn end(self) -> Result<()> {
+        Ok(())
+    }
+}
+const TAG_CONT: u8 = 0b1000_0000;
+const TAG_TWO_B: u8 = 0b1100_0000;
+const TAG_THREE_B: u8 = 0b1110_0000;
+const TAG_FOUR_B: u8 = 0b1111_0000;
+const MAX_ONE_B: u32 = 0x80;
+const MAX_TWO_B: u32 = 0x800;
+const MAX_THREE_B: u32 = 0x10000;
+
+fn encode_utf8(c: char) -> EncodeUtf8 {
+    let code = c as u32;
+    let mut buf = [0; 4];
+    let pos = if code < MAX_ONE_B {
+        buf[3] = code as u8;
+        3
+    } else if code < MAX_TWO_B {
+        buf[2] = (code >> 6 & 0x1F) as u8 | TAG_TWO_B;
+        buf[3] = (code & 0x3F) as u8 | TAG_CONT;
+        2
+    } else if code < MAX_THREE_B {
+        buf[1] = (code >> 12 & 0x0F) as u8 | TAG_THREE_B;
+        buf[2] = (code >> 6 & 0x3F) as u8 | TAG_CONT;
+        buf[3] = (code & 0x3F) as u8 | TAG_CONT;
+        1
+    } else {
+        buf[0] = (code >> 18 & 0x07) as u8 | TAG_FOUR_B;
+        buf[1] = (code >> 12 & 0x3F) as u8 | TAG_CONT;
+        buf[2] = (code >> 6 & 0x3F) as u8 | TAG_CONT;
+        buf[3] = (code & 0x3F) as u8 | TAG_CONT;
+        0
+    };
+    EncodeUtf8 { buf: buf, pos: pos }
+}
+
+struct EncodeUtf8 {
+    buf: [u8; 4],
+    pos: usize,
+}
+
+impl EncodeUtf8 {
+    fn as_slice(&self) -> &[u8] {
+        &self.buf[self.pos..]
+    }
+}
+
+
\ No newline at end of file diff --git a/src/byteorder/io.rs.html b/src/byteorder/io.rs.html new file mode 100644 index 0000000..fa3c06a --- /dev/null +++ b/src/byteorder/io.rs.html @@ -0,0 +1,3213 @@ +io.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+
+use std::io::{self, Result};
+use std::slice;
+
+use ByteOrder;
+
+/// Extends [`Read`] with methods for reading numbers. (For `std::io`.)
+///
+/// Most of the methods defined here have an unconstrained type parameter that
+/// must be explicitly instantiated. Typically, it is instantiated with either
+/// the [`BigEndian`] or [`LittleEndian`] types defined in this crate.
+///
+/// # Examples
+///
+/// Read unsigned 16 bit big-endian integers from a [`Read`]:
+///
+/// ```rust
+/// use std::io::Cursor;
+/// use byteorder::{BigEndian, ReadBytesExt};
+///
+/// let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
+/// assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap());
+/// assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
+/// ```
+///
+/// [`BigEndian`]: enum.BigEndian.html
+/// [`LittleEndian`]: enum.LittleEndian.html
+/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
+pub trait ReadBytesExt: io::Read {
+    /// Reads an unsigned 8 bit integer from the underlying reader.
+    ///
+    /// Note that since this reads a single byte, no byte order conversions
+    /// are used. It is included for completeness.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read unsigned 8 bit integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::ReadBytesExt;
+    ///
+    /// let mut rdr = Cursor::new(vec![2, 5]);
+    /// assert_eq!(2, rdr.read_u8().unwrap());
+    /// assert_eq!(5, rdr.read_u8().unwrap());
+    /// ```
+    #[inline]
+    fn read_u8(&mut self) -> Result<u8> {
+        let mut buf = [0; 1];
+        try!(self.read_exact(&mut buf));
+        Ok(buf[0])
+    }
+
+    /// Reads a signed 8 bit integer from the underlying reader.
+    ///
+    /// Note that since this reads a single byte, no byte order conversions
+    /// are used. It is included for completeness.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read signed 8 bit integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::ReadBytesExt;
+    ///
+    /// let mut rdr = Cursor::new(vec![0x02, 0xfb]);
+    /// assert_eq!(2, rdr.read_i8().unwrap());
+    /// assert_eq!(-5, rdr.read_i8().unwrap());
+    /// ```
+    #[inline]
+    fn read_i8(&mut self) -> Result<i8> {
+        let mut buf = [0; 1];
+        try!(self.read_exact(&mut buf));
+        Ok(buf[0] as i8)
+    }
+
+    /// Reads an unsigned 16 bit integer from the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read unsigned 16 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
+    /// assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap());
+    /// assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
+    /// ```
+    #[inline]
+    fn read_u16<T: ByteOrder>(&mut self) -> Result<u16> {
+        let mut buf = [0; 2];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_u16(&buf))
+    }
+
+    /// Reads a signed 16 bit integer from the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read signed 16 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![0x00, 0xc1, 0xff, 0x7c]);
+    /// assert_eq!(193, rdr.read_i16::<BigEndian>().unwrap());
+    /// assert_eq!(-132, rdr.read_i16::<BigEndian>().unwrap());
+    /// ```
+    #[inline]
+    fn read_i16<T: ByteOrder>(&mut self) -> Result<i16> {
+        let mut buf = [0; 2];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_i16(&buf))
+    }
+
+    /// Reads an unsigned 24 bit integer from the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read unsigned 24 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![0x00, 0x01, 0x0b]);
+    /// assert_eq!(267, rdr.read_u24::<BigEndian>().unwrap());
+    /// ```
+    #[inline]
+    fn read_u24<T: ByteOrder>(&mut self) -> Result<u32> {
+        let mut buf = [0; 3];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_u24(&buf))
+    }
+
+    /// Reads a signed 24 bit integer from the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read signed 24 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![0xff, 0x7a, 0x33]);
+    /// assert_eq!(-34253, rdr.read_i24::<BigEndian>().unwrap());
+    /// ```
+    #[inline]
+    fn read_i24<T: ByteOrder>(&mut self) -> Result<i32> {
+        let mut buf = [0; 3];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_i24(&buf))
+    }
+
+    /// Reads an unsigned 32 bit integer from the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read unsigned 32 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![0x00, 0x00, 0x01, 0x0b]);
+    /// assert_eq!(267, rdr.read_u32::<BigEndian>().unwrap());
+    /// ```
+    #[inline]
+    fn read_u32<T: ByteOrder>(&mut self) -> Result<u32> {
+        let mut buf = [0; 4];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_u32(&buf))
+    }
+
+    /// Reads a signed 32 bit integer from the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read signed 32 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![0xff, 0xff, 0x7a, 0x33]);
+    /// assert_eq!(-34253, rdr.read_i32::<BigEndian>().unwrap());
+    /// ```
+    #[inline]
+    fn read_i32<T: ByteOrder>(&mut self) -> Result<i32> {
+        let mut buf = [0; 4];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_i32(&buf))
+    }
+
+    /// Reads an unsigned 48 bit integer from the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read unsigned 48 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![0xb6, 0x71, 0x6b, 0xdc, 0x2b, 0x31]);
+    /// assert_eq!(200598257150769, rdr.read_u48::<BigEndian>().unwrap());
+    /// ```
+    #[inline]
+    fn read_u48<T: ByteOrder>(&mut self) -> Result<u64> {
+        let mut buf = [0; 6];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_u48(&buf))
+    }
+
+    /// Reads a signed 48 bit integer from the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read signed 48 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![0x9d, 0x71, 0xab, 0xe7, 0x97, 0x8f]);
+    /// assert_eq!(-108363435763825, rdr.read_i48::<BigEndian>().unwrap());
+    /// ```
+    #[inline]
+    fn read_i48<T: ByteOrder>(&mut self) -> Result<i64> {
+        let mut buf = [0; 6];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_i48(&buf))
+    }
+
+    /// Reads an unsigned 64 bit integer from the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read an unsigned 64 bit big-endian integer from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![0x00, 0x03, 0x43, 0x95, 0x4d, 0x60, 0x86, 0x83]);
+    /// assert_eq!(918733457491587, rdr.read_u64::<BigEndian>().unwrap());
+    /// ```
+    #[inline]
+    fn read_u64<T: ByteOrder>(&mut self) -> Result<u64> {
+        let mut buf = [0; 8];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_u64(&buf))
+    }
+
+    /// Reads a signed 64 bit integer from the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a signed 64 bit big-endian integer from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![0x80, 0, 0, 0, 0, 0, 0, 0]);
+    /// assert_eq!(i64::min_value(), rdr.read_i64::<BigEndian>().unwrap());
+    /// ```
+    #[inline]
+    fn read_i64<T: ByteOrder>(&mut self) -> Result<i64> {
+        let mut buf = [0; 8];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_i64(&buf))
+    }
+
+    /// Reads an unsigned 128 bit integer from the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read an unsigned 128 bit big-endian integer from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![
+    ///     0x00, 0x03, 0x43, 0x95, 0x4d, 0x60, 0x86, 0x83,
+    ///     0x00, 0x03, 0x43, 0x95, 0x4d, 0x60, 0x86, 0x83
+    /// ]);
+    /// assert_eq!(16947640962301618749969007319746179, rdr.read_u128::<BigEndian>().unwrap());
+    /// ```
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_u128<T: ByteOrder>(&mut self) -> Result<u128> {
+        let mut buf = [0; 16];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_u128(&buf))
+    }
+
+    /// Reads a signed 128 bit integer from the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a signed 128 bit big-endian integer from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
+    /// assert_eq!(i128::min_value(), rdr.read_i128::<BigEndian>().unwrap());
+    /// ```
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_i128<T: ByteOrder>(&mut self) -> Result<i128> {
+        let mut buf = [0; 16];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_i128(&buf))
+    }
+
+    /// Reads an unsigned n-bytes integer from the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read an unsigned n-byte big-endian integer from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![0x80, 0x74, 0xfa]);
+    /// assert_eq!(8418554, rdr.read_uint::<BigEndian>(3).unwrap());
+    #[inline]
+    fn read_uint<T: ByteOrder>(&mut self, nbytes: usize) -> Result<u64> {
+        let mut buf = [0; 8];
+        try!(self.read_exact(&mut buf[..nbytes]));
+        Ok(T::read_uint(&buf[..nbytes], nbytes))
+    }
+
+    /// Reads a signed n-bytes integer from the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read an unsigned n-byte big-endian integer from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![0xc1, 0xff, 0x7c]);
+    /// assert_eq!(-4063364, rdr.read_int::<BigEndian>(3).unwrap());
+    #[inline]
+    fn read_int<T: ByteOrder>(&mut self, nbytes: usize) -> Result<i64> {
+        let mut buf = [0; 8];
+        try!(self.read_exact(&mut buf[..nbytes]));
+        Ok(T::read_int(&buf[..nbytes], nbytes))
+    }
+
+    /// Reads an unsigned n-bytes integer from the underlying reader.
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_uint128<T: ByteOrder>(&mut self, nbytes: usize) -> Result<u128> {
+        let mut buf = [0; 16];
+        try!(self.read_exact(&mut buf[..nbytes]));
+        Ok(T::read_uint128(&buf[..nbytes], nbytes))
+    }
+
+    /// Reads a signed n-bytes integer from the underlying reader.
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_int128<T: ByteOrder>(&mut self, nbytes: usize) -> Result<i128> {
+        let mut buf = [0; 16];
+        try!(self.read_exact(&mut buf[..nbytes]));
+        Ok(T::read_int128(&buf[..nbytes], nbytes))
+    }
+
+    /// Reads a IEEE754 single-precision (4 bytes) floating point number from
+    /// the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a big-endian single-precision floating point number from a `Read`:
+    ///
+    /// ```rust
+    /// use std::f32;
+    /// use std::io::Cursor;
+    ///
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![
+    ///     0x40, 0x49, 0x0f, 0xdb,
+    /// ]);
+    /// assert_eq!(f32::consts::PI, rdr.read_f32::<BigEndian>().unwrap());
+    /// ```
+    #[inline]
+    fn read_f32<T: ByteOrder>(&mut self) -> Result<f32> {
+        let mut buf = [0; 4];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_f32(&buf))
+    }
+
+    /// Reads a IEEE754 double-precision (8 bytes) floating point number from
+    /// the underlying reader.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a big-endian double-precision floating point number from a `Read`:
+    ///
+    /// ```rust
+    /// use std::f64;
+    /// use std::io::Cursor;
+    ///
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![
+    ///     0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18,
+    /// ]);
+    /// assert_eq!(f64::consts::PI, rdr.read_f64::<BigEndian>().unwrap());
+    /// ```
+    #[inline]
+    fn read_f64<T: ByteOrder>(&mut self) -> Result<f64> {
+        let mut buf = [0; 8];
+        try!(self.read_exact(&mut buf));
+        Ok(T::read_f64(&buf))
+    }
+
+    /// Reads a sequence of unsigned 16 bit integers from the underlying
+    /// reader.
+    ///
+    /// The given buffer is either filled completely or an error is returned.
+    /// If an error is returned, the contents of `dst` are unspecified.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a sequence of unsigned 16 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
+    /// let mut dst = [0; 2];
+    /// rdr.read_u16_into::<BigEndian>(&mut dst).unwrap();
+    /// assert_eq!([517, 768], dst);
+    /// ```
+    #[inline]
+    fn read_u16_into<T: ByteOrder>(&mut self, dst: &mut [u16]) -> Result<()> {
+        {
+            let buf = unsafe { slice_to_u8_mut(dst) };
+            try!(self.read_exact(buf));
+        }
+        T::from_slice_u16(dst);
+        Ok(())
+    }
+
+    /// Reads a sequence of unsigned 32 bit integers from the underlying
+    /// reader.
+    ///
+    /// The given buffer is either filled completely or an error is returned.
+    /// If an error is returned, the contents of `dst` are unspecified.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a sequence of unsigned 32 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![0, 0, 2, 5, 0, 0, 3, 0]);
+    /// let mut dst = [0; 2];
+    /// rdr.read_u32_into::<BigEndian>(&mut dst).unwrap();
+    /// assert_eq!([517, 768], dst);
+    /// ```
+    #[inline]
+    fn read_u32_into<T: ByteOrder>(&mut self, dst: &mut [u32]) -> Result<()> {
+        {
+            let buf = unsafe { slice_to_u8_mut(dst) };
+            try!(self.read_exact(buf));
+        }
+        T::from_slice_u32(dst);
+        Ok(())
+    }
+
+    /// Reads a sequence of unsigned 64 bit integers from the underlying
+    /// reader.
+    ///
+    /// The given buffer is either filled completely or an error is returned.
+    /// If an error is returned, the contents of `dst` are unspecified.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a sequence of unsigned 64 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![
+    ///     0, 0, 0, 0, 0, 0, 2, 5,
+    ///     0, 0, 0, 0, 0, 0, 3, 0,
+    /// ]);
+    /// let mut dst = [0; 2];
+    /// rdr.read_u64_into::<BigEndian>(&mut dst).unwrap();
+    /// assert_eq!([517, 768], dst);
+    /// ```
+    #[inline]
+    fn read_u64_into<T: ByteOrder>(&mut self, dst: &mut [u64]) -> Result<()> {
+        {
+            let buf = unsafe { slice_to_u8_mut(dst) };
+            try!(self.read_exact(buf));
+        }
+        T::from_slice_u64(dst);
+        Ok(())
+    }
+
+    /// Reads a sequence of unsigned 128 bit integers from the underlying
+    /// reader.
+    ///
+    /// The given buffer is either filled completely or an error is returned.
+    /// If an error is returned, the contents of `dst` are unspecified.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a sequence of unsigned 128 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![
+    ///     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5,
+    ///     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+    /// ]);
+    /// let mut dst = [0; 2];
+    /// rdr.read_u128_into::<BigEndian>(&mut dst).unwrap();
+    /// assert_eq!([517, 768], dst);
+    /// ```
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_u128_into<T: ByteOrder>(
+        &mut self,
+        dst: &mut [u128],
+    ) -> Result<()> {
+        {
+            let buf = unsafe { slice_to_u8_mut(dst) };
+            try!(self.read_exact(buf));
+        }
+        T::from_slice_u128(dst);
+        Ok(())
+    }
+
+    /// Reads a sequence of signed 8 bit integers from the underlying reader.
+    ///
+    /// The given buffer is either filled completely or an error is returned.
+    /// If an error is returned, the contents of `dst` are unspecified.
+    ///
+    /// Note that since each `i8` is a single byte, no byte order conversions
+    /// are used. This method is included because it provides a safe, simple
+    /// way for the caller to read into a `&mut [i8]` buffer. (Without this
+    /// method, the caller would have to either use `unsafe` code or convert
+    /// each byte to `i8` individually.)
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a sequence of signed 8 bit integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![2, 251, 3]);
+    /// let mut dst = [0; 3];
+    /// rdr.read_i8_into(&mut dst).unwrap();
+    /// assert_eq!([2, -5, 3], dst);
+    /// ```
+    #[inline]
+    fn read_i8_into(&mut self, dst: &mut [i8]) -> Result<()> {
+        let buf = unsafe { slice_to_u8_mut(dst) };
+        self.read_exact(buf)
+    }
+
+    /// Reads a sequence of signed 16 bit integers from the underlying
+    /// reader.
+    ///
+    /// The given buffer is either filled completely or an error is returned.
+    /// If an error is returned, the contents of `dst` are unspecified.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a sequence of signed 16 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
+    /// let mut dst = [0; 2];
+    /// rdr.read_i16_into::<BigEndian>(&mut dst).unwrap();
+    /// assert_eq!([517, 768], dst);
+    /// ```
+    #[inline]
+    fn read_i16_into<T: ByteOrder>(&mut self, dst: &mut [i16]) -> Result<()> {
+        {
+            let buf = unsafe { slice_to_u8_mut(dst) };
+            try!(self.read_exact(buf));
+        }
+        T::from_slice_i16(dst);
+        Ok(())
+    }
+
+    /// Reads a sequence of signed 32 bit integers from the underlying
+    /// reader.
+    ///
+    /// The given buffer is either filled completely or an error is returned.
+    /// If an error is returned, the contents of `dst` are unspecified.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a sequence of signed 32 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![0, 0, 2, 5, 0, 0, 3, 0]);
+    /// let mut dst = [0; 2];
+    /// rdr.read_i32_into::<BigEndian>(&mut dst).unwrap();
+    /// assert_eq!([517, 768], dst);
+    /// ```
+    #[inline]
+    fn read_i32_into<T: ByteOrder>(&mut self, dst: &mut [i32]) -> Result<()> {
+        {
+            let buf = unsafe { slice_to_u8_mut(dst) };
+            try!(self.read_exact(buf));
+        }
+        T::from_slice_i32(dst);
+        Ok(())
+    }
+
+    /// Reads a sequence of signed 64 bit integers from the underlying
+    /// reader.
+    ///
+    /// The given buffer is either filled completely or an error is returned.
+    /// If an error is returned, the contents of `dst` are unspecified.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a sequence of signed 64 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![
+    ///     0, 0, 0, 0, 0, 0, 2, 5,
+    ///     0, 0, 0, 0, 0, 0, 3, 0,
+    /// ]);
+    /// let mut dst = [0; 2];
+    /// rdr.read_i64_into::<BigEndian>(&mut dst).unwrap();
+    /// assert_eq!([517, 768], dst);
+    /// ```
+    #[inline]
+    fn read_i64_into<T: ByteOrder>(&mut self, dst: &mut [i64]) -> Result<()> {
+        {
+            let buf = unsafe { slice_to_u8_mut(dst) };
+            try!(self.read_exact(buf));
+        }
+        T::from_slice_i64(dst);
+        Ok(())
+    }
+
+    /// Reads a sequence of signed 128 bit integers from the underlying
+    /// reader.
+    ///
+    /// The given buffer is either filled completely or an error is returned.
+    /// If an error is returned, the contents of `dst` are unspecified.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a sequence of signed 128 bit big-endian integers from a `Read`:
+    ///
+    /// ```rust
+    /// use std::io::Cursor;
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![
+    ///     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5,
+    ///     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0,
+    /// ]);
+    /// let mut dst = [0; 2];
+    /// rdr.read_i128_into::<BigEndian>(&mut dst).unwrap();
+    /// assert_eq!([517, 768], dst);
+    /// ```
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_i128_into<T: ByteOrder>(
+        &mut self,
+        dst: &mut [i128],
+    ) -> Result<()> {
+        {
+            let buf = unsafe { slice_to_u8_mut(dst) };
+            try!(self.read_exact(buf));
+        }
+        T::from_slice_i128(dst);
+        Ok(())
+    }
+
+    /// Reads a sequence of IEEE754 single-precision (4 bytes) floating
+    /// point numbers from the underlying reader.
+    ///
+    /// The given buffer is either filled completely or an error is returned.
+    /// If an error is returned, the contents of `dst` are unspecified.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a sequence of big-endian single-precision floating point number
+    /// from a `Read`:
+    ///
+    /// ```rust
+    /// use std::f32;
+    /// use std::io::Cursor;
+    ///
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![
+    ///     0x40, 0x49, 0x0f, 0xdb,
+    ///     0x3f, 0x80, 0x00, 0x00,
+    /// ]);
+    /// let mut dst = [0.0; 2];
+    /// rdr.read_f32_into::<BigEndian>(&mut dst).unwrap();
+    /// assert_eq!([f32::consts::PI, 1.0], dst);
+    /// ```
+    #[inline]
+    fn read_f32_into<T: ByteOrder>(
+        &mut self,
+        dst: &mut [f32],
+    ) -> Result<()> {
+        {
+            let buf = unsafe { slice_to_u8_mut(dst) };
+            try!(self.read_exact(buf));
+        }
+        T::from_slice_f32(dst);
+        Ok(())
+    }
+
+    /// **DEPRECATED**.
+    ///
+    /// This method is deprecated. Use `read_f32_into` instead.
+    ///
+    /// Reads a sequence of IEEE754 single-precision (4 bytes) floating
+    /// point numbers from the underlying reader.
+    ///
+    /// The given buffer is either filled completely or an error is returned.
+    /// If an error is returned, the contents of `dst` are unspecified.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a sequence of big-endian single-precision floating point number
+    /// from a `Read`:
+    ///
+    /// ```rust
+    /// use std::f32;
+    /// use std::io::Cursor;
+    ///
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![
+    ///     0x40, 0x49, 0x0f, 0xdb,
+    ///     0x3f, 0x80, 0x00, 0x00,
+    /// ]);
+    /// let mut dst = [0.0; 2];
+    /// rdr.read_f32_into_unchecked::<BigEndian>(&mut dst).unwrap();
+    /// assert_eq!([f32::consts::PI, 1.0], dst);
+    /// ```
+    #[inline]
+    #[deprecated(since="1.2.0", note="please use `read_f32_into` instead")]
+    fn read_f32_into_unchecked<T: ByteOrder>(
+        &mut self,
+        dst: &mut [f32],
+    ) -> Result<()> {
+        self.read_f32_into::<T>(dst)
+    }
+
+    /// Reads a sequence of IEEE754 double-precision (8 bytes) floating
+    /// point numbers from the underlying reader.
+    ///
+    /// The given buffer is either filled completely or an error is returned.
+    /// If an error is returned, the contents of `dst` are unspecified.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a sequence of big-endian single-precision floating point number
+    /// from a `Read`:
+    ///
+    /// ```rust
+    /// use std::f64;
+    /// use std::io::Cursor;
+    ///
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![
+    ///     0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18,
+    ///     0x3f, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    /// ]);
+    /// let mut dst = [0.0; 2];
+    /// rdr.read_f64_into::<BigEndian>(&mut dst).unwrap();
+    /// assert_eq!([f64::consts::PI, 1.0], dst);
+    /// ```
+    #[inline]
+    fn read_f64_into<T: ByteOrder>(
+        &mut self,
+        dst: &mut [f64],
+    ) -> Result<()> {
+        {
+            let buf = unsafe { slice_to_u8_mut(dst) };
+            try!(self.read_exact(buf));
+        }
+        T::from_slice_f64(dst);
+        Ok(())
+    }
+
+    /// **DEPRECATED**.
+    ///
+    /// This method is deprecated. Use `read_f64_into` instead.
+    ///
+    /// Reads a sequence of IEEE754 double-precision (8 bytes) floating
+    /// point numbers from the underlying reader.
+    ///
+    /// The given buffer is either filled completely or an error is returned.
+    /// If an error is returned, the contents of `dst` are unspecified.
+    ///
+    /// # Safety
+    ///
+    /// This method is unsafe because there are no guarantees made about the
+    /// floating point values. In particular, this method does not check for
+    /// signaling NaNs, which may result in undefined behavior.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Read::read_exact`].
+    ///
+    /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact
+    ///
+    /// # Examples
+    ///
+    /// Read a sequence of big-endian single-precision floating point number
+    /// from a `Read`:
+    ///
+    /// ```rust
+    /// use std::f64;
+    /// use std::io::Cursor;
+    ///
+    /// use byteorder::{BigEndian, ReadBytesExt};
+    ///
+    /// let mut rdr = Cursor::new(vec![
+    ///     0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18,
+    ///     0x3f, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    /// ]);
+    /// let mut dst = [0.0; 2];
+    /// rdr.read_f64_into_unchecked::<BigEndian>(&mut dst).unwrap();
+    /// assert_eq!([f64::consts::PI, 1.0], dst);
+    /// ```
+    #[inline]
+    #[deprecated(since="1.2.0", note="please use `read_f64_into` instead")]
+    fn read_f64_into_unchecked<T: ByteOrder>(
+        &mut self,
+        dst: &mut [f64],
+    ) -> Result<()> {
+        self.read_f64_into::<T>(dst)
+    }
+}
+
+/// All types that implement `Read` get methods defined in `ReadBytesExt`
+/// for free.
+impl<R: io::Read + ?Sized> ReadBytesExt for R {}
+
+/// Extends [`Write`] with methods for writing numbers. (For `std::io`.)
+///
+/// Most of the methods defined here have an unconstrained type parameter that
+/// must be explicitly instantiated. Typically, it is instantiated with either
+/// the [`BigEndian`] or [`LittleEndian`] types defined in this crate.
+///
+/// # Examples
+///
+/// Write unsigned 16 bit big-endian integers to a [`Write`]:
+///
+/// ```rust
+/// use byteorder::{BigEndian, WriteBytesExt};
+///
+/// let mut wtr = vec![];
+/// wtr.write_u16::<BigEndian>(517).unwrap();
+/// wtr.write_u16::<BigEndian>(768).unwrap();
+/// assert_eq!(wtr, vec![2, 5, 3, 0]);
+/// ```
+///
+/// [`BigEndian`]: enum.BigEndian.html
+/// [`LittleEndian`]: enum.LittleEndian.html
+/// [`Write`]: https://doc.rust-lang.org/std/io/trait.Write.html
+pub trait WriteBytesExt: io::Write {
+    /// Writes an unsigned 8 bit integer to the underlying writer.
+    ///
+    /// Note that since this writes a single byte, no byte order conversions
+    /// are used. It is included for completeness.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Examples
+    ///
+    /// Write unsigned 8 bit integers to a `Write`:
+    ///
+    /// ```rust
+    /// use byteorder::WriteBytesExt;
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_u8(2).unwrap();
+    /// wtr.write_u8(5).unwrap();
+    /// assert_eq!(wtr, b"\x02\x05");
+    /// ```
+    #[inline]
+    fn write_u8(&mut self, n: u8) -> Result<()> {
+        self.write_all(&[n])
+    }
+
+    /// Writes a signed 8 bit integer to the underlying writer.
+    ///
+    /// Note that since this writes a single byte, no byte order conversions
+    /// are used. It is included for completeness.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Examples
+    ///
+    /// Write signed 8 bit integers to a `Write`:
+    ///
+    /// ```rust
+    /// use byteorder::WriteBytesExt;
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_i8(2).unwrap();
+    /// wtr.write_i8(-5).unwrap();
+    /// assert_eq!(wtr, b"\x02\xfb");
+    /// ```
+    #[inline]
+    fn write_i8(&mut self, n: i8) -> Result<()> {
+        self.write_all(&[n as u8])
+    }
+
+    /// Writes an unsigned 16 bit integer to the underlying writer.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Examples
+    ///
+    /// Write unsigned 16 bit big-endian integers to a `Write`:
+    ///
+    /// ```rust
+    /// use byteorder::{BigEndian, WriteBytesExt};
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_u16::<BigEndian>(517).unwrap();
+    /// wtr.write_u16::<BigEndian>(768).unwrap();
+    /// assert_eq!(wtr, b"\x02\x05\x03\x00");
+    /// ```
+    #[inline]
+    fn write_u16<T: ByteOrder>(&mut self, n: u16) -> Result<()> {
+        let mut buf = [0; 2];
+        T::write_u16(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes a signed 16 bit integer to the underlying writer.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Examples
+    ///
+    /// Write signed 16 bit big-endian integers to a `Write`:
+    ///
+    /// ```rust
+    /// use byteorder::{BigEndian, WriteBytesExt};
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_i16::<BigEndian>(193).unwrap();
+    /// wtr.write_i16::<BigEndian>(-132).unwrap();
+    /// assert_eq!(wtr, b"\x00\xc1\xff\x7c");
+    /// ```
+    #[inline]
+    fn write_i16<T: ByteOrder>(&mut self, n: i16) -> Result<()> {
+        let mut buf = [0; 2];
+        T::write_i16(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes an unsigned 24 bit integer to the underlying writer.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Examples
+    ///
+    /// Write unsigned 24 bit big-endian integers to a `Write`:
+    ///
+    /// ```rust
+    /// use byteorder::{BigEndian, WriteBytesExt};
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_u24::<BigEndian>(267).unwrap();
+    /// wtr.write_u24::<BigEndian>(120111).unwrap();
+    /// assert_eq!(wtr, b"\x00\x01\x0b\x01\xd5\x2f");
+    /// ```
+    #[inline]
+    fn write_u24<T: ByteOrder>(&mut self, n: u32) -> Result<()> {
+        let mut buf = [0; 3];
+        T::write_u24(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes a signed 24 bit integer to the underlying writer.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Examples
+    ///
+    /// Write signed 24 bit big-endian integers to a `Write`:
+    ///
+    /// ```rust
+    /// use byteorder::{BigEndian, WriteBytesExt};
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_i24::<BigEndian>(-34253).unwrap();
+    /// wtr.write_i24::<BigEndian>(120111).unwrap();
+    /// assert_eq!(wtr, b"\xff\x7a\x33\x01\xd5\x2f");
+    /// ```
+    #[inline]
+    fn write_i24<T: ByteOrder>(&mut self, n: i32) -> Result<()> {
+        let mut buf = [0; 3];
+        T::write_i24(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes an unsigned 32 bit integer to the underlying writer.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Examples
+    ///
+    /// Write unsigned 32 bit big-endian integers to a `Write`:
+    ///
+    /// ```rust
+    /// use byteorder::{BigEndian, WriteBytesExt};
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_u32::<BigEndian>(267).unwrap();
+    /// wtr.write_u32::<BigEndian>(1205419366).unwrap();
+    /// assert_eq!(wtr, b"\x00\x00\x01\x0b\x47\xd9\x3d\x66");
+    /// ```
+    #[inline]
+    fn write_u32<T: ByteOrder>(&mut self, n: u32) -> Result<()> {
+        let mut buf = [0; 4];
+        T::write_u32(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes a signed 32 bit integer to the underlying writer.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Examples
+    ///
+    /// Write signed 32 bit big-endian integers to a `Write`:
+    ///
+    /// ```rust
+    /// use byteorder::{BigEndian, WriteBytesExt};
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_i32::<BigEndian>(-34253).unwrap();
+    /// wtr.write_i32::<BigEndian>(1205419366).unwrap();
+    /// assert_eq!(wtr, b"\xff\xff\x7a\x33\x47\xd9\x3d\x66");
+    /// ```
+    #[inline]
+    fn write_i32<T: ByteOrder>(&mut self, n: i32) -> Result<()> {
+        let mut buf = [0; 4];
+        T::write_i32(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes an unsigned 48 bit integer to the underlying writer.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Examples
+    ///
+    /// Write unsigned 48 bit big-endian integers to a `Write`:
+    ///
+    /// ```rust
+    /// use byteorder::{BigEndian, WriteBytesExt};
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_u48::<BigEndian>(52360336390828).unwrap();
+    /// wtr.write_u48::<BigEndian>(541).unwrap();
+    /// assert_eq!(wtr, b"\x2f\x9f\x17\x40\x3a\xac\x00\x00\x00\x00\x02\x1d");
+    /// ```
+    #[inline]
+    fn write_u48<T: ByteOrder>(&mut self, n: u64) -> Result<()> {
+        let mut buf = [0; 6];
+        T::write_u48(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes a signed 48 bit integer to the underlying writer.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Examples
+    ///
+    /// Write signed 48 bit big-endian integers to a `Write`:
+    ///
+    /// ```rust
+    /// use byteorder::{BigEndian, WriteBytesExt};
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_i48::<BigEndian>(-108363435763825).unwrap();
+    /// wtr.write_i48::<BigEndian>(77).unwrap();
+    /// assert_eq!(wtr, b"\x9d\x71\xab\xe7\x97\x8f\x00\x00\x00\x00\x00\x4d");
+    /// ```
+    #[inline]
+    fn write_i48<T: ByteOrder>(&mut self, n: i64) -> Result<()> {
+        let mut buf = [0; 6];
+        T::write_i48(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes an unsigned 64 bit integer to the underlying writer.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Examples
+    ///
+    /// Write unsigned 64 bit big-endian integers to a `Write`:
+    ///
+    /// ```rust
+    /// use byteorder::{BigEndian, WriteBytesExt};
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_u64::<BigEndian>(918733457491587).unwrap();
+    /// wtr.write_u64::<BigEndian>(143).unwrap();
+    /// assert_eq!(wtr, b"\x00\x03\x43\x95\x4d\x60\x86\x83\x00\x00\x00\x00\x00\x00\x00\x8f");
+    /// ```
+    #[inline]
+    fn write_u64<T: ByteOrder>(&mut self, n: u64) -> Result<()> {
+        let mut buf = [0; 8];
+        T::write_u64(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes a signed 64 bit integer to the underlying writer.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Examples
+    ///
+    /// Write signed 64 bit big-endian integers to a `Write`:
+    ///
+    /// ```rust
+    /// use byteorder::{BigEndian, WriteBytesExt};
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_i64::<BigEndian>(i64::min_value()).unwrap();
+    /// wtr.write_i64::<BigEndian>(i64::max_value()).unwrap();
+    /// assert_eq!(wtr, b"\x80\x00\x00\x00\x00\x00\x00\x00\x7f\xff\xff\xff\xff\xff\xff\xff");
+    /// ```
+    #[inline]
+    fn write_i64<T: ByteOrder>(&mut self, n: i64) -> Result<()> {
+        let mut buf = [0; 8];
+        T::write_i64(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes an unsigned 128 bit integer to the underlying writer.
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn write_u128<T: ByteOrder>(&mut self, n: u128) -> Result<()> {
+        let mut buf = [0; 16];
+        T::write_u128(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes a signed 128 bit integer to the underlying writer.
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn write_i128<T: ByteOrder>(&mut self, n: i128) -> Result<()> {
+        let mut buf = [0; 16];
+        T::write_i128(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes an unsigned n-bytes integer to the underlying writer.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Panics
+    ///
+    /// If the given integer is not representable in the given number of bytes,
+    /// this method panics. If `nbytes > 8`, this method panics.
+    ///
+    /// # Examples
+    ///
+    /// Write unsigned 40 bit big-endian integers to a `Write`:
+    ///
+    /// ```rust
+    /// use byteorder::{BigEndian, WriteBytesExt};
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_uint::<BigEndian>(312550384361, 5).unwrap();
+    /// wtr.write_uint::<BigEndian>(43, 5).unwrap();
+    /// assert_eq!(wtr, b"\x48\xc5\x74\x62\xe9\x00\x00\x00\x00\x2b");
+    /// ```
+    #[inline]
+    fn write_uint<T: ByteOrder>(
+        &mut self,
+        n: u64,
+        nbytes: usize,
+    ) -> Result<()> {
+        let mut buf = [0; 8];
+        T::write_uint(&mut buf, n, nbytes);
+        self.write_all(&buf[0..nbytes])
+    }
+
+    /// Writes a signed n-bytes integer to the underlying writer.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Panics
+    ///
+    /// If the given integer is not representable in the given number of bytes,
+    /// this method panics. If `nbytes > 8`, this method panics.
+    ///
+    /// # Examples
+    ///
+    /// Write signed 56 bit big-endian integers to a `Write`:
+    ///
+    /// ```rust
+    /// use byteorder::{BigEndian, WriteBytesExt};
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_int::<BigEndian>(-3548172039376767, 7).unwrap();
+    /// wtr.write_int::<BigEndian>(43, 7).unwrap();
+    /// assert_eq!(wtr, b"\xf3\x64\xf4\xd1\xfd\xb0\x81\x00\x00\x00\x00\x00\x00\x2b");
+    /// ```
+    #[inline]
+    fn write_int<T: ByteOrder>(
+        &mut self,
+        n: i64,
+        nbytes: usize,
+    ) -> Result<()> {
+        let mut buf = [0; 8];
+        T::write_int(&mut buf, n, nbytes);
+        self.write_all(&buf[0..nbytes])
+    }
+
+    /// Writes an unsigned n-bytes integer to the underlying writer.
+    ///
+    /// If the given integer is not representable in the given number of bytes,
+    /// this method panics. If `nbytes > 16`, this method panics.
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn write_uint128<T: ByteOrder>(
+        &mut self,
+        n: u128,
+        nbytes: usize,
+    ) -> Result<()> {
+        let mut buf = [0; 16];
+        T::write_uint128(&mut buf, n, nbytes);
+        self.write_all(&buf[0..nbytes])
+    }
+
+    /// Writes a signed n-bytes integer to the underlying writer.
+    ///
+    /// If the given integer is not representable in the given number of bytes,
+    /// this method panics. If `nbytes > 16`, this method panics.
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn write_int128<T: ByteOrder>(
+        &mut self,
+        n: i128,
+        nbytes: usize,
+    ) -> Result<()> {
+        let mut buf = [0; 16];
+        T::write_int128(&mut buf, n, nbytes);
+        self.write_all(&buf[0..nbytes])
+    }
+
+    /// Writes a IEEE754 single-precision (4 bytes) floating point number to
+    /// the underlying writer.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Examples
+    ///
+    /// Write a big-endian single-precision floating point number to a `Write`:
+    ///
+    /// ```rust
+    /// use std::f32;
+    ///
+    /// use byteorder::{BigEndian, WriteBytesExt};
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_f32::<BigEndian>(f32::consts::PI).unwrap();
+    /// assert_eq!(wtr, b"\x40\x49\x0f\xdb");
+    /// ```
+    #[inline]
+    fn write_f32<T: ByteOrder>(&mut self, n: f32) -> Result<()> {
+        let mut buf = [0; 4];
+        T::write_f32(&mut buf, n);
+        self.write_all(&buf)
+    }
+
+    /// Writes a IEEE754 double-precision (8 bytes) floating point number to
+    /// the underlying writer.
+    ///
+    /// # Errors
+    ///
+    /// This method returns the same errors as [`Write::write_all`].
+    ///
+    /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all
+    ///
+    /// # Examples
+    ///
+    /// Write a big-endian double-precision floating point number to a `Write`:
+    ///
+    /// ```rust
+    /// use std::f64;
+    ///
+    /// use byteorder::{BigEndian, WriteBytesExt};
+    ///
+    /// let mut wtr = Vec::new();
+    /// wtr.write_f64::<BigEndian>(f64::consts::PI).unwrap();
+    /// assert_eq!(wtr, b"\x40\x09\x21\xfb\x54\x44\x2d\x18");
+    /// ```
+    #[inline]
+    fn write_f64<T: ByteOrder>(&mut self, n: f64) -> Result<()> {
+        let mut buf = [0; 8];
+        T::write_f64(&mut buf, n);
+        self.write_all(&buf)
+    }
+}
+
+/// All types that implement `Write` get methods defined in `WriteBytesExt`
+/// for free.
+impl<W: io::Write + ?Sized> WriteBytesExt for W {}
+
+/// Convert a slice of T (where T is plain old data) to its mutable binary
+/// representation.
+///
+/// This function is wildly unsafe because it permits arbitrary modification of
+/// the binary representation of any `Copy` type. Use with care.
+unsafe fn slice_to_u8_mut<T: Copy>(slice: &mut [T]) -> &mut [u8] {
+    use std::mem::size_of;
+
+    let len = size_of::<T>() * slice.len();
+    slice::from_raw_parts_mut(slice.as_mut_ptr() as *mut u8, len)
+}
+
+
\ No newline at end of file diff --git a/src/byteorder/lib.rs.html b/src/byteorder/lib.rs.html new file mode 100644 index 0000000..33a9066 --- /dev/null +++ b/src/byteorder/lib.rs.html @@ -0,0 +1,6659 @@ +lib.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+2277
+2278
+2279
+2280
+2281
+2282
+2283
+2284
+2285
+2286
+2287
+2288
+2289
+2290
+2291
+2292
+2293
+2294
+2295
+2296
+2297
+2298
+2299
+2300
+2301
+2302
+2303
+2304
+2305
+2306
+2307
+2308
+2309
+2310
+2311
+2312
+2313
+2314
+2315
+2316
+2317
+2318
+2319
+2320
+2321
+2322
+2323
+2324
+2325
+2326
+2327
+2328
+2329
+2330
+2331
+2332
+2333
+2334
+2335
+2336
+2337
+2338
+2339
+2340
+2341
+2342
+2343
+2344
+2345
+2346
+2347
+2348
+2349
+2350
+2351
+2352
+2353
+2354
+2355
+2356
+2357
+2358
+2359
+2360
+2361
+2362
+2363
+2364
+2365
+2366
+2367
+2368
+2369
+2370
+2371
+2372
+2373
+2374
+2375
+2376
+2377
+2378
+2379
+2380
+2381
+2382
+2383
+2384
+2385
+2386
+2387
+2388
+2389
+2390
+2391
+2392
+2393
+2394
+2395
+2396
+2397
+2398
+2399
+2400
+2401
+2402
+2403
+2404
+2405
+2406
+2407
+2408
+2409
+2410
+2411
+2412
+2413
+2414
+2415
+2416
+2417
+2418
+2419
+2420
+2421
+2422
+2423
+2424
+2425
+2426
+2427
+2428
+2429
+2430
+2431
+2432
+2433
+2434
+2435
+2436
+2437
+2438
+2439
+2440
+2441
+2442
+2443
+2444
+2445
+2446
+2447
+2448
+2449
+2450
+2451
+2452
+2453
+2454
+2455
+2456
+2457
+2458
+2459
+2460
+2461
+2462
+2463
+2464
+2465
+2466
+2467
+2468
+2469
+2470
+2471
+2472
+2473
+2474
+2475
+2476
+2477
+2478
+2479
+2480
+2481
+2482
+2483
+2484
+2485
+2486
+2487
+2488
+2489
+2490
+2491
+2492
+2493
+2494
+2495
+2496
+2497
+2498
+2499
+2500
+2501
+2502
+2503
+2504
+2505
+2506
+2507
+2508
+2509
+2510
+2511
+2512
+2513
+2514
+2515
+2516
+2517
+2518
+2519
+2520
+2521
+2522
+2523
+2524
+2525
+2526
+2527
+2528
+2529
+2530
+2531
+2532
+2533
+2534
+2535
+2536
+2537
+2538
+2539
+2540
+2541
+2542
+2543
+2544
+2545
+2546
+2547
+2548
+2549
+2550
+2551
+2552
+2553
+2554
+2555
+2556
+2557
+2558
+2559
+2560
+2561
+2562
+2563
+2564
+2565
+2566
+2567
+2568
+2569
+2570
+2571
+2572
+2573
+2574
+2575
+2576
+2577
+2578
+2579
+2580
+2581
+2582
+2583
+2584
+2585
+2586
+2587
+2588
+2589
+2590
+2591
+2592
+2593
+2594
+2595
+2596
+2597
+2598
+2599
+2600
+2601
+2602
+2603
+2604
+2605
+2606
+2607
+2608
+2609
+2610
+2611
+2612
+2613
+2614
+2615
+2616
+2617
+2618
+2619
+2620
+2621
+2622
+2623
+2624
+2625
+2626
+2627
+2628
+2629
+2630
+2631
+2632
+2633
+2634
+2635
+2636
+2637
+2638
+2639
+2640
+2641
+2642
+2643
+2644
+2645
+2646
+2647
+2648
+2649
+2650
+2651
+2652
+2653
+2654
+2655
+2656
+2657
+2658
+2659
+2660
+2661
+2662
+2663
+2664
+2665
+2666
+2667
+2668
+2669
+2670
+2671
+2672
+2673
+2674
+2675
+2676
+2677
+2678
+2679
+2680
+2681
+2682
+2683
+2684
+2685
+2686
+2687
+2688
+2689
+2690
+2691
+2692
+2693
+2694
+2695
+2696
+2697
+2698
+2699
+2700
+2701
+2702
+2703
+2704
+2705
+2706
+2707
+2708
+2709
+2710
+2711
+2712
+2713
+2714
+2715
+2716
+2717
+2718
+2719
+2720
+2721
+2722
+2723
+2724
+2725
+2726
+2727
+2728
+2729
+2730
+2731
+2732
+2733
+2734
+2735
+2736
+2737
+2738
+2739
+2740
+2741
+2742
+2743
+2744
+2745
+2746
+2747
+2748
+2749
+2750
+2751
+2752
+2753
+2754
+2755
+2756
+2757
+2758
+2759
+2760
+2761
+2762
+2763
+2764
+2765
+2766
+2767
+2768
+2769
+2770
+2771
+2772
+2773
+2774
+2775
+2776
+2777
+2778
+2779
+2780
+2781
+2782
+2783
+2784
+2785
+2786
+2787
+2788
+2789
+2790
+2791
+2792
+2793
+2794
+2795
+2796
+2797
+2798
+2799
+2800
+2801
+2802
+2803
+2804
+2805
+2806
+2807
+2808
+2809
+2810
+2811
+2812
+2813
+2814
+2815
+2816
+2817
+2818
+2819
+2820
+2821
+2822
+2823
+2824
+2825
+2826
+2827
+2828
+2829
+2830
+2831
+2832
+2833
+2834
+2835
+2836
+2837
+2838
+2839
+2840
+2841
+2842
+2843
+2844
+2845
+2846
+2847
+2848
+2849
+2850
+2851
+2852
+2853
+2854
+2855
+2856
+2857
+2858
+2859
+2860
+2861
+2862
+2863
+2864
+2865
+2866
+2867
+2868
+2869
+2870
+2871
+2872
+2873
+2874
+2875
+2876
+2877
+2878
+2879
+2880
+2881
+2882
+2883
+2884
+2885
+2886
+2887
+2888
+2889
+2890
+2891
+2892
+2893
+2894
+2895
+2896
+2897
+2898
+2899
+2900
+2901
+2902
+2903
+2904
+2905
+2906
+2907
+2908
+2909
+2910
+2911
+2912
+2913
+2914
+2915
+2916
+2917
+2918
+2919
+2920
+2921
+2922
+2923
+2924
+2925
+2926
+2927
+2928
+2929
+2930
+2931
+2932
+2933
+2934
+2935
+2936
+2937
+2938
+2939
+2940
+2941
+2942
+2943
+2944
+2945
+2946
+2947
+2948
+2949
+2950
+2951
+2952
+2953
+2954
+2955
+2956
+2957
+2958
+2959
+2960
+2961
+2962
+2963
+2964
+2965
+2966
+2967
+2968
+2969
+2970
+2971
+2972
+2973
+2974
+2975
+2976
+2977
+2978
+2979
+2980
+2981
+2982
+2983
+2984
+2985
+2986
+2987
+2988
+2989
+2990
+2991
+2992
+2993
+2994
+2995
+2996
+2997
+2998
+2999
+3000
+3001
+3002
+3003
+3004
+3005
+3006
+3007
+3008
+3009
+3010
+3011
+3012
+3013
+3014
+3015
+3016
+3017
+3018
+3019
+3020
+3021
+3022
+3023
+3024
+3025
+3026
+3027
+3028
+3029
+3030
+3031
+3032
+3033
+3034
+3035
+3036
+3037
+3038
+3039
+3040
+3041
+3042
+3043
+3044
+3045
+3046
+3047
+3048
+3049
+3050
+3051
+3052
+3053
+3054
+3055
+3056
+3057
+3058
+3059
+3060
+3061
+3062
+3063
+3064
+3065
+3066
+3067
+3068
+3069
+3070
+3071
+3072
+3073
+3074
+3075
+3076
+3077
+3078
+3079
+3080
+3081
+3082
+3083
+3084
+3085
+3086
+3087
+3088
+3089
+3090
+3091
+3092
+3093
+3094
+3095
+3096
+3097
+3098
+3099
+3100
+3101
+3102
+3103
+3104
+3105
+3106
+3107
+3108
+3109
+3110
+3111
+3112
+3113
+3114
+3115
+3116
+3117
+3118
+3119
+3120
+3121
+3122
+3123
+3124
+3125
+3126
+3127
+3128
+3129
+3130
+3131
+3132
+3133
+3134
+3135
+3136
+3137
+3138
+3139
+3140
+3141
+3142
+3143
+3144
+3145
+3146
+3147
+3148
+3149
+3150
+3151
+3152
+3153
+3154
+3155
+3156
+3157
+3158
+3159
+3160
+3161
+3162
+3163
+3164
+3165
+3166
+3167
+3168
+3169
+3170
+3171
+3172
+3173
+3174
+3175
+3176
+3177
+3178
+3179
+3180
+3181
+3182
+3183
+3184
+3185
+3186
+3187
+3188
+3189
+3190
+3191
+3192
+3193
+3194
+3195
+3196
+3197
+3198
+3199
+3200
+3201
+3202
+3203
+3204
+3205
+3206
+3207
+3208
+3209
+3210
+3211
+3212
+3213
+3214
+3215
+3216
+3217
+3218
+3219
+3220
+3221
+3222
+3223
+3224
+3225
+3226
+3227
+3228
+3229
+3230
+3231
+3232
+3233
+3234
+3235
+3236
+3237
+3238
+3239
+3240
+3241
+3242
+3243
+3244
+3245
+3246
+3247
+3248
+3249
+3250
+3251
+3252
+3253
+3254
+3255
+3256
+3257
+3258
+3259
+3260
+3261
+3262
+3263
+3264
+3265
+3266
+3267
+3268
+3269
+3270
+3271
+3272
+3273
+3274
+3275
+3276
+3277
+3278
+3279
+3280
+3281
+3282
+3283
+3284
+3285
+3286
+3287
+3288
+3289
+3290
+3291
+3292
+3293
+3294
+3295
+3296
+3297
+3298
+3299
+3300
+3301
+3302
+3303
+3304
+3305
+3306
+3307
+3308
+3309
+3310
+3311
+3312
+3313
+3314
+3315
+3316
+3317
+3318
+3319
+3320
+3321
+3322
+3323
+3324
+3325
+3326
+3327
+3328
+
+/*!
+This crate provides convenience methods for encoding and decoding numbers in
+either [big-endian or little-endian order].
+
+The organization of the crate is pretty simple. A trait, [`ByteOrder`], specifies
+byte conversion methods for each type of number in Rust (sans numbers that have
+a platform dependent size like `usize` and `isize`). Two types, [`BigEndian`]
+and [`LittleEndian`] implement these methods. Finally, [`ReadBytesExt`] and
+[`WriteBytesExt`] provide convenience methods available to all types that
+implement [`Read`] and [`Write`].
+
+An alias, [`NetworkEndian`], for [`BigEndian`] is provided to help improve
+code clarity.
+
+An additional alias, [`NativeEndian`], is provided for the endianness of the
+local platform. This is convenient when serializing data for use and
+conversions are not desired.
+
+# Examples
+
+Read unsigned 16 bit big-endian integers from a [`Read`] type:
+
+```rust
+use std::io::Cursor;
+use byteorder::{BigEndian, ReadBytesExt};
+
+let mut rdr = Cursor::new(vec![2, 5, 3, 0]);
+// Note that we use type parameters to indicate which kind of byte order
+// we want!
+assert_eq!(517, rdr.read_u16::<BigEndian>().unwrap());
+assert_eq!(768, rdr.read_u16::<BigEndian>().unwrap());
+```
+
+Write unsigned 16 bit little-endian integers to a [`Write`] type:
+
+```rust
+use byteorder::{LittleEndian, WriteBytesExt};
+
+let mut wtr = vec![];
+wtr.write_u16::<LittleEndian>(517).unwrap();
+wtr.write_u16::<LittleEndian>(768).unwrap();
+assert_eq!(wtr, vec![5, 2, 0, 3]);
+```
+
+# Optional Features
+
+This crate optionally provides support for 128 bit values (`i128` and `u128`)
+when built with the `i128` feature enabled.
+
+This crate can also be used without the standard library.
+
+# Alternatives
+
+Note that as of Rust 1.32, the standard numeric types provide built-in methods
+like `to_le_bytes` and `from_le_bytes`, which support some of the same use
+cases.
+
+[big-endian or little-endian order]: https://en.wikipedia.org/wiki/Endianness
+[`ByteOrder`]: trait.ByteOrder.html
+[`BigEndian`]: enum.BigEndian.html
+[`LittleEndian`]: enum.LittleEndian.html
+[`ReadBytesExt`]: trait.ReadBytesExt.html
+[`WriteBytesExt`]: trait.WriteBytesExt.html
+[`NetworkEndian`]: type.NetworkEndian.html
+[`NativeEndian`]: type.NativeEndian.html
+[`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
+[`Write`]: https://doc.rust-lang.org/std/io/trait.Write.html
+*/
+
+#![deny(missing_docs)]
+#![cfg_attr(not(feature = "std"), no_std)]
+
+#[cfg(feature = "std")]
+extern crate core;
+
+#[cfg(test)]
+#[macro_use]
+extern crate doc_comment;
+
+#[cfg(test)]
+doctest!("../README.md");
+
+use core::fmt::Debug;
+use core::hash::Hash;
+use core::ptr::copy_nonoverlapping;
+use core::slice;
+
+#[cfg(feature = "std")]
+pub use io::{ReadBytesExt, WriteBytesExt};
+
+#[cfg(feature = "std")]
+mod io;
+
+#[inline]
+fn extend_sign(val: u64, nbytes: usize) -> i64 {
+    let shift = (8 - nbytes) * 8;
+    (val << shift) as i64 >> shift
+}
+
+#[cfg(byteorder_i128)]
+#[inline]
+fn extend_sign128(val: u128, nbytes: usize) -> i128 {
+    let shift = (16 - nbytes) * 8;
+    (val << shift) as i128 >> shift
+}
+
+#[inline]
+fn unextend_sign(val: i64, nbytes: usize) -> u64 {
+    let shift = (8 - nbytes) * 8;
+    (val << shift) as u64 >> shift
+}
+
+#[cfg(byteorder_i128)]
+#[inline]
+fn unextend_sign128(val: i128, nbytes: usize) -> u128 {
+    let shift = (16 - nbytes) * 8;
+    (val << shift) as u128 >> shift
+}
+
+#[inline]
+fn pack_size(n: u64) -> usize {
+    if n < 1 << 8 {
+        1
+    } else if n < 1 << 16 {
+        2
+    } else if n < 1 << 24 {
+        3
+    } else if n < 1 << 32 {
+        4
+    } else if n < 1 << 40 {
+        5
+    } else if n < 1 << 48 {
+        6
+    } else if n < 1 << 56 {
+        7
+    } else {
+        8
+    }
+}
+
+#[cfg(byteorder_i128)]
+#[inline]
+fn pack_size128(n: u128) -> usize {
+    if n < 1 << 8 {
+        1
+    } else if n < 1 << 16 {
+        2
+    } else if n < 1 << 24 {
+        3
+    } else if n < 1 << 32 {
+        4
+    } else if n < 1 << 40 {
+        5
+    } else if n < 1 << 48 {
+        6
+    } else if n < 1 << 56 {
+        7
+    } else if n < 1 << 64 {
+        8
+    } else if n < 1 << 72 {
+        9
+    } else if n < 1 << 80 {
+        10
+    } else if n < 1 << 88 {
+        11
+    } else if n < 1 << 96 {
+        12
+    } else if n < 1 << 104 {
+        13
+    } else if n < 1 << 112 {
+        14
+    } else if n < 1 << 120 {
+        15
+    } else {
+        16
+    }
+}
+
+mod private {
+    /// Sealed stops crates other than byteorder from implementing any traits
+    /// that use it.
+    pub trait Sealed{}
+    impl Sealed for super::LittleEndian {}
+    impl Sealed for super::BigEndian {}
+}
+
+/// `ByteOrder` describes types that can serialize integers as bytes.
+///
+/// Note that `Self` does not appear anywhere in this trait's definition!
+/// Therefore, in order to use it, you'll need to use syntax like
+/// `T::read_u16(&[0, 1])` where `T` implements `ByteOrder`.
+///
+/// This crate provides two types that implement `ByteOrder`: [`BigEndian`]
+/// and [`LittleEndian`].
+/// This trait is sealed and cannot be implemented for callers to avoid
+/// breaking backwards compatibility when adding new derived traits.
+///
+/// # Examples
+///
+/// Write and read `u32` numbers in little endian order:
+///
+/// ```rust
+/// use byteorder::{ByteOrder, LittleEndian};
+///
+/// let mut buf = [0; 4];
+/// LittleEndian::write_u32(&mut buf, 1_000_000);
+/// assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
+/// ```
+///
+/// Write and read `i16` numbers in big endian order:
+///
+/// ```rust
+/// use byteorder::{ByteOrder, BigEndian};
+///
+/// let mut buf = [0; 2];
+/// BigEndian::write_i16(&mut buf, -5_000);
+/// assert_eq!(-5_000, BigEndian::read_i16(&buf));
+/// ```
+///
+/// [`BigEndian`]: enum.BigEndian.html
+/// [`LittleEndian`]: enum.LittleEndian.html
+pub trait ByteOrder
+    : Clone + Copy + Debug + Default + Eq + Hash + Ord + PartialEq + PartialOrd
+    + private::Sealed
+{
+    /// Reads an unsigned 16 bit integer from `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 2`.
+    fn read_u16(buf: &[u8]) -> u16;
+
+    /// Reads an unsigned 24 bit integer from `buf`, stored in u32.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 3`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read 24 bit `u32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 3];
+    /// LittleEndian::write_u24(&mut buf, 1_000_000);
+    /// assert_eq!(1_000_000, LittleEndian::read_u24(&buf));
+    /// ```
+    fn read_u24(buf: &[u8]) -> u32 {
+        Self::read_uint(buf, 3) as u32
+    }
+
+    /// Reads an unsigned 32 bit integer from `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 4`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 4];
+    /// LittleEndian::write_u32(&mut buf, 1_000_000);
+    /// assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
+    /// ```
+    fn read_u32(buf: &[u8]) -> u32;
+
+    /// Reads an unsigned 48 bit integer from `buf`, stored in u64.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 6`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read 48 bit `u64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 6];
+    /// LittleEndian::write_u48(&mut buf, 1_000_000_000_000);
+    /// assert_eq!(1_000_000_000_000, LittleEndian::read_u48(&buf));
+    /// ```
+    fn read_u48(buf: &[u8]) -> u64 {
+        Self::read_uint(buf, 6) as u64
+    }
+
+    /// Reads an unsigned 64 bit integer from `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 8`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 8];
+    /// LittleEndian::write_u64(&mut buf, 1_000_000);
+    /// assert_eq!(1_000_000, LittleEndian::read_u64(&buf));
+    /// ```
+    fn read_u64(buf: &[u8]) -> u64;
+
+    /// Reads an unsigned 128 bit integer from `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 16`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u128` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 16];
+    /// LittleEndian::write_u128(&mut buf, 1_000_000);
+    /// assert_eq!(1_000_000, LittleEndian::read_u128(&buf));
+    /// ```
+    #[cfg(byteorder_i128)]
+    fn read_u128(buf: &[u8]) -> u128;
+
+    /// Reads an unsigned n-bytes integer from `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `nbytes < 1` or `nbytes > 8` or
+    /// `buf.len() < nbytes`
+    ///
+    /// # Examples
+    ///
+    /// Write and read an n-byte number in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 3];
+    /// LittleEndian::write_uint(&mut buf, 1_000_000, 3);
+    /// assert_eq!(1_000_000, LittleEndian::read_uint(&buf, 3));
+    /// ```
+    fn read_uint(buf: &[u8], nbytes: usize) -> u64;
+
+    /// Reads an unsigned n-bytes integer from `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `nbytes < 1` or `nbytes > 16` or
+    /// `buf.len() < nbytes`
+    ///
+    /// # Examples
+    ///
+    /// Write and read an n-byte number in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 3];
+    /// LittleEndian::write_uint128(&mut buf, 1_000_000, 3);
+    /// assert_eq!(1_000_000, LittleEndian::read_uint128(&buf, 3));
+    /// ```
+    #[cfg(byteorder_i128)]
+    fn read_uint128(buf: &[u8], nbytes: usize) -> u128;
+
+    /// Writes an unsigned 16 bit integer `n` to `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 2`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u16` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 2];
+    /// LittleEndian::write_u16(&mut buf, 1_000);
+    /// assert_eq!(1_000, LittleEndian::read_u16(&buf));
+    /// ```
+    fn write_u16(buf: &mut [u8], n: u16);
+
+    /// Writes an unsigned 24 bit integer `n` to `buf`, stored in u32.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 3`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read 24 bit `u32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 3];
+    /// LittleEndian::write_u24(&mut buf, 1_000_000);
+    /// assert_eq!(1_000_000, LittleEndian::read_u24(&buf));
+    /// ```
+    fn write_u24(buf: &mut [u8], n: u32) {
+        Self::write_uint(buf, n as u64, 3)
+    }
+
+    /// Writes an unsigned 32 bit integer `n` to `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 4`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 4];
+    /// LittleEndian::write_u32(&mut buf, 1_000_000);
+    /// assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
+    /// ```
+    fn write_u32(buf: &mut [u8], n: u32);
+
+    /// Writes an unsigned 48 bit integer `n` to `buf`, stored in u64.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 6`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read 48 bit `u64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 6];
+    /// LittleEndian::write_u48(&mut buf, 1_000_000_000_000);
+    /// assert_eq!(1_000_000_000_000, LittleEndian::read_u48(&buf));
+    /// ```
+    fn write_u48(buf: &mut [u8], n: u64) {
+        Self::write_uint(buf, n as u64, 6)
+    }
+
+    /// Writes an unsigned 64 bit integer `n` to `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 8`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 8];
+    /// LittleEndian::write_u64(&mut buf, 1_000_000);
+    /// assert_eq!(1_000_000, LittleEndian::read_u64(&buf));
+    /// ```
+    fn write_u64(buf: &mut [u8], n: u64);
+
+    /// Writes an unsigned 128 bit integer `n` to `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 16`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u128` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 16];
+    /// LittleEndian::write_u128(&mut buf, 1_000_000);
+    /// assert_eq!(1_000_000, LittleEndian::read_u128(&buf));
+    /// ```
+    #[cfg(byteorder_i128)]
+    fn write_u128(buf: &mut [u8], n: u128);
+
+    /// Writes an unsigned integer `n` to `buf` using only `nbytes`.
+    ///
+    /// # Panics
+    ///
+    /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 8`, then
+    /// this method panics.
+    ///
+    /// # Examples
+    ///
+    /// Write and read an n-byte number in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 3];
+    /// LittleEndian::write_uint(&mut buf, 1_000_000, 3);
+    /// assert_eq!(1_000_000, LittleEndian::read_uint(&buf, 3));
+    /// ```
+    fn write_uint(buf: &mut [u8], n: u64, nbytes: usize);
+
+    /// Writes an unsigned integer `n` to `buf` using only `nbytes`.
+    ///
+    /// # Panics
+    ///
+    /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 16`, then
+    /// this method panics.
+    ///
+    /// # Examples
+    ///
+    /// Write and read an n-byte number in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 3];
+    /// LittleEndian::write_uint128(&mut buf, 1_000_000, 3);
+    /// assert_eq!(1_000_000, LittleEndian::read_uint128(&buf, 3));
+    /// ```
+    #[cfg(byteorder_i128)]
+    fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize);
+
+    /// Reads a signed 16 bit integer from `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 2`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i16` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 2];
+    /// LittleEndian::write_i16(&mut buf, -1_000);
+    /// assert_eq!(-1_000, LittleEndian::read_i16(&buf));
+    /// ```
+    #[inline]
+    fn read_i16(buf: &[u8]) -> i16 {
+        Self::read_u16(buf) as i16
+    }
+
+    /// Reads a signed 24 bit integer from `buf`, stored in i32.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 3`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read 24 bit `i32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 3];
+    /// LittleEndian::write_i24(&mut buf, -1_000_000);
+    /// assert_eq!(-1_000_000, LittleEndian::read_i24(&buf));
+    /// ```
+    #[inline]
+    fn read_i24(buf: &[u8]) -> i32 {
+        Self::read_int(buf, 3) as i32
+    }
+
+    /// Reads a signed 32 bit integer from `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 4`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 4];
+    /// LittleEndian::write_i32(&mut buf, -1_000_000);
+    /// assert_eq!(-1_000_000, LittleEndian::read_i32(&buf));
+    /// ```
+    #[inline]
+    fn read_i32(buf: &[u8]) -> i32 {
+        Self::read_u32(buf) as i32
+    }
+
+    /// Reads a signed 48 bit integer from `buf`, stored in i64.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 6`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read 48 bit `i64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 6];
+    /// LittleEndian::write_i48(&mut buf, -1_000_000_000_000);
+    /// assert_eq!(-1_000_000_000_000, LittleEndian::read_i48(&buf));
+    /// ```
+    #[inline]
+    fn read_i48(buf: &[u8]) -> i64 {
+        Self::read_int(buf, 6) as i64
+    }
+
+    /// Reads a signed 64 bit integer from `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 8`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 8];
+    /// LittleEndian::write_i64(&mut buf, -1_000_000_000);
+    /// assert_eq!(-1_000_000_000, LittleEndian::read_i64(&buf));
+    /// ```
+    #[inline]
+    fn read_i64(buf: &[u8]) -> i64 {
+        Self::read_u64(buf) as i64
+    }
+
+    /// Reads a signed 128 bit integer from `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 16`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i128` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 16];
+    /// LittleEndian::write_i128(&mut buf, -1_000_000_000);
+    /// assert_eq!(-1_000_000_000, LittleEndian::read_i128(&buf));
+    /// ```
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_i128(buf: &[u8]) -> i128 {
+        Self::read_u128(buf) as i128
+    }
+
+    /// Reads a signed n-bytes integer from `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `nbytes < 1` or `nbytes > 8` or
+    /// `buf.len() < nbytes`
+    ///
+    /// # Examples
+    ///
+    /// Write and read n-length signed numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 3];
+    /// LittleEndian::write_int(&mut buf, -1_000, 3);
+    /// assert_eq!(-1_000, LittleEndian::read_int(&buf, 3));
+    /// ```
+    #[inline]
+    fn read_int(buf: &[u8], nbytes: usize) -> i64 {
+        extend_sign(Self::read_uint(buf, nbytes), nbytes)
+    }
+
+    /// Reads a signed n-bytes integer from `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `nbytes < 1` or `nbytes > 16` or
+    /// `buf.len() < nbytes`
+    ///
+    /// # Examples
+    ///
+    /// Write and read n-length signed numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 3];
+    /// LittleEndian::write_int128(&mut buf, -1_000, 3);
+    /// assert_eq!(-1_000, LittleEndian::read_int128(&buf, 3));
+    /// ```
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_int128(buf: &[u8], nbytes: usize) -> i128 {
+        extend_sign128(Self::read_uint128(buf, nbytes), nbytes)
+    }
+
+    /// Reads a IEEE754 single-precision (4 bytes) floating point number.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 4`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `f32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let e = 2.71828;
+    /// let mut buf = [0; 4];
+    /// LittleEndian::write_f32(&mut buf, e);
+    /// assert_eq!(e, LittleEndian::read_f32(&buf));
+    /// ```
+    #[inline]
+    fn read_f32(buf: &[u8]) -> f32 {
+        unsafe { *(&Self::read_u32(buf) as *const u32 as *const f32) }
+    }
+
+    /// Reads a IEEE754 double-precision (8 bytes) floating point number.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 8`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `f64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let phi = 1.6180339887;
+    /// let mut buf = [0; 8];
+    /// LittleEndian::write_f64(&mut buf, phi);
+    /// assert_eq!(phi, LittleEndian::read_f64(&buf));
+    /// ```
+    #[inline]
+    fn read_f64(buf: &[u8]) -> f64 {
+        unsafe { *(&Self::read_u64(buf) as *const u64 as *const f64) }
+    }
+
+    /// Writes a signed 16 bit integer `n` to `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 2`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i16` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 2];
+    /// LittleEndian::write_i16(&mut buf, -1_000);
+    /// assert_eq!(-1_000, LittleEndian::read_i16(&buf));
+    /// ```
+    #[inline]
+    fn write_i16(buf: &mut [u8], n: i16) {
+        Self::write_u16(buf, n as u16)
+    }
+
+    /// Writes a signed 24 bit integer `n` to `buf`, stored in i32.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 3`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read 24 bit `i32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 3];
+    /// LittleEndian::write_i24(&mut buf, -1_000_000);
+    /// assert_eq!(-1_000_000, LittleEndian::read_i24(&buf));
+    /// ```
+    #[inline]
+    fn write_i24(buf: &mut [u8], n: i32) {
+        Self::write_int(buf, n as i64, 3)
+    }
+
+    /// Writes a signed 32 bit integer `n` to `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 4`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 4];
+    /// LittleEndian::write_i32(&mut buf, -1_000_000);
+    /// assert_eq!(-1_000_000, LittleEndian::read_i32(&buf));
+    /// ```
+    #[inline]
+    fn write_i32(buf: &mut [u8], n: i32) {
+        Self::write_u32(buf, n as u32)
+    }
+
+    /// Writes a signed 48 bit integer `n` to `buf`, stored in i64.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 6`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read 48 bit `i64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 6];
+    /// LittleEndian::write_i48(&mut buf, -1_000_000_000_000);
+    /// assert_eq!(-1_000_000_000_000, LittleEndian::read_i48(&buf));
+    /// ```
+    #[inline]
+    fn write_i48(buf: &mut [u8], n: i64) {
+        Self::write_int(buf, n as i64, 6)
+    }
+
+    /// Writes a signed 64 bit integer `n` to `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 8`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 8];
+    /// LittleEndian::write_i64(&mut buf, -1_000_000_000);
+    /// assert_eq!(-1_000_000_000, LittleEndian::read_i64(&buf));
+    /// ```
+    #[inline]
+    fn write_i64(buf: &mut [u8], n: i64) {
+        Self::write_u64(buf, n as u64)
+    }
+
+    /// Writes a signed 128 bit integer `n` to `buf`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 16`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read n-byte `i128` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 16];
+    /// LittleEndian::write_i128(&mut buf, -1_000_000_000);
+    /// assert_eq!(-1_000_000_000, LittleEndian::read_i128(&buf));
+    /// ```
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn write_i128(buf: &mut [u8], n: i128) {
+        Self::write_u128(buf, n as u128)
+    }
+
+    /// Writes a signed integer `n` to `buf` using only `nbytes`.
+    ///
+    /// # Panics
+    ///
+    /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 8`, then
+    /// this method panics.
+    ///
+    /// # Examples
+    ///
+    /// Write and read an n-byte number in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 3];
+    /// LittleEndian::write_int(&mut buf, -1_000, 3);
+    /// assert_eq!(-1_000, LittleEndian::read_int(&buf, 3));
+    /// ```
+    #[inline]
+    fn write_int(buf: &mut [u8], n: i64, nbytes: usize) {
+        Self::write_uint(buf, unextend_sign(n, nbytes), nbytes)
+    }
+
+    /// Writes a signed integer `n` to `buf` using only `nbytes`.
+    ///
+    /// # Panics
+    ///
+    /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 16`, then
+    /// this method panics.
+    ///
+    /// # Examples
+    ///
+    /// Write and read n-length signed numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut buf = [0; 3];
+    /// LittleEndian::write_int128(&mut buf, -1_000, 3);
+    /// assert_eq!(-1_000, LittleEndian::read_int128(&buf, 3));
+    /// ```
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn write_int128(buf: &mut [u8], n: i128, nbytes: usize) {
+        Self::write_uint128(buf, unextend_sign128(n, nbytes), nbytes)
+    }
+
+    /// Writes a IEEE754 single-precision (4 bytes) floating point number.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 4`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `f32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let e = 2.71828;
+    /// let mut buf = [0; 4];
+    /// LittleEndian::write_f32(&mut buf, e);
+    /// assert_eq!(e, LittleEndian::read_f32(&buf));
+    /// ```
+    #[inline]
+    fn write_f32(buf: &mut [u8], n: f32) {
+        let n = unsafe { *(&n as *const f32 as *const u32) };
+        Self::write_u32(buf, n)
+    }
+
+    /// Writes a IEEE754 double-precision (8 bytes) floating point number.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() < 8`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `f64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let phi = 1.6180339887;
+    /// let mut buf = [0; 8];
+    /// LittleEndian::write_f64(&mut buf, phi);
+    /// assert_eq!(phi, LittleEndian::read_f64(&buf));
+    /// ```
+    #[inline]
+    fn write_f64(buf: &mut [u8], n: f64) {
+        let n = unsafe { *(&n as *const f64 as *const u64) };
+        Self::write_u64(buf, n)
+    }
+
+    /// Reads unsigned 16 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `src.len() != 2*dst.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u16` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 8];
+    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
+    /// LittleEndian::write_u16_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_u16_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    fn read_u16_into(src: &[u8], dst: &mut [u16]);
+
+    /// Reads unsigned 32 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `src.len() != 4*dst.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 16];
+    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
+    /// LittleEndian::write_u32_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_u32_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    fn read_u32_into(src: &[u8], dst: &mut [u32]);
+
+    /// Reads unsigned 64 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `src.len() != 8*dst.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 32];
+    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
+    /// LittleEndian::write_u64_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_u64_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    fn read_u64_into(src: &[u8], dst: &mut [u64]);
+
+    /// Reads unsigned 128 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `src.len() != 16*dst.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u128` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 64];
+    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
+    /// LittleEndian::write_u128_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_u128_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    #[cfg(byteorder_i128)]
+    fn read_u128_into(src: &[u8], dst: &mut [u128]);
+
+    /// Reads signed 16 bit integers from `src` to `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() != 2*dst.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i16` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 8];
+    /// let numbers_given = [1, 2, 0x0f, 0xee];
+    /// LittleEndian::write_i16_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_i16_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    #[inline]
+    fn read_i16_into(src: &[u8], dst: &mut [i16]) {
+        let dst = unsafe {
+            slice::from_raw_parts_mut(dst.as_mut_ptr() as *mut u16, dst.len())
+        };
+        Self::read_u16_into(src, dst)
+    }
+
+    /// Reads signed 32 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `src.len() != 4*dst.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 16];
+    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
+    /// LittleEndian::write_i32_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_i32_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    #[inline]
+    fn read_i32_into(src: &[u8], dst: &mut [i32]) {
+        let dst = unsafe {
+            slice::from_raw_parts_mut(dst.as_mut_ptr() as *mut u32, dst.len())
+        };
+        Self::read_u32_into(src, dst);
+    }
+
+    /// Reads signed 64 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `src.len() != 8*dst.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 32];
+    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
+    /// LittleEndian::write_i64_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_i64_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    #[inline]
+    fn read_i64_into(src: &[u8], dst: &mut [i64]) {
+        let dst = unsafe {
+            slice::from_raw_parts_mut(dst.as_mut_ptr() as *mut u64, dst.len())
+        };
+        Self::read_u64_into(src, dst);
+    }
+
+    /// Reads signed 128 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `src.len() != 16*dst.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i128` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 64];
+    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
+    /// LittleEndian::write_i128_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_i128_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_i128_into(src: &[u8], dst: &mut [i128]) {
+        let dst = unsafe {
+            slice::from_raw_parts_mut(dst.as_mut_ptr() as *mut u128, dst.len())
+        };
+        Self::read_u128_into(src, dst);
+    }
+
+    /// Reads IEEE754 single-precision (4 bytes) floating point numbers from
+    /// `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `src.len() != 4*dst.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `f32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 16];
+    /// let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
+    /// LittleEndian::write_f32_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0.0; 4];
+    /// LittleEndian::read_f32_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    #[inline]
+    fn read_f32_into(src: &[u8], dst: &mut [f32]) {
+        let dst = unsafe {
+            slice::from_raw_parts_mut(dst.as_mut_ptr() as *mut u32, dst.len())
+        };
+        Self::read_u32_into(src, dst);
+    }
+
+    /// **DEPRECATED**.
+    ///
+    /// This method is deprecated. Use `read_f32_into` instead.
+    /// Reads IEEE754 single-precision (4 bytes) floating point numbers from
+    /// `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `src.len() != 4*dst.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `f32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 16];
+    /// let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
+    /// LittleEndian::write_f32_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0.0; 4];
+    /// LittleEndian::read_f32_into_unchecked(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    #[inline]
+    #[deprecated(since="1.3.0", note="please use `read_f32_into` instead")]
+    fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32]) {
+        Self::read_f32_into(src, dst);
+    }
+
+    /// Reads IEEE754 single-precision (4 bytes) floating point numbers from
+    /// `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `src.len() != 8*dst.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `f64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 32];
+    /// let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
+    /// LittleEndian::write_f64_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0.0; 4];
+    /// LittleEndian::read_f64_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    #[inline]
+    fn read_f64_into(src: &[u8], dst: &mut [f64]) {
+        let dst = unsafe {
+            slice::from_raw_parts_mut(dst.as_mut_ptr() as *mut u64, dst.len())
+        };
+        Self::read_u64_into(src, dst);
+    }
+
+    /// **DEPRECATED**.
+    ///
+    /// This method is deprecated. Use `read_f64_into` instead.
+    ///
+    /// Reads IEEE754 single-precision (4 bytes) floating point numbers from
+    /// `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `src.len() != 8*dst.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `f64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 32];
+    /// let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
+    /// LittleEndian::write_f64_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0.0; 4];
+    /// LittleEndian::read_f64_into_unchecked(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    #[inline]
+    #[deprecated(since="1.3.0", note="please use `read_f64_into` instead")]
+    fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64]) {
+        Self::read_f64_into(src, dst);
+    }
+
+    /// Writes unsigned 16 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `dst.len() != 2*src.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u16` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 8];
+    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
+    /// LittleEndian::write_u16_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_u16_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    fn write_u16_into(src: &[u16], dst: &mut [u8]);
+
+    /// Writes unsigned 32 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `dst.len() != 4*src.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 16];
+    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
+    /// LittleEndian::write_u32_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_u32_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    fn write_u32_into(src: &[u32], dst: &mut [u8]);
+
+    /// Writes unsigned 64 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `dst.len() != 8*src.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 32];
+    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
+    /// LittleEndian::write_u64_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_u64_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    fn write_u64_into(src: &[u64], dst: &mut [u8]);
+
+    /// Writes unsigned 128 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `dst.len() != 16*src.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `u128` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 64];
+    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
+    /// LittleEndian::write_u128_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_u128_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    #[cfg(byteorder_i128)]
+    fn write_u128_into(src: &[u128], dst: &mut [u8]);
+
+    /// Writes signed 16 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `buf.len() != 2*src.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i16` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 8];
+    /// let numbers_given = [1, 2, 0x0f, 0xee];
+    /// LittleEndian::write_i16_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_i16_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    fn write_i16_into(src: &[i16], dst: &mut [u8]) {
+        let src = unsafe {
+            slice::from_raw_parts(src.as_ptr() as *const u16, src.len())
+        };
+        Self::write_u16_into(src, dst);
+    }
+
+    /// Writes signed 32 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `dst.len() != 4*src.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 16];
+    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
+    /// LittleEndian::write_i32_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_i32_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    fn write_i32_into(src: &[i32], dst: &mut [u8]) {
+        let src = unsafe {
+            slice::from_raw_parts(src.as_ptr() as *const u32, src.len())
+        };
+        Self::write_u32_into(src, dst);
+    }
+
+    /// Writes signed 64 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `dst.len() != 8*src.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 32];
+    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
+    /// LittleEndian::write_i64_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_i64_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    fn write_i64_into(src: &[i64], dst: &mut [u8]) {
+        let src = unsafe {
+            slice::from_raw_parts(src.as_ptr() as *const u64, src.len())
+        };
+        Self::write_u64_into(src, dst);
+    }
+
+    /// Writes signed 128 bit integers from `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `dst.len() != 16*src.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `i128` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 64];
+    /// let numbers_given = [1, 2, 0xf00f, 0xffee];
+    /// LittleEndian::write_i128_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0; 4];
+    /// LittleEndian::read_i128_into(&bytes, &mut numbers_got);
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    #[cfg(byteorder_i128)]
+    fn write_i128_into(src: &[i128], dst: &mut [u8]) {
+        let src = unsafe {
+            slice::from_raw_parts(src.as_ptr() as *const u128, src.len())
+        };
+        Self::write_u128_into(src, dst);
+    }
+
+    /// Writes IEEE754 single-precision (4 bytes) floating point numbers from
+    /// `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `src.len() != 4*dst.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `f32` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 16];
+    /// let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
+    /// LittleEndian::write_f32_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0.0; 4];
+    /// unsafe {
+    ///     LittleEndian::read_f32_into(&bytes, &mut numbers_got);
+    /// }
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    fn write_f32_into(src: &[f32], dst: &mut [u8]) {
+        let src = unsafe {
+            slice::from_raw_parts(src.as_ptr() as *const u32, src.len())
+        };
+        Self::write_u32_into(src, dst);
+    }
+
+    /// Writes IEEE754 double-precision (8 bytes) floating point numbers from
+    /// `src` into `dst`.
+    ///
+    /// # Panics
+    ///
+    /// Panics when `src.len() != 8*dst.len()`.
+    ///
+    /// # Examples
+    ///
+    /// Write and read `f64` numbers in little endian order:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, LittleEndian};
+    ///
+    /// let mut bytes = [0; 32];
+    /// let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
+    /// LittleEndian::write_f64_into(&numbers_given, &mut bytes);
+    ///
+    /// let mut numbers_got = [0.0; 4];
+    /// unsafe {
+    ///     LittleEndian::read_f64_into(&bytes, &mut numbers_got);
+    /// }
+    /// assert_eq!(numbers_given, numbers_got);
+    /// ```
+    fn write_f64_into(src: &[f64], dst: &mut [u8]) {
+        let src = unsafe {
+            slice::from_raw_parts(src.as_ptr() as *const u64, src.len())
+        };
+        Self::write_u64_into(src, dst);
+    }
+
+    /// Converts the given slice of unsigned 16 bit integers to a particular
+    /// endianness.
+    ///
+    /// If the endianness matches the endianness of the host platform, then
+    /// this is a no-op.
+    ///
+    /// # Examples
+    ///
+    /// Convert the host platform's endianness to big-endian:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, BigEndian};
+    ///
+    /// let mut numbers = [5, 65000];
+    /// BigEndian::from_slice_u16(&mut numbers);
+    /// assert_eq!(numbers, [5u16.to_be(), 65000u16.to_be()]);
+    /// ```
+    fn from_slice_u16(numbers: &mut [u16]);
+
+    /// Converts the given slice of unsigned 32 bit integers to a particular
+    /// endianness.
+    ///
+    /// If the endianness matches the endianness of the host platform, then
+    /// this is a no-op.
+    ///
+    /// # Examples
+    ///
+    /// Convert the host platform's endianness to big-endian:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, BigEndian};
+    ///
+    /// let mut numbers = [5, 65000];
+    /// BigEndian::from_slice_u32(&mut numbers);
+    /// assert_eq!(numbers, [5u32.to_be(), 65000u32.to_be()]);
+    /// ```
+    fn from_slice_u32(numbers: &mut [u32]);
+
+    /// Converts the given slice of unsigned 64 bit integers to a particular
+    /// endianness.
+    ///
+    /// If the endianness matches the endianness of the host platform, then
+    /// this is a no-op.
+    ///
+    /// # Examples
+    ///
+    /// Convert the host platform's endianness to big-endian:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, BigEndian};
+    ///
+    /// let mut numbers = [5, 65000];
+    /// BigEndian::from_slice_u64(&mut numbers);
+    /// assert_eq!(numbers, [5u64.to_be(), 65000u64.to_be()]);
+    /// ```
+    fn from_slice_u64(numbers: &mut [u64]);
+
+    /// Converts the given slice of unsigned 128 bit integers to a particular
+    /// endianness.
+    ///
+    /// If the endianness matches the endianness of the host platform, then
+    /// this is a no-op.
+    ///
+    /// # Examples
+    ///
+    /// Convert the host platform's endianness to big-endian:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, BigEndian};
+    ///
+    /// let mut numbers = [5, 65000];
+    /// BigEndian::from_slice_u128(&mut numbers);
+    /// assert_eq!(numbers, [5u128.to_be(), 65000u128.to_be()]);
+    /// ```
+    #[cfg(byteorder_i128)]
+    fn from_slice_u128(numbers: &mut [u128]);
+
+    /// Converts the given slice of signed 16 bit integers to a particular
+    /// endianness.
+    ///
+    /// If the endianness matches the endianness of the host platform, then
+    /// this is a no-op.
+    ///
+    /// # Examples
+    ///
+    /// Convert the host platform's endianness to big-endian:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, BigEndian};
+    ///
+    /// let mut numbers = [5, 6500];
+    /// BigEndian::from_slice_i16(&mut numbers);
+    /// assert_eq!(numbers, [5i16.to_be(), 6500i16.to_be()]);
+    /// ```
+    #[inline]
+    fn from_slice_i16(src: &mut [i16]) {
+        let src = unsafe {
+            slice::from_raw_parts_mut(src.as_ptr() as *mut u16, src.len())
+        };
+        Self::from_slice_u16(src);
+    }
+
+    /// Converts the given slice of signed 32 bit integers to a particular
+    /// endianness.
+    ///
+    /// If the endianness matches the endianness of the host platform, then
+    /// this is a no-op.
+    ///
+    /// # Examples
+    ///
+    /// Convert the host platform's endianness to big-endian:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, BigEndian};
+    ///
+    /// let mut numbers = [5, 65000];
+    /// BigEndian::from_slice_i32(&mut numbers);
+    /// assert_eq!(numbers, [5i32.to_be(), 65000i32.to_be()]);
+    /// ```
+    #[inline]
+    fn from_slice_i32(src: &mut [i32]) {
+        let src = unsafe {
+            slice::from_raw_parts_mut(src.as_ptr() as *mut u32, src.len())
+        };
+        Self::from_slice_u32(src);
+    }
+
+    /// Converts the given slice of signed 64 bit integers to a particular
+    /// endianness.
+    ///
+    /// If the endianness matches the endianness of the host platform, then
+    /// this is a no-op.
+    ///
+    /// # Examples
+    ///
+    /// Convert the host platform's endianness to big-endian:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, BigEndian};
+    ///
+    /// let mut numbers = [5, 65000];
+    /// BigEndian::from_slice_i64(&mut numbers);
+    /// assert_eq!(numbers, [5i64.to_be(), 65000i64.to_be()]);
+    /// ```
+    #[inline]
+    fn from_slice_i64(src: &mut [i64]) {
+        let src = unsafe {
+            slice::from_raw_parts_mut(src.as_ptr() as *mut u64, src.len())
+        };
+        Self::from_slice_u64(src);
+    }
+
+    /// Converts the given slice of signed 128 bit integers to a particular
+    /// endianness.
+    ///
+    /// If the endianness matches the endianness of the host platform, then
+    /// this is a no-op.
+    ///
+    /// # Examples
+    ///
+    /// Convert the host platform's endianness to big-endian:
+    ///
+    /// ```rust
+    /// use byteorder::{ByteOrder, BigEndian};
+    ///
+    /// let mut numbers = [5, 65000];
+    /// BigEndian::from_slice_i128(&mut numbers);
+    /// assert_eq!(numbers, [5i128.to_be(), 65000i128.to_be()]);
+    /// ```
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn from_slice_i128(src: &mut [i128]) {
+        let src = unsafe {
+            slice::from_raw_parts_mut(src.as_ptr() as *mut u128, src.len())
+        };
+        Self::from_slice_u128(src);
+    }
+
+    /// Converts the given slice of IEEE754 single-precision (4 bytes) floating
+    /// point numbers to a particular endianness.
+    ///
+    /// If the endianness matches the endianness of the host platform, then
+    /// this is a no-op.
+    fn from_slice_f32(numbers: &mut [f32]);
+
+    /// Converts the given slice of IEEE754 double-precision (8 bytes) floating
+    /// point numbers to a particular endianness.
+    ///
+    /// If the endianness matches the endianness of the host platform, then
+    /// this is a no-op.
+    fn from_slice_f64(numbers: &mut [f64]);
+}
+
+/// Defines big-endian serialization.
+///
+/// Note that this type has no value constructor. It is used purely at the
+/// type level.
+///
+/// # Examples
+///
+/// Write and read `u32` numbers in big endian order:
+///
+/// ```rust
+/// use byteorder::{ByteOrder, BigEndian};
+///
+/// let mut buf = [0; 4];
+/// BigEndian::write_u32(&mut buf, 1_000_000);
+/// assert_eq!(1_000_000, BigEndian::read_u32(&buf));
+/// ```
+#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+pub enum BigEndian {}
+
+impl Default for BigEndian {
+    fn default() -> BigEndian {
+        panic!("BigEndian default")
+    }
+}
+
+/// A type alias for [`BigEndian`].
+///
+/// [`BigEndian`]: enum.BigEndian.html
+pub type BE = BigEndian;
+
+/// Defines little-endian serialization.
+///
+/// Note that this type has no value constructor. It is used purely at the
+/// type level.
+///
+/// # Examples
+///
+/// Write and read `u32` numbers in little endian order:
+///
+/// ```rust
+/// use byteorder::{ByteOrder, LittleEndian};
+///
+/// let mut buf = [0; 4];
+/// LittleEndian::write_u32(&mut buf, 1_000_000);
+/// assert_eq!(1_000_000, LittleEndian::read_u32(&buf));
+/// ```
+#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
+pub enum LittleEndian {}
+
+impl Default for LittleEndian {
+    fn default() -> LittleEndian {
+        panic!("LittleEndian default")
+    }
+}
+
+/// A type alias for [`LittleEndian`].
+///
+/// [`LittleEndian`]: enum.LittleEndian.html
+pub type LE = LittleEndian;
+
+/// Defines network byte order serialization.
+///
+/// Network byte order is defined by [RFC 1700][1] to be big-endian, and is
+/// referred to in several protocol specifications.  This type is an alias of
+/// [`BigEndian`].
+///
+/// [1]: https://tools.ietf.org/html/rfc1700
+///
+/// Note that this type has no value constructor. It is used purely at the
+/// type level.
+///
+/// # Examples
+///
+/// Write and read `i16` numbers in big endian order:
+///
+/// ```rust
+/// use byteorder::{ByteOrder, NetworkEndian, BigEndian};
+///
+/// let mut buf = [0; 2];
+/// BigEndian::write_i16(&mut buf, -5_000);
+/// assert_eq!(-5_000, NetworkEndian::read_i16(&buf));
+/// ```
+///
+/// [`BigEndian`]: enum.BigEndian.html
+pub type NetworkEndian = BigEndian;
+
+/// Defines system native-endian serialization.
+///
+/// Note that this type has no value constructor. It is used purely at the
+/// type level.
+///
+/// On this platform, this is an alias for [`LittleEndian`].
+///
+/// [`LittleEndian`]: enum.LittleEndian.html
+#[cfg(target_endian = "little")]
+pub type NativeEndian = LittleEndian;
+
+/// Defines system native-endian serialization.
+///
+/// Note that this type has no value constructor. It is used purely at the
+/// type level.
+///
+/// On this platform, this is an alias for [`BigEndian`].
+///
+/// [`BigEndian`]: enum.BigEndian.html
+#[cfg(target_endian = "big")]
+pub type NativeEndian = BigEndian;
+
+macro_rules! read_num_bytes {
+    ($ty:ty, $size:expr, $src:expr, $which:ident) => ({
+        assert!($size == ::core::mem::size_of::<$ty>());
+        assert!($size <= $src.len());
+        let mut data: $ty = 0;
+        unsafe {
+            copy_nonoverlapping(
+                $src.as_ptr(),
+                &mut data as *mut $ty as *mut u8,
+                $size);
+        }
+        data.$which()
+    });
+}
+
+macro_rules! write_num_bytes {
+    ($ty:ty, $size:expr, $n:expr, $dst:expr, $which:ident) => ({
+        assert!($size <= $dst.len());
+        unsafe {
+            // N.B. https://github.com/rust-lang/rust/issues/22776
+            let bytes = *(&$n.$which() as *const _ as *const [u8; $size]);
+            copy_nonoverlapping((&bytes).as_ptr(), $dst.as_mut_ptr(), $size);
+        }
+    });
+}
+
+macro_rules! read_slice {
+    ($src:expr, $dst:expr, $size:expr, $which:ident) => {{
+        assert_eq!($src.len(), $size * $dst.len());
+
+        unsafe {
+            copy_nonoverlapping(
+                $src.as_ptr(),
+                $dst.as_mut_ptr() as *mut u8,
+                $src.len());
+        }
+        for v in $dst.iter_mut() {
+            *v = v.$which();
+        }
+    }};
+}
+
+macro_rules! write_slice_native {
+    ($src:expr, $dst:expr, $ty:ty, $size:expr) => {{
+        assert!($size == ::core::mem::size_of::<$ty>());
+        assert_eq!($size * $src.len(), $dst.len());
+
+        unsafe {
+            copy_nonoverlapping(
+                $src.as_ptr() as *const u8,
+                $dst.as_mut_ptr(),
+                $dst.len());
+        }
+    }};
+}
+
+macro_rules! write_slice {
+    ($src:expr, $dst:expr, $ty:ty, $size:expr, $write:expr) => ({
+        assert!($size == ::core::mem::size_of::<$ty>());
+        assert_eq!($size * $src.len(), $dst.len());
+
+        for (&n, chunk) in $src.iter().zip($dst.chunks_mut($size)) {
+            $write(chunk, n);
+        }
+    });
+}
+
+impl ByteOrder for BigEndian {
+    #[inline]
+    fn read_u16(buf: &[u8]) -> u16 {
+        read_num_bytes!(u16, 2, buf, to_be)
+    }
+
+    #[inline]
+    fn read_u32(buf: &[u8]) -> u32 {
+        read_num_bytes!(u32, 4, buf, to_be)
+    }
+
+    #[inline]
+    fn read_u64(buf: &[u8]) -> u64 {
+        read_num_bytes!(u64, 8, buf, to_be)
+    }
+
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_u128(buf: &[u8]) -> u128 {
+        read_num_bytes!(u128, 16, buf, to_be)
+    }
+
+    #[inline]
+    fn read_uint(buf: &[u8], nbytes: usize) -> u64 {
+        assert!(1 <= nbytes && nbytes <= 8 && nbytes <= buf.len());
+        let mut out = [0u8; 8];
+        let ptr_out = out.as_mut_ptr();
+        unsafe {
+            copy_nonoverlapping(
+                buf.as_ptr(), ptr_out.offset((8 - nbytes) as isize), nbytes);
+            (*(ptr_out as *const u64)).to_be()
+        }
+    }
+
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_uint128(buf: &[u8], nbytes: usize) -> u128 {
+        assert!(1 <= nbytes && nbytes <= 16 && nbytes <= buf.len());
+        let mut out = [0u8; 16];
+        let ptr_out = out.as_mut_ptr();
+        unsafe {
+            copy_nonoverlapping(
+                buf.as_ptr(), ptr_out.offset((16 - nbytes) as isize), nbytes);
+            (*(ptr_out as *const u128)).to_be()
+        }
+    }
+
+    #[inline]
+    fn write_u16(buf: &mut [u8], n: u16) {
+        write_num_bytes!(u16, 2, n, buf, to_be);
+    }
+
+    #[inline]
+    fn write_u32(buf: &mut [u8], n: u32) {
+        write_num_bytes!(u32, 4, n, buf, to_be);
+    }
+
+    #[inline]
+    fn write_u64(buf: &mut [u8], n: u64) {
+        write_num_bytes!(u64, 8, n, buf, to_be);
+    }
+
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn write_u128(buf: &mut [u8], n: u128) {
+        write_num_bytes!(u128, 16, n, buf, to_be);
+    }
+
+    #[inline]
+    fn write_uint(buf: &mut [u8], n: u64, nbytes: usize) {
+        assert!(pack_size(n) <= nbytes && nbytes <= 8);
+        assert!(nbytes <= buf.len());
+        unsafe {
+            let bytes = *(&n.to_be() as *const u64 as *const [u8; 8]);
+            copy_nonoverlapping(
+                bytes.as_ptr().offset((8 - nbytes) as isize),
+                buf.as_mut_ptr(),
+                nbytes);
+        }
+    }
+
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize) {
+        assert!(pack_size128(n) <= nbytes && nbytes <= 16);
+        assert!(nbytes <= buf.len());
+        unsafe {
+            let bytes = *(&n.to_be() as *const u128 as *const [u8; 16]);
+            copy_nonoverlapping(
+                bytes.as_ptr().offset((16 - nbytes) as isize),
+                buf.as_mut_ptr(),
+                nbytes);
+        }
+    }
+
+    #[inline]
+    fn read_u16_into(src: &[u8], dst: &mut [u16]) {
+        read_slice!(src, dst, 2, to_be);
+    }
+
+    #[inline]
+    fn read_u32_into(src: &[u8], dst: &mut [u32]) {
+        read_slice!(src, dst, 4, to_be);
+    }
+
+    #[inline]
+    fn read_u64_into(src: &[u8], dst: &mut [u64]) {
+        read_slice!(src, dst, 8, to_be);
+    }
+
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_u128_into(src: &[u8], dst: &mut [u128]) {
+        read_slice!(src, dst, 16, to_be);
+    }
+
+    #[inline]
+    fn write_u16_into(src: &[u16], dst: &mut [u8]) {
+        if cfg!(target_endian = "big") {
+            write_slice_native!(src, dst, u16, 2);
+        } else {
+            write_slice!(src, dst, u16, 2, Self::write_u16);
+        }
+    }
+
+    #[inline]
+    fn write_u32_into(src: &[u32], dst: &mut [u8]) {
+        if cfg!(target_endian = "big") {
+            write_slice_native!(src, dst, u32, 4);
+        } else {
+            write_slice!(src, dst, u32, 4, Self::write_u32);
+        }
+    }
+
+    #[inline]
+    fn write_u64_into(src: &[u64], dst: &mut [u8]) {
+        if cfg!(target_endian = "big") {
+            write_slice_native!(src, dst, u64, 8);
+        } else {
+            write_slice!(src, dst, u64, 8, Self::write_u64);
+        }
+    }
+
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn write_u128_into(src: &[u128], dst: &mut [u8]) {
+        if cfg!(target_endian = "big") {
+            write_slice_native!(src, dst, u128, 16);
+        } else {
+            write_slice!(src, dst, u128, 16, Self::write_u128);
+        }
+    }
+
+    #[inline]
+    fn from_slice_u16(numbers: &mut [u16]) {
+        if cfg!(target_endian = "little") {
+            for n in numbers {
+                *n = n.to_be();
+            }
+        }
+    }
+
+    #[inline]
+    fn from_slice_u32(numbers: &mut [u32]) {
+        if cfg!(target_endian = "little") {
+            for n in numbers {
+                *n = n.to_be();
+            }
+        }
+    }
+
+    #[inline]
+    fn from_slice_u64(numbers: &mut [u64]) {
+        if cfg!(target_endian = "little") {
+            for n in numbers {
+                *n = n.to_be();
+            }
+        }
+    }
+
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn from_slice_u128(numbers: &mut [u128]) {
+        if cfg!(target_endian = "little") {
+            for n in numbers {
+                *n = n.to_be();
+            }
+        }
+    }
+
+    #[inline]
+    fn from_slice_f32(numbers: &mut [f32]) {
+        if cfg!(target_endian = "little") {
+            for n in numbers {
+                unsafe {
+                    let int = *(n as *const f32 as *const u32);
+                    *n = *(&int.to_be() as *const u32 as *const f32);
+                }
+            }
+        }
+    }
+
+    #[inline]
+    fn from_slice_f64(numbers: &mut [f64]) {
+        if cfg!(target_endian = "little") {
+            for n in numbers {
+                unsafe {
+                    let int = *(n as *const f64 as *const u64);
+                    *n = *(&int.to_be() as *const u64 as *const f64);
+                }
+            }
+        }
+    }
+}
+
+impl ByteOrder for LittleEndian {
+    #[inline]
+    fn read_u16(buf: &[u8]) -> u16 {
+        read_num_bytes!(u16, 2, buf, to_le)
+    }
+
+    #[inline]
+    fn read_u32(buf: &[u8]) -> u32 {
+        read_num_bytes!(u32, 4, buf, to_le)
+    }
+
+    #[inline]
+    fn read_u64(buf: &[u8]) -> u64 {
+        read_num_bytes!(u64, 8, buf, to_le)
+    }
+
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_u128(buf: &[u8]) -> u128 {
+        read_num_bytes!(u128, 16, buf, to_le)
+    }
+
+    #[inline]
+    fn read_uint(buf: &[u8], nbytes: usize) -> u64 {
+        assert!(1 <= nbytes && nbytes <= 8 && nbytes <= buf.len());
+        let mut out = [0u8; 8];
+        let ptr_out = out.as_mut_ptr();
+        unsafe {
+            copy_nonoverlapping(buf.as_ptr(), ptr_out, nbytes);
+            (*(ptr_out as *const u64)).to_le()
+        }
+    }
+
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_uint128(buf: &[u8], nbytes: usize) -> u128 {
+        assert!(1 <= nbytes && nbytes <= 16 && nbytes <= buf.len());
+        let mut out = [0u8; 16];
+        let ptr_out = out.as_mut_ptr();
+        unsafe {
+            copy_nonoverlapping(buf.as_ptr(), ptr_out, nbytes);
+            (*(ptr_out as *const u128)).to_le()
+        }
+    }
+
+    #[inline]
+    fn write_u16(buf: &mut [u8], n: u16) {
+        write_num_bytes!(u16, 2, n, buf, to_le);
+    }
+
+    #[inline]
+    fn write_u32(buf: &mut [u8], n: u32) {
+        write_num_bytes!(u32, 4, n, buf, to_le);
+    }
+
+    #[inline]
+    fn write_u64(buf: &mut [u8], n: u64) {
+        write_num_bytes!(u64, 8, n, buf, to_le);
+    }
+
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn write_u128(buf: &mut [u8], n: u128) {
+        write_num_bytes!(u128, 16, n, buf, to_le);
+    }
+
+    #[inline]
+    fn write_uint(buf: &mut [u8], n: u64, nbytes: usize) {
+        assert!(pack_size(n as u64) <= nbytes && nbytes <= 8);
+        assert!(nbytes <= buf.len());
+        unsafe {
+            let bytes = *(&n.to_le() as *const u64 as *const [u8; 8]);
+            copy_nonoverlapping(bytes.as_ptr(), buf.as_mut_ptr(), nbytes);
+        }
+    }
+
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize) {
+        assert!(pack_size128(n as u128) <= nbytes && nbytes <= 16);
+        assert!(nbytes <= buf.len());
+        unsafe {
+            let bytes = *(&n.to_le() as *const u128 as *const [u8; 16]);
+            copy_nonoverlapping(bytes.as_ptr(), buf.as_mut_ptr(), nbytes);
+        }
+    }
+
+    #[inline]
+    fn read_u16_into(src: &[u8], dst: &mut [u16]) {
+        read_slice!(src, dst, 2, to_le);
+    }
+
+    #[inline]
+    fn read_u32_into(src: &[u8], dst: &mut [u32]) {
+        read_slice!(src, dst, 4, to_le);
+    }
+
+    #[inline]
+    fn read_u64_into(src: &[u8], dst: &mut [u64]) {
+        read_slice!(src, dst, 8, to_le);
+    }
+
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn read_u128_into(src: &[u8], dst: &mut [u128]) {
+        read_slice!(src, dst, 16, to_le);
+    }
+
+    #[inline]
+    fn write_u16_into(src: &[u16], dst: &mut [u8]) {
+        if cfg!(target_endian = "little") {
+            write_slice_native!(src, dst, u16, 2);
+        } else {
+            write_slice!(src, dst, u16, 2, Self::write_u16);
+        }
+    }
+
+    #[inline]
+    fn write_u32_into(src: &[u32], dst: &mut [u8]) {
+        if cfg!(target_endian = "little") {
+            write_slice_native!(src, dst, u32, 4);
+        } else {
+            write_slice!(src, dst, u32, 4, Self::write_u32);
+        }
+    }
+
+    #[inline]
+    fn write_u64_into(src: &[u64], dst: &mut [u8]) {
+        if cfg!(target_endian = "little") {
+            write_slice_native!(src, dst, u64, 8);
+        } else {
+            write_slice!(src, dst, u64, 8, Self::write_u64);
+        }
+    }
+
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn write_u128_into(src: &[u128], dst: &mut [u8]) {
+        if cfg!(target_endian = "little") {
+            write_slice_native!(src, dst, u128, 16);
+        } else {
+            write_slice!(src, dst, u128, 16, Self::write_u128);
+        }
+    }
+
+    #[inline]
+    fn from_slice_u16(numbers: &mut [u16]) {
+        if cfg!(target_endian = "big") {
+            for n in numbers {
+                *n = n.to_le();
+            }
+        }
+    }
+
+    #[inline]
+    fn from_slice_u32(numbers: &mut [u32]) {
+        if cfg!(target_endian = "big") {
+            for n in numbers {
+                *n = n.to_le();
+            }
+        }
+    }
+
+    #[inline]
+    fn from_slice_u64(numbers: &mut [u64]) {
+        if cfg!(target_endian = "big") {
+            for n in numbers {
+                *n = n.to_le();
+            }
+        }
+    }
+
+    #[cfg(byteorder_i128)]
+    #[inline]
+    fn from_slice_u128(numbers: &mut [u128]) {
+        if cfg!(target_endian = "big") {
+            for n in numbers {
+                *n = n.to_le();
+            }
+        }
+    }
+
+    #[inline]
+    fn from_slice_f32(numbers: &mut [f32]) {
+        if cfg!(target_endian = "big") {
+            for n in numbers {
+                unsafe {
+                    let int = *(n as *const f32 as *const u32);
+                    *n = *(&int.to_le() as *const u32 as *const f32);
+                }
+            }
+        }
+    }
+
+    #[inline]
+    fn from_slice_f64(numbers: &mut [f64]) {
+        if cfg!(target_endian = "big") {
+            for n in numbers {
+                unsafe {
+                    let int = *(n as *const f64 as *const u64);
+                    *n = *(&int.to_le() as *const u64 as *const f64);
+                }
+            }
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    extern crate quickcheck;
+    extern crate rand;
+
+    use self::quickcheck::{QuickCheck, StdGen, Testable};
+    use self::rand::thread_rng;
+    #[cfg(byteorder_i128)]
+    use self::rand::Rng;
+    #[cfg(byteorder_i128)]
+    use self::quickcheck::{Arbitrary, Gen};
+
+    pub const U24_MAX: u32 = 16_777_215;
+    pub const I24_MAX: i32 = 8_388_607;
+    pub const U48_MAX: u64 = 281_474_976_710_655;
+    pub const I48_MAX: i64 = 140_737_488_355_327;
+
+    pub const U64_MAX: u64 = ::core::u64::MAX;
+    pub const I64_MAX: u64 = ::core::i64::MAX as u64;
+
+    macro_rules! calc_max {
+        ($max:expr, $bytes:expr) => { calc_max!($max, $bytes, 8) };
+        ($max:expr, $bytes:expr, $maxbytes:expr) => {
+            ($max - 1) >> (8 * ($maxbytes - $bytes))
+        };
+    }
+
+    #[derive(Clone, Debug)]
+    pub struct Wi128<T>(pub T);
+
+    #[cfg(byteorder_i128)]
+    impl<T: Clone> Wi128<T> {
+        pub fn clone(&self) -> T {
+            self.0.clone()
+        }
+    }
+
+    impl<T: PartialEq> PartialEq<T> for Wi128<T> {
+        fn eq(&self, other: &T) -> bool {
+            self.0.eq(other)
+        }
+    }
+
+    #[cfg(byteorder_i128)]
+    impl Arbitrary for Wi128<u128> {
+        fn arbitrary<G: Gen>(gen: &mut G) -> Wi128<u128> {
+            let max = calc_max!(::core::u128::MAX, gen.size(), 16);
+            let output =
+                (gen.gen::<u64>() as u128) |
+                ((gen.gen::<u64>() as u128) << 64);
+            Wi128(output & (max - 1))
+        }
+    }
+
+    #[cfg(byteorder_i128)]
+    impl Arbitrary for Wi128<i128> {
+        fn arbitrary<G: Gen>(gen: &mut G) -> Wi128<i128> {
+            let max = calc_max!(::core::i128::MAX, gen.size(), 16);
+            let output =
+                (gen.gen::<i64>() as i128) |
+                ((gen.gen::<i64>() as i128) << 64);
+            Wi128(output & (max - 1))
+        }
+    }
+
+    pub fn qc_sized<A: Testable>(f: A, size: u64) {
+        QuickCheck::new()
+            .gen(StdGen::new(thread_rng(), size as usize))
+            .tests(1_00)
+            .max_tests(10_000)
+            .quickcheck(f);
+    }
+
+    macro_rules! qc_byte_order {
+        ($name:ident, $ty_int:ty, $max:expr,
+         $bytes:expr, $read:ident, $write:ident) => (
+            mod $name {
+                use {BigEndian, ByteOrder, NativeEndian, LittleEndian};
+                #[allow(unused_imports)] use super::{ qc_sized, Wi128 };
+
+                #[test]
+                fn big_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let mut buf = [0; 16];
+                        BigEndian::$write(&mut buf, n.clone(), $bytes);
+                        n == BigEndian::$read(&mut buf[..$bytes], $bytes)
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max);
+                }
+
+                #[test]
+                fn little_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let mut buf = [0; 16];
+                        LittleEndian::$write(&mut buf, n.clone(), $bytes);
+                        n == LittleEndian::$read(&mut buf[..$bytes], $bytes)
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max);
+                }
+
+                #[test]
+                fn native_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let mut buf = [0; 16];
+                        NativeEndian::$write(&mut buf, n.clone(), $bytes);
+                        n == NativeEndian::$read(&mut buf[..$bytes], $bytes)
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max);
+                }
+            }
+        );
+        ($name:ident, $ty_int:ty, $max:expr,
+         $read:ident, $write:ident) => (
+            mod $name {
+                use core::mem::size_of;
+                use {BigEndian, ByteOrder, NativeEndian, LittleEndian};
+                #[allow(unused_imports)] use super::{ qc_sized, Wi128 };
+
+                #[test]
+                fn big_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let bytes = size_of::<$ty_int>();
+                        let mut buf = [0; 16];
+                        BigEndian::$write(&mut buf[16 - bytes..], n.clone());
+                        n == BigEndian::$read(&mut buf[16 - bytes..])
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
+                }
+
+                #[test]
+                fn little_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let bytes = size_of::<$ty_int>();
+                        let mut buf = [0; 16];
+                        LittleEndian::$write(&mut buf[..bytes], n.clone());
+                        n == LittleEndian::$read(&mut buf[..bytes])
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
+                }
+
+                #[test]
+                fn native_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let bytes = size_of::<$ty_int>();
+                        let mut buf = [0; 16];
+                        NativeEndian::$write(&mut buf[..bytes], n.clone());
+                        n == NativeEndian::$read(&mut buf[..bytes])
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
+                }
+            }
+        );
+    }
+
+    qc_byte_order!(prop_u16, u16, ::core::u16::MAX as u64, read_u16, write_u16);
+    qc_byte_order!(prop_i16, i16, ::core::i16::MAX as u64, read_i16, write_i16);
+    qc_byte_order!(prop_u24, u32, ::test::U24_MAX as u64, read_u24, write_u24);
+    qc_byte_order!(prop_i24, i32, ::test::I24_MAX as u64, read_i24, write_i24);
+    qc_byte_order!(prop_u32, u32, ::core::u32::MAX as u64, read_u32, write_u32);
+    qc_byte_order!(prop_i32, i32, ::core::i32::MAX as u64, read_i32, write_i32);
+    qc_byte_order!(prop_u48, u64, ::test::U48_MAX as u64, read_u48, write_u48);
+    qc_byte_order!(prop_i48, i64, ::test::I48_MAX as u64, read_i48, write_i48);
+    qc_byte_order!(prop_u64, u64, ::core::u64::MAX as u64, read_u64, write_u64);
+    qc_byte_order!(prop_i64, i64, ::core::i64::MAX as u64, read_i64, write_i64);
+    qc_byte_order!(prop_f32, f32, ::core::u64::MAX as u64, read_f32, write_f32);
+    qc_byte_order!(prop_f64, f64, ::core::i64::MAX as u64, read_f64, write_f64);
+
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_u128, Wi128<u128>, 16 + 1, read_u128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_i128, Wi128<i128>, 16 + 1, read_i128, write_i128);
+
+    qc_byte_order!(prop_uint_1,
+        u64, calc_max!(super::U64_MAX, 1), 1, read_uint, write_uint);
+    qc_byte_order!(prop_uint_2,
+        u64, calc_max!(super::U64_MAX, 2), 2, read_uint, write_uint);
+    qc_byte_order!(prop_uint_3,
+        u64, calc_max!(super::U64_MAX, 3), 3, read_uint, write_uint);
+    qc_byte_order!(prop_uint_4,
+        u64, calc_max!(super::U64_MAX, 4), 4, read_uint, write_uint);
+    qc_byte_order!(prop_uint_5,
+        u64, calc_max!(super::U64_MAX, 5), 5, read_uint, write_uint);
+    qc_byte_order!(prop_uint_6,
+        u64, calc_max!(super::U64_MAX, 6), 6, read_uint, write_uint);
+    qc_byte_order!(prop_uint_7,
+        u64, calc_max!(super::U64_MAX, 7), 7, read_uint, write_uint);
+    qc_byte_order!(prop_uint_8,
+        u64, calc_max!(super::U64_MAX, 8), 8, read_uint, write_uint);
+
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_1,
+        Wi128<u128>, 1, 1, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_2,
+        Wi128<u128>, 2, 2, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_3,
+        Wi128<u128>, 3, 3, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_4,
+        Wi128<u128>, 4, 4, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_5,
+        Wi128<u128>, 5, 5, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_6,
+        Wi128<u128>, 6, 6, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_7,
+        Wi128<u128>, 7, 7, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_8,
+        Wi128<u128>, 8, 8, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_9,
+        Wi128<u128>, 9, 9, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_10,
+        Wi128<u128>, 10, 10, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_11,
+        Wi128<u128>, 11, 11, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_12,
+        Wi128<u128>, 12, 12, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_13,
+        Wi128<u128>, 13, 13, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_14,
+        Wi128<u128>, 14, 14, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_15,
+        Wi128<u128>, 15, 15, read_uint128, write_uint128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_uint128_16,
+        Wi128<u128>, 16, 16, read_uint128, write_uint128);
+
+    qc_byte_order!(prop_int_1,
+        i64, calc_max!(super::I64_MAX, 1), 1, read_int, write_int);
+    qc_byte_order!(prop_int_2,
+        i64, calc_max!(super::I64_MAX, 2), 2, read_int, write_int);
+    qc_byte_order!(prop_int_3,
+        i64, calc_max!(super::I64_MAX, 3), 3, read_int, write_int);
+    qc_byte_order!(prop_int_4,
+        i64, calc_max!(super::I64_MAX, 4), 4, read_int, write_int);
+    qc_byte_order!(prop_int_5,
+        i64, calc_max!(super::I64_MAX, 5), 5, read_int, write_int);
+    qc_byte_order!(prop_int_6,
+        i64, calc_max!(super::I64_MAX, 6), 6, read_int, write_int);
+    qc_byte_order!(prop_int_7,
+        i64, calc_max!(super::I64_MAX, 7), 7, read_int, write_int);
+    qc_byte_order!(prop_int_8,
+        i64, calc_max!(super::I64_MAX, 8), 8, read_int, write_int);
+
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_1,
+        Wi128<i128>, 1, 1, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_2,
+        Wi128<i128>, 2, 2, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_3,
+        Wi128<i128>, 3, 3, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_4,
+        Wi128<i128>, 4, 4, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_5,
+        Wi128<i128>, 5, 5, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_6,
+        Wi128<i128>, 6, 6, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_7,
+        Wi128<i128>, 7, 7, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_8,
+        Wi128<i128>, 8, 8, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_9,
+        Wi128<i128>, 9, 9, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_10,
+        Wi128<i128>, 10, 10, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_11,
+        Wi128<i128>, 11, 11, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_12,
+        Wi128<i128>, 12, 12, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_13,
+        Wi128<i128>, 13, 13, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_14,
+        Wi128<i128>, 14, 14, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_15,
+        Wi128<i128>, 15, 15, read_int128, write_int128);
+    #[cfg(byteorder_i128)]
+    qc_byte_order!(prop_int128_16,
+        Wi128<i128>, 16, 16, read_int128, write_int128);
+
+
+    // Test that all of the byte conversion functions panic when given a
+    // buffer that is too small.
+    //
+    // These tests are critical to ensure safety, otherwise we might end up
+    // with a buffer overflow.
+    macro_rules! too_small {
+        ($name:ident, $maximally_small:expr, $zero:expr,
+         $read:ident, $write:ident) => (
+            mod $name {
+                use {BigEndian, ByteOrder, NativeEndian, LittleEndian};
+
+                #[test]
+                #[should_panic]
+                fn read_big_endian() {
+                    let buf = [0; $maximally_small];
+                    BigEndian::$read(&buf);
+                }
+
+                #[test]
+                #[should_panic]
+                fn read_little_endian() {
+                    let buf = [0; $maximally_small];
+                    LittleEndian::$read(&buf);
+                }
+
+                #[test]
+                #[should_panic]
+                fn read_native_endian() {
+                    let buf = [0; $maximally_small];
+                    NativeEndian::$read(&buf);
+                }
+
+                #[test]
+                #[should_panic]
+                fn write_big_endian() {
+                    let mut buf = [0; $maximally_small];
+                    BigEndian::$write(&mut buf, $zero);
+                }
+
+                #[test]
+                #[should_panic]
+                fn write_little_endian() {
+                    let mut buf = [0; $maximally_small];
+                    LittleEndian::$write(&mut buf, $zero);
+                }
+
+                #[test]
+                #[should_panic]
+                fn write_native_endian() {
+                    let mut buf = [0; $maximally_small];
+                    NativeEndian::$write(&mut buf, $zero);
+                }
+            }
+        );
+        ($name:ident, $maximally_small:expr, $read:ident) => (
+            mod $name {
+                use {BigEndian, ByteOrder, NativeEndian, LittleEndian};
+
+                #[test]
+                #[should_panic]
+                fn read_big_endian() {
+                    let buf = [0; $maximally_small];
+                    BigEndian::$read(&buf, $maximally_small + 1);
+                }
+
+                #[test]
+                #[should_panic]
+                fn read_little_endian() {
+                    let buf = [0; $maximally_small];
+                    LittleEndian::$read(&buf, $maximally_small + 1);
+                }
+
+                #[test]
+                #[should_panic]
+                fn read_native_endian() {
+                    let buf = [0; $maximally_small];
+                    NativeEndian::$read(&buf, $maximally_small + 1);
+                }
+            }
+        );
+    }
+
+    too_small!(small_u16, 1, 0, read_u16, write_u16);
+    too_small!(small_i16, 1, 0, read_i16, write_i16);
+    too_small!(small_u32, 3, 0, read_u32, write_u32);
+    too_small!(small_i32, 3, 0, read_i32, write_i32);
+    too_small!(small_u64, 7, 0, read_u64, write_u64);
+    too_small!(small_i64, 7, 0, read_i64, write_i64);
+    too_small!(small_f32, 3, 0.0, read_f32, write_f32);
+    too_small!(small_f64, 7, 0.0, read_f64, write_f64);
+    #[cfg(byteorder_i128)]
+    too_small!(small_u128, 15, 0, read_u128, write_u128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_i128, 15, 0, read_i128, write_i128);
+
+    too_small!(small_uint_1, 1, read_uint);
+    too_small!(small_uint_2, 2, read_uint);
+    too_small!(small_uint_3, 3, read_uint);
+    too_small!(small_uint_4, 4, read_uint);
+    too_small!(small_uint_5, 5, read_uint);
+    too_small!(small_uint_6, 6, read_uint);
+    too_small!(small_uint_7, 7, read_uint);
+
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_1, 1, read_uint128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_2, 2, read_uint128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_3, 3, read_uint128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_4, 4, read_uint128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_5, 5, read_uint128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_6, 6, read_uint128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_7, 7, read_uint128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_8, 8, read_uint128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_9, 9, read_uint128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_10, 10, read_uint128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_11, 11, read_uint128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_12, 12, read_uint128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_13, 13, read_uint128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_14, 14, read_uint128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_uint128_15, 15, read_uint128);
+
+    too_small!(small_int_1, 1, read_int);
+    too_small!(small_int_2, 2, read_int);
+    too_small!(small_int_3, 3, read_int);
+    too_small!(small_int_4, 4, read_int);
+    too_small!(small_int_5, 5, read_int);
+    too_small!(small_int_6, 6, read_int);
+    too_small!(small_int_7, 7, read_int);
+
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_1, 1, read_int128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_2, 2, read_int128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_3, 3, read_int128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_4, 4, read_int128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_5, 5, read_int128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_6, 6, read_int128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_7, 7, read_int128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_8, 8, read_int128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_9, 9, read_int128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_10, 10, read_int128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_11, 11, read_int128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_12, 12, read_int128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_13, 13, read_int128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_14, 14, read_int128);
+    #[cfg(byteorder_i128)]
+    too_small!(small_int128_15, 15, read_int128);
+
+    // Test that reading/writing slices enforces the correct lengths.
+    macro_rules! slice_lengths {
+        ($name:ident, $read:ident, $write:ident,
+         $num_bytes:expr, $numbers:expr) => {
+            mod $name {
+                use {ByteOrder, BigEndian, NativeEndian, LittleEndian};
+
+                #[test]
+                #[should_panic]
+                fn read_big_endian() {
+                    let bytes = [0; $num_bytes];
+                    let mut numbers = $numbers;
+                    BigEndian::$read(&bytes, &mut numbers);
+                }
+
+                #[test]
+                #[should_panic]
+                fn read_little_endian() {
+                    let bytes = [0; $num_bytes];
+                    let mut numbers = $numbers;
+                    LittleEndian::$read(&bytes, &mut numbers);
+                }
+
+                #[test]
+                #[should_panic]
+                fn read_native_endian() {
+                    let bytes = [0; $num_bytes];
+                    let mut numbers = $numbers;
+                    NativeEndian::$read(&bytes, &mut numbers);
+                }
+
+                #[test]
+                #[should_panic]
+                fn write_big_endian() {
+                    let mut bytes = [0; $num_bytes];
+                    let numbers = $numbers;
+                    BigEndian::$write(&numbers, &mut bytes);
+                }
+
+                #[test]
+                #[should_panic]
+                fn write_little_endian() {
+                    let mut bytes = [0; $num_bytes];
+                    let numbers = $numbers;
+                    LittleEndian::$write(&numbers, &mut bytes);
+                }
+
+                #[test]
+                #[should_panic]
+                fn write_native_endian() {
+                    let mut bytes = [0; $num_bytes];
+                    let numbers = $numbers;
+                    NativeEndian::$write(&numbers, &mut bytes);
+                }
+            }
+        }
+    }
+
+    slice_lengths!(
+        slice_len_too_small_u16, read_u16_into, write_u16_into, 3, [0, 0]);
+    slice_lengths!(
+        slice_len_too_big_u16, read_u16_into, write_u16_into, 5, [0, 0]);
+    slice_lengths!(
+        slice_len_too_small_i16, read_i16_into, write_i16_into, 3, [0, 0]);
+    slice_lengths!(
+        slice_len_too_big_i16, read_i16_into, write_i16_into, 5, [0, 0]);
+
+    slice_lengths!(
+        slice_len_too_small_u32, read_u32_into, write_u32_into, 7, [0, 0]);
+    slice_lengths!(
+        slice_len_too_big_u32, read_u32_into, write_u32_into, 9, [0, 0]);
+    slice_lengths!(
+        slice_len_too_small_i32, read_i32_into, write_i32_into, 7, [0, 0]);
+    slice_lengths!(
+        slice_len_too_big_i32, read_i32_into, write_i32_into, 9, [0, 0]);
+
+    slice_lengths!(
+        slice_len_too_small_u64, read_u64_into, write_u64_into, 15, [0, 0]);
+    slice_lengths!(
+        slice_len_too_big_u64, read_u64_into, write_u64_into, 17, [0, 0]);
+    slice_lengths!(
+        slice_len_too_small_i64, read_i64_into, write_i64_into, 15, [0, 0]);
+    slice_lengths!(
+        slice_len_too_big_i64, read_i64_into, write_i64_into, 17, [0, 0]);
+
+    #[cfg(byteorder_i128)]
+    slice_lengths!(
+        slice_len_too_small_u128, read_u128_into, write_u128_into, 31, [0, 0]);
+    #[cfg(byteorder_i128)]
+    slice_lengths!(
+        slice_len_too_big_u128, read_u128_into, write_u128_into, 33, [0, 0]);
+    #[cfg(byteorder_i128)]
+    slice_lengths!(
+        slice_len_too_small_i128, read_i128_into, write_i128_into, 31, [0, 0]);
+    #[cfg(byteorder_i128)]
+    slice_lengths!(
+        slice_len_too_big_i128, read_i128_into, write_i128_into, 33, [0, 0]);
+
+    #[test]
+    fn uint_bigger_buffer() {
+        use {ByteOrder, LittleEndian};
+        let n = LittleEndian::read_uint(&[1, 2, 3, 4, 5, 6, 7, 8], 5);
+        assert_eq!(n, 0x0504030201);
+    }
+}
+
+#[cfg(test)]
+#[cfg(feature = "std")]
+mod stdtests {
+    extern crate quickcheck;
+    extern crate rand;
+
+    use self::quickcheck::{QuickCheck, StdGen, Testable};
+    use self::rand::thread_rng;
+
+    fn qc_unsized<A: Testable>(f: A) {
+
+        QuickCheck::new()
+            .gen(StdGen::new(thread_rng(), 16))
+            .tests(1_00)
+            .max_tests(10_000)
+            .quickcheck(f);
+    }
+
+    macro_rules! calc_max {
+        ($max:expr, $bytes:expr) => { ($max - 1) >> (8 * (8 - $bytes)) };
+    }
+
+    macro_rules! qc_bytes_ext {
+        ($name:ident, $ty_int:ty, $max:expr,
+         $bytes:expr, $read:ident, $write:ident) => (
+            mod $name {
+                use std::io::Cursor;
+                use {
+                    ReadBytesExt, WriteBytesExt,
+                    BigEndian, NativeEndian, LittleEndian,
+                };
+                #[allow(unused_imports)] use test::{qc_sized, Wi128};
+
+                #[test]
+                fn big_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let mut wtr = vec![];
+                        wtr.$write::<BigEndian>(n.clone()).unwrap();
+                        let offset = wtr.len() - $bytes;
+                        let mut rdr = Cursor::new(&mut wtr[offset..]);
+                        n == rdr.$read::<BigEndian>($bytes).unwrap()
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max);
+                }
+
+                #[test]
+                fn little_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let mut wtr = vec![];
+                        wtr.$write::<LittleEndian>(n.clone()).unwrap();
+                        let mut rdr = Cursor::new(wtr);
+                        n == rdr.$read::<LittleEndian>($bytes).unwrap()
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max);
+                }
+
+                #[test]
+                fn native_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let mut wtr = vec![];
+                        wtr.$write::<NativeEndian>(n.clone()).unwrap();
+                        let offset = if cfg!(target_endian = "big") {
+                            wtr.len() - $bytes
+                        } else {
+                            0
+                        };
+                        let mut rdr = Cursor::new(&mut wtr[offset..]);
+                        n == rdr.$read::<NativeEndian>($bytes).unwrap()
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max);
+                }
+            }
+        );
+        ($name:ident, $ty_int:ty, $max:expr, $read:ident, $write:ident) => (
+            mod $name {
+                use std::io::Cursor;
+                use {
+                    ReadBytesExt, WriteBytesExt,
+                    BigEndian, NativeEndian, LittleEndian,
+                };
+                #[allow(unused_imports)] use test::{qc_sized, Wi128};
+
+                #[test]
+                fn big_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let mut wtr = vec![];
+                        wtr.$write::<BigEndian>(n.clone()).unwrap();
+                        let mut rdr = Cursor::new(wtr);
+                        n == rdr.$read::<BigEndian>().unwrap()
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
+                }
+
+                #[test]
+                fn little_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let mut wtr = vec![];
+                        wtr.$write::<LittleEndian>(n.clone()).unwrap();
+                        let mut rdr = Cursor::new(wtr);
+                        n == rdr.$read::<LittleEndian>().unwrap()
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
+                }
+
+                #[test]
+                fn native_endian() {
+                    fn prop(n: $ty_int) -> bool {
+                        let mut wtr = vec![];
+                        wtr.$write::<NativeEndian>(n.clone()).unwrap();
+                        let mut rdr = Cursor::new(wtr);
+                        n == rdr.$read::<NativeEndian>().unwrap()
+                    }
+                    qc_sized(prop as fn($ty_int) -> bool, $max - 1);
+                }
+            }
+        );
+    }
+
+    qc_bytes_ext!(prop_ext_u16,
+        u16, ::std::u16::MAX as u64, read_u16, write_u16);
+    qc_bytes_ext!(prop_ext_i16,
+        i16, ::std::i16::MAX as u64, read_i16, write_i16);
+    qc_bytes_ext!(prop_ext_u32,
+        u32, ::std::u32::MAX as u64, read_u32, write_u32);
+    qc_bytes_ext!(prop_ext_i32,
+        i32, ::std::i32::MAX as u64, read_i32, write_i32);
+    qc_bytes_ext!(prop_ext_u64,
+        u64, ::std::u64::MAX as u64, read_u64, write_u64);
+    qc_bytes_ext!(prop_ext_i64,
+        i64, ::std::i64::MAX as u64, read_i64, write_i64);
+    qc_bytes_ext!(prop_ext_f32,
+        f32, ::std::u64::MAX as u64, read_f32, write_f32);
+    qc_bytes_ext!(prop_ext_f64,
+        f64, ::std::i64::MAX as u64, read_f64, write_f64);
+
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_u128, Wi128<u128>, 16 + 1, read_u128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_i128, Wi128<i128>, 16 + 1, read_i128, write_i128);
+
+    qc_bytes_ext!(prop_ext_uint_1,
+        u64, calc_max!(::test::U64_MAX, 1), 1, read_uint, write_u64);
+    qc_bytes_ext!(prop_ext_uint_2,
+        u64, calc_max!(::test::U64_MAX, 2), 2, read_uint, write_u64);
+    qc_bytes_ext!(prop_ext_uint_3,
+        u64, calc_max!(::test::U64_MAX, 3), 3, read_uint, write_u64);
+    qc_bytes_ext!(prop_ext_uint_4,
+        u64, calc_max!(::test::U64_MAX, 4), 4, read_uint, write_u64);
+    qc_bytes_ext!(prop_ext_uint_5,
+        u64, calc_max!(::test::U64_MAX, 5), 5, read_uint, write_u64);
+    qc_bytes_ext!(prop_ext_uint_6,
+        u64, calc_max!(::test::U64_MAX, 6), 6, read_uint, write_u64);
+    qc_bytes_ext!(prop_ext_uint_7,
+        u64, calc_max!(::test::U64_MAX, 7), 7, read_uint, write_u64);
+    qc_bytes_ext!(prop_ext_uint_8,
+        u64, calc_max!(::test::U64_MAX, 8), 8, read_uint, write_u64);
+
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_1,
+        Wi128<u128>, 1, 1, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_2,
+        Wi128<u128>, 2, 2, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_3,
+        Wi128<u128>, 3, 3, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_4,
+        Wi128<u128>, 4, 4, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_5,
+        Wi128<u128>, 5, 5, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_6,
+        Wi128<u128>, 6, 6, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_7,
+        Wi128<u128>, 7, 7, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_8,
+        Wi128<u128>, 8, 8, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_9,
+        Wi128<u128>, 9, 9, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_10,
+        Wi128<u128>, 10, 10, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_11,
+        Wi128<u128>, 11, 11, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_12,
+        Wi128<u128>, 12, 12, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_13,
+        Wi128<u128>, 13, 13, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_14,
+        Wi128<u128>, 14, 14, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_15,
+        Wi128<u128>, 15, 15, read_uint128, write_u128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_uint128_16,
+        Wi128<u128>, 16, 16, read_uint128, write_u128);
+
+    qc_bytes_ext!(prop_ext_int_1,
+        i64, calc_max!(::test::I64_MAX, 1), 1, read_int, write_i64);
+    qc_bytes_ext!(prop_ext_int_2,
+        i64, calc_max!(::test::I64_MAX, 2), 2, read_int, write_i64);
+    qc_bytes_ext!(prop_ext_int_3,
+        i64, calc_max!(::test::I64_MAX, 3), 3, read_int, write_i64);
+    qc_bytes_ext!(prop_ext_int_4,
+        i64, calc_max!(::test::I64_MAX, 4), 4, read_int, write_i64);
+    qc_bytes_ext!(prop_ext_int_5,
+        i64, calc_max!(::test::I64_MAX, 5), 5, read_int, write_i64);
+    qc_bytes_ext!(prop_ext_int_6,
+        i64, calc_max!(::test::I64_MAX, 6), 6, read_int, write_i64);
+    qc_bytes_ext!(prop_ext_int_7,
+        i64, calc_max!(::test::I64_MAX, 1), 7, read_int, write_i64);
+    qc_bytes_ext!(prop_ext_int_8,
+        i64, calc_max!(::test::I64_MAX, 8), 8, read_int, write_i64);
+
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_1,
+        Wi128<i128>, 1, 1, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_2,
+        Wi128<i128>, 2, 2, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_3,
+        Wi128<i128>, 3, 3, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_4,
+        Wi128<i128>, 4, 4, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_5,
+        Wi128<i128>, 5, 5, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_6,
+        Wi128<i128>, 6, 6, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_7,
+        Wi128<i128>, 7, 7, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_8,
+        Wi128<i128>, 8, 8, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_9,
+        Wi128<i128>, 9, 9, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_10,
+        Wi128<i128>, 10, 10, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_11,
+        Wi128<i128>, 11, 11, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_12,
+        Wi128<i128>, 12, 12, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_13,
+        Wi128<i128>, 13, 13, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_14,
+        Wi128<i128>, 14, 14, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_15,
+        Wi128<i128>, 15, 15, read_int128, write_i128);
+    #[cfg(byteorder_i128)]
+    qc_bytes_ext!(prop_ext_int128_16,
+        Wi128<i128>, 16, 16, read_int128, write_i128);
+
+    // Test slice serialization/deserialization.
+    macro_rules! qc_slice {
+        ($name:ident, $ty_int:ty, $read:ident, $write:ident, $zero:expr) => {
+            mod $name {
+                use core::mem::size_of;
+                use {ByteOrder, BigEndian, NativeEndian, LittleEndian};
+                use super::qc_unsized;
+                #[allow(unused_imports)]
+                use test::Wi128;
+
+                #[test]
+                fn big_endian() {
+                    #[allow(unused_unsafe)]
+                    fn prop(numbers: Vec<$ty_int>) -> bool {
+                        let numbers: Vec<_> = numbers
+                            .into_iter()
+                            .map(|x| x.clone())
+                            .collect();
+                        let num_bytes = size_of::<$ty_int>() * numbers.len();
+                        let mut bytes = vec![0; num_bytes];
+
+                        BigEndian::$write(&numbers, &mut bytes);
+
+                        let mut got = vec![$zero; numbers.len()];
+                        unsafe { BigEndian::$read(&bytes, &mut got); }
+
+                        numbers == got
+                    }
+                    qc_unsized(prop as fn(_) -> bool);
+                }
+
+                #[test]
+                fn little_endian() {
+                    #[allow(unused_unsafe)]
+                    fn prop(numbers: Vec<$ty_int>) -> bool {
+                        let numbers: Vec<_> = numbers
+                            .into_iter()
+                            .map(|x| x.clone())
+                            .collect();
+                        let num_bytes = size_of::<$ty_int>() * numbers.len();
+                        let mut bytes = vec![0; num_bytes];
+
+                        LittleEndian::$write(&numbers, &mut bytes);
+
+                        let mut got = vec![$zero; numbers.len()];
+                        unsafe { LittleEndian::$read(&bytes, &mut got); }
+
+                        numbers == got
+                    }
+                    qc_unsized(prop as fn(_) -> bool);
+                }
+
+                #[test]
+                fn native_endian() {
+                    #[allow(unused_unsafe)]
+                    fn prop(numbers: Vec<$ty_int>) -> bool {
+                        let numbers: Vec<_> = numbers
+                            .into_iter()
+                            .map(|x| x.clone())
+                            .collect();
+                        let num_bytes = size_of::<$ty_int>() * numbers.len();
+                        let mut bytes = vec![0; num_bytes];
+
+                        NativeEndian::$write(&numbers, &mut bytes);
+
+                        let mut got = vec![$zero; numbers.len()];
+                        unsafe { NativeEndian::$read(&bytes, &mut got); }
+
+                        numbers == got
+                    }
+                    qc_unsized(prop as fn(_) -> bool);
+                }
+            }
+        }
+    }
+
+    qc_slice!(prop_slice_u16, u16, read_u16_into, write_u16_into, 0);
+    qc_slice!(prop_slice_i16, i16, read_i16_into, write_i16_into, 0);
+    qc_slice!(prop_slice_u32, u32, read_u32_into, write_u32_into, 0);
+    qc_slice!(prop_slice_i32, i32, read_i32_into, write_i32_into, 0);
+    qc_slice!(prop_slice_u64, u64, read_u64_into, write_u64_into, 0);
+    qc_slice!(prop_slice_i64, i64, read_i64_into, write_i64_into, 0);
+    #[cfg(byteorder_i128)]
+    qc_slice!(
+        prop_slice_u128, Wi128<u128>, read_u128_into, write_u128_into, 0);
+    #[cfg(byteorder_i128)]
+    qc_slice!(
+        prop_slice_i128, Wi128<i128>, read_i128_into, write_i128_into, 0);
+
+    qc_slice!(
+        prop_slice_f32, f32, read_f32_into, write_f32_into, 0.0);
+    qc_slice!(
+        prop_slice_f64, f64, read_f64_into, write_f64_into, 0.0);
+}
+
+
\ No newline at end of file diff --git a/src/cfg_if/lib.rs.html b/src/cfg_if/lib.rs.html new file mode 100644 index 0000000..e639604 --- /dev/null +++ b/src/cfg_if/lib.rs.html @@ -0,0 +1,355 @@ +lib.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+
+//! A macro for defining `#[cfg]` if-else statements.
+//!
+//! The macro provided by this crate, `cfg_if`, is similar to the `if/elif` C
+//! preprocessor macro by allowing definition of a cascade of `#[cfg]` cases,
+//! emitting the implementation which matches first.
+//!
+//! This allows you to conveniently provide a long list `#[cfg]`'d blocks of code
+//! without having to rewrite each clause multiple times.
+//!
+//! # Example
+//!
+//! ```
+//! cfg_if::cfg_if! {
+//!     if #[cfg(unix)] {
+//!         fn foo() { /* unix specific functionality */ }
+//!     } else if #[cfg(target_pointer_width = "32")] {
+//!         fn foo() { /* non-unix, 32-bit functionality */ }
+//!     } else {
+//!         fn foo() { /* fallback implementation */ }
+//!     }
+//! }
+//!
+//! # fn main() {}
+//! ```
+
+#![no_std]
+#![doc(html_root_url = "https://docs.rs/cfg-if")]
+#![deny(missing_docs)]
+#![cfg_attr(test, deny(warnings))]
+
+/// The main macro provided by this crate. See crate documentation for more
+/// information.
+#[macro_export]
+macro_rules! cfg_if {
+    // match if/else chains with a final `else`
+    ($(
+        if #[cfg($($meta:meta),*)] { $($tokens:tt)* }
+    ) else * else {
+        $($tokens2:tt)*
+    }) => {
+        $crate::cfg_if! {
+            @__items
+            () ;
+            $( ( ($($meta),*) ($($tokens)*) ), )*
+            ( () ($($tokens2)*) ),
+        }
+    };
+
+    // match if/else chains lacking a final `else`
+    (
+        if #[cfg($($i_met:meta),*)] { $($i_tokens:tt)* }
+        $(
+            else if #[cfg($($e_met:meta),*)] { $($e_tokens:tt)* }
+        )*
+    ) => {
+        $crate::cfg_if! {
+            @__items
+            () ;
+            ( ($($i_met),*) ($($i_tokens)*) ),
+            $( ( ($($e_met),*) ($($e_tokens)*) ), )*
+            ( () () ),
+        }
+    };
+
+    // Internal and recursive macro to emit all the items
+    //
+    // Collects all the negated cfgs in a list at the beginning and after the
+    // semicolon is all the remaining items
+    (@__items ($($not:meta,)*) ; ) => {};
+    (@__items ($($not:meta,)*) ; ( ($($m:meta),*) ($($tokens:tt)*) ), $($rest:tt)*) => {
+        // Emit all items within one block, applying an appropriate #[cfg]. The
+        // #[cfg] will require all `$m` matchers specified and must also negate
+        // all previous matchers.
+        #[cfg(all($($m,)* not(any($($not),*))))] $crate::cfg_if! { @__identity $($tokens)* }
+
+        // Recurse to emit all other items in `$rest`, and when we do so add all
+        // our `$m` matchers to the list of `$not` matchers as future emissions
+        // will have to negate everything we just matched as well.
+        $crate::cfg_if! { @__items ($($not,)* $($m,)*) ; $($rest)* }
+    };
+
+    // Internal macro to make __apply work out right for different match types,
+    // because of how macros matching/expand stuff.
+    (@__identity $($tokens:tt)*) => {
+        $($tokens)*
+    };
+}
+
+#[cfg(test)]
+mod tests {
+    cfg_if! {
+        if #[cfg(test)] {
+            use core::option::Option as Option2;
+            fn works1() -> Option2<u32> { Some(1) }
+        } else {
+            fn works1() -> Option<u32> { None }
+        }
+    }
+
+    cfg_if! {
+        if #[cfg(foo)] {
+            fn works2() -> bool { false }
+        } else if #[cfg(test)] {
+            fn works2() -> bool { true }
+        } else {
+            fn works2() -> bool { false }
+        }
+    }
+
+    cfg_if! {
+        if #[cfg(foo)] {
+            fn works3() -> bool { false }
+        } else {
+            fn works3() -> bool { true }
+        }
+    }
+
+    cfg_if! {
+        if #[cfg(test)] {
+            use core::option::Option as Option3;
+            fn works4() -> Option3<u32> { Some(1) }
+        }
+    }
+
+    cfg_if! {
+        if #[cfg(foo)] {
+            fn works5() -> bool { false }
+        } else if #[cfg(test)] {
+            fn works5() -> bool { true }
+        }
+    }
+
+    #[test]
+    fn it_works() {
+        assert!(works1().is_some());
+        assert!(works2());
+        assert!(works3());
+        assert!(works4().is_some());
+        assert!(works5());
+    }
+
+    #[test]
+    #[allow(clippy::assertions_on_constants)]
+    fn test_usage_within_a_function() {
+        cfg_if! {if #[cfg(debug_assertions)] {
+            // we want to put more than one thing here to make sure that they
+            // all get configured properly.
+            assert!(cfg!(debug_assertions));
+            assert_eq!(4, 2+2);
+        } else {
+            assert!(works1().is_some());
+            assert_eq!(10, 5+5);
+        }}
+    }
+
+    trait Trait {
+        fn blah(&self);
+    }
+
+    #[allow(dead_code)]
+    struct Struct;
+
+    impl Trait for Struct {
+        cfg_if! {
+            if #[cfg(feature = "blah")] {
+                fn blah(&self) {
+                    unimplemented!();
+                }
+            } else {
+                fn blah(&self) {
+                    unimplemented!();
+                }
+            }
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/ironsea_index/lib.rs.html b/src/ironsea_index/lib.rs.html new file mode 100644 index 0000000..87ff12b --- /dev/null +++ b/src/ironsea_index/lib.rs.html @@ -0,0 +1,273 @@ +lib.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+
+#![forbid(unsafe_code)]
+#![deny(missing_docs)]
+
+//! # Iron Sea - Index
+//!
+//! This repository contains the traits definitions for the Iron Sea
+//! database toolkit indices.
+//!
+//! ## Iron Sea: Database Toolkit
+//! **Iron Sea** provides a set of database engine bricks, which can be
+//! combined and applied on arbitrary data structures.
+//!
+//! Unlike a traditional database, it does not assume a specific
+//! physical structure for the tables nor the records, but relies on the
+//! developer to provide a set of extractor functions which are used by
+//! the specific indices provided.
+//!
+//! This enables the index implementations to be agnostic from the
+//! underlying data structure, and re-used.
+//!
+//!
+
+/// Record behavior used by Indexed implementations.
+///
+/// This trait provides common methods used by index implementations to
+/// retrieve information about a single record. This is provided by the
+/// users of indices, for each of their `struct` they wish to index.
+///
+/// Multiple implementation can be provided, as long as their types are
+/// different.
+///
+// TODO: Add more complex scenarii where multiple implementations with
+//       the same types are necessary, for example returning either a or
+//       b.
+///
+/// # Examples
+///
+/// ```
+/// use ironsea_index::Record;
+///
+/// #[derive(Clone, Debug)]
+/// pub struct MyPair {
+///     a: i64,
+///     b: i64,
+/// }
+///
+/// impl Record<String> for MyPair {
+///    fn key(&self) -> String {
+///        format!("{}", self.a)
+///    }
+/// }
+///
+/// impl Record<i64> for MyPair {
+///    fn key(&self) -> i64 {
+///        self.a
+///    }
+/// }
+///
+/// fn main() {
+///
+///    let table = vec![MyPair{ a: 10, b:34}, MyPair{ a: 1, b:56}, MyPair{ a: 2, b:23}];
+///
+///    // Example without using an actual index crate, we will simply use
+///    // the Record<K> trait to sort the array of pairs.
+///    let mut lex_sort = table.clone();
+///    lex_sort.sort_unstable_by_key(|e| {let k: String = e.key(); k});
+///
+///    let mut num_sort = table.clone();
+///    num_sort.sort_unstable_by_key(|e| {let k: i64 = e.key(); k});
+///
+///    assert_eq!(format!("unsorted {:?}", table),
+///         "unsorted [MyPair { a: 10, b: 34 }, MyPair { a: 1, b: 56 }, MyPair { a: 2, b: 23 }]");
+///    assert_eq!(format!("lex sort {:?}", lex_sort),
+///         "lex sort [MyPair { a: 1, b: 56 }, MyPair { a: 10, b: 34 }, MyPair { a: 2, b: 23 }]");
+///    assert_eq!(format!("num sort {:?}", num_sort),
+///         "num sort [MyPair { a: 1, b: 56 }, MyPair { a: 2, b: 23 }, MyPair { a: 10, b: 34 }]");
+/// }
+/// ```
+pub trait Record<K> {
+    /// Extract the key from the record.
+    fn key(&self) -> K;
+}
+
+/// Record behavior used by IndexedDestructured implementations.
+///
+/// RecordFields is used by indices which de-structure records into two
+/// components, the key and the fields associated to that unique key.
+/// This is provided by the users of indices, for each of their `struct`
+/// they wish to index.
+pub trait RecordFields<F> {
+    /// Extract the fields of the record
+    fn fields(&self) -> F;
+}
+
+/// Methods provided by indices.
+///
+/// This kind of indices can work on references to the original vector
+/// or take ownership of the records, based on the type given for the
+/// records.
+///
+///  * `R`: Type of the records
+///  * `K`: Type of the keys
+
+// Generic types are not sorted alphabetically, to match next trait
+// semantic order
+pub trait Indexed<R, K> {
+    /// Retrieve all records matching the key.
+    fn find(&self, key: &K) -> Vec<&R>;
+
+    /// Retrieve all records matching in the key range defined by
+    /// `start` and `end`.
+    ///
+    /// * `start` is included
+    // TODO: TBC for `end`
+    fn find_range(&self, start: &K, end: &K) -> Vec<&R>;
+}
+
+/// Methods provided by destructuring indices.
+///
+/// This kind of indices store inside the index both keys and values,
+/// meaning the original records can be freed.
+///
+///  * `F`: Type of the struct containing the remaining fields
+///  * `K`: Type of the keys
+pub trait IndexedDestructured<F, K> {
+    /// Retrieve all records matching the key.
+    fn find(&self, key: &K) -> Vec<&F>;
+
+    /// Retrieve all records matching in the key range defined by
+    /// `start` and `end`.
+    ///
+    /// * `start` is included
+    // TODO: TBC for `end`
+    fn find_range(&self, start: &K, end: &K) -> Vec<(K, &F)>;
+}
+
+
\ No newline at end of file diff --git a/src/ironsea_index_sfc_dbc/cell_space.rs.html b/src/ironsea_index_sfc_dbc/cell_space.rs.html new file mode 100644 index 0000000..aba15f5 --- /dev/null +++ b/src/ironsea_index_sfc_dbc/cell_space.rs.html @@ -0,0 +1,681 @@ +cell_space.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+
+use std::collections::HashSet;
+use std::fmt::Debug;
+use std::hash::Hash;
+use std::marker;
+use std::ops::Index;
+
+use ironsea_index::Record;
+use serde::Deserialize;
+use serde::Serialize;
+
+type Cell<T> = Vec<T>;
+
+#[derive(Clone, Debug, Deserialize, Serialize)]
+struct CellDictionary<K, V> {
+    table: Vec<Cell<V>>,
+    max_offset: usize,
+    _marker: marker::PhantomData<K>,
+}
+
+impl<K, V> CellDictionary<K, V>
+where
+    K: Debug + Index<usize, Output = V>,
+    V: Clone + Debug + Hash + Ord,
+{
+    pub fn new<I, R>(iter: I, dimension: usize, cell_bits: usize) -> Self
+    where
+        I: Iterator<Item = R>,
+        R: Debug + Record<K>,
+    {
+        // 1. Retrieve a list of distinct values for the coordinate `dimension`
+        let mut distinct: HashSet<V> = iter.map(|record| record.key()[dimension].clone()).collect();
+
+        // 2. Build a sorted list, of distinct elements
+        let mut distinct = distinct.drain().collect::<Vec<_>>();
+        distinct.sort_unstable();
+
+        info!(
+            "Number of distinct coordinates on dim[{}]: {}",
+            dimension,
+            distinct.len()
+        );
+
+        trace!("min {:?}, max {:?}", distinct[0], distinct.last());
+
+        // 3. Build the dictionary space
+        // 3.1. Build dictionnary per dimension, Add cell and offset
+        //      informations
+        let mut count = 0;
+        let mut cell = 0;
+
+        // Beware integer division is rounded towards zero, so add 1 to the
+        // result as this is the max number of elements per bucket.
+        let max_offset = (distinct.len() / (1 << cell_bits)) + 1;
+
+        let mut cells: Vec<Cell<V>> = Vec::with_capacity(1 << cell_bits);
+
+        // Do not forget to initialise cells[0]!
+        cells.push(Vec::with_capacity(max_offset));
+
+        for coordinate in distinct {
+            //trace!("{:?} {:?} {:?} {:?}", dimension, coordinate, cell, count);
+
+            // Check first, otherwise we might add a cell which will stay empty.
+            if count == max_offset {
+                count = 0;
+                cell += 1;
+                cells.push(Vec::with_capacity(max_offset));
+            }
+
+            cells[cell].push(coordinate);
+            count += 1;
+        }
+
+        info!(
+            "dim[{}]: {} cells, {} max per cell",
+            dimension,
+            cells.len(),
+            max_offset,
+        );
+
+        CellDictionary {
+            table: cells,
+            max_offset,
+            _marker: marker::PhantomData,
+        }
+    }
+
+    fn max_offset(&self) -> usize {
+        self.max_offset
+    }
+
+    fn cells(&self) -> &Vec<Cell<V>> {
+        &self.table
+    }
+
+    fn cell_id(&self, position: &V) -> Option<usize> {
+        let mut id = 0;
+        // If the last value of the current cell is >= than the value, then
+        // the value is stored in the cell.
+        // If this is the first cell, we will look into it as `id` is
+        // still 0.
+        for cell in self.cells() {
+            // last cell is likely to be only partially full
+            match cell.last() {
+                Some(x) => {
+                    if x >= position {
+                        break;
+                    }
+                }
+                None => break,
+            };
+            id += 1;
+        }
+
+        if id >= self.cells().len() {
+            None
+        } else {
+            Some(id)
+        }
+    }
+
+    fn key(&self, position: &V) -> Option<(usize, usize)> {
+        let mut result = None;
+        if let Some(id) = self.cell_id(position) {
+            if let Ok(offset) = self.table[id].binary_search(position) {
+                result = Some((id, offset));
+            }
+        }
+
+        result
+    }
+
+    fn key_down(&self, position: &V) -> (usize, usize) {
+        match self.cell_id(position) {
+            Some(id) => match self.table[id].binary_search(position) {
+                Ok(offset) => (id, offset),
+                Err(offset) => {
+                    if offset > 0 {
+                        (id, offset - 1)
+                    } else if id == 0 {
+                        (0, 0)
+                    } else {
+                        let id = id - 1;
+                        (id, self.table[id].len() - 1)
+                    }
+                }
+            },
+            None => self.last(),
+        }
+    }
+
+    fn last(&self) -> (usize, usize) {
+        assert!(!self.table.is_empty());
+        let last_id = self.table.len() - 1;
+
+        assert!(!self.table[last_id].is_empty());
+        let last_offset = self.table[last_id].len() - 1;
+
+        (last_id, last_offset)
+    }
+
+    fn key_up(&self, position: &V) -> (usize, usize) {
+        match self.cell_id(position) {
+            Some(id) => match self.table[id].binary_search(position) {
+                Ok(offset) => (id, offset),
+                Err(offset) => {
+                    if offset < self.max_offset {
+                        (id, offset)
+                    } else if id < self.table.len() {
+                        (id + 1, 0)
+                    } else {
+                        self.last()
+                    }
+                }
+            },
+            None => self.last(),
+        }
+    }
+
+    fn value(&self, cell_id: usize, offset: usize) -> &V {
+        &self.table[cell_id][offset]
+    }
+}
+
+#[derive(Clone, Debug, Deserialize, Serialize)]
+pub struct CellSpace<K, V> {
+    dimensions: usize,
+    coordinates: Vec<CellDictionary<K, V>>,
+    coordinates_max_offsets: Vec<usize>,
+}
+
+impl<K, V> CellSpace<K, V>
+where
+    K: Debug + Index<usize, Output = V>,
+    V: Clone + Debug + Hash + Ord,
+{
+    pub fn new<I, R>(iter: I, dimensions: usize, cell_bits: usize) -> Self
+    where
+        I: Clone + Iterator<Item = R>,
+        R: Debug + Record<K>,
+    {
+        let mut space = CellSpace {
+            dimensions,
+            coordinates: vec![],
+            coordinates_max_offsets: vec![],
+        };
+
+        // FIXME: Add check to ensure all positions have the required number of dimensions.
+        for k in 0..dimensions {
+            let dic = CellDictionary::new(iter.clone(), k, cell_bits);
+            let max = dic.max_offset();
+            space.coordinates.push(dic);
+            space.coordinates_max_offsets.push(max);
+        }
+
+        space
+    }
+
+    pub fn last(&self) -> (Vec<usize>, Vec<usize>) {
+        let mut cells = Vec::with_capacity(self.dimensions);
+        let mut offsets = Vec::with_capacity(self.dimensions);
+        for k in 0..self.dimensions {
+            let (cell_id, offset) = self.coordinates[k].last();
+            cells.push(cell_id);
+            offsets.push(offset);
+        }
+
+        (cells, offsets)
+    }
+
+    pub fn key(&self, position: &K) -> Result<(Vec<usize>, Vec<usize>), String> {
+        //TODO: Should we check inside each objects, or just assume it is correct and/or rely on the bound checks?
+        /* This impose to require ExactSizeIterator, which is not implemented on Vec, and can't be in any easy way.
+        if self.dimensions != position.len() {
+            return Err(format!(
+                "Incorrect number of dimensions, expected {}, got {} for {:?}",
+                self.dimensions,
+                position.len(),
+                position
+            ));
+        }*/
+
+        let mut cells = Vec::with_capacity(self.dimensions);
+        let mut offsets = Vec::with_capacity(self.dimensions);
+        for k in 0..self.dimensions {
+            match self.coordinates[k].key(&position[k]) {
+                None => {
+                    return Err(format!(
+                        "Incorrect value for position[{:?}]: {:?}",
+                        k, &position[k]
+                    ))
+                }
+                Some((id, offset)) => {
+                    cells.push(id);
+                    offsets.push(offset)
+                }
+            };
+        }
+
+        Ok((cells, offsets))
+    }
+
+    // Round down to the preceding element or self if in the space
+    pub fn key_down(&self, position: &K) -> Result<(Vec<usize>, Vec<usize>), String> {
+        //TODO: Should we check inside each objects, or just assume it is correct and/or rely on the bound checks?
+        /* This impose to require ExactSizeIterator, which is not implemented on Vec, and can't be in any easy way.
+        if self.dimensions != position.len() {
+            return Err(format!(
+                "Incorrect number of dimensions, expected {}, got {} for {:?}",
+                self.dimensions,
+                position.len(),
+                position
+            ));
+        }*/
+
+        let mut cells = Vec::with_capacity(self.dimensions);
+        let mut offsets = Vec::with_capacity(self.dimensions);
+        for k in 0..self.dimensions {
+            let (id, offset) = self.coordinates[k].key_down(&position[k]);
+            cells.push(id);
+            offsets.push(offset);
+        }
+
+        Ok((cells, offsets))
+    }
+
+    // Round up to the next element or self if in the space
+    pub fn key_up(&self, position: &K) -> Result<(Vec<usize>, Vec<usize>), String> {
+        //TODO: Should we check inside each objects, or just assume it is correct and/or rely on the bound checks?
+        /* This impose to require ExactSizeIterator, which is not implemented on Vec, and can't be in any easy way.
+        if self.dimensions != position.len() {
+            return Err(format!(
+                "Incorrect number of dimensions, expected {}, got {} for {:?}",
+                self.dimensions,
+                position.len(),
+                position
+            ));
+        }*/
+
+        let mut cells = Vec::with_capacity(self.dimensions);
+        let mut offsets = Vec::with_capacity(self.dimensions);
+        for k in 0..self.dimensions {
+            let (id, offset) = self.coordinates[k].key_up(&position[k]);
+            cells.push(id);
+            offsets.push(offset);
+        }
+
+        Ok((cells, offsets))
+    }
+
+    pub fn value(&self, cells_id: Vec<usize>, offsets: Vec<usize>) -> Result<Vec<&V>, String> {
+        //TODO: Should we check inside each objects, or just assume it is correct and/or rely on the bound checks?
+        if self.dimensions != cells_id.len() {
+            return Err(format!(
+                "Incorrect number of dimensions, expected {}, got {} for {:?}",
+                self.dimensions,
+                cells_id.len(),
+                cells_id
+            ));
+        }
+
+        //TODO: Should we check inside each objects, or just assume it is correct and/or rely on the bound checks?
+        if self.dimensions != offsets.len() {
+            return Err(format!(
+                "Incorrect number of dimensions, expected {}, got {} for {:?}",
+                self.dimensions,
+                offsets.len(),
+                offsets
+            ));
+        }
+
+        let mut values = Vec::with_capacity(self.dimensions);
+        for k in 0..self.dimensions {
+            values.push(self.coordinates[k].value(cells_id[k], offsets[k]));
+        }
+
+        Ok(values)
+    }
+}
+
+
\ No newline at end of file diff --git a/src/ironsea_index_sfc_dbc/lib.rs.html b/src/ironsea_index_sfc_dbc/lib.rs.html new file mode 100644 index 0000000..4b392d9 --- /dev/null +++ b/src/ironsea_index_sfc_dbc/lib.rs.html @@ -0,0 +1,83 @@ +lib.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
+#![forbid(unsafe_code)]
+#![warn(missing_docs)]
+
+//! # Iron Sea - Index SFC DBC
+//!
+//! Index for the Iron Sea toolkit, based on a Space Filling Curve (SFC),
+//! over Dictionary-Based Compression (DBC), which offers great
+//! performances for both range queries over point cloud data and at the
+//! same time uses a storage-efficient index.
+//!
+//! More details in the [paper].
+//!
+//! [paper]: https://infoscience.epfl.ch/record/232536?ln=en
+//!
+//! ## Iron Sea: Database Toolkit
+//! **Iron Sea** provides a set of database engine bricks, which can be
+//! combined and applied on arbitrary data structures.
+//!
+//! Unlike a traditional database, it does not assume a specific
+//! physical structure for the tables nor the records, but relies on the
+//! developer to provide a set of extractor functions which are used by
+//! the specific indices provided.
+//!
+//! This enables the index implementations to be agnostic from the
+//! underlying data structure, and re-used.
+//!
+
+#[macro_use]
+extern crate log;
+
+#[macro_use]
+extern crate arrayref;
+
+mod cell_space;
+mod morton;
+mod sfc;
+
+pub use sfc::Record;
+pub use sfc::RecordFields;
+pub use sfc::SpaceFillingCurve as IndexOwned;
+
+
\ No newline at end of file diff --git a/src/ironsea_index_sfc_dbc/morton.rs.html b/src/ironsea_index_sfc_dbc/morton.rs.html new file mode 100644 index 0000000..e45706a --- /dev/null +++ b/src/ironsea_index_sfc_dbc/morton.rs.html @@ -0,0 +1,895 @@ +morton.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+
+use std::fmt;
+use std::fmt::Debug;
+
+use serde::de;
+use serde::de::Deserialize;
+use serde::de::Deserializer;
+use serde::de::MapAccess;
+use serde::de::SeqAccess;
+use serde::de::Visitor;
+use serde::ser::Serialize;
+use serde::ser::SerializeStruct;
+use serde::ser::Serializer;
+
+pub type MortonCode = u32;
+pub type MortonValue = u16;
+
+const MORTON_CODE_BITS: usize = 32;
+const MORTON_VALUE_BITS: usize = 10;
+const MORTON_MAX_VALUES: usize = 1024;
+
+#[derive(Clone)]
+pub struct MortonEncoder {
+    cell_bits: usize,
+    cell_mask: usize,
+    dimensions: usize,
+    table: Vec<[MortonCode; MORTON_MAX_VALUES]>,
+}
+
+impl Debug for MortonEncoder {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(
+            f,
+            "MortonEncoder {{ cell_bits: {}, cell_mask: {}, dimensions: {}, table: ",
+            self.cell_bits, self.cell_mask, self.dimensions
+        )?;
+        write!(f, "[ ")?;
+        for k in &self.table {
+            write!(f, "[ ")?;
+            for v in k.iter() {
+                write!(f, "{}, ", v)?;
+            }
+            write!(f, "], ")?;
+        }
+        write!(f, "] }}")
+    }
+}
+
+impl MortonEncoder {
+    pub fn new(dimensions: usize, cell_bits: usize) -> Self {
+        // Make sure we can store the encoding in a single T.
+        // Don't know how to make that test generically
+        assert!(MORTON_VALUE_BITS >= cell_bits);
+        assert!(MORTON_CODE_BITS >= cell_bits * dimensions);
+
+        //let mut masks = vec![];
+        let mut table = vec![];
+        let cell_max = 1 << cell_bits;
+        let cell_mask = cell_max - 1;
+
+        // Build lookup table & masks
+        for k in 0..dimensions {
+            table.push([0; MORTON_MAX_VALUES]);
+            for i in 0..cell_max {
+                let mut v = 0;
+                for p in 0..cell_bits {
+                    // Note: bit is at position p, so shift it only K-1 p position again below, instead
+                    // of K times
+                    let bit = i & (1 << p);
+                    let new_bit = bit << (p * (dimensions - 1) + k);
+                    v |= new_bit;
+                }
+                table[k][i] = v as MortonCode;
+            }
+            /*
+            let mut v = 0usize;
+            for p in 0..cell_bits {
+                let new_bit = 1 << p * (dimensions - 1) + k;
+                v = v | new_bit;
+            }
+            masks.push(v as MortonCode);
+            */
+        }
+
+        MortonEncoder {
+            cell_bits,
+            cell_mask,
+            dimensions,
+            table,
+            //masks,
+        }
+    }
+
+    fn encode_1(&self, k: usize, v: MortonValue) -> MortonCode {
+        // Already done by the array bound checker anyway
+        //assert!((v as usize) < MORTON_MAX_VALUES);
+        //assert!(k < self.table.len());
+
+        // Ensure we only have valid values in inputs, even when less bits than
+        // the maximum is used to define those values.
+        let v = v as usize & self.cell_mask;
+        self.table[k][v]
+    }
+
+    fn decode_1(&self, k: usize, code: MortonCode) -> MortonValue {
+        // Already done by the array bound checker anyway
+        //assert!(k < self.table.len());
+
+        let mut v = 0;
+
+        for i in 0..self.cell_bits {
+            let bit_pos = i * self.table.len() + k;
+            let bit = code as usize & (1 << bit_pos);
+            let bit_pos = bit_pos - i;
+            v |= (bit >> bit_pos) as MortonValue;
+        }
+
+        v as MortonValue
+    }
+
+    pub fn encode(&self, v: &[MortonValue]) -> Result<MortonCode, String> {
+        //TODO: Should we check inside each objects, or just assume it is correct and/or rely on the bound checks?
+        if self.dimensions != v.len() {
+            return Err(format!(
+                "Incorrect number of dimensions, expected {}, got {} for {:?}",
+                self.dimensions,
+                v.len(),
+                v
+            ));
+        }
+
+        let mut code = 0;
+
+        for (k, i) in v.iter().enumerate().take(self.dimensions) {
+            code |= self.encode_1(k, *i);
+        }
+
+        Ok(code)
+    }
+
+    pub fn decode(&self, code: MortonCode) -> Vec<MortonValue> {
+        let mut values = vec![];
+
+        for k in 0..self.dimensions {
+            values.push(self.decode_1(k, code));
+        }
+
+        values
+    }
+}
+
+impl Serialize for MortonEncoder {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        // We serialize the minimum amount of information necessary to
+        // deserialize the table.
+        // This is the parameters to init(dimensions, cell_bits)
+        let mut state = serializer.serialize_struct("MortonEncoder", 2)?;
+        state.serialize_field("cell_bits", &self.cell_bits)?;
+        state.serialize_field("dimensions", &self.dimensions)?;
+        state.end()
+    }
+}
+
+impl<'de> Deserialize<'de> for MortonEncoder {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        enum Field {
+            CellBits,
+            Dimensions,
+        };
+
+        impl<'de> Deserialize<'de> for Field {
+            fn deserialize<D>(deserializer: D) -> Result<Field, D::Error>
+            where
+                D: Deserializer<'de>,
+            {
+                struct FieldVisitor;
+
+                impl<'de> Visitor<'de> for FieldVisitor {
+                    type Value = Field;
+
+                    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                        formatter.write_str("`cell_bits` or `dimensions`")
+                    }
+
+                    fn visit_str<E>(self, value: &str) -> Result<Field, E>
+                    where
+                        E: de::Error,
+                    {
+                        match value {
+                            "cell_bits" => Ok(Field::CellBits),
+                            "dimensions" => Ok(Field::Dimensions),
+                            _ => Err(de::Error::unknown_field(value, FIELDS)),
+                        }
+                    }
+                }
+
+                deserializer.deserialize_identifier(FieldVisitor)
+            }
+        }
+
+        struct MortonEncoderVisitor;
+
+        impl<'de> Visitor<'de> for MortonEncoderVisitor {
+            type Value = MortonEncoder;
+
+            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                formatter.write_str("struct MortonEncoder")
+            }
+
+            fn visit_seq<V>(self, mut seq: V) -> Result<MortonEncoder, V::Error>
+            where
+                V: SeqAccess<'de>,
+            {
+                let cell_bits = seq
+                    .next_element()?
+                    .ok_or_else(|| de::Error::invalid_length(0, &self))?;
+                let dimensions = seq
+                    .next_element()?
+                    .ok_or_else(|| de::Error::invalid_length(1, &self))?;
+                Ok(MortonEncoder::new(dimensions, cell_bits))
+            }
+
+            fn visit_map<V>(self, mut map: V) -> Result<MortonEncoder, V::Error>
+            where
+                V: MapAccess<'de>,
+            {
+                let mut cell_bits = None;
+                let mut dimensions = None;
+                while let Some(key) = map.next_key()? {
+                    match key {
+                        Field::CellBits => {
+                            if cell_bits.is_some() {
+                                return Err(de::Error::duplicate_field("cell_bits"));
+                            }
+                            cell_bits = Some(map.next_value()?);
+                        }
+                        Field::Dimensions => {
+                            if dimensions.is_some() {
+                                return Err(de::Error::duplicate_field("dimensions"));
+                            }
+                            dimensions = Some(map.next_value()?);
+                        }
+                    }
+                }
+                let cell_bits = cell_bits.ok_or_else(|| de::Error::missing_field("cell_bits"))?;
+                let dimensions =
+                    dimensions.ok_or_else(|| de::Error::missing_field("dimensions"))?;
+                Ok(MortonEncoder::new(dimensions, cell_bits))
+            }
+        }
+
+        const FIELDS: &[&str] = &["cell_bits", "dimensions"];
+        deserializer.deserialize_struct("MortonEncoder", FIELDS, MortonEncoderVisitor)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    mod init {
+        use super::*;
+
+        /* Check the assertions */
+        #[test]
+        #[should_panic]
+        fn dim1_bit32() {
+            let _m = MortonEncoder::new(1, 31);
+        }
+
+        #[test]
+        #[should_panic]
+        fn dim2_bit16() {
+            // Max 10 bit for the codes, even if 16 would fit
+            let _m = MortonEncoder::new(2, 16);
+        }
+
+        #[test]
+        #[should_panic]
+        fn dim33_bit1() {
+            let _m = MortonEncoder::new(33, 1);
+        }
+
+        #[test]
+        #[should_panic]
+        fn dim17_bit2() {
+            let _m = MortonEncoder::new(17, 2);
+        }
+
+        #[test]
+        fn dim1_bit10() {
+            let _m = MortonEncoder::new(1, 10);
+        }
+
+        #[test]
+        fn dim2_bit10() {
+            let _m = MortonEncoder::new(2, 10);
+        }
+
+        #[test]
+        fn dim3_bit10() {
+            let _m = MortonEncoder::new(3, 10);
+        }
+
+        #[test]
+        fn dim4_bit8() {
+            let _m = MortonEncoder::new(4, 8);
+        }
+
+        #[test]
+        fn dim32_bit1() {
+            let _m = MortonEncoder::new(32, 1);
+        }
+
+        /*
+            morton_init();
+        // Morton table looks OK
+        //    for n in 0..10 {
+        //        println!("{:4}", n);
+        //        for k in 0..K {
+        //            println!("{:032b}", unsafe {MORTON[k][n]});
+        //        }
+        //    }
+
+            for n in 0..CELL_MAX {
+                println!("## {:04}", n);
+                let mut c = 0 as Code;
+                for k in 0..K {
+                    // check diagonal
+                    c = c | morton_encode(k, n as u16);
+                }
+                let f = n as u16;
+                for k in 1..2 {
+                    // check diagonal
+                    let p = morton_decode(k, c);
+                    println!("\n{:04} \n f {:04}\n p {:04}\n 𝚫 {:06}\n", c, f, p, f-p);
+
+                }
+            }
+
+
+            let mut f = 0.0f64;
+        //    while f < 1.0 {
+        //        let v = convert_to_fixed(&f);
+        //        let p = convert_to_f64(&v);
+        //        println!("\n{:010} \n f {:+0.16e}\n p {:+03.16e}\n 𝚫 {:+03.16e}\n", v, f, p, f - p);
+        //
+        //        f += 0.1e-1;
+        //    }
+
+            let f =0.000724939184752;
+            let v = convert_to_fixed(&f);
+            let p = convert_to_f64(&v);
+            println!("\n{:010} \n f {:+0.16e}\n p {:+03.16e}\n 𝚫 {:+03.16e}\n", v, f, p, f - p);
+
+        */
+    }
+
+    mod encode {
+        use super::*;
+
+        /* Check the lookup table produced */
+        #[test]
+        fn dim1_bit10() {
+            let m = MortonEncoder::new(1, 10);
+            for n in 0..MORTON_MAX_VALUES {
+                assert_eq!(n as MortonCode, m.encode_1(0, n as MortonValue));
+            }
+        }
+
+        #[test]
+        fn table_dim2_bit10() {
+            let m = MortonEncoder::new(2, 10);
+            let mut lookup = Vec::<Vec<MortonCode>>::new();
+
+            for k in 0..2 {
+                lookup.push(Vec::new());
+
+                for n in 0..MORTON_MAX_VALUES {
+                    // Morton numbers are number where the bit are exploded so that we can
+                    // interleave them. This means that for each position of a value, we need to
+                    // insert dimensions - 1 columns between each bits, and shift that result by the
+                    // dimension number so that we can OR all the dimensions together without having
+                    // bits colliding.
+                    let mut v = 0;
+                    for p in 0..MORTON_VALUE_BITS {
+                        let b = (n & (1 << p)) >> p;
+                        v = v | b << (p * 2 + k);
+                    }
+                    lookup[k].push(v as MortonCode);
+                }
+            }
+
+            for k in 0..2 {
+                for n in 0..MORTON_MAX_VALUES {
+                    assert_eq!(lookup[k][n], m.encode_1(k, n as MortonValue));
+                }
+            }
+        }
+
+        fn check(dimensions: usize, value_max: usize, value_bits: usize, m: MortonEncoder) -> () {
+            let mut lookup = Vec::<Vec<MortonCode>>::new();
+
+            for k in 0..dimensions {
+                lookup.push(Vec::new());
+
+                for n in 0..value_max {
+                    // Morton numbers are number where the bit are exploded so that we can
+                    // interleave them. This means that for each position of a value, we need to
+                    // insert dimensions -1 columns between each bits, and shift that result by the
+                    // dimension number so that we can OR all the dimensions together without having
+                    // bits colliding.
+                    let mut v = 0;
+                    for p in 0..value_bits {
+                        let b = (n & (1 << p)) >> p;
+                        v = v | b << (p * dimensions + k);
+                    }
+                    lookup[k].push(v as MortonCode);
+                }
+            }
+
+            for k in 0..dimensions {
+                for n in 0..value_max {
+                    assert_eq!(lookup[k][n], m.encode_1(k, n as MortonValue));
+                }
+            }
+        }
+
+        #[test]
+        fn table_dim3_bit10() {
+            let m = MortonEncoder::new(3, 10);
+            check(3, 1024, 10, m);
+        }
+
+        #[test]
+        fn table_dim4_bit8() {
+            let m = MortonEncoder::new(4, 8);
+            check(4, 256, 8, m);
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/ironsea_index_sfc_dbc/sfc.rs.html b/src/ironsea_index_sfc_dbc/sfc.rs.html new file mode 100644 index 0000000..6f7557a --- /dev/null +++ b/src/ironsea_index_sfc_dbc/sfc.rs.html @@ -0,0 +1,769 @@ +sfc.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+
+#![allow(clippy::type_repetition_in_bounds)]
+
+use std::cmp::PartialEq;
+use std::fmt::Debug;
+use std::hash::Hash;
+//use std::io;
+use std::iter::FromIterator;
+use std::ops::Index;
+
+pub use ironsea_index::IndexedDestructured;
+pub use ironsea_index::Record;
+pub use ironsea_index::RecordFields;
+//use ironsea_store::Load;
+//use ironsea_store::Store;
+//use serde::de::DeserializeOwned;
+use serde::Deserialize;
+use serde::Serialize;
+
+use super::cell_space::CellSpace;
+use super::morton::MortonCode;
+use super::morton::MortonEncoder;
+use super::morton::MortonValue;
+
+type SFCCode = MortonCode;
+type SFCOffset = u32;
+
+//FIXME: Remove the need for a constant, how can we make it type-checked instead?
+//       type-num crate?
+const MAX_K: usize = 3;
+
+#[derive(Debug)]
+struct Limit<V> {
+    idx: usize,
+    position: Vec<V>,
+}
+
+#[derive(Debug)]
+struct Limits<'a, V> {
+    start: Limit<&'a V>,
+    end: Limit<&'a V>,
+}
+
+#[derive(Clone, Debug, Deserialize, Serialize)]
+struct SFCRecord<F> {
+    //FIXME: Find a way around hardcoding MAX_K
+    offsets: [SFCOffset; MAX_K],
+    fields: F,
+}
+
+#[derive(Clone, Debug, Deserialize, Serialize)]
+struct SFCCell<F> {
+    code: MortonCode,
+    records: Vec<SFCRecord<F>>,
+}
+
+/// Space Filling Curve-based index.
+///
+/// This structure retains the state of the index.
+#[derive(Clone, Debug, Deserialize, Serialize)]
+pub struct SpaceFillingCurve<F, K, V>
+where
+    F: PartialEq,
+    K: Debug + FromIterator<V> + Index<usize, Output = V>,
+    V: Clone + Debug + From<usize> + Ord,
+{
+    dimensions: usize,
+    morton: MortonEncoder,
+    space: CellSpace<K, V>,
+    index: Vec<SFCCell<F>>,
+}
+
+impl<F, K, V> SpaceFillingCurve<F, K, V>
+where
+    F: PartialEq,
+    K: Debug + FromIterator<V> + Index<usize, Output = V>,
+    V: Clone + Debug + From<usize> + Hash + Ord,
+{
+    /// Creates a new Index from the provided iterator.
+    ///
+    /// * `dimensions`: The number of dimensions of the space, a.k.a the
+    ///                 length of the vector representing a single
+    ///                 position.
+    /// * `cell_bits`: The number of bits to reserve for the grid we
+    ///                build on top of the coordinate dictionaries.
+    ///                We generate 2^`cell_bits` Cells per dimension.
+    ///
+    //FIXME: Should accept indexing 0 elements, at least not crash!
+    pub fn new<I, R>(iter: I, dimensions: usize, cell_bits: usize) -> Self
+    where
+        I: Clone + Iterator<Item = R>,
+        R: Debug + Record<K> + RecordFields<F>,
+    {
+        // 1. build the dictionnary space, called here CellSpace, as well as
+        // initialize the morton encoder used to project the multi-dimensional
+        // coordinates into a single dimension.
+        let mut index = SpaceFillingCurve {
+            dimensions,
+            morton: MortonEncoder::new(dimensions, cell_bits),
+            space: CellSpace::new(iter.clone(), dimensions, cell_bits),
+            index: vec![],
+        };
+
+        // 2. Build a flat table of (code, offset, entries)
+        let mut flat_table = vec![];
+        let (nb_records, _) = iter.size_hint();
+        for record in iter.into_iter() {
+            let position = record.key();
+            match index.space.key(&position) {
+                Ok((cell_ids, offsets)) => match index.encode(&cell_ids) {
+                    Ok(code) => {
+                        let offsets = offsets.iter().map(|i| *i as SFCOffset).collect::<Vec<_>>();
+                        flat_table.push((
+                            code,
+                            SFCRecord {
+                                offsets: *array_ref!(offsets, 0, MAX_K),
+                                fields: record.fields(),
+                            },
+                        ))
+                    }
+                    Err(e) => error!("Unable to encode position {:#?}: {}", cell_ids, e),
+                },
+                Err(e) => error!("Invalid position {:#?}: {}", position, e),
+            }
+        }
+
+        debug!("Processed {:#?} records into the index", nb_records);
+
+        // 5. Sort by SFCcode
+        flat_table.sort_unstable_by(|a, b| a.0.cmp(&b.0));
+        let nb_records = flat_table.len();
+
+        let mut current_cell_code = flat_table[0].0;
+        let mut count = 0;
+        index.index.push(SFCCell {
+            code: current_cell_code,
+            records: vec![],
+        });
+        for (code, record) in flat_table {
+            if code == current_cell_code {
+                index.index[count].records.push(record);
+            } else {
+                index.index.push(SFCCell {
+                    code,
+                    records: vec![record],
+                });
+                current_cell_code = code;
+                count += 1;
+            }
+        }
+        debug!("Inserted {:#?} records into the index", nb_records);
+
+        index
+    }
+
+    /// Returns a vector of keys which have stored values in the index
+    /// equal to `value`.
+    pub fn find_by_value(&self, value: &F) -> Vec<K> {
+        let mut results = vec![];
+        for cell in &self.index {
+            for record in &cell.records {
+                if &record.fields == value {
+                    if let Ok(key) = self.position(cell.code, &record.offsets) {
+                        results.push(key);
+                    }
+                }
+            }
+        }
+
+        results
+    }
+
+    // Map the cell_ids of a point to its SFCcode
+    fn encode(&self, cell_ids: &[usize]) -> Result<SFCCode, String> {
+        let mut t = vec![];
+        for v in cell_ids.iter() {
+            t.push(*v as MortonValue);
+        }
+
+        self.morton.encode(&t)
+    }
+
+    fn last(&self) -> (Vec<usize>, Vec<usize>) {
+        self.space.last()
+    }
+
+    fn value(&self, code: SFCCode, offsets: &[SFCOffset]) -> Result<Vec<&V>, String> {
+        Ok(self.space.value(
+            self.morton
+                .decode(code)
+                .iter()
+                .map(|e| *e as usize)
+                .collect(),
+            offsets.iter().map(|e| *e as usize).collect(),
+        )?)
+    }
+
+    // Build coordinate values from encoded value
+    fn position(&self, code: SFCCode, offsets: &[SFCOffset]) -> Result<K, String> {
+        let position = self.value(code, offsets)?;
+
+        Ok(position.iter().map(|i| (*i).clone()).collect())
+    }
+
+    fn limits(&self, start: &K, end: &K) -> Result<Limits<V>, String> {
+        trace!("limits: {:?} - {:?}", start, end);
+
+        // Round down if not found, for start of range:
+        let (cells, offsets) = self.space.key_down(start)?;
+        let code = self.encode(&cells)?;
+        let idx = match self.index.binary_search_by(|e| e.code.cmp(&code)) {
+            Err(e) => {
+                if e > 0 {
+                    e - 1
+                } else {
+                    0
+                }
+            }
+            Ok(c) => c,
+        };
+        let position = self.space.value(cells, offsets)?;
+        let start = Limit { idx, position };
+
+        // Round up if not found, for end of range:
+        let (cells, offsets) = self.space.key_up(end)?;
+        let code = self.encode(&cells)?;
+        let idx = match self.index.binary_search_by(|e| e.code.cmp(&code)) {
+            Err(e) => {
+                if e >= self.index.len() {
+                    self.index.len()
+                } else {
+                    e
+                }
+            }
+            Ok(c) => c + 1,
+        };
+
+        let position = self.space.value(cells, offsets)?;
+        let end = Limit { idx, position };
+
+        trace!("limits: {:?} - {:?}", start, end);
+
+        Ok(Limits { start, end })
+    }
+}
+
+impl<F, K, V> IndexedDestructured<F, K> for SpaceFillingCurve<F, K, V>
+where
+    F: PartialEq,
+    K: Debug + FromIterator<V> + Index<usize, Output = V>,
+    V: Clone + Debug + From<usize> + Hash + Ord,
+{
+    fn find(&self, key: &K) -> Vec<&F> {
+        let mut values = vec![];
+
+        if let Ok((cell_ids, offsets)) = self.space.key(key) {
+            match self.encode(&cell_ids) {
+                Err(e) => error!("{}", e),
+                Ok(code) => {
+                    if let Ok(cell) = self.index.binary_search_by(|a| a.code.cmp(&code)) {
+                        for record in &self.index[cell].records {
+                            let mut select = true;
+                            for (k, o) in offsets.iter().enumerate().take(self.dimensions) {
+                                select &= record.offsets[k] == (*o as SFCOffset);
+                            }
+
+                            if select {
+                                values.push(&record.fields);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        values
+    }
+
+    fn find_range(&self, start: &K, end: &K) -> Vec<(K, &F)> {
+        let mut values = vec![];
+
+        match self.limits(start, end) {
+            Ok(limits) => {
+                for idx in limits.start.idx..limits.end.idx {
+                    let code = self.index[idx].code;
+
+                    let first = match self.value(code, &self.index[idx].records[0].offsets) {
+                        Err(e) => {
+                            error!("Cannot retrieve first value of cell: {}", e);
+                            continue;
+                        }
+                        Ok(r) => r,
+                    };
+
+                    let (cell_ids, last_offsets) = self.last();
+                    let last = match self.space.value(cell_ids, last_offsets) {
+                        Err(e) => {
+                            error!("Cannot retrieve last value of cell: {}", e);
+                            continue;
+                        }
+                        Ok(r) => r,
+                    };
+
+                    // Check first & last point of the cell, if both are fully
+                    // in the bounding box, then all the points of the cell will
+                    // be.
+                    if limits.start.position <= first
+                        && first <= limits.end.position
+                        && limits.start.position <= last
+                        && last <= limits.end.position
+                    {
+                        for record in &self.index[idx].records {
+                            if let Ok(key) = self.position(code, &record.offsets) {
+                                values.push((key, &record.fields));
+                            }
+                        }
+                    } else {
+                        // We have points which are outside of the bounding box,
+                        // so check every points one by one.
+                        for record in &self.index[idx].records {
+                            let pos = match self.value(code, &record.offsets) {
+                                Err(e) => {
+                                    error!("{}", e);
+                                    continue;
+                                }
+                                Ok(r) => r,
+                            };
+
+                            if limits.start.position <= pos && pos <= limits.end.position {
+                                if let Ok(key) = self.position(code, &record.offsets) {
+                                    values.push((key, &record.fields));
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            Err(e) => error!("find_range: limits failed: {}", e),
+        };
+
+        values
+    }
+}
+
+/*
+impl<F, K, V> Store for SpaceFillingCurve<F, K, V>
+where
+    F: PartialEq + Serialize,
+    K: Debug + Serialize + FromIterator<V> + Index<usize, Output = V>,
+    V: Clone + Debug + From<usize> + Ord + Serialize,
+{
+    fn store<W>(&mut self, writer: W) -> io::Result<()>
+    where
+        W: std::io::Write,
+    {
+        match bincode::serialize_into(writer, &self) {
+            Ok(_) => Ok(()),
+            Err(e) => Err(io::Error::new(io::ErrorKind::WriteZero, e)),
+        }
+    }
+}
+
+impl<F, K, V> Load for SpaceFillingCurve<F, K, V>
+where
+    F: PartialEq + DeserializeOwned,
+    K: Debug + DeserializeOwned + FromIterator<V> + Index<usize, Output = V>,
+    V: Clone + Debug + DeserializeOwned + From<usize> + Ord,
+{
+    fn load<Re: io::Read>(reader: Re) -> io::Result<Self> {
+        match bincode::deserialize_from(reader) {
+            Ok(data) => Ok(data),
+            Err(e) => Err(io::Error::new(io::ErrorKind::InvalidData, e)),
+        }
+    }
+
+    // only required for store_mapped_file
+    fn load_slice(from: &[u8]) -> io::Result<Self> {
+        match bincode::deserialize(from) {
+            Ok(data) => Ok(data),
+            Err(e) => Err(io::Error::new(io::ErrorKind::InvalidData, e)),
+        }
+    }
+}
+*/
+
+
\ No newline at end of file diff --git a/src/log/lib.rs.html b/src/log/lib.rs.html new file mode 100644 index 0000000..1687d3f --- /dev/null +++ b/src/log/lib.rs.html @@ -0,0 +1,3339 @@ +lib.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! A lightweight logging facade.
+//!
+//! The `log` crate provides a single logging API that abstracts over the
+//! actual logging implementation. Libraries can use the logging API provided
+//! by this crate, and the consumer of those libraries can choose the logging
+//! implementation that is most suitable for its use case.
+//!
+//! If no logging implementation is selected, the facade falls back to a "noop"
+//! implementation that ignores all log messages. The overhead in this case
+//! is very small - just an integer load, comparison and jump.
+//!
+//! A log request consists of a _target_, a _level_, and a _body_. A target is a
+//! string which defaults to the module path of the location of the log request,
+//! though that default may be overridden. Logger implementations typically use
+//! the target to filter requests based on some user configuration.
+//!
+//! # Use
+//!
+//! The basic use of the log crate is through the five logging macros: [`error!`],
+//! [`warn!`], [`info!`], [`debug!`] and [`trace!`]
+//! where `error!` represents the highest-priority log messages
+//! and `trace!` the lowest. The log messages are filtered by configuring
+//! the log level to exclude messages with a lower priority.
+//! Each of these macros accept format strings similarly to [`println!`].
+//!
+//!
+//! [`error!`]: ./macro.error.html
+//! [`warn!`]: ./macro.warn.html
+//! [`info!`]: ./macro.info.html
+//! [`debug!`]: ./macro.debug.html
+//! [`trace!`]: ./macro.trace.html
+//! [`println!`]: https://doc.rust-lang.org/stable/std/macro.println.html
+//!
+//! ## In libraries
+//!
+//! Libraries should link only to the `log` crate, and use the provided
+//! macros to log whatever information will be useful to downstream consumers.
+//!
+//! ### Examples
+//!
+//! ```edition2018
+//! # #[derive(Debug)] pub struct Yak(String);
+//! # impl Yak { fn shave(&mut self, _: u32) {} }
+//! # fn find_a_razor() -> Result<u32, u32> { Ok(1) }
+//! use log::{info, warn};
+//!
+//! pub fn shave_the_yak(yak: &mut Yak) {
+//!     info!(target: "yak_events", "Commencing yak shaving for {:?}", yak);
+//!
+//!     loop {
+//!         match find_a_razor() {
+//!             Ok(razor) => {
+//!                 info!("Razor located: {}", razor);
+//!                 yak.shave(razor);
+//!                 break;
+//!             }
+//!             Err(err) => {
+//!                 warn!("Unable to locate a razor: {}, retrying", err);
+//!             }
+//!         }
+//!     }
+//! }
+//! # fn main() {}
+//! ```
+//!
+//! ## In executables
+//!
+//! Executables should choose a logging implementation and initialize it early in the
+//! runtime of the program. Logging implementations will typically include a
+//! function to do this. Any log messages generated before
+//! the implementation is initialized will be ignored.
+//!
+//! The executable itself may use the `log` crate to log as well.
+//!
+//! ### Warning
+//!
+//! The logging system may only be initialized once.
+//!
+//! # Available logging implementations
+//!
+//! In order to produce log output executables have to use
+//! a logger implementation compatible with the facade.
+//! There are many available implementations to choose from,
+//! here are some of the most popular ones:
+//!
+//! * Simple minimal loggers:
+//!     * [env_logger]
+//!     * [simple_logger]
+//!     * [simplelog]
+//!     * [pretty_env_logger]
+//!     * [stderrlog]
+//!     * [flexi_logger]
+//! * Complex configurable frameworks:
+//!     * [log4rs]
+//!     * [fern]
+//! * Adaptors for other facilities:
+//!     * [syslog]
+//!     * [slog-stdlog]
+//!
+//! # Implementing a Logger
+//!
+//! Loggers implement the [`Log`] trait. Here's a very basic example that simply
+//! logs all messages at the [`Error`][level_link], [`Warn`][level_link] or
+//! [`Info`][level_link] levels to stdout:
+//!
+//! ```edition2018
+//! use log::{Record, Level, Metadata};
+//!
+//! struct SimpleLogger;
+//!
+//! impl log::Log for SimpleLogger {
+//!     fn enabled(&self, metadata: &Metadata) -> bool {
+//!         metadata.level() <= Level::Info
+//!     }
+//!
+//!     fn log(&self, record: &Record) {
+//!         if self.enabled(record.metadata()) {
+//!             println!("{} - {}", record.level(), record.args());
+//!         }
+//!     }
+//!
+//!     fn flush(&self) {}
+//! }
+//!
+//! # fn main() {}
+//! ```
+//!
+//! Loggers are installed by calling the [`set_logger`] function. The maximum
+//! log level also needs to be adjusted via the [`set_max_level`] function. The
+//! logging facade uses this as an optimization to improve performance of log
+//! messages at levels that are disabled. It's important to set it, as it
+//! defaults to [`Off`][filter_link], so no log messages will ever be captured!
+//! In the case of our example logger, we'll want to set the maximum log level
+//! to [`Info`][filter_link], since we ignore any [`Debug`][level_link] or
+//! [`Trace`][level_link] level log messages. A logging implementation should
+//! provide a function that wraps a call to [`set_logger`] and
+//! [`set_max_level`], handling initialization of the logger:
+//!
+//! ```edition2018
+//! # use log::{Level, Metadata};
+//! # struct SimpleLogger;
+//! # impl log::Log for SimpleLogger {
+//! #   fn enabled(&self, _: &Metadata) -> bool { false }
+//! #   fn log(&self, _: &log::Record) {}
+//! #   fn flush(&self) {}
+//! # }
+//! # fn main() {}
+//! use log::{SetLoggerError, LevelFilter};
+//!
+//! static LOGGER: SimpleLogger = SimpleLogger;
+//!
+//! pub fn init() -> Result<(), SetLoggerError> {
+//!     log::set_logger(&LOGGER)
+//!         .map(|()| log::set_max_level(LevelFilter::Info))
+//! }
+//! ```
+//!
+//! Implementations that adjust their configurations at runtime should take care
+//! to adjust the maximum log level as well.
+//!
+//! # Use with `std`
+//!
+//! `set_logger` requires you to provide a `&'static Log`, which can be hard to
+//! obtain if your logger depends on some runtime configuration. The
+//! `set_boxed_logger` function is available with the `std` Cargo feature. It is
+//! identical to `set_logger` except that it takes a `Box<Log>` rather than a
+//! `&'static Log`:
+//!
+//! ```edition2018
+//! # use log::{Level, LevelFilter, Log, SetLoggerError, Metadata};
+//! # struct SimpleLogger;
+//! # impl log::Log for SimpleLogger {
+//! #   fn enabled(&self, _: &Metadata) -> bool { false }
+//! #   fn log(&self, _: &log::Record) {}
+//! #   fn flush(&self) {}
+//! # }
+//! # fn main() {}
+//! # #[cfg(feature = "std")]
+//! pub fn init() -> Result<(), SetLoggerError> {
+//!     log::set_boxed_logger(Box::new(SimpleLogger))
+//!         .map(|()| log::set_max_level(LevelFilter::Info))
+//! }
+//! ```
+//!
+//! # Compile time filters
+//!
+//! Log levels can be statically disabled at compile time via Cargo features. Log invocations at
+//! disabled levels will be skipped and will not even be present in the resulting binary unless the
+//! log level is specified dynamically. This level is configured separately for release and debug
+//! builds. The features are:
+//!
+//! * `max_level_off`
+//! * `max_level_error`
+//! * `max_level_warn`
+//! * `max_level_info`
+//! * `max_level_debug`
+//! * `max_level_trace`
+//! * `release_max_level_off`
+//! * `release_max_level_error`
+//! * `release_max_level_warn`
+//! * `release_max_level_info`
+//! * `release_max_level_debug`
+//! * `release_max_level_trace`
+//!
+//! These features control the value of the `STATIC_MAX_LEVEL` constant. The logging macros check
+//! this value before logging a message. By default, no levels are disabled.
+//!
+//! Libraries should avoid using the max level features because they're global and can't be changed
+//! once they're set.
+//!
+//! For example, a crate can disable trace level logs in debug builds and trace, debug, and info
+//! level logs in release builds with the following configuration:
+//!
+//! ```toml
+//! [dependencies]
+//! log = { version = "0.4", features = ["max_level_debug", "release_max_level_warn"] }
+//! ```
+//! # Crate Feature Flags
+//!
+//! The following crate feature flags are avaliable in addition to the filters. They are
+//! configured in your `Cargo.toml`.
+//!
+//! * `std` allows use of `std` crate instead of the default `core`. Enables using `std::error` and
+//! `set_boxed_logger` functionality.
+//! * `serde` enables support for serialization and deserialization of `Level` and `LevelFilter`.
+//!
+//! ```toml
+//! [dependencies]
+//! log = { version = "0.4", features = ["std", "serde"] }
+//! ```
+//!
+//! # Version compatibility
+//!
+//! The 0.3 and 0.4 versions of the `log` crate are almost entirely compatible. Log messages
+//! made using `log` 0.3 will forward transparently to a logger implementation using `log` 0.4. Log
+//! messages made using `log` 0.4 will forward to a logger implementation using `log` 0.3, but the
+//! module path and file name information associated with the message will unfortunately be lost.
+//!
+//! [`Log`]: trait.Log.html
+//! [level_link]: enum.Level.html
+//! [filter_link]: enum.LevelFilter.html
+//! [`set_logger`]: fn.set_logger.html
+//! [`set_max_level`]: fn.set_max_level.html
+//! [`try_set_logger_raw`]: fn.try_set_logger_raw.html
+//! [`shutdown_logger_raw`]: fn.shutdown_logger_raw.html
+//! [env_logger]: https://docs.rs/env_logger/*/env_logger/
+//! [simple_logger]: https://github.com/borntyping/rust-simple_logger
+//! [simplelog]: https://github.com/drakulix/simplelog.rs
+//! [pretty_env_logger]: https://docs.rs/pretty_env_logger/*/pretty_env_logger/
+//! [stderrlog]: https://docs.rs/stderrlog/*/stderrlog/
+//! [flexi_logger]: https://docs.rs/flexi_logger/*/flexi_logger/
+//! [syslog]: https://docs.rs/syslog/*/syslog/
+//! [slog-stdlog]: https://docs.rs/slog-stdlog/*/slog_stdlog/
+//! [log4rs]: https://docs.rs/log4rs/*/log4rs/
+//! [fern]: https://docs.rs/fern/*/fern/
+
+#![doc(
+    html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
+    html_favicon_url = "https://www.rust-lang.org/favicon.ico",
+    html_root_url = "https://docs.rs/log/0.4.8"
+)]
+#![warn(missing_docs)]
+#![deny(missing_debug_implementations)]
+#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
+// When compiled for the rustc compiler itself we want to make sure that this is
+// an unstable crate
+#![cfg_attr(rustbuild, feature(staged_api, rustc_private))]
+#![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))]
+
+#[cfg(all(not(feature = "std"), not(test)))]
+extern crate core as std;
+
+#[macro_use]
+extern crate cfg_if;
+
+use std::cmp;
+#[cfg(feature = "std")]
+use std::error;
+use std::fmt;
+use std::mem;
+use std::str::FromStr;
+use std::sync::atomic::{AtomicUsize, Ordering};
+
+// FIXME: ATOMIC_USIZE_INIT was deprecated in rust 1.34. Silence the
+// deprecation warning until our MSRV >= 1.24, where we can use the
+// replacement const fn `AtomicUsize::new`
+#[allow(deprecated)]
+use std::sync::atomic::ATOMIC_USIZE_INIT;
+
+#[macro_use]
+mod macros;
+mod serde;
+
+#[cfg(feature = "kv_unstable")]
+pub mod kv;
+
+// The LOGGER static holds a pointer to the global logger. It is protected by
+// the STATE static which determines whether LOGGER has been initialized yet.
+static mut LOGGER: &'static Log = &NopLogger;
+
+#[allow(deprecated)]
+static STATE: AtomicUsize = ATOMIC_USIZE_INIT;
+
+// There are three different states that we care about: the logger's
+// uninitialized, the logger's initializing (set_logger's been called but
+// LOGGER hasn't actually been set yet), or the logger's active.
+const UNINITIALIZED: usize = 0;
+const INITIALIZING: usize = 1;
+const INITIALIZED: usize = 2;
+
+#[allow(deprecated)]
+static MAX_LOG_LEVEL_FILTER: AtomicUsize = ATOMIC_USIZE_INIT;
+
+static LOG_LEVEL_NAMES: [&'static str; 6] = ["OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"];
+
+static SET_LOGGER_ERROR: &'static str = "attempted to set a logger after the logging system \
+                                         was already initialized";
+static LEVEL_PARSE_ERROR: &'static str =
+    "attempted to convert a string that doesn't match an existing log level";
+
+/// An enum representing the available verbosity levels of the logger.
+///
+/// Typical usage includes: checking if a certain `Level` is enabled with
+/// [`log_enabled!`](macro.log_enabled.html), specifying the `Level` of
+/// [`log!`](macro.log.html), and comparing a `Level` directly to a
+/// [`LevelFilter`](enum.LevelFilter.html).
+#[repr(usize)]
+#[derive(Copy, Eq, Debug, Hash)]
+pub enum Level {
+    /// The "error" level.
+    ///
+    /// Designates very serious errors.
+    Error = 1, // This way these line up with the discriminants for LevelFilter below
+    /// The "warn" level.
+    ///
+    /// Designates hazardous situations.
+    Warn,
+    /// The "info" level.
+    ///
+    /// Designates useful information.
+    Info,
+    /// The "debug" level.
+    ///
+    /// Designates lower priority information.
+    Debug,
+    /// The "trace" level.
+    ///
+    /// Designates very low priority, often extremely verbose, information.
+    Trace,
+}
+
+impl Clone for Level {
+    #[inline]
+    fn clone(&self) -> Level {
+        *self
+    }
+}
+
+impl PartialEq for Level {
+    #[inline]
+    fn eq(&self, other: &Level) -> bool {
+        *self as usize == *other as usize
+    }
+}
+
+impl PartialEq<LevelFilter> for Level {
+    #[inline]
+    fn eq(&self, other: &LevelFilter) -> bool {
+        *self as usize == *other as usize
+    }
+}
+
+impl PartialOrd for Level {
+    #[inline]
+    fn partial_cmp(&self, other: &Level) -> Option<cmp::Ordering> {
+        Some(self.cmp(other))
+    }
+
+    #[inline]
+    fn lt(&self, other: &Level) -> bool {
+        (*self as usize) < *other as usize
+    }
+
+    #[inline]
+    fn le(&self, other: &Level) -> bool {
+        *self as usize <= *other as usize
+    }
+
+    #[inline]
+    fn gt(&self, other: &Level) -> bool {
+        *self as usize > *other as usize
+    }
+
+    #[inline]
+    fn ge(&self, other: &Level) -> bool {
+        *self as usize >= *other as usize
+    }
+}
+
+impl PartialOrd<LevelFilter> for Level {
+    #[inline]
+    fn partial_cmp(&self, other: &LevelFilter) -> Option<cmp::Ordering> {
+        Some((*self as usize).cmp(&(*other as usize)))
+    }
+
+    #[inline]
+    fn lt(&self, other: &LevelFilter) -> bool {
+        (*self as usize) < *other as usize
+    }
+
+    #[inline]
+    fn le(&self, other: &LevelFilter) -> bool {
+        *self as usize <= *other as usize
+    }
+
+    #[inline]
+    fn gt(&self, other: &LevelFilter) -> bool {
+        *self as usize > *other as usize
+    }
+
+    #[inline]
+    fn ge(&self, other: &LevelFilter) -> bool {
+        *self as usize >= *other as usize
+    }
+}
+
+impl Ord for Level {
+    #[inline]
+    fn cmp(&self, other: &Level) -> cmp::Ordering {
+        (*self as usize).cmp(&(*other as usize))
+    }
+}
+
+fn ok_or<T, E>(t: Option<T>, e: E) -> Result<T, E> {
+    match t {
+        Some(t) => Ok(t),
+        None => Err(e),
+    }
+}
+
+// Reimplemented here because std::ascii is not available in libcore
+fn eq_ignore_ascii_case(a: &str, b: &str) -> bool {
+    fn to_ascii_uppercase(c: u8) -> u8 {
+        if c >= b'a' && c <= b'z' {
+            c - b'a' + b'A'
+        } else {
+            c
+        }
+    }
+
+    if a.len() == b.len() {
+        a.bytes()
+            .zip(b.bytes())
+            .all(|(a, b)| to_ascii_uppercase(a) == to_ascii_uppercase(b))
+    } else {
+        false
+    }
+}
+
+impl FromStr for Level {
+    type Err = ParseLevelError;
+    fn from_str(level: &str) -> Result<Level, Self::Err> {
+        ok_or(
+            LOG_LEVEL_NAMES
+                .iter()
+                .position(|&name| eq_ignore_ascii_case(name, level))
+                .into_iter()
+                .filter(|&idx| idx != 0)
+                .map(|idx| Level::from_usize(idx).unwrap())
+                .next(),
+            ParseLevelError(()),
+        )
+    }
+}
+
+impl fmt::Display for Level {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        fmt.pad(LOG_LEVEL_NAMES[*self as usize])
+    }
+}
+
+impl Level {
+    fn from_usize(u: usize) -> Option<Level> {
+        match u {
+            1 => Some(Level::Error),
+            2 => Some(Level::Warn),
+            3 => Some(Level::Info),
+            4 => Some(Level::Debug),
+            5 => Some(Level::Trace),
+            _ => None,
+        }
+    }
+
+    /// Returns the most verbose logging level.
+    #[inline]
+    pub fn max() -> Level {
+        Level::Trace
+    }
+
+    /// Converts the `Level` to the equivalent `LevelFilter`.
+    #[inline]
+    pub fn to_level_filter(&self) -> LevelFilter {
+        LevelFilter::from_usize(*self as usize).unwrap()
+    }
+}
+
+/// An enum representing the available verbosity level filters of the logger.
+///
+/// A `LevelFilter` may be compared directly to a [`Level`]. Use this type
+/// to get and set the maximum log level with [`max_level()`] and [`set_max_level`].
+///
+/// [`Level`]: enum.Level.html
+/// [`max_level()`]: fn.max_level.html
+/// [`set_max_level`]: fn.set_max_level.html
+#[repr(usize)]
+#[derive(Copy, Eq, Debug, Hash)]
+pub enum LevelFilter {
+    /// A level lower than all log levels.
+    Off,
+    /// Corresponds to the `Error` log level.
+    Error,
+    /// Corresponds to the `Warn` log level.
+    Warn,
+    /// Corresponds to the `Info` log level.
+    Info,
+    /// Corresponds to the `Debug` log level.
+    Debug,
+    /// Corresponds to the `Trace` log level.
+    Trace,
+}
+
+// Deriving generates terrible impls of these traits
+
+impl Clone for LevelFilter {
+    #[inline]
+    fn clone(&self) -> LevelFilter {
+        *self
+    }
+}
+
+impl PartialEq for LevelFilter {
+    #[inline]
+    fn eq(&self, other: &LevelFilter) -> bool {
+        *self as usize == *other as usize
+    }
+}
+
+impl PartialEq<Level> for LevelFilter {
+    #[inline]
+    fn eq(&self, other: &Level) -> bool {
+        other.eq(self)
+    }
+}
+
+impl PartialOrd for LevelFilter {
+    #[inline]
+    fn partial_cmp(&self, other: &LevelFilter) -> Option<cmp::Ordering> {
+        Some(self.cmp(other))
+    }
+
+    #[inline]
+    fn lt(&self, other: &LevelFilter) -> bool {
+        (*self as usize) < *other as usize
+    }
+
+    #[inline]
+    fn le(&self, other: &LevelFilter) -> bool {
+        *self as usize <= *other as usize
+    }
+
+    #[inline]
+    fn gt(&self, other: &LevelFilter) -> bool {
+        *self as usize > *other as usize
+    }
+
+    #[inline]
+    fn ge(&self, other: &LevelFilter) -> bool {
+        *self as usize >= *other as usize
+    }
+}
+
+impl PartialOrd<Level> for LevelFilter {
+    #[inline]
+    fn partial_cmp(&self, other: &Level) -> Option<cmp::Ordering> {
+        Some((*self as usize).cmp(&(*other as usize)))
+    }
+
+    #[inline]
+    fn lt(&self, other: &Level) -> bool {
+        (*self as usize) < *other as usize
+    }
+
+    #[inline]
+    fn le(&self, other: &Level) -> bool {
+        *self as usize <= *other as usize
+    }
+
+    #[inline]
+    fn gt(&self, other: &Level) -> bool {
+        *self as usize > *other as usize
+    }
+
+    #[inline]
+    fn ge(&self, other: &Level) -> bool {
+        *self as usize >= *other as usize
+    }
+}
+
+impl Ord for LevelFilter {
+    #[inline]
+    fn cmp(&self, other: &LevelFilter) -> cmp::Ordering {
+        (*self as usize).cmp(&(*other as usize))
+    }
+}
+
+impl FromStr for LevelFilter {
+    type Err = ParseLevelError;
+    fn from_str(level: &str) -> Result<LevelFilter, Self::Err> {
+        ok_or(
+            LOG_LEVEL_NAMES
+                .iter()
+                .position(|&name| eq_ignore_ascii_case(name, level))
+                .map(|p| LevelFilter::from_usize(p).unwrap()),
+            ParseLevelError(()),
+        )
+    }
+}
+
+impl fmt::Display for LevelFilter {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        fmt.pad(LOG_LEVEL_NAMES[*self as usize])
+    }
+}
+
+impl LevelFilter {
+    fn from_usize(u: usize) -> Option<LevelFilter> {
+        match u {
+            0 => Some(LevelFilter::Off),
+            1 => Some(LevelFilter::Error),
+            2 => Some(LevelFilter::Warn),
+            3 => Some(LevelFilter::Info),
+            4 => Some(LevelFilter::Debug),
+            5 => Some(LevelFilter::Trace),
+            _ => None,
+        }
+    }
+    /// Returns the most verbose logging level filter.
+    #[inline]
+    pub fn max() -> LevelFilter {
+        LevelFilter::Trace
+    }
+
+    /// Converts `self` to the equivalent `Level`.
+    ///
+    /// Returns `None` if `self` is `LevelFilter::Off`.
+    #[inline]
+    pub fn to_level(&self) -> Option<Level> {
+        Level::from_usize(*self as usize)
+    }
+}
+
+#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
+enum MaybeStaticStr<'a> {
+    Static(&'static str),
+    Borrowed(&'a str),
+}
+
+impl<'a> MaybeStaticStr<'a> {
+    #[inline]
+    fn get(&self) -> &'a str {
+        match *self {
+            MaybeStaticStr::Static(s) => s,
+            MaybeStaticStr::Borrowed(s) => s,
+        }
+    }
+}
+
+/// The "payload" of a log message.
+///
+/// # Use
+///
+/// `Record` structures are passed as parameters to the [`log`][method.log]
+/// method of the [`Log`] trait. Logger implementors manipulate these
+/// structures in order to display log messages. `Record`s are automatically
+/// created by the [`log!`] macro and so are not seen by log users.
+///
+/// Note that the [`level()`] and [`target()`] accessors are equivalent to
+/// `self.metadata().level()` and `self.metadata().target()` respectively.
+/// These methods are provided as a convenience for users of this structure.
+///
+/// # Example
+///
+/// The following example shows a simple logger that displays the level,
+/// module path, and message of any `Record` that is passed to it.
+///
+/// ```edition2018
+/// struct SimpleLogger;
+///
+/// impl log::Log for SimpleLogger {
+///    fn enabled(&self, metadata: &log::Metadata) -> bool {
+///        true
+///    }
+///
+///    fn log(&self, record: &log::Record) {
+///        if !self.enabled(record.metadata()) {
+///            return;
+///        }
+///
+///        println!("{}:{} -- {}",
+///                 record.level(),
+///                 record.target(),
+///                 record.args());
+///    }
+///    fn flush(&self) {}
+/// }
+/// ```
+///
+/// [method.log]: trait.Log.html#tymethod.log
+/// [`Log`]: trait.Log.html
+/// [`log!`]: macro.log.html
+/// [`level()`]: struct.Record.html#method.level
+/// [`target()`]: struct.Record.html#method.target
+#[derive(Clone, Debug)]
+pub struct Record<'a> {
+    metadata: Metadata<'a>,
+    args: fmt::Arguments<'a>,
+    module_path: Option<MaybeStaticStr<'a>>,
+    file: Option<MaybeStaticStr<'a>>,
+    line: Option<u32>,
+    #[cfg(feature = "kv_unstable")]
+    key_values: KeyValues<'a>,
+}
+
+// This wrapper type is only needed so we can
+// `#[derive(Debug)]` on `Record`. It also
+// provides a useful `Debug` implementation for
+// the underlying `Source`.
+#[cfg(feature = "kv_unstable")]
+#[derive(Clone)]
+struct KeyValues<'a>(&'a kv::Source);
+
+#[cfg(feature = "kv_unstable")]
+impl<'a> fmt::Debug for KeyValues<'a> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut visitor = f.debug_map();
+        self.0.visit(&mut visitor)?;
+        visitor.finish()
+    }
+}
+
+impl<'a> Record<'a> {
+    /// Returns a new builder.
+    #[inline]
+    pub fn builder() -> RecordBuilder<'a> {
+        RecordBuilder::new()
+    }
+
+    /// The message body.
+    #[inline]
+    pub fn args(&self) -> &fmt::Arguments<'a> {
+        &self.args
+    }
+
+    /// Metadata about the log directive.
+    #[inline]
+    pub fn metadata(&self) -> &Metadata<'a> {
+        &self.metadata
+    }
+
+    /// The verbosity level of the message.
+    #[inline]
+    pub fn level(&self) -> Level {
+        self.metadata.level()
+    }
+
+    /// The name of the target of the directive.
+    #[inline]
+    pub fn target(&self) -> &'a str {
+        self.metadata.target()
+    }
+
+    /// The module path of the message.
+    #[inline]
+    pub fn module_path(&self) -> Option<&'a str> {
+        self.module_path.map(|s| s.get())
+    }
+
+    /// The module path of the message, if it is a `'static` string.
+    #[inline]
+    pub fn module_path_static(&self) -> Option<&'static str> {
+        match self.module_path {
+            Some(MaybeStaticStr::Static(s)) => Some(s),
+            _ => None,
+        }
+    }
+
+    /// The source file containing the message.
+    #[inline]
+    pub fn file(&self) -> Option<&'a str> {
+        self.file.map(|s| s.get())
+    }
+
+    /// The module path of the message, if it is a `'static` string.
+    #[inline]
+    pub fn file_static(&self) -> Option<&'static str> {
+        match self.file {
+            Some(MaybeStaticStr::Static(s)) => Some(s),
+            _ => None,
+        }
+    }
+
+    /// The line containing the message.
+    #[inline]
+    pub fn line(&self) -> Option<u32> {
+        self.line
+    }
+
+    /// The structued key-value pairs associated with the message.
+    #[cfg(feature = "kv_unstable")]
+    #[inline]
+    pub fn key_values(&self) -> &kv::Source {
+        self.key_values.0
+    }
+
+    /// Create a new [`Builder`](struct.Builder.html) based on this record.
+    #[cfg(feature = "kv_unstable")]
+    #[inline]
+    pub fn to_builder(&self) -> RecordBuilder {
+        RecordBuilder {
+            record: Record {
+                metadata: Metadata {
+                    level: self.metadata.level,
+                    target: self.metadata.target,
+                },
+                args: self.args,
+                module_path: self.module_path,
+                file: self.file,
+                line: self.line,
+                key_values: self.key_values.clone(),
+            }
+        }
+    }
+}
+
+/// Builder for [`Record`](struct.Record.html).
+///
+/// Typically should only be used by log library creators or for testing and "shim loggers".
+/// The `RecordBuilder` can set the different parameters of `Record` object, and returns
+/// the created object when `build` is called.
+///
+/// # Examples
+///
+///
+/// ```edition2018
+/// use log::{Level, Record};
+///
+/// let record = Record::builder()
+///                 .args(format_args!("Error!"))
+///                 .level(Level::Error)
+///                 .target("myApp")
+///                 .file(Some("server.rs"))
+///                 .line(Some(144))
+///                 .module_path(Some("server"))
+///                 .build();
+/// ```
+///
+/// Alternatively, use [`MetadataBuilder`](struct.MetadataBuilder.html):
+///
+/// ```edition2018
+/// use log::{Record, Level, MetadataBuilder};
+///
+/// let error_metadata = MetadataBuilder::new()
+///                         .target("myApp")
+///                         .level(Level::Error)
+///                         .build();
+///
+/// let record = Record::builder()
+///                 .metadata(error_metadata)
+///                 .args(format_args!("Error!"))
+///                 .line(Some(433))
+///                 .file(Some("app.rs"))
+///                 .module_path(Some("server"))
+///                 .build();
+/// ```
+#[derive(Debug)]
+pub struct RecordBuilder<'a> {
+    record: Record<'a>,
+}
+
+impl<'a> RecordBuilder<'a> {
+    /// Construct new `RecordBuilder`.
+    ///
+    /// The default options are:
+    ///
+    /// - `args`: [`format_args!("")`]
+    /// - `metadata`: [`Metadata::builder().build()`]
+    /// - `module_path`: `None`
+    /// - `file`: `None`
+    /// - `line`: `None`
+    ///
+    /// [`format_args!("")`]: https://doc.rust-lang.org/std/macro.format_args.html
+    /// [`Metadata::builder().build()`]: struct.MetadataBuilder.html#method.build
+    #[inline]
+    pub fn new() -> RecordBuilder<'a> {
+        #[cfg(feature = "kv_unstable")]
+        return RecordBuilder {
+            record: Record {
+                args: format_args!(""),
+                metadata: Metadata::builder().build(),
+                module_path: None,
+                file: None,
+                line: None,
+                key_values: KeyValues(&Option::None::<(kv::Key, kv::Value)>),
+            },
+        };
+
+        #[cfg(not(feature = "kv_unstable"))]
+        return RecordBuilder {
+            record: Record {
+                args: format_args!(""),
+                metadata: Metadata::builder().build(),
+                module_path: None,
+                file: None,
+                line: None,
+            },
+        };
+    }
+
+    /// Set [`args`](struct.Record.html#method.args).
+    #[inline]
+    pub fn args(&mut self, args: fmt::Arguments<'a>) -> &mut RecordBuilder<'a> {
+        self.record.args = args;
+        self
+    }
+
+    /// Set [`metadata`](struct.Record.html#method.metadata). Construct a `Metadata` object with [`MetadataBuilder`](struct.MetadataBuilder.html).
+    #[inline]
+    pub fn metadata(&mut self, metadata: Metadata<'a>) -> &mut RecordBuilder<'a> {
+        self.record.metadata = metadata;
+        self
+    }
+
+    /// Set [`Metadata::level`](struct.Metadata.html#method.level).
+    #[inline]
+    pub fn level(&mut self, level: Level) -> &mut RecordBuilder<'a> {
+        self.record.metadata.level = level;
+        self
+    }
+
+    /// Set [`Metadata::target`](struct.Metadata.html#method.target)
+    #[inline]
+    pub fn target(&mut self, target: &'a str) -> &mut RecordBuilder<'a> {
+        self.record.metadata.target = target;
+        self
+    }
+
+    /// Set [`module_path`](struct.Record.html#method.module_path)
+    #[inline]
+    pub fn module_path(&mut self, path: Option<&'a str>) -> &mut RecordBuilder<'a> {
+        self.record.module_path = path.map(MaybeStaticStr::Borrowed);
+        self
+    }
+
+    /// Set [`module_path`](struct.Record.html#method.module_path) to a `'static` string
+    #[inline]
+    pub fn module_path_static(&mut self, path: Option<&'static str>) -> &mut RecordBuilder<'a> {
+        self.record.module_path = path.map(MaybeStaticStr::Static);
+        self
+    }
+
+    /// Set [`file`](struct.Record.html#method.file)
+    #[inline]
+    pub fn file(&mut self, file: Option<&'a str>) -> &mut RecordBuilder<'a> {
+        self.record.file = file.map(MaybeStaticStr::Borrowed);
+        self
+    }
+
+    /// Set [`file`](struct.Record.html#method.file) to a `'static` string.
+    #[inline]
+    pub fn file_static(&mut self, file: Option<&'static str>) -> &mut RecordBuilder<'a> {
+        self.record.file = file.map(MaybeStaticStr::Static);
+        self
+    }
+
+    /// Set [`line`](struct.Record.html#method.line)
+    #[inline]
+    pub fn line(&mut self, line: Option<u32>) -> &mut RecordBuilder<'a> {
+        self.record.line = line;
+        self
+    }
+
+    /// Set [`key_values`](struct.Record.html#method.key_values)
+    #[cfg(feature = "kv_unstable")]
+    #[inline]
+    pub fn key_values(&mut self, kvs: &'a kv::Source) -> &mut RecordBuilder<'a> {
+        self.record.key_values = KeyValues(kvs);
+        self
+    }
+
+    /// Invoke the builder and return a `Record`
+    #[inline]
+    pub fn build(&self) -> Record<'a> {
+        self.record.clone()
+    }
+}
+
+/// Metadata about a log message.
+///
+/// # Use
+///
+/// `Metadata` structs are created when users of the library use
+/// logging macros.
+///
+/// They are consumed by implementations of the `Log` trait in the
+/// `enabled` method.
+///
+/// `Record`s use `Metadata` to determine the log message's severity
+/// and target.
+///
+/// Users should use the `log_enabled!` macro in their code to avoid
+/// constructing expensive log messages.
+///
+/// # Examples
+///
+/// ```edition2018
+/// use log::{Record, Level, Metadata};
+///
+/// struct MyLogger;
+///
+/// impl log::Log for MyLogger {
+///     fn enabled(&self, metadata: &Metadata) -> bool {
+///         metadata.level() <= Level::Info
+///     }
+///
+///     fn log(&self, record: &Record) {
+///         if self.enabled(record.metadata()) {
+///             println!("{} - {}", record.level(), record.args());
+///         }
+///     }
+///     fn flush(&self) {}
+/// }
+///
+/// # fn main(){}
+/// ```
+#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
+pub struct Metadata<'a> {
+    level: Level,
+    target: &'a str,
+}
+
+impl<'a> Metadata<'a> {
+    /// Returns a new builder.
+    #[inline]
+    pub fn builder() -> MetadataBuilder<'a> {
+        MetadataBuilder::new()
+    }
+
+    /// The verbosity level of the message.
+    #[inline]
+    pub fn level(&self) -> Level {
+        self.level
+    }
+
+    /// The name of the target of the directive.
+    #[inline]
+    pub fn target(&self) -> &'a str {
+        self.target
+    }
+}
+
+/// Builder for [`Metadata`](struct.Metadata.html).
+///
+/// Typically should only be used by log library creators or for testing and "shim loggers".
+/// The `MetadataBuilder` can set the different parameters of a `Metadata` object, and returns
+/// the created object when `build` is called.
+///
+/// # Example
+///
+/// ```edition2018
+/// let target = "myApp";
+/// use log::{Level, MetadataBuilder};
+/// let metadata = MetadataBuilder::new()
+///                     .level(Level::Debug)
+///                     .target(target)
+///                     .build();
+/// ```
+#[derive(Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
+pub struct MetadataBuilder<'a> {
+    metadata: Metadata<'a>,
+}
+
+impl<'a> MetadataBuilder<'a> {
+    /// Construct a new `MetadataBuilder`.
+    ///
+    /// The default options are:
+    ///
+    /// - `level`: `Level::Info`
+    /// - `target`: `""`
+    #[inline]
+    pub fn new() -> MetadataBuilder<'a> {
+        MetadataBuilder {
+            metadata: Metadata {
+                level: Level::Info,
+                target: "",
+            },
+        }
+    }
+
+    /// Setter for [`level`](struct.Metadata.html#method.level).
+    #[inline]
+    pub fn level(&mut self, arg: Level) -> &mut MetadataBuilder<'a> {
+        self.metadata.level = arg;
+        self
+    }
+
+    /// Setter for [`target`](struct.Metadata.html#method.target).
+    #[inline]
+    pub fn target(&mut self, target: &'a str) -> &mut MetadataBuilder<'a> {
+        self.metadata.target = target;
+        self
+    }
+
+    /// Returns a `Metadata` object.
+    #[inline]
+    pub fn build(&self) -> Metadata<'a> {
+        self.metadata.clone()
+    }
+}
+
+/// A trait encapsulating the operations required of a logger.
+pub trait Log: Sync + Send {
+    /// Determines if a log message with the specified metadata would be
+    /// logged.
+    ///
+    /// This is used by the `log_enabled!` macro to allow callers to avoid
+    /// expensive computation of log message arguments if the message would be
+    /// discarded anyway.
+    fn enabled(&self, metadata: &Metadata) -> bool;
+
+    /// Logs the `Record`.
+    ///
+    /// Note that `enabled` is *not* necessarily called before this method.
+    /// Implementations of `log` should perform all necessary filtering
+    /// internally.
+    fn log(&self, record: &Record);
+
+    /// Flushes any buffered records.
+    fn flush(&self);
+}
+
+// Just used as a dummy initial value for LOGGER
+struct NopLogger;
+
+impl Log for NopLogger {
+    fn enabled(&self, _: &Metadata) -> bool {
+        false
+    }
+
+    fn log(&self, _: &Record) {}
+    fn flush(&self) {}
+}
+
+/// Sets the global maximum log level.
+///
+/// Generally, this should only be called by the active logging implementation.
+#[inline]
+pub fn set_max_level(level: LevelFilter) {
+    MAX_LOG_LEVEL_FILTER.store(level as usize, Ordering::SeqCst)
+}
+
+/// Returns the current maximum log level.
+///
+/// The [`log!`], [`error!`], [`warn!`], [`info!`], [`debug!`], and [`trace!`] macros check
+/// this value and discard any message logged at a higher level. The maximum
+/// log level is set by the [`set_max_level`] function.
+///
+/// [`log!`]: macro.log.html
+/// [`error!`]: macro.error.html
+/// [`warn!`]: macro.warn.html
+/// [`info!`]: macro.info.html
+/// [`debug!`]: macro.debug.html
+/// [`trace!`]: macro.trace.html
+/// [`set_max_level`]: fn.set_max_level.html
+#[inline(always)]
+pub fn max_level() -> LevelFilter {
+    unsafe { mem::transmute(MAX_LOG_LEVEL_FILTER.load(Ordering::Relaxed)) }
+}
+
+/// Sets the global logger to a `Box<Log>`.
+///
+/// This is a simple convenience wrapper over `set_logger`, which takes a
+/// `Box<Log>` rather than a `&'static Log`. See the documentation for
+/// [`set_logger`] for more details.
+///
+/// Requires the `std` feature.
+///
+/// # Errors
+///
+/// An error is returned if a logger has already been set.
+///
+/// [`set_logger`]: fn.set_logger.html
+#[cfg(all(feature = "std", atomic_cas))]
+pub fn set_boxed_logger(logger: Box<Log>) -> Result<(), SetLoggerError> {
+    set_logger_inner(|| unsafe { &*Box::into_raw(logger) })
+}
+
+/// Sets the global logger to a `&'static Log`.
+///
+/// This function may only be called once in the lifetime of a program. Any log
+/// events that occur before the call to `set_logger` completes will be ignored.
+///
+/// This function does not typically need to be called manually. Logger
+/// implementations should provide an initialization method that installs the
+/// logger internally.
+///
+/// # Availability
+///
+/// This method is available even when the `std` feature is disabled. However,
+/// it is currently unavailable on `thumbv6` targets, which lack support for
+/// some atomic operations which are used by this function. Even on those
+/// targets, [`set_logger_racy`] will be available.
+///
+/// # Errors
+///
+/// An error is returned if a logger has already been set.
+///
+/// # Examples
+///
+/// ```edition2018
+/// use log::{error, info, warn, Record, Level, Metadata, LevelFilter};
+///
+/// static MY_LOGGER: MyLogger = MyLogger;
+///
+/// struct MyLogger;
+///
+/// impl log::Log for MyLogger {
+///     fn enabled(&self, metadata: &Metadata) -> bool {
+///         metadata.level() <= Level::Info
+///     }
+///
+///     fn log(&self, record: &Record) {
+///         if self.enabled(record.metadata()) {
+///             println!("{} - {}", record.level(), record.args());
+///         }
+///     }
+///     fn flush(&self) {}
+/// }
+///
+/// # fn main(){
+/// log::set_logger(&MY_LOGGER).unwrap();
+/// log::set_max_level(LevelFilter::Info);
+///
+/// info!("hello log");
+/// warn!("warning");
+/// error!("oops");
+/// # }
+/// ```
+///
+/// [`set_logger_racy`]: fn.set_logger_racy.html
+#[cfg(atomic_cas)]
+pub fn set_logger(logger: &'static Log) -> Result<(), SetLoggerError> {
+    set_logger_inner(|| logger)
+}
+
+#[cfg(atomic_cas)]
+fn set_logger_inner<F>(make_logger: F) -> Result<(), SetLoggerError>
+where
+    F: FnOnce() -> &'static Log,
+{
+    unsafe {
+        match STATE.compare_and_swap(UNINITIALIZED, INITIALIZING, Ordering::SeqCst) {
+            UNINITIALIZED => {
+                LOGGER = make_logger();
+                STATE.store(INITIALIZED, Ordering::SeqCst);
+                Ok(())
+            }
+            INITIALIZING => {
+                while STATE.load(Ordering::SeqCst) == INITIALIZING {}
+                Err(SetLoggerError(()))
+            }
+            _ => Err(SetLoggerError(())),
+        }
+    }
+}
+
+/// A thread-unsafe version of [`set_logger`].
+///
+/// This function is available on all platforms, even those that do not have
+/// support for atomics that is needed by [`set_logger`].
+///
+/// In almost all cases, [`set_logger`] should be preferred.
+///
+/// # Safety
+///
+/// This function is only safe to call when no other logger initialization
+/// function is called while this function still executes.
+///
+/// This can be upheld by (for example) making sure that **there are no other
+/// threads**, and (on embedded) that **interrupts are disabled**.
+///
+/// It is safe to use other logging functions while this function runs
+/// (including all logging macros).
+///
+/// [`set_logger`]: fn.set_logger.html
+pub unsafe fn set_logger_racy(logger: &'static Log) -> Result<(), SetLoggerError> {
+    match STATE.load(Ordering::SeqCst) {
+        UNINITIALIZED => {
+            LOGGER = logger;
+            STATE.store(INITIALIZED, Ordering::SeqCst);
+            Ok(())
+        }
+        INITIALIZING => {
+            // This is just plain UB, since we were racing another initialization function
+            unreachable!("set_logger_racy must not be used with other initialization functions")
+        }
+        _ => Err(SetLoggerError(())),
+    }
+}
+
+/// The type returned by [`set_logger`] if [`set_logger`] has already been called.
+///
+/// [`set_logger`]: fn.set_logger.html
+#[allow(missing_copy_implementations)]
+#[derive(Debug)]
+pub struct SetLoggerError(());
+
+impl fmt::Display for SetLoggerError {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        fmt.write_str(SET_LOGGER_ERROR)
+    }
+}
+
+// The Error trait is not available in libcore
+#[cfg(feature = "std")]
+impl error::Error for SetLoggerError {
+    fn description(&self) -> &str {
+        SET_LOGGER_ERROR
+    }
+}
+
+/// The type returned by [`from_str`] when the string doesn't match any of the log levels.
+///
+/// [`from_str`]: https://doc.rust-lang.org/std/str/trait.FromStr.html#tymethod.from_str
+#[allow(missing_copy_implementations)]
+#[derive(Debug, PartialEq)]
+pub struct ParseLevelError(());
+
+impl fmt::Display for ParseLevelError {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        fmt.write_str(LEVEL_PARSE_ERROR)
+    }
+}
+
+// The Error trait is not available in libcore
+#[cfg(feature = "std")]
+impl error::Error for ParseLevelError {
+    fn description(&self) -> &str {
+        LEVEL_PARSE_ERROR
+    }
+}
+
+/// Returns a reference to the logger.
+///
+/// If a logger has not been set, a no-op implementation is returned.
+pub fn logger() -> &'static Log {
+    unsafe {
+        if STATE.load(Ordering::SeqCst) != INITIALIZED {
+            static NOP: NopLogger = NopLogger;
+            &NOP
+        } else {
+            LOGGER
+        }
+    }
+}
+
+// WARNING: this is not part of the crate's public API and is subject to change at any time
+#[doc(hidden)]
+pub fn __private_api_log(
+    args: fmt::Arguments,
+    level: Level,
+    &(target, module_path, file, line): &(&str, &'static str, &'static str, u32),
+) {
+    logger().log(
+        &Record::builder()
+            .args(args)
+            .level(level)
+            .target(target)
+            .module_path_static(Some(module_path))
+            .file_static(Some(file))
+            .line(Some(line))
+            .build(),
+    );
+}
+
+// WARNING: this is not part of the crate's public API and is subject to change at any time
+#[doc(hidden)]
+pub fn __private_api_enabled(level: Level, target: &str) -> bool {
+    logger().enabled(&Metadata::builder().level(level).target(target).build())
+}
+
+/// The statically resolved maximum log level.
+///
+/// See the crate level documentation for information on how to configure this.
+///
+/// This value is checked by the log macros, but not by the `Log`ger returned by
+/// the [`logger`] function. Code that manually calls functions on that value
+/// should compare the level against this value.
+///
+/// [`logger`]: fn.logger.html
+pub const STATIC_MAX_LEVEL: LevelFilter = MAX_LEVEL_INNER;
+
+cfg_if! {
+    if #[cfg(all(not(debug_assertions), feature = "release_max_level_off"))] {
+        const MAX_LEVEL_INNER: LevelFilter = LevelFilter::Off;
+    } else if #[cfg(all(not(debug_assertions), feature = "release_max_level_error"))] {
+        const MAX_LEVEL_INNER: LevelFilter = LevelFilter::Error;
+    } else if #[cfg(all(not(debug_assertions), feature = "release_max_level_warn"))] {
+        const MAX_LEVEL_INNER: LevelFilter = LevelFilter::Warn;
+    } else if #[cfg(all(not(debug_assertions), feature = "release_max_level_info"))] {
+        const MAX_LEVEL_INNER: LevelFilter = LevelFilter::Info;
+    } else if #[cfg(all(not(debug_assertions), feature = "release_max_level_debug"))] {
+        const MAX_LEVEL_INNER: LevelFilter = LevelFilter::Debug;
+    } else if #[cfg(all(not(debug_assertions), feature = "release_max_level_trace"))] {
+        const MAX_LEVEL_INNER: LevelFilter = LevelFilter::Trace;
+    } else if #[cfg(feature = "max_level_off")] {
+        const MAX_LEVEL_INNER: LevelFilter = LevelFilter::Off;
+    } else if #[cfg(feature = "max_level_error")] {
+        const MAX_LEVEL_INNER: LevelFilter = LevelFilter::Error;
+    } else if #[cfg(feature = "max_level_warn")] {
+        const MAX_LEVEL_INNER: LevelFilter = LevelFilter::Warn;
+    } else if #[cfg(feature = "max_level_info")] {
+        const MAX_LEVEL_INNER: LevelFilter = LevelFilter::Info;
+    } else if #[cfg(feature = "max_level_debug")] {
+        const MAX_LEVEL_INNER: LevelFilter = LevelFilter::Debug;
+    } else {
+        const MAX_LEVEL_INNER: LevelFilter = LevelFilter::Trace;
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    extern crate std;
+    use super::{Level, LevelFilter, ParseLevelError};
+    use tests::std::string::ToString;
+
+    #[test]
+    fn test_levelfilter_from_str() {
+        let tests = [
+            ("off", Ok(LevelFilter::Off)),
+            ("error", Ok(LevelFilter::Error)),
+            ("warn", Ok(LevelFilter::Warn)),
+            ("info", Ok(LevelFilter::Info)),
+            ("debug", Ok(LevelFilter::Debug)),
+            ("trace", Ok(LevelFilter::Trace)),
+            ("OFF", Ok(LevelFilter::Off)),
+            ("ERROR", Ok(LevelFilter::Error)),
+            ("WARN", Ok(LevelFilter::Warn)),
+            ("INFO", Ok(LevelFilter::Info)),
+            ("DEBUG", Ok(LevelFilter::Debug)),
+            ("TRACE", Ok(LevelFilter::Trace)),
+            ("asdf", Err(ParseLevelError(()))),
+        ];
+        for &(s, ref expected) in &tests {
+            assert_eq!(expected, &s.parse());
+        }
+    }
+
+    #[test]
+    fn test_level_from_str() {
+        let tests = [
+            ("OFF", Err(ParseLevelError(()))),
+            ("error", Ok(Level::Error)),
+            ("warn", Ok(Level::Warn)),
+            ("info", Ok(Level::Info)),
+            ("debug", Ok(Level::Debug)),
+            ("trace", Ok(Level::Trace)),
+            ("ERROR", Ok(Level::Error)),
+            ("WARN", Ok(Level::Warn)),
+            ("INFO", Ok(Level::Info)),
+            ("DEBUG", Ok(Level::Debug)),
+            ("TRACE", Ok(Level::Trace)),
+            ("asdf", Err(ParseLevelError(()))),
+        ];
+        for &(s, ref expected) in &tests {
+            assert_eq!(expected, &s.parse());
+        }
+    }
+
+    #[test]
+    fn test_level_show() {
+        assert_eq!("INFO", Level::Info.to_string());
+        assert_eq!("ERROR", Level::Error.to_string());
+    }
+
+    #[test]
+    fn test_levelfilter_show() {
+        assert_eq!("OFF", LevelFilter::Off.to_string());
+        assert_eq!("ERROR", LevelFilter::Error.to_string());
+    }
+
+    #[test]
+    fn test_cross_cmp() {
+        assert!(Level::Debug > LevelFilter::Error);
+        assert!(LevelFilter::Warn < Level::Trace);
+        assert!(LevelFilter::Off < Level::Error);
+    }
+
+    #[test]
+    fn test_cross_eq() {
+        assert!(Level::Error == LevelFilter::Error);
+        assert!(LevelFilter::Off != Level::Error);
+        assert!(Level::Trace == LevelFilter::Trace);
+    }
+
+    #[test]
+    fn test_to_level() {
+        assert_eq!(Some(Level::Error), LevelFilter::Error.to_level());
+        assert_eq!(None, LevelFilter::Off.to_level());
+        assert_eq!(Some(Level::Debug), LevelFilter::Debug.to_level());
+    }
+
+    #[test]
+    fn test_to_level_filter() {
+        assert_eq!(LevelFilter::Error, Level::Error.to_level_filter());
+        assert_eq!(LevelFilter::Trace, Level::Trace.to_level_filter());
+    }
+
+    #[test]
+    #[cfg(feature = "std")]
+    fn test_error_trait() {
+        use super::SetLoggerError;
+        use std::error::Error;
+        let e = SetLoggerError(());
+        assert_eq!(
+            e.description(),
+            "attempted to set a logger after the logging system \
+             was already initialized"
+        );
+    }
+
+    #[test]
+    fn test_metadata_builder() {
+        use super::MetadataBuilder;
+        let target = "myApp";
+        let metadata_test = MetadataBuilder::new()
+            .level(Level::Debug)
+            .target(target)
+            .build();
+        assert_eq!(metadata_test.level(), Level::Debug);
+        assert_eq!(metadata_test.target(), "myApp");
+    }
+
+    #[test]
+    fn test_metadata_convenience_builder() {
+        use super::Metadata;
+        let target = "myApp";
+        let metadata_test = Metadata::builder()
+            .level(Level::Debug)
+            .target(target)
+            .build();
+        assert_eq!(metadata_test.level(), Level::Debug);
+        assert_eq!(metadata_test.target(), "myApp");
+    }
+
+    #[test]
+    fn test_record_builder() {
+        use super::{MetadataBuilder, RecordBuilder};
+        let target = "myApp";
+        let metadata = MetadataBuilder::new().target(target).build();
+        let fmt_args = format_args!("hello");
+        let record_test = RecordBuilder::new()
+            .args(fmt_args)
+            .metadata(metadata)
+            .module_path(Some("foo"))
+            .file(Some("bar"))
+            .line(Some(30))
+            .build();
+        assert_eq!(record_test.metadata().target(), "myApp");
+        assert_eq!(record_test.module_path(), Some("foo"));
+        assert_eq!(record_test.file(), Some("bar"));
+        assert_eq!(record_test.line(), Some(30));
+    }
+
+    #[test]
+    fn test_record_convenience_builder() {
+        use super::{Metadata, Record};
+        let target = "myApp";
+        let metadata = Metadata::builder().target(target).build();
+        let fmt_args = format_args!("hello");
+        let record_test = Record::builder()
+            .args(fmt_args)
+            .metadata(metadata)
+            .module_path(Some("foo"))
+            .file(Some("bar"))
+            .line(Some(30))
+            .build();
+        assert_eq!(record_test.target(), "myApp");
+        assert_eq!(record_test.module_path(), Some("foo"));
+        assert_eq!(record_test.file(), Some("bar"));
+        assert_eq!(record_test.line(), Some(30));
+    }
+
+    #[test]
+    fn test_record_complete_builder() {
+        use super::{Level, Record};
+        let target = "myApp";
+        let record_test = Record::builder()
+            .module_path(Some("foo"))
+            .file(Some("bar"))
+            .line(Some(30))
+            .target(target)
+            .level(Level::Error)
+            .build();
+        assert_eq!(record_test.target(), "myApp");
+        assert_eq!(record_test.level(), Level::Error);
+        assert_eq!(record_test.module_path(), Some("foo"));
+        assert_eq!(record_test.file(), Some("bar"));
+        assert_eq!(record_test.line(), Some(30));
+    }
+
+    #[test]
+    #[cfg(feature = "kv_unstable")]
+    fn test_record_key_values_builder() {
+        use super::Record;
+        use kv::{self, Visitor};
+
+        struct TestVisitor {
+            seen_pairs: usize,
+        }
+
+        impl<'kvs> Visitor<'kvs> for TestVisitor {
+            fn visit_pair(
+                &mut self,
+                _: kv::Key<'kvs>,
+                _: kv::Value<'kvs>
+            ) -> Result<(), kv::Error> {
+                self.seen_pairs += 1;
+                Ok(())
+            }
+        }
+
+        let kvs: &[(&str, i32)] = &[
+            ("a", 1),
+            ("b", 2)
+        ];
+        let record_test = Record::builder()
+            .key_values(&kvs)
+            .build();
+
+        let mut visitor = TestVisitor {
+            seen_pairs: 0,
+        };
+
+        record_test.key_values().visit(&mut visitor).unwrap();
+
+        assert_eq!(2, visitor.seen_pairs);
+    }
+}
+
+
\ No newline at end of file diff --git a/src/log/macros.rs.html b/src/log/macros.rs.html new file mode 100644 index 0000000..ec42846 --- /dev/null +++ b/src/log/macros.rs.html @@ -0,0 +1,503 @@ +macros.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+
+// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+/// The standard logging macro.
+///
+/// This macro will generically log with the specified `Level` and `format!`
+/// based argument list.
+///
+/// # Examples
+///
+/// ```edition2018
+/// use log::{log, Level};
+///
+/// # fn main() {
+/// let data = (42, "Forty-two");
+/// let private_data = "private";
+///
+/// log!(Level::Error, "Received errors: {}, {}", data.0, data.1);
+/// log!(target: "app_events", Level::Warn, "App warning: {}, {}, {}",
+///     data.0, data.1, private_data);
+/// # }
+/// ```
+#[macro_export(local_inner_macros)]
+macro_rules! log {
+    (target: $target:expr, $lvl:expr, $($arg:tt)+) => ({
+        let lvl = $lvl;
+        if lvl <= $crate::STATIC_MAX_LEVEL && lvl <= $crate::max_level() {
+            $crate::__private_api_log(
+                __log_format_args!($($arg)+),
+                lvl,
+                &($target, __log_module_path!(), __log_file!(), __log_line!()),
+            );
+        }
+    });
+    ($lvl:expr, $($arg:tt)+) => (log!(target: __log_module_path!(), $lvl, $($arg)+))
+}
+
+/// Logs a message at the error level.
+///
+/// # Examples
+///
+/// ```edition2018
+/// use log::error;
+///
+/// # fn main() {
+/// let (err_info, port) = ("No connection", 22);
+///
+/// error!("Error: {} on port {}", err_info, port);
+/// error!(target: "app_events", "App Error: {}, Port: {}", err_info, 22);
+/// # }
+/// ```
+#[macro_export(local_inner_macros)]
+macro_rules! error {
+    (target: $target:expr, $($arg:tt)+) => (
+        log!(target: $target, $crate::Level::Error, $($arg)+);
+    );
+    ($($arg:tt)+) => (
+        log!($crate::Level::Error, $($arg)+);
+    )
+}
+
+/// Logs a message at the warn level.
+///
+/// # Examples
+///
+/// ```edition2018
+/// use log::warn;
+///
+/// # fn main() {
+/// let warn_description = "Invalid Input";
+///
+/// warn!("Warning! {}!", warn_description);
+/// warn!(target: "input_events", "App received warning: {}", warn_description);
+/// # }
+/// ```
+#[macro_export(local_inner_macros)]
+macro_rules! warn {
+    (target: $target:expr, $($arg:tt)+) => (
+        log!(target: $target, $crate::Level::Warn, $($arg)+);
+    );
+    ($($arg:tt)+) => (
+        log!($crate::Level::Warn, $($arg)+);
+    )
+}
+
+/// Logs a message at the info level.
+///
+/// # Examples
+///
+/// ```edition2018
+/// use log::info;
+///
+/// # fn main() {
+/// # struct Connection { port: u32, speed: f32 }
+/// let conn_info = Connection { port: 40, speed: 3.20 };
+///
+/// info!("Connected to port {} at {} Mb/s", conn_info.port, conn_info.speed);
+/// info!(target: "connection_events", "Successfull connection, port: {}, speed: {}",
+///       conn_info.port, conn_info.speed);
+/// # }
+/// ```
+#[macro_export(local_inner_macros)]
+macro_rules! info {
+    (target: $target:expr, $($arg:tt)+) => (
+        log!(target: $target, $crate::Level::Info, $($arg)+);
+    );
+    ($($arg:tt)+) => (
+        log!($crate::Level::Info, $($arg)+);
+    )
+}
+
+/// Logs a message at the debug level.
+///
+/// # Examples
+///
+/// ```edition2018
+/// use log::debug;
+///
+/// # fn main() {
+/// # struct Position { x: f32, y: f32 }
+/// let pos = Position { x: 3.234, y: -1.223 };
+///
+/// debug!("New position: x: {}, y: {}", pos.x, pos.y);
+/// debug!(target: "app_events", "New position: x: {}, y: {}", pos.x, pos.y);
+/// # }
+/// ```
+#[macro_export(local_inner_macros)]
+macro_rules! debug {
+    (target: $target:expr, $($arg:tt)+) => (
+        log!(target: $target, $crate::Level::Debug, $($arg)+);
+    );
+    ($($arg:tt)+) => (
+        log!($crate::Level::Debug, $($arg)+);
+    )
+}
+
+/// Logs a message at the trace level.
+///
+/// # Examples
+///
+/// ```edition2018
+/// use log::trace;
+///
+/// # fn main() {
+/// # struct Position { x: f32, y: f32 }
+/// let pos = Position { x: 3.234, y: -1.223 };
+///
+/// trace!("Position is: x: {}, y: {}", pos.x, pos.y);
+/// trace!(target: "app_events", "x is {} and y is {}",
+///        if pos.x >= 0.0 { "positive" } else { "negative" },
+///        if pos.y >= 0.0 { "positive" } else { "negative" });
+/// # }
+/// ```
+#[macro_export(local_inner_macros)]
+macro_rules! trace {
+    (target: $target:expr, $($arg:tt)+) => (
+        log!(target: $target, $crate::Level::Trace, $($arg)+);
+    );
+    ($($arg:tt)+) => (
+        log!($crate::Level::Trace, $($arg)+);
+    )
+}
+
+/// Determines if a message logged at the specified level in that module will
+/// be logged.
+///
+/// This can be used to avoid expensive computation of log message arguments if
+/// the message would be ignored anyway.
+///
+/// # Examples
+///
+/// ```edition2018
+/// use log::Level::Debug;
+/// use log::{debug, log_enabled};
+///
+/// # fn foo() {
+/// if log_enabled!(Debug) {
+///     let data = expensive_call();
+///     debug!("expensive debug data: {} {}", data.x, data.y);
+/// }
+/// if log_enabled!(target: "Global", Debug) {
+///    let data = expensive_call();
+///    debug!(target: "Global", "expensive debug data: {} {}", data.x, data.y);
+/// }
+/// # }
+/// # struct Data { x: u32, y: u32 }
+/// # fn expensive_call() -> Data { Data { x: 0, y: 0 } }
+/// # fn main() {}
+/// ```
+#[macro_export(local_inner_macros)]
+macro_rules! log_enabled {
+    (target: $target:expr, $lvl:expr) => {{
+        let lvl = $lvl;
+        lvl <= $crate::STATIC_MAX_LEVEL
+            && lvl <= $crate::max_level()
+            && $crate::__private_api_enabled(lvl, $target)
+    }};
+    ($lvl:expr) => {
+        log_enabled!(target: __log_module_path!(), $lvl)
+    };
+}
+
+// The log macro above cannot invoke format_args directly because it uses
+// local_inner_macros. A format_args invocation there would resolve to
+// $crate::format_args which does not exist. Instead invoke format_args here
+// outside of local_inner_macros so that it resolves (probably) to
+// core::format_args or std::format_args. Same for the several macros that
+// follow.
+//
+// This is a workaround until we drop support for pre-1.30 compilers. At that
+// point we can remove use of local_inner_macros, use $crate:: when invoking
+// local macros, and invoke format_args directly.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __log_format_args {
+    ($($args:tt)*) => {
+        format_args!($($args)*)
+    };
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __log_module_path {
+    () => {
+        module_path!()
+    };
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __log_file {
+    () => {
+        file!()
+    };
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __log_line {
+    () => {
+        line!()
+    };
+}
+
+
\ No newline at end of file diff --git a/src/proc_macro2/fallback.rs.html b/src/proc_macro2/fallback.rs.html new file mode 100644 index 0000000..209f76d --- /dev/null +++ b/src/proc_macro2/fallback.rs.html @@ -0,0 +1,2919 @@ +fallback.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+
+#[cfg(span_locations)]
+use std::cell::RefCell;
+#[cfg(span_locations)]
+use std::cmp;
+use std::fmt;
+use std::iter;
+use std::ops::RangeBounds;
+#[cfg(procmacro2_semver_exempt)]
+use std::path::Path;
+use std::path::PathBuf;
+use std::str::FromStr;
+use std::vec;
+
+use crate::strnom::{block_comment, skip_whitespace, whitespace, word_break, Cursor, PResult};
+use crate::{Delimiter, Punct, Spacing, TokenTree};
+use unicode_xid::UnicodeXID;
+
+#[derive(Clone)]
+pub struct TokenStream {
+    inner: Vec<TokenTree>,
+}
+
+#[derive(Debug)]
+pub struct LexError;
+
+impl TokenStream {
+    pub fn new() -> TokenStream {
+        TokenStream { inner: Vec::new() }
+    }
+
+    pub fn is_empty(&self) -> bool {
+        self.inner.len() == 0
+    }
+}
+
+#[cfg(span_locations)]
+fn get_cursor(src: &str) -> Cursor {
+    // Create a dummy file & add it to the source map
+    SOURCE_MAP.with(|cm| {
+        let mut cm = cm.borrow_mut();
+        let name = format!("<parsed string {}>", cm.files.len());
+        let span = cm.add_file(&name, src);
+        Cursor {
+            rest: src,
+            off: span.lo,
+        }
+    })
+}
+
+#[cfg(not(span_locations))]
+fn get_cursor(src: &str) -> Cursor {
+    Cursor { rest: src }
+}
+
+impl FromStr for TokenStream {
+    type Err = LexError;
+
+    fn from_str(src: &str) -> Result<TokenStream, LexError> {
+        // Create a dummy file & add it to the source map
+        let cursor = get_cursor(src);
+
+        match token_stream(cursor) {
+            Ok((input, output)) => {
+                if skip_whitespace(input).len() != 0 {
+                    Err(LexError)
+                } else {
+                    Ok(output)
+                }
+            }
+            Err(LexError) => Err(LexError),
+        }
+    }
+}
+
+impl fmt::Display for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut joint = false;
+        for (i, tt) in self.inner.iter().enumerate() {
+            if i != 0 && !joint {
+                write!(f, " ")?;
+            }
+            joint = false;
+            match *tt {
+                TokenTree::Group(ref tt) => {
+                    let (start, end) = match tt.delimiter() {
+                        Delimiter::Parenthesis => ("(", ")"),
+                        Delimiter::Brace => ("{", "}"),
+                        Delimiter::Bracket => ("[", "]"),
+                        Delimiter::None => ("", ""),
+                    };
+                    if tt.stream().into_iter().next().is_none() {
+                        write!(f, "{} {}", start, end)?
+                    } else {
+                        write!(f, "{} {} {}", start, tt.stream(), end)?
+                    }
+                }
+                TokenTree::Ident(ref tt) => write!(f, "{}", tt)?,
+                TokenTree::Punct(ref tt) => {
+                    write!(f, "{}", tt.as_char())?;
+                    match tt.spacing() {
+                        Spacing::Alone => {}
+                        Spacing::Joint => joint = true,
+                    }
+                }
+                TokenTree::Literal(ref tt) => write!(f, "{}", tt)?,
+            }
+        }
+
+        Ok(())
+    }
+}
+
+impl fmt::Debug for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str("TokenStream ")?;
+        f.debug_list().entries(self.clone()).finish()
+    }
+}
+
+#[cfg(use_proc_macro)]
+impl From<proc_macro::TokenStream> for TokenStream {
+    fn from(inner: proc_macro::TokenStream) -> TokenStream {
+        inner
+            .to_string()
+            .parse()
+            .expect("compiler token stream parse failed")
+    }
+}
+
+#[cfg(use_proc_macro)]
+impl From<TokenStream> for proc_macro::TokenStream {
+    fn from(inner: TokenStream) -> proc_macro::TokenStream {
+        inner
+            .to_string()
+            .parse()
+            .expect("failed to parse to compiler tokens")
+    }
+}
+
+impl From<TokenTree> for TokenStream {
+    fn from(tree: TokenTree) -> TokenStream {
+        TokenStream { inner: vec![tree] }
+    }
+}
+
+impl iter::FromIterator<TokenTree> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenTree>>(streams: I) -> Self {
+        let mut v = Vec::new();
+
+        for token in streams.into_iter() {
+            v.push(token);
+        }
+
+        TokenStream { inner: v }
+    }
+}
+
+impl iter::FromIterator<TokenStream> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
+        let mut v = Vec::new();
+
+        for stream in streams.into_iter() {
+            v.extend(stream.inner);
+        }
+
+        TokenStream { inner: v }
+    }
+}
+
+impl Extend<TokenTree> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, streams: I) {
+        self.inner.extend(streams);
+    }
+}
+
+impl Extend<TokenStream> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, streams: I) {
+        self.inner
+            .extend(streams.into_iter().flat_map(|stream| stream));
+    }
+}
+
+pub type TokenTreeIter = vec::IntoIter<TokenTree>;
+
+impl IntoIterator for TokenStream {
+    type Item = TokenTree;
+    type IntoIter = TokenTreeIter;
+
+    fn into_iter(self) -> TokenTreeIter {
+        self.inner.into_iter()
+    }
+}
+
+#[derive(Clone, PartialEq, Eq)]
+pub struct SourceFile {
+    path: PathBuf,
+}
+
+impl SourceFile {
+    /// Get the path to this source file as a string.
+    pub fn path(&self) -> PathBuf {
+        self.path.clone()
+    }
+
+    pub fn is_real(&self) -> bool {
+        // XXX(nika): Support real files in the future?
+        false
+    }
+}
+
+impl fmt::Debug for SourceFile {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("SourceFile")
+            .field("path", &self.path())
+            .field("is_real", &self.is_real())
+            .finish()
+    }
+}
+
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub struct LineColumn {
+    pub line: usize,
+    pub column: usize,
+}
+
+#[cfg(span_locations)]
+thread_local! {
+    static SOURCE_MAP: RefCell<SourceMap> = RefCell::new(SourceMap {
+        // NOTE: We start with a single dummy file which all call_site() and
+        // def_site() spans reference.
+        files: vec![{
+            #[cfg(procmacro2_semver_exempt)]
+            {
+                FileInfo {
+                    name: "<unspecified>".to_owned(),
+                    span: Span { lo: 0, hi: 0 },
+                    lines: vec![0],
+                }
+            }
+
+            #[cfg(not(procmacro2_semver_exempt))]
+            {
+                FileInfo {
+                    span: Span { lo: 0, hi: 0 },
+                    lines: vec![0],
+                }
+            }
+        }],
+    });
+}
+
+#[cfg(span_locations)]
+struct FileInfo {
+    #[cfg(procmacro2_semver_exempt)]
+    name: String,
+    span: Span,
+    lines: Vec<usize>,
+}
+
+#[cfg(span_locations)]
+impl FileInfo {
+    fn offset_line_column(&self, offset: usize) -> LineColumn {
+        assert!(self.span_within(Span {
+            lo: offset as u32,
+            hi: offset as u32
+        }));
+        let offset = offset - self.span.lo as usize;
+        match self.lines.binary_search(&offset) {
+            Ok(found) => LineColumn {
+                line: found + 1,
+                column: 0,
+            },
+            Err(idx) => LineColumn {
+                line: idx,
+                column: offset - self.lines[idx - 1],
+            },
+        }
+    }
+
+    fn span_within(&self, span: Span) -> bool {
+        span.lo >= self.span.lo && span.hi <= self.span.hi
+    }
+}
+
+/// Computesthe offsets of each line in the given source string.
+#[cfg(span_locations)]
+fn lines_offsets(s: &str) -> Vec<usize> {
+    let mut lines = vec![0];
+    let mut prev = 0;
+    while let Some(len) = s[prev..].find('\n') {
+        prev += len + 1;
+        lines.push(prev);
+    }
+    lines
+}
+
+#[cfg(span_locations)]
+struct SourceMap {
+    files: Vec<FileInfo>,
+}
+
+#[cfg(span_locations)]
+impl SourceMap {
+    fn next_start_pos(&self) -> u32 {
+        // Add 1 so there's always space between files.
+        //
+        // We'll always have at least 1 file, as we initialize our files list
+        // with a dummy file.
+        self.files.last().unwrap().span.hi + 1
+    }
+
+    fn add_file(&mut self, name: &str, src: &str) -> Span {
+        let lines = lines_offsets(src);
+        let lo = self.next_start_pos();
+        // XXX(nika): Shouild we bother doing a checked cast or checked add here?
+        let span = Span {
+            lo,
+            hi: lo + (src.len() as u32),
+        };
+
+        #[cfg(procmacro2_semver_exempt)]
+        self.files.push(FileInfo {
+            name: name.to_owned(),
+            span,
+            lines,
+        });
+
+        #[cfg(not(procmacro2_semver_exempt))]
+        self.files.push(FileInfo { span, lines });
+        let _ = name;
+
+        span
+    }
+
+    fn fileinfo(&self, span: Span) -> &FileInfo {
+        for file in &self.files {
+            if file.span_within(span) {
+                return file;
+            }
+        }
+        panic!("Invalid span with no related FileInfo!");
+    }
+}
+
+#[derive(Clone, Copy, PartialEq, Eq)]
+pub struct Span {
+    #[cfg(span_locations)]
+    lo: u32,
+    #[cfg(span_locations)]
+    hi: u32,
+}
+
+impl Span {
+    #[cfg(not(span_locations))]
+    pub fn call_site() -> Span {
+        Span {}
+    }
+
+    #[cfg(span_locations)]
+    pub fn call_site() -> Span {
+        Span { lo: 0, hi: 0 }
+    }
+
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn def_site() -> Span {
+        Span::call_site()
+    }
+
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn resolved_at(&self, _other: Span) -> Span {
+        // Stable spans consist only of line/column information, so
+        // `resolved_at` and `located_at` only select which span the
+        // caller wants line/column information from.
+        *self
+    }
+
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn located_at(&self, other: Span) -> Span {
+        other
+    }
+
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn source_file(&self) -> SourceFile {
+        SOURCE_MAP.with(|cm| {
+            let cm = cm.borrow();
+            let fi = cm.fileinfo(*self);
+            SourceFile {
+                path: Path::new(&fi.name).to_owned(),
+            }
+        })
+    }
+
+    #[cfg(span_locations)]
+    pub fn start(&self) -> LineColumn {
+        SOURCE_MAP.with(|cm| {
+            let cm = cm.borrow();
+            let fi = cm.fileinfo(*self);
+            fi.offset_line_column(self.lo as usize)
+        })
+    }
+
+    #[cfg(span_locations)]
+    pub fn end(&self) -> LineColumn {
+        SOURCE_MAP.with(|cm| {
+            let cm = cm.borrow();
+            let fi = cm.fileinfo(*self);
+            fi.offset_line_column(self.hi as usize)
+        })
+    }
+
+    #[cfg(not(span_locations))]
+    pub fn join(&self, _other: Span) -> Option<Span> {
+        Some(Span {})
+    }
+
+    #[cfg(span_locations)]
+    pub fn join(&self, other: Span) -> Option<Span> {
+        SOURCE_MAP.with(|cm| {
+            let cm = cm.borrow();
+            // If `other` is not within the same FileInfo as us, return None.
+            if !cm.fileinfo(*self).span_within(other) {
+                return None;
+            }
+            Some(Span {
+                lo: cmp::min(self.lo, other.lo),
+                hi: cmp::max(self.hi, other.hi),
+            })
+        })
+    }
+
+    #[cfg(not(span_locations))]
+    fn first_byte(self) -> Self {
+        self
+    }
+
+    #[cfg(span_locations)]
+    fn first_byte(self) -> Self {
+        Span {
+            lo: self.lo,
+            hi: cmp::min(self.lo.saturating_add(1), self.hi),
+        }
+    }
+
+    #[cfg(not(span_locations))]
+    fn last_byte(self) -> Self {
+        self
+    }
+
+    #[cfg(span_locations)]
+    fn last_byte(self) -> Self {
+        Span {
+            lo: cmp::max(self.hi.saturating_sub(1), self.lo),
+            hi: self.hi,
+        }
+    }
+}
+
+impl fmt::Debug for Span {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        #[cfg(procmacro2_semver_exempt)]
+        return write!(f, "bytes({}..{})", self.lo, self.hi);
+
+        #[cfg(not(procmacro2_semver_exempt))]
+        write!(f, "Span")
+    }
+}
+
+pub fn debug_span_field_if_nontrivial(debug: &mut fmt::DebugStruct, span: Span) {
+    if cfg!(procmacro2_semver_exempt) {
+        debug.field("span", &span);
+    }
+}
+
+#[derive(Clone)]
+pub struct Group {
+    delimiter: Delimiter,
+    stream: TokenStream,
+    span: Span,
+}
+
+impl Group {
+    pub fn new(delimiter: Delimiter, stream: TokenStream) -> Group {
+        Group {
+            delimiter,
+            stream,
+            span: Span::call_site(),
+        }
+    }
+
+    pub fn delimiter(&self) -> Delimiter {
+        self.delimiter
+    }
+
+    pub fn stream(&self) -> TokenStream {
+        self.stream.clone()
+    }
+
+    pub fn span(&self) -> Span {
+        self.span
+    }
+
+    pub fn span_open(&self) -> Span {
+        self.span.first_byte()
+    }
+
+    pub fn span_close(&self) -> Span {
+        self.span.last_byte()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.span = span;
+    }
+}
+
+impl fmt::Display for Group {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let (left, right) = match self.delimiter {
+            Delimiter::Parenthesis => ("(", ")"),
+            Delimiter::Brace => ("{", "}"),
+            Delimiter::Bracket => ("[", "]"),
+            Delimiter::None => ("", ""),
+        };
+
+        f.write_str(left)?;
+        self.stream.fmt(f)?;
+        f.write_str(right)?;
+
+        Ok(())
+    }
+}
+
+impl fmt::Debug for Group {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = fmt.debug_struct("Group");
+        debug.field("delimiter", &self.delimiter);
+        debug.field("stream", &self.stream);
+        #[cfg(procmacro2_semver_exempt)]
+        debug.field("span", &self.span);
+        debug.finish()
+    }
+}
+
+#[derive(Clone)]
+pub struct Ident {
+    sym: String,
+    span: Span,
+    raw: bool,
+}
+
+impl Ident {
+    fn _new(string: &str, raw: bool, span: Span) -> Ident {
+        validate_ident(string);
+
+        Ident {
+            sym: string.to_owned(),
+            span,
+            raw,
+        }
+    }
+
+    pub fn new(string: &str, span: Span) -> Ident {
+        Ident::_new(string, false, span)
+    }
+
+    pub fn new_raw(string: &str, span: Span) -> Ident {
+        Ident::_new(string, true, span)
+    }
+
+    pub fn span(&self) -> Span {
+        self.span
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.span = span;
+    }
+}
+
+fn is_ident_start(c: char) -> bool {
+    ('a' <= c && c <= 'z')
+        || ('A' <= c && c <= 'Z')
+        || c == '_'
+        || (c > '\x7f' && UnicodeXID::is_xid_start(c))
+}
+
+fn is_ident_continue(c: char) -> bool {
+    ('a' <= c && c <= 'z')
+        || ('A' <= c && c <= 'Z')
+        || c == '_'
+        || ('0' <= c && c <= '9')
+        || (c > '\x7f' && UnicodeXID::is_xid_continue(c))
+}
+
+fn validate_ident(string: &str) {
+    let validate = string;
+    if validate.is_empty() {
+        panic!("Ident is not allowed to be empty; use Option<Ident>");
+    }
+
+    if validate.bytes().all(|digit| digit >= b'0' && digit <= b'9') {
+        panic!("Ident cannot be a number; use Literal instead");
+    }
+
+    fn ident_ok(string: &str) -> bool {
+        let mut chars = string.chars();
+        let first = chars.next().unwrap();
+        if !is_ident_start(first) {
+            return false;
+        }
+        for ch in chars {
+            if !is_ident_continue(ch) {
+                return false;
+            }
+        }
+        true
+    }
+
+    if !ident_ok(validate) {
+        panic!("{:?} is not a valid Ident", string);
+    }
+}
+
+impl PartialEq for Ident {
+    fn eq(&self, other: &Ident) -> bool {
+        self.sym == other.sym && self.raw == other.raw
+    }
+}
+
+impl<T> PartialEq<T> for Ident
+where
+    T: ?Sized + AsRef<str>,
+{
+    fn eq(&self, other: &T) -> bool {
+        let other = other.as_ref();
+        if self.raw {
+            other.starts_with("r#") && self.sym == other[2..]
+        } else {
+            self.sym == other
+        }
+    }
+}
+
+impl fmt::Display for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        if self.raw {
+            "r#".fmt(f)?;
+        }
+        self.sym.fmt(f)
+    }
+}
+
+impl fmt::Debug for Ident {
+    // Ident(proc_macro), Ident(r#union)
+    #[cfg(not(procmacro2_semver_exempt))]
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = f.debug_tuple("Ident");
+        debug.field(&format_args!("{}", self));
+        debug.finish()
+    }
+
+    // Ident {
+    //     sym: proc_macro,
+    //     span: bytes(128..138)
+    // }
+    #[cfg(procmacro2_semver_exempt)]
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = f.debug_struct("Ident");
+        debug.field("sym", &format_args!("{}", self));
+        debug.field("span", &self.span);
+        debug.finish()
+    }
+}
+
+#[derive(Clone)]
+pub struct Literal {
+    text: String,
+    span: Span,
+}
+
+macro_rules! suffixed_numbers {
+    ($($name:ident => $kind:ident,)*) => ($(
+        pub fn $name(n: $kind) -> Literal {
+            Literal::_new(format!(concat!("{}", stringify!($kind)), n))
+        }
+    )*)
+}
+
+macro_rules! unsuffixed_numbers {
+    ($($name:ident => $kind:ident,)*) => ($(
+        pub fn $name(n: $kind) -> Literal {
+            Literal::_new(n.to_string())
+        }
+    )*)
+}
+
+impl Literal {
+    fn _new(text: String) -> Literal {
+        Literal {
+            text,
+            span: Span::call_site(),
+        }
+    }
+
+    suffixed_numbers! {
+        u8_suffixed => u8,
+        u16_suffixed => u16,
+        u32_suffixed => u32,
+        u64_suffixed => u64,
+        u128_suffixed => u128,
+        usize_suffixed => usize,
+        i8_suffixed => i8,
+        i16_suffixed => i16,
+        i32_suffixed => i32,
+        i64_suffixed => i64,
+        i128_suffixed => i128,
+        isize_suffixed => isize,
+
+        f32_suffixed => f32,
+        f64_suffixed => f64,
+    }
+
+    unsuffixed_numbers! {
+        u8_unsuffixed => u8,
+        u16_unsuffixed => u16,
+        u32_unsuffixed => u32,
+        u64_unsuffixed => u64,
+        u128_unsuffixed => u128,
+        usize_unsuffixed => usize,
+        i8_unsuffixed => i8,
+        i16_unsuffixed => i16,
+        i32_unsuffixed => i32,
+        i64_unsuffixed => i64,
+        i128_unsuffixed => i128,
+        isize_unsuffixed => isize,
+    }
+
+    pub fn f32_unsuffixed(f: f32) -> Literal {
+        let mut s = f.to_string();
+        if !s.contains(".") {
+            s.push_str(".0");
+        }
+        Literal::_new(s)
+    }
+
+    pub fn f64_unsuffixed(f: f64) -> Literal {
+        let mut s = f.to_string();
+        if !s.contains(".") {
+            s.push_str(".0");
+        }
+        Literal::_new(s)
+    }
+
+    pub fn string(t: &str) -> Literal {
+        let mut text = String::with_capacity(t.len() + 2);
+        text.push('"');
+        for c in t.chars() {
+            if c == '\'' {
+                // escape_default turns this into "\'" which is unnecessary.
+                text.push(c);
+            } else {
+                text.extend(c.escape_default());
+            }
+        }
+        text.push('"');
+        Literal::_new(text)
+    }
+
+    pub fn character(t: char) -> Literal {
+        let mut text = String::new();
+        text.push('\'');
+        if t == '"' {
+            // escape_default turns this into '\"' which is unnecessary.
+            text.push(t);
+        } else {
+            text.extend(t.escape_default());
+        }
+        text.push('\'');
+        Literal::_new(text)
+    }
+
+    pub fn byte_string(bytes: &[u8]) -> Literal {
+        let mut escaped = "b\"".to_string();
+        for b in bytes {
+            match *b {
+                b'\0' => escaped.push_str(r"\0"),
+                b'\t' => escaped.push_str(r"\t"),
+                b'\n' => escaped.push_str(r"\n"),
+                b'\r' => escaped.push_str(r"\r"),
+                b'"' => escaped.push_str("\\\""),
+                b'\\' => escaped.push_str("\\\\"),
+                b'\x20'..=b'\x7E' => escaped.push(*b as char),
+                _ => escaped.push_str(&format!("\\x{:02X}", b)),
+            }
+        }
+        escaped.push('"');
+        Literal::_new(escaped)
+    }
+
+    pub fn span(&self) -> Span {
+        self.span
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.span = span;
+    }
+
+    pub fn subspan<R: RangeBounds<usize>>(&self, _range: R) -> Option<Span> {
+        None
+    }
+}
+
+impl fmt::Display for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.text.fmt(f)
+    }
+}
+
+impl fmt::Debug for Literal {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = fmt.debug_struct("Literal");
+        debug.field("lit", &format_args!("{}", self.text));
+        #[cfg(procmacro2_semver_exempt)]
+        debug.field("span", &self.span);
+        debug.finish()
+    }
+}
+
+fn token_stream(mut input: Cursor) -> PResult<TokenStream> {
+    let mut trees = Vec::new();
+    loop {
+        let input_no_ws = skip_whitespace(input);
+        if input_no_ws.rest.len() == 0 {
+            break;
+        }
+        if let Ok((a, tokens)) = doc_comment(input_no_ws) {
+            input = a;
+            trees.extend(tokens);
+            continue;
+        }
+
+        let (a, tt) = match token_tree(input_no_ws) {
+            Ok(p) => p,
+            Err(_) => break,
+        };
+        trees.push(tt);
+        input = a;
+    }
+    Ok((input, TokenStream { inner: trees }))
+}
+
+#[cfg(not(span_locations))]
+fn spanned<'a, T>(
+    input: Cursor<'a>,
+    f: fn(Cursor<'a>) -> PResult<'a, T>,
+) -> PResult<'a, (T, crate::Span)> {
+    let (a, b) = f(skip_whitespace(input))?;
+    Ok((a, ((b, crate::Span::_new_stable(Span::call_site())))))
+}
+
+#[cfg(span_locations)]
+fn spanned<'a, T>(
+    input: Cursor<'a>,
+    f: fn(Cursor<'a>) -> PResult<'a, T>,
+) -> PResult<'a, (T, crate::Span)> {
+    let input = skip_whitespace(input);
+    let lo = input.off;
+    let (a, b) = f(input)?;
+    let hi = a.off;
+    let span = crate::Span::_new_stable(Span { lo, hi });
+    Ok((a, (b, span)))
+}
+
+fn token_tree(input: Cursor) -> PResult<TokenTree> {
+    let (rest, (mut tt, span)) = spanned(input, token_kind)?;
+    tt.set_span(span);
+    Ok((rest, tt))
+}
+
+named!(token_kind -> TokenTree, alt!(
+    map!(group, |g| TokenTree::Group(crate::Group::_new_stable(g)))
+    |
+    map!(literal, |l| TokenTree::Literal(crate::Literal::_new_stable(l))) // must be before symbol
+    |
+    map!(op, TokenTree::Punct)
+    |
+    symbol_leading_ws
+));
+
+named!(group -> Group, alt!(
+    delimited!(
+        punct!("("),
+        token_stream,
+        punct!(")")
+    ) => { |ts| Group::new(Delimiter::Parenthesis, ts) }
+    |
+    delimited!(
+        punct!("["),
+        token_stream,
+        punct!("]")
+    ) => { |ts| Group::new(Delimiter::Bracket, ts) }
+    |
+    delimited!(
+        punct!("{"),
+        token_stream,
+        punct!("}")
+    ) => { |ts| Group::new(Delimiter::Brace, ts) }
+));
+
+fn symbol_leading_ws(input: Cursor) -> PResult<TokenTree> {
+    symbol(skip_whitespace(input))
+}
+
+fn symbol(input: Cursor) -> PResult<TokenTree> {
+    let raw = input.starts_with("r#");
+    let rest = input.advance((raw as usize) << 1);
+
+    let (rest, sym) = symbol_not_raw(rest)?;
+
+    if !raw {
+        let ident = crate::Ident::new(sym, crate::Span::call_site());
+        return Ok((rest, ident.into()));
+    }
+
+    if sym == "_" {
+        return Err(LexError);
+    }
+
+    let ident = crate::Ident::_new_raw(sym, crate::Span::call_site());
+    Ok((rest, ident.into()))
+}
+
+fn symbol_not_raw(input: Cursor) -> PResult<&str> {
+    let mut chars = input.char_indices();
+
+    match chars.next() {
+        Some((_, ch)) if is_ident_start(ch) => {}
+        _ => return Err(LexError),
+    }
+
+    let mut end = input.len();
+    for (i, ch) in chars {
+        if !is_ident_continue(ch) {
+            end = i;
+            break;
+        }
+    }
+
+    Ok((input.advance(end), &input.rest[..end]))
+}
+
+fn literal(input: Cursor) -> PResult<Literal> {
+    let input_no_ws = skip_whitespace(input);
+
+    match literal_nocapture(input_no_ws) {
+        Ok((a, ())) => {
+            let start = input.len() - input_no_ws.len();
+            let len = input_no_ws.len() - a.len();
+            let end = start + len;
+            Ok((a, Literal::_new(input.rest[start..end].to_string())))
+        }
+        Err(LexError) => Err(LexError),
+    }
+}
+
+named!(literal_nocapture -> (), alt!(
+    string
+    |
+    byte_string
+    |
+    byte
+    |
+    character
+    |
+    float
+    |
+    int
+));
+
+named!(string -> (), alt!(
+    quoted_string
+    |
+    preceded!(
+        punct!("r"),
+        raw_string
+    ) => { |_| () }
+));
+
+named!(quoted_string -> (), do_parse!(
+    punct!("\"") >>
+    cooked_string >>
+    tag!("\"") >>
+    option!(symbol_not_raw) >>
+    (())
+));
+
+fn cooked_string(input: Cursor) -> PResult<()> {
+    let mut chars = input.char_indices().peekable();
+    while let Some((byte_offset, ch)) = chars.next() {
+        match ch {
+            '"' => {
+                return Ok((input.advance(byte_offset), ()));
+            }
+            '\r' => {
+                if let Some((_, '\n')) = chars.next() {
+                    // ...
+                } else {
+                    break;
+                }
+            }
+            '\\' => match chars.next() {
+                Some((_, 'x')) => {
+                    if !backslash_x_char(&mut chars) {
+                        break;
+                    }
+                }
+                Some((_, 'n')) | Some((_, 'r')) | Some((_, 't')) | Some((_, '\\'))
+                | Some((_, '\'')) | Some((_, '"')) | Some((_, '0')) => {}
+                Some((_, 'u')) => {
+                    if !backslash_u(&mut chars) {
+                        break;
+                    }
+                }
+                Some((_, '\n')) | Some((_, '\r')) => {
+                    while let Some(&(_, ch)) = chars.peek() {
+                        if ch.is_whitespace() {
+                            chars.next();
+                        } else {
+                            break;
+                        }
+                    }
+                }
+                _ => break,
+            },
+            _ch => {}
+        }
+    }
+    Err(LexError)
+}
+
+named!(byte_string -> (), alt!(
+    delimited!(
+        punct!("b\""),
+        cooked_byte_string,
+        tag!("\"")
+    ) => { |_| () }
+    |
+    preceded!(
+        punct!("br"),
+        raw_string
+    ) => { |_| () }
+));
+
+fn cooked_byte_string(mut input: Cursor) -> PResult<()> {
+    let mut bytes = input.bytes().enumerate();
+    'outer: while let Some((offset, b)) = bytes.next() {
+        match b {
+            b'"' => {
+                return Ok((input.advance(offset), ()));
+            }
+            b'\r' => {
+                if let Some((_, b'\n')) = bytes.next() {
+                    // ...
+                } else {
+                    break;
+                }
+            }
+            b'\\' => match bytes.next() {
+                Some((_, b'x')) => {
+                    if !backslash_x_byte(&mut bytes) {
+                        break;
+                    }
+                }
+                Some((_, b'n')) | Some((_, b'r')) | Some((_, b't')) | Some((_, b'\\'))
+                | Some((_, b'0')) | Some((_, b'\'')) | Some((_, b'"')) => {}
+                Some((newline, b'\n')) | Some((newline, b'\r')) => {
+                    let rest = input.advance(newline + 1);
+                    for (offset, ch) in rest.char_indices() {
+                        if !ch.is_whitespace() {
+                            input = rest.advance(offset);
+                            bytes = input.bytes().enumerate();
+                            continue 'outer;
+                        }
+                    }
+                    break;
+                }
+                _ => break,
+            },
+            b if b < 0x80 => {}
+            _ => break,
+        }
+    }
+    Err(LexError)
+}
+
+fn raw_string(input: Cursor) -> PResult<()> {
+    let mut chars = input.char_indices();
+    let mut n = 0;
+    while let Some((byte_offset, ch)) = chars.next() {
+        match ch {
+            '"' => {
+                n = byte_offset;
+                break;
+            }
+            '#' => {}
+            _ => return Err(LexError),
+        }
+    }
+    for (byte_offset, ch) in chars {
+        match ch {
+            '"' if input.advance(byte_offset + 1).starts_with(&input.rest[..n]) => {
+                let rest = input.advance(byte_offset + 1 + n);
+                return Ok((rest, ()));
+            }
+            '\r' => {}
+            _ => {}
+        }
+    }
+    Err(LexError)
+}
+
+named!(byte -> (), do_parse!(
+    punct!("b") >>
+    tag!("'") >>
+    cooked_byte >>
+    tag!("'") >>
+    (())
+));
+
+fn cooked_byte(input: Cursor) -> PResult<()> {
+    let mut bytes = input.bytes().enumerate();
+    let ok = match bytes.next().map(|(_, b)| b) {
+        Some(b'\\') => match bytes.next().map(|(_, b)| b) {
+            Some(b'x') => backslash_x_byte(&mut bytes),
+            Some(b'n') | Some(b'r') | Some(b't') | Some(b'\\') | Some(b'0') | Some(b'\'')
+            | Some(b'"') => true,
+            _ => false,
+        },
+        b => b.is_some(),
+    };
+    if ok {
+        match bytes.next() {
+            Some((offset, _)) => {
+                if input.chars().as_str().is_char_boundary(offset) {
+                    Ok((input.advance(offset), ()))
+                } else {
+                    Err(LexError)
+                }
+            }
+            None => Ok((input.advance(input.len()), ())),
+        }
+    } else {
+        Err(LexError)
+    }
+}
+
+named!(character -> (), do_parse!(
+    punct!("'") >>
+    cooked_char >>
+    tag!("'") >>
+    (())
+));
+
+fn cooked_char(input: Cursor) -> PResult<()> {
+    let mut chars = input.char_indices();
+    let ok = match chars.next().map(|(_, ch)| ch) {
+        Some('\\') => match chars.next().map(|(_, ch)| ch) {
+            Some('x') => backslash_x_char(&mut chars),
+            Some('u') => backslash_u(&mut chars),
+            Some('n') | Some('r') | Some('t') | Some('\\') | Some('0') | Some('\'') | Some('"') => {
+                true
+            }
+            _ => false,
+        },
+        ch => ch.is_some(),
+    };
+    if ok {
+        match chars.next() {
+            Some((idx, _)) => Ok((input.advance(idx), ())),
+            None => Ok((input.advance(input.len()), ())),
+        }
+    } else {
+        Err(LexError)
+    }
+}
+
+macro_rules! next_ch {
+    ($chars:ident @ $pat:pat $(| $rest:pat)*) => {
+        match $chars.next() {
+            Some((_, ch)) => match ch {
+                $pat $(| $rest)*  => ch,
+                _ => return false,
+            },
+            None => return false
+        }
+    };
+}
+
+fn backslash_x_char<I>(chars: &mut I) -> bool
+where
+    I: Iterator<Item = (usize, char)>,
+{
+    next_ch!(chars @ '0'..='7');
+    next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F');
+    true
+}
+
+fn backslash_x_byte<I>(chars: &mut I) -> bool
+where
+    I: Iterator<Item = (usize, u8)>,
+{
+    next_ch!(chars @ b'0'..=b'9' | b'a'..=b'f' | b'A'..=b'F');
+    next_ch!(chars @ b'0'..=b'9' | b'a'..=b'f' | b'A'..=b'F');
+    true
+}
+
+fn backslash_u<I>(chars: &mut I) -> bool
+where
+    I: Iterator<Item = (usize, char)>,
+{
+    next_ch!(chars @ '{');
+    next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F');
+    loop {
+        let c = next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F' | '_' | '}');
+        if c == '}' {
+            return true;
+        }
+    }
+}
+
+fn float(input: Cursor) -> PResult<()> {
+    let (mut rest, ()) = float_digits(input)?;
+    if let Some(ch) = rest.chars().next() {
+        if is_ident_start(ch) {
+            rest = symbol_not_raw(rest)?.0;
+        }
+    }
+    word_break(rest)
+}
+
+fn float_digits(input: Cursor) -> PResult<()> {
+    let mut chars = input.chars().peekable();
+    match chars.next() {
+        Some(ch) if ch >= '0' && ch <= '9' => {}
+        _ => return Err(LexError),
+    }
+
+    let mut len = 1;
+    let mut has_dot = false;
+    let mut has_exp = false;
+    while let Some(&ch) = chars.peek() {
+        match ch {
+            '0'..='9' | '_' => {
+                chars.next();
+                len += 1;
+            }
+            '.' => {
+                if has_dot {
+                    break;
+                }
+                chars.next();
+                if chars
+                    .peek()
+                    .map(|&ch| ch == '.' || is_ident_start(ch))
+                    .unwrap_or(false)
+                {
+                    return Err(LexError);
+                }
+                len += 1;
+                has_dot = true;
+            }
+            'e' | 'E' => {
+                chars.next();
+                len += 1;
+                has_exp = true;
+                break;
+            }
+            _ => break,
+        }
+    }
+
+    let rest = input.advance(len);
+    if !(has_dot || has_exp || rest.starts_with("f32") || rest.starts_with("f64")) {
+        return Err(LexError);
+    }
+
+    if has_exp {
+        let mut has_exp_value = false;
+        while let Some(&ch) = chars.peek() {
+            match ch {
+                '+' | '-' => {
+                    if has_exp_value {
+                        break;
+                    }
+                    chars.next();
+                    len += 1;
+                }
+                '0'..='9' => {
+                    chars.next();
+                    len += 1;
+                    has_exp_value = true;
+                }
+                '_' => {
+                    chars.next();
+                    len += 1;
+                }
+                _ => break,
+            }
+        }
+        if !has_exp_value {
+            return Err(LexError);
+        }
+    }
+
+    Ok((input.advance(len), ()))
+}
+
+fn int(input: Cursor) -> PResult<()> {
+    let (mut rest, ()) = digits(input)?;
+    if let Some(ch) = rest.chars().next() {
+        if is_ident_start(ch) {
+            rest = symbol_not_raw(rest)?.0;
+        }
+    }
+    word_break(rest)
+}
+
+fn digits(mut input: Cursor) -> PResult<()> {
+    let base = if input.starts_with("0x") {
+        input = input.advance(2);
+        16
+    } else if input.starts_with("0o") {
+        input = input.advance(2);
+        8
+    } else if input.starts_with("0b") {
+        input = input.advance(2);
+        2
+    } else {
+        10
+    };
+
+    let mut len = 0;
+    let mut empty = true;
+    for b in input.bytes() {
+        let digit = match b {
+            b'0'..=b'9' => (b - b'0') as u64,
+            b'a'..=b'f' => 10 + (b - b'a') as u64,
+            b'A'..=b'F' => 10 + (b - b'A') as u64,
+            b'_' => {
+                if empty && base == 10 {
+                    return Err(LexError);
+                }
+                len += 1;
+                continue;
+            }
+            _ => break,
+        };
+        if digit >= base {
+            return Err(LexError);
+        }
+        len += 1;
+        empty = false;
+    }
+    if empty {
+        Err(LexError)
+    } else {
+        Ok((input.advance(len), ()))
+    }
+}
+
+fn op(input: Cursor) -> PResult<Punct> {
+    let input = skip_whitespace(input);
+    match op_char(input) {
+        Ok((rest, '\'')) => {
+            symbol(rest)?;
+            Ok((rest, Punct::new('\'', Spacing::Joint)))
+        }
+        Ok((rest, ch)) => {
+            let kind = match op_char(rest) {
+                Ok(_) => Spacing::Joint,
+                Err(LexError) => Spacing::Alone,
+            };
+            Ok((rest, Punct::new(ch, kind)))
+        }
+        Err(LexError) => Err(LexError),
+    }
+}
+
+fn op_char(input: Cursor) -> PResult<char> {
+    if input.starts_with("//") || input.starts_with("/*") {
+        // Do not accept `/` of a comment as an op.
+        return Err(LexError);
+    }
+
+    let mut chars = input.chars();
+    let first = match chars.next() {
+        Some(ch) => ch,
+        None => {
+            return Err(LexError);
+        }
+    };
+    let recognized = "~!@#$%^&*-=+|;:,<.>/?'";
+    if recognized.contains(first) {
+        Ok((input.advance(first.len_utf8()), first))
+    } else {
+        Err(LexError)
+    }
+}
+
+fn doc_comment(input: Cursor) -> PResult<Vec<TokenTree>> {
+    let mut trees = Vec::new();
+    let (rest, ((comment, inner), span)) = spanned(input, doc_comment_contents)?;
+    trees.push(TokenTree::Punct(Punct::new('#', Spacing::Alone)));
+    if inner {
+        trees.push(Punct::new('!', Spacing::Alone).into());
+    }
+    let mut stream = vec![
+        TokenTree::Ident(crate::Ident::new("doc", span)),
+        TokenTree::Punct(Punct::new('=', Spacing::Alone)),
+        TokenTree::Literal(crate::Literal::string(comment)),
+    ];
+    for tt in stream.iter_mut() {
+        tt.set_span(span);
+    }
+    let group = Group::new(Delimiter::Bracket, stream.into_iter().collect());
+    trees.push(crate::Group::_new_stable(group).into());
+    for tt in trees.iter_mut() {
+        tt.set_span(span);
+    }
+    Ok((rest, trees))
+}
+
+named!(doc_comment_contents -> (&str, bool), alt!(
+    do_parse!(
+        punct!("//!") >>
+        s: take_until_newline_or_eof!() >>
+        ((s, true))
+    )
+    |
+    do_parse!(
+        option!(whitespace) >>
+        peek!(tag!("/*!")) >>
+        s: block_comment >>
+        ((s, true))
+    )
+    |
+    do_parse!(
+        punct!("///") >>
+        not!(tag!("/")) >>
+        s: take_until_newline_or_eof!() >>
+        ((s, false))
+    )
+    |
+    do_parse!(
+        option!(whitespace) >>
+        peek!(tuple!(tag!("/**"), not!(tag!("*")))) >>
+        s: block_comment >>
+        ((s, false))
+    )
+));
+
+
\ No newline at end of file diff --git a/src/proc_macro2/lib.rs.html b/src/proc_macro2/lib.rs.html new file mode 100644 index 0000000..d60a463 --- /dev/null +++ b/src/proc_macro2/lib.rs.html @@ -0,0 +1,2401 @@ +lib.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+
+//! A wrapper around the procedural macro API of the compiler's [`proc_macro`]
+//! crate. This library serves two purposes:
+//!
+//! [`proc_macro`]: https://doc.rust-lang.org/proc_macro/
+//!
+//! - **Bring proc-macro-like functionality to other contexts like build.rs and
+//!   main.rs.** Types from `proc_macro` are entirely specific to procedural
+//!   macros and cannot ever exist in code outside of a procedural macro.
+//!   Meanwhile `proc_macro2` types may exist anywhere including non-macro code.
+//!   By developing foundational libraries like [syn] and [quote] against
+//!   `proc_macro2` rather than `proc_macro`, the procedural macro ecosystem
+//!   becomes easily applicable to many other use cases and we avoid
+//!   reimplementing non-macro equivalents of those libraries.
+//!
+//! - **Make procedural macros unit testable.** As a consequence of being
+//!   specific to procedural macros, nothing that uses `proc_macro` can be
+//!   executed from a unit test. In order for helper libraries or components of
+//!   a macro to be testable in isolation, they must be implemented using
+//!   `proc_macro2`.
+//!
+//! [syn]: https://github.com/dtolnay/syn
+//! [quote]: https://github.com/dtolnay/quote
+//!
+//! # Usage
+//!
+//! The skeleton of a typical procedural macro typically looks like this:
+//!
+//! ```
+//! extern crate proc_macro;
+//!
+//! # const IGNORE: &str = stringify! {
+//! #[proc_macro_derive(MyDerive)]
+//! # };
+//! # #[cfg(wrap_proc_macro)]
+//! pub fn my_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+//!     let input = proc_macro2::TokenStream::from(input);
+//!
+//!     let output: proc_macro2::TokenStream = {
+//!         /* transform input */
+//!         # input
+//!     };
+//!
+//!     proc_macro::TokenStream::from(output)
+//! }
+//! ```
+//!
+//! If parsing with [Syn], you'll use [`parse_macro_input!`] instead to
+//! propagate parse errors correctly back to the compiler when parsing fails.
+//!
+//! [`parse_macro_input!`]: https://docs.rs/syn/1.0/syn/macro.parse_macro_input.html
+//!
+//! # Unstable features
+//!
+//! The default feature set of proc-macro2 tracks the most recent stable
+//! compiler API. Functionality in `proc_macro` that is not yet stable is not
+//! exposed by proc-macro2 by default.
+//!
+//! To opt into the additional APIs available in the most recent nightly
+//! compiler, the `procmacro2_semver_exempt` config flag must be passed to
+//! rustc. We will polyfill those nightly-only APIs back to Rust 1.31.0. As
+//! these are unstable APIs that track the nightly compiler, minor versions of
+//! proc-macro2 may make breaking changes to them at any time.
+//!
+//! ```sh
+//! RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build
+//! ```
+//!
+//! Note that this must not only be done for your crate, but for any crate that
+//! depends on your crate. This infectious nature is intentional, as it serves
+//! as a reminder that you are outside of the normal semver guarantees.
+//!
+//! Semver exempt methods are marked as such in the proc-macro2 documentation.
+//!
+//! # Thread-Safety
+//!
+//! Most types in this crate are `!Sync` because the underlying compiler
+//! types make use of thread-local memory, meaning they cannot be accessed from
+//! a different thread.
+
+// Proc-macro2 types in rustdoc of other crates get linked to here.
+#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.8")]
+#![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))]
+#![cfg_attr(super_unstable, feature(proc_macro_raw_ident, proc_macro_def_site))]
+
+#[cfg(use_proc_macro)]
+extern crate proc_macro;
+
+use std::cmp::Ordering;
+use std::fmt;
+use std::hash::{Hash, Hasher};
+use std::iter::FromIterator;
+use std::marker;
+use std::ops::RangeBounds;
+#[cfg(procmacro2_semver_exempt)]
+use std::path::PathBuf;
+use std::rc::Rc;
+use std::str::FromStr;
+
+#[macro_use]
+mod strnom;
+mod fallback;
+
+#[cfg(not(wrap_proc_macro))]
+use crate::fallback as imp;
+#[path = "wrapper.rs"]
+#[cfg(wrap_proc_macro)]
+mod imp;
+
+/// An abstract stream of tokens, or more concretely a sequence of token trees.
+///
+/// This type provides interfaces for iterating over token trees and for
+/// collecting token trees into one stream.
+///
+/// Token stream is both the input and output of `#[proc_macro]`,
+/// `#[proc_macro_attribute]` and `#[proc_macro_derive]` definitions.
+#[derive(Clone)]
+pub struct TokenStream {
+    inner: imp::TokenStream,
+    _marker: marker::PhantomData<Rc<()>>,
+}
+
+/// Error returned from `TokenStream::from_str`.
+pub struct LexError {
+    inner: imp::LexError,
+    _marker: marker::PhantomData<Rc<()>>,
+}
+
+impl TokenStream {
+    fn _new(inner: imp::TokenStream) -> TokenStream {
+        TokenStream {
+            inner,
+            _marker: marker::PhantomData,
+        }
+    }
+
+    fn _new_stable(inner: fallback::TokenStream) -> TokenStream {
+        TokenStream {
+            inner: inner.into(),
+            _marker: marker::PhantomData,
+        }
+    }
+
+    /// Returns an empty `TokenStream` containing no token trees.
+    pub fn new() -> TokenStream {
+        TokenStream::_new(imp::TokenStream::new())
+    }
+
+    /// Checks if this `TokenStream` is empty.
+    pub fn is_empty(&self) -> bool {
+        self.inner.is_empty()
+    }
+}
+
+/// `TokenStream::default()` returns an empty stream,
+/// i.e. this is equivalent with `TokenStream::new()`.
+impl Default for TokenStream {
+    fn default() -> Self {
+        TokenStream::new()
+    }
+}
+
+/// Attempts to break the string into tokens and parse those tokens into a token
+/// stream.
+///
+/// May fail for a number of reasons, for example, if the string contains
+/// unbalanced delimiters or characters not existing in the language.
+///
+/// NOTE: Some errors may cause panics instead of returning `LexError`. We
+/// reserve the right to change these errors into `LexError`s later.
+impl FromStr for TokenStream {
+    type Err = LexError;
+
+    fn from_str(src: &str) -> Result<TokenStream, LexError> {
+        let e = src.parse().map_err(|e| LexError {
+            inner: e,
+            _marker: marker::PhantomData,
+        })?;
+        Ok(TokenStream::_new(e))
+    }
+}
+
+#[cfg(use_proc_macro)]
+impl From<proc_macro::TokenStream> for TokenStream {
+    fn from(inner: proc_macro::TokenStream) -> TokenStream {
+        TokenStream::_new(inner.into())
+    }
+}
+
+#[cfg(use_proc_macro)]
+impl From<TokenStream> for proc_macro::TokenStream {
+    fn from(inner: TokenStream) -> proc_macro::TokenStream {
+        inner.inner.into()
+    }
+}
+
+impl From<TokenTree> for TokenStream {
+    fn from(token: TokenTree) -> Self {
+        TokenStream::_new(imp::TokenStream::from(token))
+    }
+}
+
+impl Extend<TokenTree> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, streams: I) {
+        self.inner.extend(streams)
+    }
+}
+
+impl Extend<TokenStream> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, streams: I) {
+        self.inner
+            .extend(streams.into_iter().map(|stream| stream.inner))
+    }
+}
+
+/// Collects a number of token trees into a single stream.
+impl FromIterator<TokenTree> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenTree>>(streams: I) -> Self {
+        TokenStream::_new(streams.into_iter().collect())
+    }
+}
+impl FromIterator<TokenStream> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
+        TokenStream::_new(streams.into_iter().map(|i| i.inner).collect())
+    }
+}
+
+/// Prints the token stream as a string that is supposed to be losslessly
+/// convertible back into the same token stream (modulo spans), except for
+/// possibly `TokenTree::Group`s with `Delimiter::None` delimiters and negative
+/// numeric literals.
+impl fmt::Display for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.inner.fmt(f)
+    }
+}
+
+/// Prints token in a form convenient for debugging.
+impl fmt::Debug for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.inner.fmt(f)
+    }
+}
+
+impl fmt::Debug for LexError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.inner.fmt(f)
+    }
+}
+
+/// The source file of a given `Span`.
+///
+/// This type is semver exempt and not exposed by default.
+#[cfg(procmacro2_semver_exempt)]
+#[derive(Clone, PartialEq, Eq)]
+pub struct SourceFile {
+    inner: imp::SourceFile,
+    _marker: marker::PhantomData<Rc<()>>,
+}
+
+#[cfg(procmacro2_semver_exempt)]
+impl SourceFile {
+    fn _new(inner: imp::SourceFile) -> Self {
+        SourceFile {
+            inner,
+            _marker: marker::PhantomData,
+        }
+    }
+
+    /// Get the path to this source file.
+    ///
+    /// ### Note
+    ///
+    /// If the code span associated with this `SourceFile` was generated by an
+    /// external macro, this may not be an actual path on the filesystem. Use
+    /// [`is_real`] to check.
+    ///
+    /// Also note that even if `is_real` returns `true`, if
+    /// `--remap-path-prefix` was passed on the command line, the path as given
+    /// may not actually be valid.
+    ///
+    /// [`is_real`]: #method.is_real
+    pub fn path(&self) -> PathBuf {
+        self.inner.path()
+    }
+
+    /// Returns `true` if this source file is a real source file, and not
+    /// generated by an external macro's expansion.
+    pub fn is_real(&self) -> bool {
+        self.inner.is_real()
+    }
+}
+
+#[cfg(procmacro2_semver_exempt)]
+impl fmt::Debug for SourceFile {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.inner.fmt(f)
+    }
+}
+
+/// A line-column pair representing the start or end of a `Span`.
+///
+/// This type is semver exempt and not exposed by default.
+#[cfg(span_locations)]
+#[derive(Copy, Clone, Debug, PartialEq, Eq)]
+pub struct LineColumn {
+    /// The 1-indexed line in the source file on which the span starts or ends
+    /// (inclusive).
+    pub line: usize,
+    /// The 0-indexed column (in UTF-8 characters) in the source file on which
+    /// the span starts or ends (inclusive).
+    pub column: usize,
+}
+
+/// A region of source code, along with macro expansion information.
+#[derive(Copy, Clone)]
+pub struct Span {
+    inner: imp::Span,
+    _marker: marker::PhantomData<Rc<()>>,
+}
+
+impl Span {
+    fn _new(inner: imp::Span) -> Span {
+        Span {
+            inner,
+            _marker: marker::PhantomData,
+        }
+    }
+
+    fn _new_stable(inner: fallback::Span) -> Span {
+        Span {
+            inner: inner.into(),
+            _marker: marker::PhantomData,
+        }
+    }
+
+    /// The span of the invocation of the current procedural macro.
+    ///
+    /// Identifiers created with this span will be resolved as if they were
+    /// written directly at the macro call location (call-site hygiene) and
+    /// other code at the macro call site will be able to refer to them as well.
+    pub fn call_site() -> Span {
+        Span::_new(imp::Span::call_site())
+    }
+
+    /// A span that resolves at the macro definition site.
+    ///
+    /// This method is semver exempt and not exposed by default.
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn def_site() -> Span {
+        Span::_new(imp::Span::def_site())
+    }
+
+    /// Creates a new span with the same line/column information as `self` but
+    /// that resolves symbols as though it were at `other`.
+    ///
+    /// This method is semver exempt and not exposed by default.
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn resolved_at(&self, other: Span) -> Span {
+        Span::_new(self.inner.resolved_at(other.inner))
+    }
+
+    /// Creates a new span with the same name resolution behavior as `self` but
+    /// with the line/column information of `other`.
+    ///
+    /// This method is semver exempt and not exposed by default.
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn located_at(&self, other: Span) -> Span {
+        Span::_new(self.inner.located_at(other.inner))
+    }
+
+    /// Convert `proc_macro2::Span` to `proc_macro::Span`.
+    ///
+    /// This method is available when building with a nightly compiler, or when
+    /// building with rustc 1.29+ *without* semver exempt features.
+    ///
+    /// # Panics
+    ///
+    /// Panics if called from outside of a procedural macro. Unlike
+    /// `proc_macro2::Span`, the `proc_macro::Span` type can only exist within
+    /// the context of a procedural macro invocation.
+    #[cfg(wrap_proc_macro)]
+    pub fn unwrap(self) -> proc_macro::Span {
+        self.inner.unwrap()
+    }
+
+    // Soft deprecated. Please use Span::unwrap.
+    #[cfg(wrap_proc_macro)]
+    #[doc(hidden)]
+    pub fn unstable(self) -> proc_macro::Span {
+        self.unwrap()
+    }
+
+    /// The original source file into which this span points.
+    ///
+    /// This method is semver exempt and not exposed by default.
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn source_file(&self) -> SourceFile {
+        SourceFile::_new(self.inner.source_file())
+    }
+
+    /// Get the starting line/column in the source file for this span.
+    ///
+    /// This method requires the `"span-locations"` feature to be enabled.
+    #[cfg(span_locations)]
+    pub fn start(&self) -> LineColumn {
+        let imp::LineColumn { line, column } = self.inner.start();
+        LineColumn { line, column }
+    }
+
+    /// Get the ending line/column in the source file for this span.
+    ///
+    /// This method requires the `"span-locations"` feature to be enabled.
+    #[cfg(span_locations)]
+    pub fn end(&self) -> LineColumn {
+        let imp::LineColumn { line, column } = self.inner.end();
+        LineColumn { line, column }
+    }
+
+    /// Create a new span encompassing `self` and `other`.
+    ///
+    /// Returns `None` if `self` and `other` are from different files.
+    ///
+    /// Warning: the underlying [`proc_macro::Span::join`] method is
+    /// nightly-only. When called from within a procedural macro not using a
+    /// nightly compiler, this method will always return `None`.
+    ///
+    /// [`proc_macro::Span::join`]: https://doc.rust-lang.org/proc_macro/struct.Span.html#method.join
+    pub fn join(&self, other: Span) -> Option<Span> {
+        self.inner.join(other.inner).map(Span::_new)
+    }
+
+    /// Compares two spans to see if they're equal.
+    ///
+    /// This method is semver exempt and not exposed by default.
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn eq(&self, other: &Span) -> bool {
+        self.inner.eq(&other.inner)
+    }
+}
+
+/// Prints a span in a form convenient for debugging.
+impl fmt::Debug for Span {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.inner.fmt(f)
+    }
+}
+
+/// A single token or a delimited sequence of token trees (e.g. `[1, (), ..]`).
+#[derive(Clone)]
+pub enum TokenTree {
+    /// A token stream surrounded by bracket delimiters.
+    Group(Group),
+    /// An identifier.
+    Ident(Ident),
+    /// A single punctuation character (`+`, `,`, `$`, etc.).
+    Punct(Punct),
+    /// A literal character (`'a'`), string (`"hello"`), number (`2.3`), etc.
+    Literal(Literal),
+}
+
+impl TokenTree {
+    /// Returns the span of this tree, delegating to the `span` method of
+    /// the contained token or a delimited stream.
+    pub fn span(&self) -> Span {
+        match *self {
+            TokenTree::Group(ref t) => t.span(),
+            TokenTree::Ident(ref t) => t.span(),
+            TokenTree::Punct(ref t) => t.span(),
+            TokenTree::Literal(ref t) => t.span(),
+        }
+    }
+
+    /// Configures the span for *only this token*.
+    ///
+    /// Note that if this token is a `Group` then this method will not configure
+    /// the span of each of the internal tokens, this will simply delegate to
+    /// the `set_span` method of each variant.
+    pub fn set_span(&mut self, span: Span) {
+        match *self {
+            TokenTree::Group(ref mut t) => t.set_span(span),
+            TokenTree::Ident(ref mut t) => t.set_span(span),
+            TokenTree::Punct(ref mut t) => t.set_span(span),
+            TokenTree::Literal(ref mut t) => t.set_span(span),
+        }
+    }
+}
+
+impl From<Group> for TokenTree {
+    fn from(g: Group) -> TokenTree {
+        TokenTree::Group(g)
+    }
+}
+
+impl From<Ident> for TokenTree {
+    fn from(g: Ident) -> TokenTree {
+        TokenTree::Ident(g)
+    }
+}
+
+impl From<Punct> for TokenTree {
+    fn from(g: Punct) -> TokenTree {
+        TokenTree::Punct(g)
+    }
+}
+
+impl From<Literal> for TokenTree {
+    fn from(g: Literal) -> TokenTree {
+        TokenTree::Literal(g)
+    }
+}
+
+/// Prints the token tree as a string that is supposed to be losslessly
+/// convertible back into the same token tree (modulo spans), except for
+/// possibly `TokenTree::Group`s with `Delimiter::None` delimiters and negative
+/// numeric literals.
+impl fmt::Display for TokenTree {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match *self {
+            TokenTree::Group(ref t) => t.fmt(f),
+            TokenTree::Ident(ref t) => t.fmt(f),
+            TokenTree::Punct(ref t) => t.fmt(f),
+            TokenTree::Literal(ref t) => t.fmt(f),
+        }
+    }
+}
+
+/// Prints token tree in a form convenient for debugging.
+impl fmt::Debug for TokenTree {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        // Each of these has the name in the struct type in the derived debug,
+        // so don't bother with an extra layer of indirection
+        match *self {
+            TokenTree::Group(ref t) => t.fmt(f),
+            TokenTree::Ident(ref t) => {
+                let mut debug = f.debug_struct("Ident");
+                debug.field("sym", &format_args!("{}", t));
+                imp::debug_span_field_if_nontrivial(&mut debug, t.span().inner);
+                debug.finish()
+            }
+            TokenTree::Punct(ref t) => t.fmt(f),
+            TokenTree::Literal(ref t) => t.fmt(f),
+        }
+    }
+}
+
+/// A delimited token stream.
+///
+/// A `Group` internally contains a `TokenStream` which is surrounded by
+/// `Delimiter`s.
+#[derive(Clone)]
+pub struct Group {
+    inner: imp::Group,
+}
+
+/// Describes how a sequence of token trees is delimited.
+#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+pub enum Delimiter {
+    /// `( ... )`
+    Parenthesis,
+    /// `{ ... }`
+    Brace,
+    /// `[ ... ]`
+    Bracket,
+    /// `Ø ... Ø`
+    ///
+    /// An implicit delimiter, that may, for example, appear around tokens
+    /// coming from a "macro variable" `$var`. It is important to preserve
+    /// operator priorities in cases like `$var * 3` where `$var` is `1 + 2`.
+    /// Implicit delimiters may not survive roundtrip of a token stream through
+    /// a string.
+    None,
+}
+
+impl Group {
+    fn _new(inner: imp::Group) -> Self {
+        Group { inner }
+    }
+
+    fn _new_stable(inner: fallback::Group) -> Self {
+        Group {
+            inner: inner.into(),
+        }
+    }
+
+    /// Creates a new `Group` with the given delimiter and token stream.
+    ///
+    /// This constructor will set the span for this group to
+    /// `Span::call_site()`. To change the span you can use the `set_span`
+    /// method below.
+    pub fn new(delimiter: Delimiter, stream: TokenStream) -> Group {
+        Group {
+            inner: imp::Group::new(delimiter, stream.inner),
+        }
+    }
+
+    /// Returns the delimiter of this `Group`
+    pub fn delimiter(&self) -> Delimiter {
+        self.inner.delimiter()
+    }
+
+    /// Returns the `TokenStream` of tokens that are delimited in this `Group`.
+    ///
+    /// Note that the returned token stream does not include the delimiter
+    /// returned above.
+    pub fn stream(&self) -> TokenStream {
+        TokenStream::_new(self.inner.stream())
+    }
+
+    /// Returns the span for the delimiters of this token stream, spanning the
+    /// entire `Group`.
+    ///
+    /// ```text
+    /// pub fn span(&self) -> Span {
+    ///            ^^^^^^^
+    /// ```
+    pub fn span(&self) -> Span {
+        Span::_new(self.inner.span())
+    }
+
+    /// Returns the span pointing to the opening delimiter of this group.
+    ///
+    /// ```text
+    /// pub fn span_open(&self) -> Span {
+    ///                 ^
+    /// ```
+    pub fn span_open(&self) -> Span {
+        Span::_new(self.inner.span_open())
+    }
+
+    /// Returns the span pointing to the closing delimiter of this group.
+    ///
+    /// ```text
+    /// pub fn span_close(&self) -> Span {
+    ///                        ^
+    /// ```
+    pub fn span_close(&self) -> Span {
+        Span::_new(self.inner.span_close())
+    }
+
+    /// Configures the span for this `Group`'s delimiters, but not its internal
+    /// tokens.
+    ///
+    /// This method will **not** set the span of all the internal tokens spanned
+    /// by this group, but rather it will only set the span of the delimiter
+    /// tokens at the level of the `Group`.
+    pub fn set_span(&mut self, span: Span) {
+        self.inner.set_span(span.inner)
+    }
+}
+
+/// Prints the group as a string that should be losslessly convertible back
+/// into the same group (modulo spans), except for possibly `TokenTree::Group`s
+/// with `Delimiter::None` delimiters.
+impl fmt::Display for Group {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        fmt::Display::fmt(&self.inner, formatter)
+    }
+}
+
+impl fmt::Debug for Group {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        fmt::Debug::fmt(&self.inner, formatter)
+    }
+}
+
+/// An `Punct` is an single punctuation character like `+`, `-` or `#`.
+///
+/// Multicharacter operators like `+=` are represented as two instances of
+/// `Punct` with different forms of `Spacing` returned.
+#[derive(Clone)]
+pub struct Punct {
+    op: char,
+    spacing: Spacing,
+    span: Span,
+}
+
+/// Whether an `Punct` is followed immediately by another `Punct` or followed by
+/// another token or whitespace.
+#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+pub enum Spacing {
+    /// E.g. `+` is `Alone` in `+ =`, `+ident` or `+()`.
+    Alone,
+    /// E.g. `+` is `Joint` in `+=` or `'` is `Joint` in `'#`.
+    ///
+    /// Additionally, single quote `'` can join with identifiers to form
+    /// lifetimes `'ident`.
+    Joint,
+}
+
+impl Punct {
+    /// Creates a new `Punct` from the given character and spacing.
+    ///
+    /// The `ch` argument must be a valid punctuation character permitted by the
+    /// language, otherwise the function will panic.
+    ///
+    /// The returned `Punct` will have the default span of `Span::call_site()`
+    /// which can be further configured with the `set_span` method below.
+    pub fn new(op: char, spacing: Spacing) -> Punct {
+        Punct {
+            op,
+            spacing,
+            span: Span::call_site(),
+        }
+    }
+
+    /// Returns the value of this punctuation character as `char`.
+    pub fn as_char(&self) -> char {
+        self.op
+    }
+
+    /// Returns the spacing of this punctuation character, indicating whether
+    /// it's immediately followed by another `Punct` in the token stream, so
+    /// they can potentially be combined into a multicharacter operator
+    /// (`Joint`), or it's followed by some other token or whitespace (`Alone`)
+    /// so the operator has certainly ended.
+    pub fn spacing(&self) -> Spacing {
+        self.spacing
+    }
+
+    /// Returns the span for this punctuation character.
+    pub fn span(&self) -> Span {
+        self.span
+    }
+
+    /// Configure the span for this punctuation character.
+    pub fn set_span(&mut self, span: Span) {
+        self.span = span;
+    }
+}
+
+/// Prints the punctuation character as a string that should be losslessly
+/// convertible back into the same character.
+impl fmt::Display for Punct {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.op.fmt(f)
+    }
+}
+
+impl fmt::Debug for Punct {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = fmt.debug_struct("Punct");
+        debug.field("op", &self.op);
+        debug.field("spacing", &self.spacing);
+        imp::debug_span_field_if_nontrivial(&mut debug, self.span.inner);
+        debug.finish()
+    }
+}
+
+/// A word of Rust code, which may be a keyword or legal variable name.
+///
+/// An identifier consists of at least one Unicode code point, the first of
+/// which has the XID_Start property and the rest of which have the XID_Continue
+/// property.
+///
+/// - The empty string is not an identifier. Use `Option<Ident>`.
+/// - A lifetime is not an identifier. Use `syn::Lifetime` instead.
+///
+/// An identifier constructed with `Ident::new` is permitted to be a Rust
+/// keyword, though parsing one through its [`Parse`] implementation rejects
+/// Rust keywords. Use `input.call(Ident::parse_any)` when parsing to match the
+/// behaviour of `Ident::new`.
+///
+/// [`Parse`]: https://docs.rs/syn/1.0/syn/parse/trait.Parse.html
+///
+/// # Examples
+///
+/// A new ident can be created from a string using the `Ident::new` function.
+/// A span must be provided explicitly which governs the name resolution
+/// behavior of the resulting identifier.
+///
+/// ```
+/// use proc_macro2::{Ident, Span};
+///
+/// fn main() {
+///     let call_ident = Ident::new("calligraphy", Span::call_site());
+///
+///     println!("{}", call_ident);
+/// }
+/// ```
+///
+/// An ident can be interpolated into a token stream using the `quote!` macro.
+///
+/// ```
+/// use proc_macro2::{Ident, Span};
+/// use quote::quote;
+///
+/// fn main() {
+///     let ident = Ident::new("demo", Span::call_site());
+///
+///     // Create a variable binding whose name is this ident.
+///     let expanded = quote! { let #ident = 10; };
+///
+///     // Create a variable binding with a slightly different name.
+///     let temp_ident = Ident::new(&format!("new_{}", ident), Span::call_site());
+///     let expanded = quote! { let #temp_ident = 10; };
+/// }
+/// ```
+///
+/// A string representation of the ident is available through the `to_string()`
+/// method.
+///
+/// ```
+/// # use proc_macro2::{Ident, Span};
+/// #
+/// # let ident = Ident::new("another_identifier", Span::call_site());
+/// #
+/// // Examine the ident as a string.
+/// let ident_string = ident.to_string();
+/// if ident_string.len() > 60 {
+///     println!("Very long identifier: {}", ident_string)
+/// }
+/// ```
+#[derive(Clone)]
+pub struct Ident {
+    inner: imp::Ident,
+    _marker: marker::PhantomData<Rc<()>>,
+}
+
+impl Ident {
+    fn _new(inner: imp::Ident) -> Ident {
+        Ident {
+            inner,
+            _marker: marker::PhantomData,
+        }
+    }
+
+    /// Creates a new `Ident` with the given `string` as well as the specified
+    /// `span`.
+    ///
+    /// The `string` argument must be a valid identifier permitted by the
+    /// language, otherwise the function will panic.
+    ///
+    /// Note that `span`, currently in rustc, configures the hygiene information
+    /// for this identifier.
+    ///
+    /// As of this time `Span::call_site()` explicitly opts-in to "call-site"
+    /// hygiene meaning that identifiers created with this span will be resolved
+    /// as if they were written directly at the location of the macro call, and
+    /// other code at the macro call site will be able to refer to them as well.
+    ///
+    /// Later spans like `Span::def_site()` will allow to opt-in to
+    /// "definition-site" hygiene meaning that identifiers created with this
+    /// span will be resolved at the location of the macro definition and other
+    /// code at the macro call site will not be able to refer to them.
+    ///
+    /// Due to the current importance of hygiene this constructor, unlike other
+    /// tokens, requires a `Span` to be specified at construction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the input string is neither a keyword nor a legal variable
+    /// name. If you are not sure whether the string contains an identifier and
+    /// need to handle an error case, use
+    /// <a href="https://docs.rs/syn/1.0/syn/fn.parse_str.html"><code
+    ///   style="padding-right:0;">syn::parse_str</code></a><code
+    ///   style="padding-left:0;">::&lt;Ident&gt;</code>
+    /// rather than `Ident::new`.
+    pub fn new(string: &str, span: Span) -> Ident {
+        Ident::_new(imp::Ident::new(string, span.inner))
+    }
+
+    /// Same as `Ident::new`, but creates a raw identifier (`r#ident`).
+    ///
+    /// This method is semver exempt and not exposed by default.
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn new_raw(string: &str, span: Span) -> Ident {
+        Ident::_new_raw(string, span)
+    }
+
+    fn _new_raw(string: &str, span: Span) -> Ident {
+        Ident::_new(imp::Ident::new_raw(string, span.inner))
+    }
+
+    /// Returns the span of this `Ident`.
+    pub fn span(&self) -> Span {
+        Span::_new(self.inner.span())
+    }
+
+    /// Configures the span of this `Ident`, possibly changing its hygiene
+    /// context.
+    pub fn set_span(&mut self, span: Span) {
+        self.inner.set_span(span.inner);
+    }
+}
+
+impl PartialEq for Ident {
+    fn eq(&self, other: &Ident) -> bool {
+        self.inner == other.inner
+    }
+}
+
+impl<T> PartialEq<T> for Ident
+where
+    T: ?Sized + AsRef<str>,
+{
+    fn eq(&self, other: &T) -> bool {
+        self.inner == other
+    }
+}
+
+impl Eq for Ident {}
+
+impl PartialOrd for Ident {
+    fn partial_cmp(&self, other: &Ident) -> Option<Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+impl Ord for Ident {
+    fn cmp(&self, other: &Ident) -> Ordering {
+        self.to_string().cmp(&other.to_string())
+    }
+}
+
+impl Hash for Ident {
+    fn hash<H: Hasher>(&self, hasher: &mut H) {
+        self.to_string().hash(hasher)
+    }
+}
+
+/// Prints the identifier as a string that should be losslessly convertible back
+/// into the same identifier.
+impl fmt::Display for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.inner.fmt(f)
+    }
+}
+
+impl fmt::Debug for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.inner.fmt(f)
+    }
+}
+
+/// A literal string (`"hello"`), byte string (`b"hello"`), character (`'a'`),
+/// byte character (`b'a'`), an integer or floating point number with or without
+/// a suffix (`1`, `1u8`, `2.3`, `2.3f32`).
+///
+/// Boolean literals like `true` and `false` do not belong here, they are
+/// `Ident`s.
+#[derive(Clone)]
+pub struct Literal {
+    inner: imp::Literal,
+    _marker: marker::PhantomData<Rc<()>>,
+}
+
+macro_rules! suffixed_int_literals {
+    ($($name:ident => $kind:ident,)*) => ($(
+        /// Creates a new suffixed integer literal with the specified value.
+        ///
+        /// This function will create an integer like `1u32` where the integer
+        /// value specified is the first part of the token and the integral is
+        /// also suffixed at the end. Literals created from negative numbers may
+        /// not survive rountrips through `TokenStream` or strings and may be
+        /// broken into two tokens (`-` and positive literal).
+        ///
+        /// Literals created through this method have the `Span::call_site()`
+        /// span by default, which can be configured with the `set_span` method
+        /// below.
+        pub fn $name(n: $kind) -> Literal {
+            Literal::_new(imp::Literal::$name(n))
+        }
+    )*)
+}
+
+macro_rules! unsuffixed_int_literals {
+    ($($name:ident => $kind:ident,)*) => ($(
+        /// Creates a new unsuffixed integer literal with the specified value.
+        ///
+        /// This function will create an integer like `1` where the integer
+        /// value specified is the first part of the token. No suffix is
+        /// specified on this token, meaning that invocations like
+        /// `Literal::i8_unsuffixed(1)` are equivalent to
+        /// `Literal::u32_unsuffixed(1)`. Literals created from negative numbers
+        /// may not survive rountrips through `TokenStream` or strings and may
+        /// be broken into two tokens (`-` and positive literal).
+        ///
+        /// Literals created through this method have the `Span::call_site()`
+        /// span by default, which can be configured with the `set_span` method
+        /// below.
+        pub fn $name(n: $kind) -> Literal {
+            Literal::_new(imp::Literal::$name(n))
+        }
+    )*)
+}
+
+impl Literal {
+    fn _new(inner: imp::Literal) -> Literal {
+        Literal {
+            inner,
+            _marker: marker::PhantomData,
+        }
+    }
+
+    fn _new_stable(inner: fallback::Literal) -> Literal {
+        Literal {
+            inner: inner.into(),
+            _marker: marker::PhantomData,
+        }
+    }
+
+    suffixed_int_literals! {
+        u8_suffixed => u8,
+        u16_suffixed => u16,
+        u32_suffixed => u32,
+        u64_suffixed => u64,
+        u128_suffixed => u128,
+        usize_suffixed => usize,
+        i8_suffixed => i8,
+        i16_suffixed => i16,
+        i32_suffixed => i32,
+        i64_suffixed => i64,
+        i128_suffixed => i128,
+        isize_suffixed => isize,
+    }
+
+    unsuffixed_int_literals! {
+        u8_unsuffixed => u8,
+        u16_unsuffixed => u16,
+        u32_unsuffixed => u32,
+        u64_unsuffixed => u64,
+        u128_unsuffixed => u128,
+        usize_unsuffixed => usize,
+        i8_unsuffixed => i8,
+        i16_unsuffixed => i16,
+        i32_unsuffixed => i32,
+        i64_unsuffixed => i64,
+        i128_unsuffixed => i128,
+        isize_unsuffixed => isize,
+    }
+
+    /// Creates a new unsuffixed floating-point literal.
+    ///
+    /// This constructor is similar to those like `Literal::i8_unsuffixed` where
+    /// the float's value is emitted directly into the token but no suffix is
+    /// used, so it may be inferred to be a `f64` later in the compiler.
+    /// Literals created from negative numbers may not survive rountrips through
+    /// `TokenStream` or strings and may be broken into two tokens (`-` and
+    /// positive literal).
+    ///
+    /// # Panics
+    ///
+    /// This function requires that the specified float is finite, for example
+    /// if it is infinity or NaN this function will panic.
+    pub fn f64_unsuffixed(f: f64) -> Literal {
+        assert!(f.is_finite());
+        Literal::_new(imp::Literal::f64_unsuffixed(f))
+    }
+
+    /// Creates a new suffixed floating-point literal.
+    ///
+    /// This constructor will create a literal like `1.0f64` where the value
+    /// specified is the preceding part of the token and `f64` is the suffix of
+    /// the token. This token will always be inferred to be an `f64` in the
+    /// compiler. Literals created from negative numbers may not survive
+    /// rountrips through `TokenStream` or strings and may be broken into two
+    /// tokens (`-` and positive literal).
+    ///
+    /// # Panics
+    ///
+    /// This function requires that the specified float is finite, for example
+    /// if it is infinity or NaN this function will panic.
+    pub fn f64_suffixed(f: f64) -> Literal {
+        assert!(f.is_finite());
+        Literal::_new(imp::Literal::f64_suffixed(f))
+    }
+
+    /// Creates a new unsuffixed floating-point literal.
+    ///
+    /// This constructor is similar to those like `Literal::i8_unsuffixed` where
+    /// the float's value is emitted directly into the token but no suffix is
+    /// used, so it may be inferred to be a `f64` later in the compiler.
+    /// Literals created from negative numbers may not survive rountrips through
+    /// `TokenStream` or strings and may be broken into two tokens (`-` and
+    /// positive literal).
+    ///
+    /// # Panics
+    ///
+    /// This function requires that the specified float is finite, for example
+    /// if it is infinity or NaN this function will panic.
+    pub fn f32_unsuffixed(f: f32) -> Literal {
+        assert!(f.is_finite());
+        Literal::_new(imp::Literal::f32_unsuffixed(f))
+    }
+
+    /// Creates a new suffixed floating-point literal.
+    ///
+    /// This constructor will create a literal like `1.0f32` where the value
+    /// specified is the preceding part of the token and `f32` is the suffix of
+    /// the token. This token will always be inferred to be an `f32` in the
+    /// compiler. Literals created from negative numbers may not survive
+    /// rountrips through `TokenStream` or strings and may be broken into two
+    /// tokens (`-` and positive literal).
+    ///
+    /// # Panics
+    ///
+    /// This function requires that the specified float is finite, for example
+    /// if it is infinity or NaN this function will panic.
+    pub fn f32_suffixed(f: f32) -> Literal {
+        assert!(f.is_finite());
+        Literal::_new(imp::Literal::f32_suffixed(f))
+    }
+
+    /// String literal.
+    pub fn string(string: &str) -> Literal {
+        Literal::_new(imp::Literal::string(string))
+    }
+
+    /// Character literal.
+    pub fn character(ch: char) -> Literal {
+        Literal::_new(imp::Literal::character(ch))
+    }
+
+    /// Byte string literal.
+    pub fn byte_string(s: &[u8]) -> Literal {
+        Literal::_new(imp::Literal::byte_string(s))
+    }
+
+    /// Returns the span encompassing this literal.
+    pub fn span(&self) -> Span {
+        Span::_new(self.inner.span())
+    }
+
+    /// Configures the span associated for this literal.
+    pub fn set_span(&mut self, span: Span) {
+        self.inner.set_span(span.inner);
+    }
+
+    /// Returns a `Span` that is a subset of `self.span()` containing only
+    /// the source bytes in range `range`. Returns `None` if the would-be
+    /// trimmed span is outside the bounds of `self`.
+    ///
+    /// Warning: the underlying [`proc_macro::Literal::subspan`] method is
+    /// nightly-only. When called from within a procedural macro not using a
+    /// nightly compiler, this method will always return `None`.
+    ///
+    /// [`proc_macro::Literal::subspan`]: https://doc.rust-lang.org/proc_macro/struct.Literal.html#method.subspan
+    pub fn subspan<R: RangeBounds<usize>>(&self, range: R) -> Option<Span> {
+        self.inner.subspan(range).map(Span::_new)
+    }
+}
+
+impl fmt::Debug for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.inner.fmt(f)
+    }
+}
+
+impl fmt::Display for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.inner.fmt(f)
+    }
+}
+
+/// Public implementation details for the `TokenStream` type, such as iterators.
+pub mod token_stream {
+    use std::fmt;
+    use std::marker;
+    use std::rc::Rc;
+
+    pub use crate::TokenStream;
+    use crate::{imp, TokenTree};
+
+    /// An iterator over `TokenStream`'s `TokenTree`s.
+    ///
+    /// The iteration is "shallow", e.g. the iterator doesn't recurse into
+    /// delimited groups, and returns whole groups as token trees.
+    #[derive(Clone)]
+    pub struct IntoIter {
+        inner: imp::TokenTreeIter,
+        _marker: marker::PhantomData<Rc<()>>,
+    }
+
+    impl Iterator for IntoIter {
+        type Item = TokenTree;
+
+        fn next(&mut self) -> Option<TokenTree> {
+            self.inner.next()
+        }
+    }
+
+    impl fmt::Debug for IntoIter {
+        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+            self.inner.fmt(f)
+        }
+    }
+
+    impl IntoIterator for TokenStream {
+        type Item = TokenTree;
+        type IntoIter = IntoIter;
+
+        fn into_iter(self) -> IntoIter {
+            IntoIter {
+                inner: self.inner.into_iter(),
+                _marker: marker::PhantomData,
+            }
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/proc_macro2/strnom.rs.html b/src/proc_macro2/strnom.rs.html new file mode 100644 index 0000000..87f1ccf --- /dev/null +++ b/src/proc_macro2/strnom.rs.html @@ -0,0 +1,785 @@ +strnom.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+
+//! Adapted from [`nom`](https://github.com/Geal/nom).
+
+use crate::fallback::LexError;
+use std::str::{Bytes, CharIndices, Chars};
+use unicode_xid::UnicodeXID;
+
+#[derive(Copy, Clone, Eq, PartialEq)]
+pub struct Cursor<'a> {
+    pub rest: &'a str,
+    #[cfg(span_locations)]
+    pub off: u32,
+}
+
+impl<'a> Cursor<'a> {
+    #[cfg(not(span_locations))]
+    pub fn advance(&self, amt: usize) -> Cursor<'a> {
+        Cursor {
+            rest: &self.rest[amt..],
+        }
+    }
+    #[cfg(span_locations)]
+    pub fn advance(&self, amt: usize) -> Cursor<'a> {
+        Cursor {
+            rest: &self.rest[amt..],
+            off: self.off + (amt as u32),
+        }
+    }
+
+    pub fn find(&self, p: char) -> Option<usize> {
+        self.rest.find(p)
+    }
+
+    pub fn starts_with(&self, s: &str) -> bool {
+        self.rest.starts_with(s)
+    }
+
+    pub fn is_empty(&self) -> bool {
+        self.rest.is_empty()
+    }
+
+    pub fn len(&self) -> usize {
+        self.rest.len()
+    }
+
+    pub fn as_bytes(&self) -> &'a [u8] {
+        self.rest.as_bytes()
+    }
+
+    pub fn bytes(&self) -> Bytes<'a> {
+        self.rest.bytes()
+    }
+
+    pub fn chars(&self) -> Chars<'a> {
+        self.rest.chars()
+    }
+
+    pub fn char_indices(&self) -> CharIndices<'a> {
+        self.rest.char_indices()
+    }
+}
+
+pub type PResult<'a, O> = Result<(Cursor<'a>, O), LexError>;
+
+pub fn whitespace(input: Cursor) -> PResult<()> {
+    if input.is_empty() {
+        return Err(LexError);
+    }
+
+    let bytes = input.as_bytes();
+    let mut i = 0;
+    while i < bytes.len() {
+        let s = input.advance(i);
+        if bytes[i] == b'/' {
+            if s.starts_with("//")
+                && (!s.starts_with("///") || s.starts_with("////"))
+                && !s.starts_with("//!")
+            {
+                if let Some(len) = s.find('\n') {
+                    i += len + 1;
+                    continue;
+                }
+                break;
+            } else if s.starts_with("/**/") {
+                i += 4;
+                continue;
+            } else if s.starts_with("/*")
+                && (!s.starts_with("/**") || s.starts_with("/***"))
+                && !s.starts_with("/*!")
+            {
+                let (_, com) = block_comment(s)?;
+                i += com.len();
+                continue;
+            }
+        }
+        match bytes[i] {
+            b' ' | 0x09..=0x0d => {
+                i += 1;
+                continue;
+            }
+            b if b <= 0x7f => {}
+            _ => {
+                let ch = s.chars().next().unwrap();
+                if is_whitespace(ch) {
+                    i += ch.len_utf8();
+                    continue;
+                }
+            }
+        }
+        return if i > 0 { Ok((s, ())) } else { Err(LexError) };
+    }
+    Ok((input.advance(input.len()), ()))
+}
+
+pub fn block_comment(input: Cursor) -> PResult<&str> {
+    if !input.starts_with("/*") {
+        return Err(LexError);
+    }
+
+    let mut depth = 0;
+    let bytes = input.as_bytes();
+    let mut i = 0;
+    let upper = bytes.len() - 1;
+    while i < upper {
+        if bytes[i] == b'/' && bytes[i + 1] == b'*' {
+            depth += 1;
+            i += 1; // eat '*'
+        } else if bytes[i] == b'*' && bytes[i + 1] == b'/' {
+            depth -= 1;
+            if depth == 0 {
+                return Ok((input.advance(i + 2), &input.rest[..i + 2]));
+            }
+            i += 1; // eat '/'
+        }
+        i += 1;
+    }
+    Err(LexError)
+}
+
+pub fn skip_whitespace(input: Cursor) -> Cursor {
+    match whitespace(input) {
+        Ok((rest, _)) => rest,
+        Err(LexError) => input,
+    }
+}
+
+fn is_whitespace(ch: char) -> bool {
+    // Rust treats left-to-right mark and right-to-left mark as whitespace
+    ch.is_whitespace() || ch == '\u{200e}' || ch == '\u{200f}'
+}
+
+pub fn word_break(input: Cursor) -> PResult<()> {
+    match input.chars().next() {
+        Some(ch) if UnicodeXID::is_xid_continue(ch) => Err(LexError),
+        Some(_) | None => Ok((input, ())),
+    }
+}
+
+macro_rules! named {
+    ($name:ident -> $o:ty, $submac:ident!( $($args:tt)* )) => {
+        fn $name<'a>(i: Cursor<'a>) -> $crate::strnom::PResult<'a, $o> {
+            $submac!(i, $($args)*)
+        }
+    };
+}
+
+macro_rules! alt {
+    ($i:expr, $e:ident | $($rest:tt)*) => {
+        alt!($i, call!($e) | $($rest)*)
+    };
+
+    ($i:expr, $subrule:ident!( $($args:tt)*) | $($rest:tt)*) => {
+        match $subrule!($i, $($args)*) {
+            res @ Ok(_) => res,
+            _ => alt!($i, $($rest)*)
+        }
+    };
+
+    ($i:expr, $subrule:ident!( $($args:tt)* ) => { $gen:expr } | $($rest:tt)+) => {
+        match $subrule!($i, $($args)*) {
+            Ok((i, o)) => Ok((i, $gen(o))),
+            Err(LexError) => alt!($i, $($rest)*)
+        }
+    };
+
+    ($i:expr, $e:ident => { $gen:expr } | $($rest:tt)*) => {
+        alt!($i, call!($e) => { $gen } | $($rest)*)
+    };
+
+    ($i:expr, $e:ident => { $gen:expr }) => {
+        alt!($i, call!($e) => { $gen })
+    };
+
+    ($i:expr, $subrule:ident!( $($args:tt)* ) => { $gen:expr }) => {
+        match $subrule!($i, $($args)*) {
+            Ok((i, o)) => Ok((i, $gen(o))),
+            Err(LexError) => Err(LexError),
+        }
+    };
+
+    ($i:expr, $e:ident) => {
+        alt!($i, call!($e))
+    };
+
+    ($i:expr, $subrule:ident!( $($args:tt)*)) => {
+        $subrule!($i, $($args)*)
+    };
+}
+
+macro_rules! do_parse {
+    ($i:expr, ( $($rest:expr),* )) => {
+        Ok(($i, ( $($rest),* )))
+    };
+
+    ($i:expr, $e:ident >> $($rest:tt)*) => {
+        do_parse!($i, call!($e) >> $($rest)*)
+    };
+
+    ($i:expr, $submac:ident!( $($args:tt)* ) >> $($rest:tt)*) => {
+        match $submac!($i, $($args)*) {
+            Err(LexError) => Err(LexError),
+            Ok((i, _)) => do_parse!(i, $($rest)*),
+        }
+    };
+
+    ($i:expr, $field:ident : $e:ident >> $($rest:tt)*) => {
+        do_parse!($i, $field: call!($e) >> $($rest)*)
+    };
+
+    ($i:expr, $field:ident : $submac:ident!( $($args:tt)* ) >> $($rest:tt)*) => {
+        match $submac!($i, $($args)*) {
+            Err(LexError) => Err(LexError),
+            Ok((i, o)) => {
+                let $field = o;
+                do_parse!(i, $($rest)*)
+            },
+        }
+    };
+}
+
+macro_rules! peek {
+    ($i:expr, $submac:ident!( $($args:tt)* )) => {
+        match $submac!($i, $($args)*) {
+            Ok((_, o)) => Ok(($i, o)),
+            Err(LexError) => Err(LexError),
+        }
+    };
+}
+
+macro_rules! call {
+    ($i:expr, $fun:expr $(, $args:expr)*) => {
+        $fun($i $(, $args)*)
+    };
+}
+
+macro_rules! option {
+    ($i:expr, $f:expr) => {
+        match $f($i) {
+            Ok((i, o)) => Ok((i, Some(o))),
+            Err(LexError) => Ok(($i, None)),
+        }
+    };
+}
+
+macro_rules! take_until_newline_or_eof {
+    ($i:expr,) => {{
+        if $i.len() == 0 {
+            Ok(($i, ""))
+        } else {
+            match $i.find('\n') {
+                Some(i) => Ok(($i.advance(i), &$i.rest[..i])),
+                None => Ok(($i.advance($i.len()), &$i.rest[..$i.len()])),
+            }
+        }
+    }};
+}
+
+macro_rules! tuple {
+    ($i:expr, $($rest:tt)*) => {
+        tuple_parser!($i, (), $($rest)*)
+    };
+}
+
+/// Do not use directly. Use `tuple!`.
+macro_rules! tuple_parser {
+    ($i:expr, ($($parsed:tt),*), $e:ident, $($rest:tt)*) => {
+        tuple_parser!($i, ($($parsed),*), call!($e), $($rest)*)
+    };
+
+    ($i:expr, (), $submac:ident!( $($args:tt)* ), $($rest:tt)*) => {
+        match $submac!($i, $($args)*) {
+            Err(LexError) => Err(LexError),
+            Ok((i, o)) => tuple_parser!(i, (o), $($rest)*),
+        }
+    };
+
+    ($i:expr, ($($parsed:tt)*), $submac:ident!( $($args:tt)* ), $($rest:tt)*) => {
+        match $submac!($i, $($args)*) {
+            Err(LexError) => Err(LexError),
+            Ok((i, o)) => tuple_parser!(i, ($($parsed)* , o), $($rest)*),
+        }
+    };
+
+    ($i:expr, ($($parsed:tt),*), $e:ident) => {
+        tuple_parser!($i, ($($parsed),*), call!($e))
+    };
+
+    ($i:expr, (), $submac:ident!( $($args:tt)* )) => {
+        $submac!($i, $($args)*)
+    };
+
+    ($i:expr, ($($parsed:expr),*), $submac:ident!( $($args:tt)* )) => {
+        match $submac!($i, $($args)*) {
+            Err(LexError) => Err(LexError),
+            Ok((i, o)) => Ok((i, ($($parsed),*, o)))
+        }
+    };
+
+    ($i:expr, ($($parsed:expr),*)) => {
+        Ok(($i, ($($parsed),*)))
+    };
+}
+
+macro_rules! not {
+    ($i:expr, $submac:ident!( $($args:tt)* )) => {
+        match $submac!($i, $($args)*) {
+            Ok((_, _)) => Err(LexError),
+            Err(LexError) => Ok(($i, ())),
+        }
+    };
+}
+
+macro_rules! tag {
+    ($i:expr, $tag:expr) => {
+        if $i.starts_with($tag) {
+            Ok(($i.advance($tag.len()), &$i.rest[..$tag.len()]))
+        } else {
+            Err(LexError)
+        }
+    };
+}
+
+macro_rules! punct {
+    ($i:expr, $punct:expr) => {
+        $crate::strnom::punct($i, $punct)
+    };
+}
+
+/// Do not use directly. Use `punct!`.
+pub fn punct<'a>(input: Cursor<'a>, token: &'static str) -> PResult<'a, &'a str> {
+    let input = skip_whitespace(input);
+    if input.starts_with(token) {
+        Ok((input.advance(token.len()), token))
+    } else {
+        Err(LexError)
+    }
+}
+
+macro_rules! preceded {
+    ($i:expr, $submac:ident!( $($args:tt)* ), $submac2:ident!( $($args2:tt)* )) => {
+        match tuple!($i, $submac!($($args)*), $submac2!($($args2)*)) {
+            Ok((remaining, (_, o))) => Ok((remaining, o)),
+            Err(LexError) => Err(LexError),
+        }
+    };
+
+    ($i:expr, $submac:ident!( $($args:tt)* ), $g:expr) => {
+        preceded!($i, $submac!($($args)*), call!($g))
+    };
+}
+
+macro_rules! delimited {
+    ($i:expr, $submac:ident!( $($args:tt)* ), $($rest:tt)+) => {
+        match tuple_parser!($i, (), $submac!($($args)*), $($rest)*) {
+            Err(LexError) => Err(LexError),
+            Ok((i1, (_, o, _))) => Ok((i1, o))
+        }
+    };
+}
+
+macro_rules! map {
+    ($i:expr, $submac:ident!( $($args:tt)* ), $g:expr) => {
+        match $submac!($i, $($args)*) {
+            Err(LexError) => Err(LexError),
+            Ok((i, o)) => Ok((i, call!(o, $g)))
+        }
+    };
+
+    ($i:expr, $f:expr, $g:expr) => {
+        map!($i, call!($f), $g)
+    };
+}
+
+
\ No newline at end of file diff --git a/src/proc_macro2/wrapper.rs.html b/src/proc_macro2/wrapper.rs.html new file mode 100644 index 0000000..32e32bf --- /dev/null +++ b/src/proc_macro2/wrapper.rs.html @@ -0,0 +1,1869 @@ +wrapper.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+
+use std::fmt;
+use std::iter;
+use std::ops::RangeBounds;
+use std::panic::{self, PanicInfo};
+#[cfg(super_unstable)]
+use std::path::PathBuf;
+use std::str::FromStr;
+
+use crate::{fallback, Delimiter, Punct, Spacing, TokenTree};
+
+#[derive(Clone)]
+pub enum TokenStream {
+    Compiler(DeferredTokenStream),
+    Fallback(fallback::TokenStream),
+}
+
+// Work around https://github.com/rust-lang/rust/issues/65080.
+// In `impl Extend<TokenTree> for TokenStream` which is used heavily by quote,
+// we hold on to the appended tokens and do proc_macro::TokenStream::extend as
+// late as possible to batch together consecutive uses of the Extend impl.
+#[derive(Clone)]
+pub struct DeferredTokenStream {
+    stream: proc_macro::TokenStream,
+    extra: Vec<proc_macro::TokenTree>,
+}
+
+pub enum LexError {
+    Compiler(proc_macro::LexError),
+    Fallback(fallback::LexError),
+}
+
+fn nightly_works() -> bool {
+    use std::sync::atomic::*;
+    use std::sync::Once;
+
+    static WORKS: AtomicUsize = AtomicUsize::new(0);
+    static INIT: Once = Once::new();
+
+    match WORKS.load(Ordering::SeqCst) {
+        1 => return false,
+        2 => return true,
+        _ => {}
+    }
+
+    // Swap in a null panic hook to avoid printing "thread panicked" to stderr,
+    // then use catch_unwind to determine whether the compiler's proc_macro is
+    // working. When proc-macro2 is used from outside of a procedural macro all
+    // of the proc_macro crate's APIs currently panic.
+    //
+    // The Once is to prevent the possibility of this ordering:
+    //
+    //     thread 1 calls take_hook, gets the user's original hook
+    //     thread 1 calls set_hook with the null hook
+    //     thread 2 calls take_hook, thinks null hook is the original hook
+    //     thread 2 calls set_hook with the null hook
+    //     thread 1 calls set_hook with the actual original hook
+    //     thread 2 calls set_hook with what it thinks is the original hook
+    //
+    // in which the user's hook has been lost.
+    //
+    // There is still a race condition where a panic in a different thread can
+    // happen during the interval that the user's original panic hook is
+    // unregistered such that their hook is incorrectly not called. This is
+    // sufficiently unlikely and less bad than printing panic messages to stderr
+    // on correct use of this crate. Maybe there is a libstd feature request
+    // here. For now, if a user needs to guarantee that this failure mode does
+    // not occur, they need to call e.g. `proc_macro2::Span::call_site()` from
+    // the main thread before launching any other threads.
+    INIT.call_once(|| {
+        type PanicHook = dyn Fn(&PanicInfo) + Sync + Send + 'static;
+
+        let null_hook: Box<PanicHook> = Box::new(|_panic_info| { /* ignore */ });
+        let sanity_check = &*null_hook as *const PanicHook;
+        let original_hook = panic::take_hook();
+        panic::set_hook(null_hook);
+
+        let works = panic::catch_unwind(|| proc_macro::Span::call_site()).is_ok();
+        WORKS.store(works as usize + 1, Ordering::SeqCst);
+
+        let hopefully_null_hook = panic::take_hook();
+        panic::set_hook(original_hook);
+        if sanity_check != &*hopefully_null_hook {
+            panic!("observed race condition in proc_macro2::nightly_works");
+        }
+    });
+    nightly_works()
+}
+
+fn mismatch() -> ! {
+    panic!("stable/nightly mismatch")
+}
+
+impl DeferredTokenStream {
+    fn new(stream: proc_macro::TokenStream) -> Self {
+        DeferredTokenStream {
+            stream,
+            extra: Vec::new(),
+        }
+    }
+
+    fn is_empty(&self) -> bool {
+        self.stream.is_empty() && self.extra.is_empty()
+    }
+
+    fn evaluate_now(&mut self) {
+        self.stream.extend(self.extra.drain(..));
+    }
+
+    fn into_token_stream(mut self) -> proc_macro::TokenStream {
+        self.evaluate_now();
+        self.stream
+    }
+}
+
+impl TokenStream {
+    pub fn new() -> TokenStream {
+        if nightly_works() {
+            TokenStream::Compiler(DeferredTokenStream::new(proc_macro::TokenStream::new()))
+        } else {
+            TokenStream::Fallback(fallback::TokenStream::new())
+        }
+    }
+
+    pub fn is_empty(&self) -> bool {
+        match self {
+            TokenStream::Compiler(tts) => tts.is_empty(),
+            TokenStream::Fallback(tts) => tts.is_empty(),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::TokenStream {
+        match self {
+            TokenStream::Compiler(s) => s.into_token_stream(),
+            TokenStream::Fallback(_) => mismatch(),
+        }
+    }
+
+    fn unwrap_stable(self) -> fallback::TokenStream {
+        match self {
+            TokenStream::Compiler(_) => mismatch(),
+            TokenStream::Fallback(s) => s,
+        }
+    }
+}
+
+impl FromStr for TokenStream {
+    type Err = LexError;
+
+    fn from_str(src: &str) -> Result<TokenStream, LexError> {
+        if nightly_works() {
+            Ok(TokenStream::Compiler(DeferredTokenStream::new(
+                proc_macro_parse(src)?,
+            )))
+        } else {
+            Ok(TokenStream::Fallback(src.parse()?))
+        }
+    }
+}
+
+// Work around https://github.com/rust-lang/rust/issues/58736.
+fn proc_macro_parse(src: &str) -> Result<proc_macro::TokenStream, LexError> {
+    panic::catch_unwind(|| src.parse().map_err(LexError::Compiler))
+        .unwrap_or(Err(LexError::Fallback(fallback::LexError)))
+}
+
+impl fmt::Display for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            TokenStream::Compiler(tts) => tts.clone().into_token_stream().fmt(f),
+            TokenStream::Fallback(tts) => tts.fmt(f),
+        }
+    }
+}
+
+impl From<proc_macro::TokenStream> for TokenStream {
+    fn from(inner: proc_macro::TokenStream) -> TokenStream {
+        TokenStream::Compiler(DeferredTokenStream::new(inner))
+    }
+}
+
+impl From<TokenStream> for proc_macro::TokenStream {
+    fn from(inner: TokenStream) -> proc_macro::TokenStream {
+        match inner {
+            TokenStream::Compiler(inner) => inner.into_token_stream(),
+            TokenStream::Fallback(inner) => inner.to_string().parse().unwrap(),
+        }
+    }
+}
+
+impl From<fallback::TokenStream> for TokenStream {
+    fn from(inner: fallback::TokenStream) -> TokenStream {
+        TokenStream::Fallback(inner)
+    }
+}
+
+// Assumes nightly_works().
+fn into_compiler_token(token: TokenTree) -> proc_macro::TokenTree {
+    match token {
+        TokenTree::Group(tt) => tt.inner.unwrap_nightly().into(),
+        TokenTree::Punct(tt) => {
+            let spacing = match tt.spacing() {
+                Spacing::Joint => proc_macro::Spacing::Joint,
+                Spacing::Alone => proc_macro::Spacing::Alone,
+            };
+            let mut op = proc_macro::Punct::new(tt.as_char(), spacing);
+            op.set_span(tt.span().inner.unwrap_nightly());
+            op.into()
+        }
+        TokenTree::Ident(tt) => tt.inner.unwrap_nightly().into(),
+        TokenTree::Literal(tt) => tt.inner.unwrap_nightly().into(),
+    }
+}
+
+impl From<TokenTree> for TokenStream {
+    fn from(token: TokenTree) -> TokenStream {
+        if nightly_works() {
+            TokenStream::Compiler(DeferredTokenStream::new(into_compiler_token(token).into()))
+        } else {
+            TokenStream::Fallback(token.into())
+        }
+    }
+}
+
+impl iter::FromIterator<TokenTree> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self {
+        if nightly_works() {
+            TokenStream::Compiler(DeferredTokenStream::new(
+                trees.into_iter().map(into_compiler_token).collect(),
+            ))
+        } else {
+            TokenStream::Fallback(trees.into_iter().collect())
+        }
+    }
+}
+
+impl iter::FromIterator<TokenStream> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
+        let mut streams = streams.into_iter();
+        match streams.next() {
+            Some(TokenStream::Compiler(mut first)) => {
+                first.evaluate_now();
+                first.stream.extend(streams.map(|s| match s {
+                    TokenStream::Compiler(s) => s.into_token_stream(),
+                    TokenStream::Fallback(_) => mismatch(),
+                }));
+                TokenStream::Compiler(first)
+            }
+            Some(TokenStream::Fallback(mut first)) => {
+                first.extend(streams.map(|s| match s {
+                    TokenStream::Fallback(s) => s,
+                    TokenStream::Compiler(_) => mismatch(),
+                }));
+                TokenStream::Fallback(first)
+            }
+            None => TokenStream::new(),
+        }
+    }
+}
+
+impl Extend<TokenTree> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, streams: I) {
+        match self {
+            TokenStream::Compiler(tts) => {
+                // Here is the reason for DeferredTokenStream.
+                tts.extra
+                    .extend(streams.into_iter().map(into_compiler_token));
+            }
+            TokenStream::Fallback(tts) => tts.extend(streams),
+        }
+    }
+}
+
+impl Extend<TokenStream> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, streams: I) {
+        match self {
+            TokenStream::Compiler(tts) => {
+                tts.evaluate_now();
+                tts.stream
+                    .extend(streams.into_iter().map(|stream| stream.unwrap_nightly()));
+            }
+            TokenStream::Fallback(tts) => {
+                tts.extend(streams.into_iter().map(|stream| stream.unwrap_stable()));
+            }
+        }
+    }
+}
+
+impl fmt::Debug for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            TokenStream::Compiler(tts) => tts.clone().into_token_stream().fmt(f),
+            TokenStream::Fallback(tts) => tts.fmt(f),
+        }
+    }
+}
+
+impl From<proc_macro::LexError> for LexError {
+    fn from(e: proc_macro::LexError) -> LexError {
+        LexError::Compiler(e)
+    }
+}
+
+impl From<fallback::LexError> for LexError {
+    fn from(e: fallback::LexError) -> LexError {
+        LexError::Fallback(e)
+    }
+}
+
+impl fmt::Debug for LexError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            LexError::Compiler(e) => e.fmt(f),
+            LexError::Fallback(e) => e.fmt(f),
+        }
+    }
+}
+
+#[derive(Clone)]
+pub enum TokenTreeIter {
+    Compiler(proc_macro::token_stream::IntoIter),
+    Fallback(fallback::TokenTreeIter),
+}
+
+impl IntoIterator for TokenStream {
+    type Item = TokenTree;
+    type IntoIter = TokenTreeIter;
+
+    fn into_iter(self) -> TokenTreeIter {
+        match self {
+            TokenStream::Compiler(tts) => {
+                TokenTreeIter::Compiler(tts.into_token_stream().into_iter())
+            }
+            TokenStream::Fallback(tts) => TokenTreeIter::Fallback(tts.into_iter()),
+        }
+    }
+}
+
+impl Iterator for TokenTreeIter {
+    type Item = TokenTree;
+
+    fn next(&mut self) -> Option<TokenTree> {
+        let token = match self {
+            TokenTreeIter::Compiler(iter) => iter.next()?,
+            TokenTreeIter::Fallback(iter) => return iter.next(),
+        };
+        Some(match token {
+            proc_macro::TokenTree::Group(tt) => crate::Group::_new(Group::Compiler(tt)).into(),
+            proc_macro::TokenTree::Punct(tt) => {
+                let spacing = match tt.spacing() {
+                    proc_macro::Spacing::Joint => Spacing::Joint,
+                    proc_macro::Spacing::Alone => Spacing::Alone,
+                };
+                let mut o = Punct::new(tt.as_char(), spacing);
+                o.set_span(crate::Span::_new(Span::Compiler(tt.span())));
+                o.into()
+            }
+            proc_macro::TokenTree::Ident(s) => crate::Ident::_new(Ident::Compiler(s)).into(),
+            proc_macro::TokenTree::Literal(l) => crate::Literal::_new(Literal::Compiler(l)).into(),
+        })
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        match self {
+            TokenTreeIter::Compiler(tts) => tts.size_hint(),
+            TokenTreeIter::Fallback(tts) => tts.size_hint(),
+        }
+    }
+}
+
+impl fmt::Debug for TokenTreeIter {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("TokenTreeIter").finish()
+    }
+}
+
+#[derive(Clone, PartialEq, Eq)]
+#[cfg(super_unstable)]
+pub enum SourceFile {
+    Compiler(proc_macro::SourceFile),
+    Fallback(fallback::SourceFile),
+}
+
+#[cfg(super_unstable)]
+impl SourceFile {
+    fn nightly(sf: proc_macro::SourceFile) -> Self {
+        SourceFile::Compiler(sf)
+    }
+
+    /// Get the path to this source file as a string.
+    pub fn path(&self) -> PathBuf {
+        match self {
+            SourceFile::Compiler(a) => a.path(),
+            SourceFile::Fallback(a) => a.path(),
+        }
+    }
+
+    pub fn is_real(&self) -> bool {
+        match self {
+            SourceFile::Compiler(a) => a.is_real(),
+            SourceFile::Fallback(a) => a.is_real(),
+        }
+    }
+}
+
+#[cfg(super_unstable)]
+impl fmt::Debug for SourceFile {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            SourceFile::Compiler(a) => a.fmt(f),
+            SourceFile::Fallback(a) => a.fmt(f),
+        }
+    }
+}
+
+#[cfg(any(super_unstable, feature = "span-locations"))]
+pub struct LineColumn {
+    pub line: usize,
+    pub column: usize,
+}
+
+#[derive(Copy, Clone)]
+pub enum Span {
+    Compiler(proc_macro::Span),
+    Fallback(fallback::Span),
+}
+
+impl Span {
+    pub fn call_site() -> Span {
+        if nightly_works() {
+            Span::Compiler(proc_macro::Span::call_site())
+        } else {
+            Span::Fallback(fallback::Span::call_site())
+        }
+    }
+
+    #[cfg(super_unstable)]
+    pub fn def_site() -> Span {
+        if nightly_works() {
+            Span::Compiler(proc_macro::Span::def_site())
+        } else {
+            Span::Fallback(fallback::Span::def_site())
+        }
+    }
+
+    #[cfg(super_unstable)]
+    pub fn resolved_at(&self, other: Span) -> Span {
+        match (self, other) {
+            (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.resolved_at(b)),
+            (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.resolved_at(b)),
+            _ => mismatch(),
+        }
+    }
+
+    #[cfg(super_unstable)]
+    pub fn located_at(&self, other: Span) -> Span {
+        match (self, other) {
+            (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.located_at(b)),
+            (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.located_at(b)),
+            _ => mismatch(),
+        }
+    }
+
+    pub fn unwrap(self) -> proc_macro::Span {
+        match self {
+            Span::Compiler(s) => s,
+            Span::Fallback(_) => panic!("proc_macro::Span is only available in procedural macros"),
+        }
+    }
+
+    #[cfg(super_unstable)]
+    pub fn source_file(&self) -> SourceFile {
+        match self {
+            Span::Compiler(s) => SourceFile::nightly(s.source_file()),
+            Span::Fallback(s) => SourceFile::Fallback(s.source_file()),
+        }
+    }
+
+    #[cfg(any(super_unstable, feature = "span-locations"))]
+    pub fn start(&self) -> LineColumn {
+        match self {
+            #[cfg(proc_macro_span)]
+            Span::Compiler(s) => {
+                let proc_macro::LineColumn { line, column } = s.start();
+                LineColumn { line, column }
+            }
+            #[cfg(not(proc_macro_span))]
+            Span::Compiler(_) => LineColumn { line: 0, column: 0 },
+            Span::Fallback(s) => {
+                let fallback::LineColumn { line, column } = s.start();
+                LineColumn { line, column }
+            }
+        }
+    }
+
+    #[cfg(any(super_unstable, feature = "span-locations"))]
+    pub fn end(&self) -> LineColumn {
+        match self {
+            #[cfg(proc_macro_span)]
+            Span::Compiler(s) => {
+                let proc_macro::LineColumn { line, column } = s.end();
+                LineColumn { line, column }
+            }
+            #[cfg(not(proc_macro_span))]
+            Span::Compiler(_) => LineColumn { line: 0, column: 0 },
+            Span::Fallback(s) => {
+                let fallback::LineColumn { line, column } = s.end();
+                LineColumn { line, column }
+            }
+        }
+    }
+
+    pub fn join(&self, other: Span) -> Option<Span> {
+        let ret = match (self, other) {
+            #[cfg(proc_macro_span)]
+            (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.join(b)?),
+            (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.join(b)?),
+            _ => return None,
+        };
+        Some(ret)
+    }
+
+    #[cfg(super_unstable)]
+    pub fn eq(&self, other: &Span) -> bool {
+        match (self, other) {
+            (Span::Compiler(a), Span::Compiler(b)) => a.eq(b),
+            (Span::Fallback(a), Span::Fallback(b)) => a.eq(b),
+            _ => false,
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Span {
+        match self {
+            Span::Compiler(s) => s,
+            Span::Fallback(_) => mismatch(),
+        }
+    }
+}
+
+impl From<proc_macro::Span> for crate::Span {
+    fn from(proc_span: proc_macro::Span) -> crate::Span {
+        crate::Span::_new(Span::Compiler(proc_span))
+    }
+}
+
+impl From<fallback::Span> for Span {
+    fn from(inner: fallback::Span) -> Span {
+        Span::Fallback(inner)
+    }
+}
+
+impl fmt::Debug for Span {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Span::Compiler(s) => s.fmt(f),
+            Span::Fallback(s) => s.fmt(f),
+        }
+    }
+}
+
+pub fn debug_span_field_if_nontrivial(debug: &mut fmt::DebugStruct, span: Span) {
+    match span {
+        Span::Compiler(s) => {
+            debug.field("span", &s);
+        }
+        Span::Fallback(s) => fallback::debug_span_field_if_nontrivial(debug, s),
+    }
+}
+
+#[derive(Clone)]
+pub enum Group {
+    Compiler(proc_macro::Group),
+    Fallback(fallback::Group),
+}
+
+impl Group {
+    pub fn new(delimiter: Delimiter, stream: TokenStream) -> Group {
+        match stream {
+            TokenStream::Compiler(tts) => {
+                let delimiter = match delimiter {
+                    Delimiter::Parenthesis => proc_macro::Delimiter::Parenthesis,
+                    Delimiter::Bracket => proc_macro::Delimiter::Bracket,
+                    Delimiter::Brace => proc_macro::Delimiter::Brace,
+                    Delimiter::None => proc_macro::Delimiter::None,
+                };
+                Group::Compiler(proc_macro::Group::new(delimiter, tts.into_token_stream()))
+            }
+            TokenStream::Fallback(stream) => {
+                Group::Fallback(fallback::Group::new(delimiter, stream))
+            }
+        }
+    }
+
+    pub fn delimiter(&self) -> Delimiter {
+        match self {
+            Group::Compiler(g) => match g.delimiter() {
+                proc_macro::Delimiter::Parenthesis => Delimiter::Parenthesis,
+                proc_macro::Delimiter::Bracket => Delimiter::Bracket,
+                proc_macro::Delimiter::Brace => Delimiter::Brace,
+                proc_macro::Delimiter::None => Delimiter::None,
+            },
+            Group::Fallback(g) => g.delimiter(),
+        }
+    }
+
+    pub fn stream(&self) -> TokenStream {
+        match self {
+            Group::Compiler(g) => TokenStream::Compiler(DeferredTokenStream::new(g.stream())),
+            Group::Fallback(g) => TokenStream::Fallback(g.stream()),
+        }
+    }
+
+    pub fn span(&self) -> Span {
+        match self {
+            Group::Compiler(g) => Span::Compiler(g.span()),
+            Group::Fallback(g) => Span::Fallback(g.span()),
+        }
+    }
+
+    pub fn span_open(&self) -> Span {
+        match self {
+            #[cfg(proc_macro_span)]
+            Group::Compiler(g) => Span::Compiler(g.span_open()),
+            #[cfg(not(proc_macro_span))]
+            Group::Compiler(g) => Span::Compiler(g.span()),
+            Group::Fallback(g) => Span::Fallback(g.span_open()),
+        }
+    }
+
+    pub fn span_close(&self) -> Span {
+        match self {
+            #[cfg(proc_macro_span)]
+            Group::Compiler(g) => Span::Compiler(g.span_close()),
+            #[cfg(not(proc_macro_span))]
+            Group::Compiler(g) => Span::Compiler(g.span()),
+            Group::Fallback(g) => Span::Fallback(g.span_close()),
+        }
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        match (self, span) {
+            (Group::Compiler(g), Span::Compiler(s)) => g.set_span(s),
+            (Group::Fallback(g), Span::Fallback(s)) => g.set_span(s),
+            _ => mismatch(),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Group {
+        match self {
+            Group::Compiler(g) => g,
+            Group::Fallback(_) => mismatch(),
+        }
+    }
+}
+
+impl From<fallback::Group> for Group {
+    fn from(g: fallback::Group) -> Self {
+        Group::Fallback(g)
+    }
+}
+
+impl fmt::Display for Group {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Group::Compiler(group) => group.fmt(formatter),
+            Group::Fallback(group) => group.fmt(formatter),
+        }
+    }
+}
+
+impl fmt::Debug for Group {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Group::Compiler(group) => group.fmt(formatter),
+            Group::Fallback(group) => group.fmt(formatter),
+        }
+    }
+}
+
+#[derive(Clone)]
+pub enum Ident {
+    Compiler(proc_macro::Ident),
+    Fallback(fallback::Ident),
+}
+
+impl Ident {
+    pub fn new(string: &str, span: Span) -> Ident {
+        match span {
+            Span::Compiler(s) => Ident::Compiler(proc_macro::Ident::new(string, s)),
+            Span::Fallback(s) => Ident::Fallback(fallback::Ident::new(string, s)),
+        }
+    }
+
+    pub fn new_raw(string: &str, span: Span) -> Ident {
+        match span {
+            Span::Compiler(s) => {
+                let p: proc_macro::TokenStream = string.parse().unwrap();
+                let ident = match p.into_iter().next() {
+                    Some(proc_macro::TokenTree::Ident(mut i)) => {
+                        i.set_span(s);
+                        i
+                    }
+                    _ => panic!(),
+                };
+                Ident::Compiler(ident)
+            }
+            Span::Fallback(s) => Ident::Fallback(fallback::Ident::new_raw(string, s)),
+        }
+    }
+
+    pub fn span(&self) -> Span {
+        match self {
+            Ident::Compiler(t) => Span::Compiler(t.span()),
+            Ident::Fallback(t) => Span::Fallback(t.span()),
+        }
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        match (self, span) {
+            (Ident::Compiler(t), Span::Compiler(s)) => t.set_span(s),
+            (Ident::Fallback(t), Span::Fallback(s)) => t.set_span(s),
+            _ => mismatch(),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Ident {
+        match self {
+            Ident::Compiler(s) => s,
+            Ident::Fallback(_) => mismatch(),
+        }
+    }
+}
+
+impl PartialEq for Ident {
+    fn eq(&self, other: &Ident) -> bool {
+        match (self, other) {
+            (Ident::Compiler(t), Ident::Compiler(o)) => t.to_string() == o.to_string(),
+            (Ident::Fallback(t), Ident::Fallback(o)) => t == o,
+            _ => mismatch(),
+        }
+    }
+}
+
+impl<T> PartialEq<T> for Ident
+where
+    T: ?Sized + AsRef<str>,
+{
+    fn eq(&self, other: &T) -> bool {
+        let other = other.as_ref();
+        match self {
+            Ident::Compiler(t) => t.to_string() == other,
+            Ident::Fallback(t) => t == other,
+        }
+    }
+}
+
+impl fmt::Display for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Ident::Compiler(t) => t.fmt(f),
+            Ident::Fallback(t) => t.fmt(f),
+        }
+    }
+}
+
+impl fmt::Debug for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Ident::Compiler(t) => t.fmt(f),
+            Ident::Fallback(t) => t.fmt(f),
+        }
+    }
+}
+
+#[derive(Clone)]
+pub enum Literal {
+    Compiler(proc_macro::Literal),
+    Fallback(fallback::Literal),
+}
+
+macro_rules! suffixed_numbers {
+    ($($name:ident => $kind:ident,)*) => ($(
+        pub fn $name(n: $kind) -> Literal {
+            if nightly_works() {
+                Literal::Compiler(proc_macro::Literal::$name(n))
+            } else {
+                Literal::Fallback(fallback::Literal::$name(n))
+            }
+        }
+    )*)
+}
+
+macro_rules! unsuffixed_integers {
+    ($($name:ident => $kind:ident,)*) => ($(
+        pub fn $name(n: $kind) -> Literal {
+            if nightly_works() {
+                Literal::Compiler(proc_macro::Literal::$name(n))
+            } else {
+                Literal::Fallback(fallback::Literal::$name(n))
+            }
+        }
+    )*)
+}
+
+impl Literal {
+    suffixed_numbers! {
+        u8_suffixed => u8,
+        u16_suffixed => u16,
+        u32_suffixed => u32,
+        u64_suffixed => u64,
+        u128_suffixed => u128,
+        usize_suffixed => usize,
+        i8_suffixed => i8,
+        i16_suffixed => i16,
+        i32_suffixed => i32,
+        i64_suffixed => i64,
+        i128_suffixed => i128,
+        isize_suffixed => isize,
+
+        f32_suffixed => f32,
+        f64_suffixed => f64,
+    }
+
+    unsuffixed_integers! {
+        u8_unsuffixed => u8,
+        u16_unsuffixed => u16,
+        u32_unsuffixed => u32,
+        u64_unsuffixed => u64,
+        u128_unsuffixed => u128,
+        usize_unsuffixed => usize,
+        i8_unsuffixed => i8,
+        i16_unsuffixed => i16,
+        i32_unsuffixed => i32,
+        i64_unsuffixed => i64,
+        i128_unsuffixed => i128,
+        isize_unsuffixed => isize,
+    }
+
+    pub fn f32_unsuffixed(f: f32) -> Literal {
+        if nightly_works() {
+            Literal::Compiler(proc_macro::Literal::f32_unsuffixed(f))
+        } else {
+            Literal::Fallback(fallback::Literal::f32_unsuffixed(f))
+        }
+    }
+
+    pub fn f64_unsuffixed(f: f64) -> Literal {
+        if nightly_works() {
+            Literal::Compiler(proc_macro::Literal::f64_unsuffixed(f))
+        } else {
+            Literal::Fallback(fallback::Literal::f64_unsuffixed(f))
+        }
+    }
+
+    pub fn string(t: &str) -> Literal {
+        if nightly_works() {
+            Literal::Compiler(proc_macro::Literal::string(t))
+        } else {
+            Literal::Fallback(fallback::Literal::string(t))
+        }
+    }
+
+    pub fn character(t: char) -> Literal {
+        if nightly_works() {
+            Literal::Compiler(proc_macro::Literal::character(t))
+        } else {
+            Literal::Fallback(fallback::Literal::character(t))
+        }
+    }
+
+    pub fn byte_string(bytes: &[u8]) -> Literal {
+        if nightly_works() {
+            Literal::Compiler(proc_macro::Literal::byte_string(bytes))
+        } else {
+            Literal::Fallback(fallback::Literal::byte_string(bytes))
+        }
+    }
+
+    pub fn span(&self) -> Span {
+        match self {
+            Literal::Compiler(lit) => Span::Compiler(lit.span()),
+            Literal::Fallback(lit) => Span::Fallback(lit.span()),
+        }
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        match (self, span) {
+            (Literal::Compiler(lit), Span::Compiler(s)) => lit.set_span(s),
+            (Literal::Fallback(lit), Span::Fallback(s)) => lit.set_span(s),
+            _ => mismatch(),
+        }
+    }
+
+    pub fn subspan<R: RangeBounds<usize>>(&self, range: R) -> Option<Span> {
+        match self {
+            #[cfg(proc_macro_span)]
+            Literal::Compiler(lit) => lit.subspan(range).map(Span::Compiler),
+            #[cfg(not(proc_macro_span))]
+            Literal::Compiler(_lit) => None,
+            Literal::Fallback(lit) => lit.subspan(range).map(Span::Fallback),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Literal {
+        match self {
+            Literal::Compiler(s) => s,
+            Literal::Fallback(_) => mismatch(),
+        }
+    }
+}
+
+impl From<fallback::Literal> for Literal {
+    fn from(s: fallback::Literal) -> Literal {
+        Literal::Fallback(s)
+    }
+}
+
+impl fmt::Display for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Literal::Compiler(t) => t.fmt(f),
+            Literal::Fallback(t) => t.fmt(f),
+        }
+    }
+}
+
+impl fmt::Debug for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Literal::Compiler(t) => t.fmt(f),
+            Literal::Fallback(t) => t.fmt(f),
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/quote/ext.rs.html b/src/quote/ext.rs.html new file mode 100644 index 0000000..841e6fe --- /dev/null +++ b/src/quote/ext.rs.html @@ -0,0 +1,227 @@ +ext.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+
+use super::ToTokens;
+
+use std::iter;
+
+use proc_macro2::{TokenStream, TokenTree};
+
+/// TokenStream extension trait with methods for appending tokens.
+///
+/// This trait is sealed and cannot be implemented outside of the `quote` crate.
+pub trait TokenStreamExt: private::Sealed {
+    /// For use by `ToTokens` implementations.
+    ///
+    /// Appends the token specified to this list of tokens.
+    fn append<U>(&mut self, token: U)
+    where
+        U: Into<TokenTree>;
+
+    /// For use by `ToTokens` implementations.
+    ///
+    /// ```
+    /// # use quote::{quote, TokenStreamExt, ToTokens};
+    /// # use proc_macro2::TokenStream;
+    /// #
+    /// struct X;
+    ///
+    /// impl ToTokens for X {
+    ///     fn to_tokens(&self, tokens: &mut TokenStream) {
+    ///         tokens.append_all(&[true, false]);
+    ///     }
+    /// }
+    ///
+    /// let tokens = quote!(#X);
+    /// assert_eq!(tokens.to_string(), "true false");
+    /// ```
+    fn append_all<I>(&mut self, iter: I)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens;
+
+    /// For use by `ToTokens` implementations.
+    ///
+    /// Appends all of the items in the iterator `I`, separated by the tokens
+    /// `U`.
+    fn append_separated<I, U>(&mut self, iter: I, op: U)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+        U: ToTokens;
+
+    /// For use by `ToTokens` implementations.
+    ///
+    /// Appends all tokens in the iterator `I`, appending `U` after each
+    /// element, including after the last element of the iterator.
+    fn append_terminated<I, U>(&mut self, iter: I, term: U)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+        U: ToTokens;
+}
+
+impl TokenStreamExt for TokenStream {
+    fn append<U>(&mut self, token: U)
+    where
+        U: Into<TokenTree>,
+    {
+        self.extend(iter::once(token.into()));
+    }
+
+    fn append_all<I>(&mut self, iter: I)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+    {
+        for token in iter {
+            token.to_tokens(self);
+        }
+    }
+
+    fn append_separated<I, U>(&mut self, iter: I, op: U)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+        U: ToTokens,
+    {
+        for (i, token) in iter.into_iter().enumerate() {
+            if i > 0 {
+                op.to_tokens(self);
+            }
+            token.to_tokens(self);
+        }
+    }
+
+    fn append_terminated<I, U>(&mut self, iter: I, term: U)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+        U: ToTokens,
+    {
+        for token in iter {
+            token.to_tokens(self);
+            term.to_tokens(self);
+        }
+    }
+}
+
+mod private {
+    use proc_macro2::TokenStream;
+
+    pub trait Sealed {}
+
+    impl Sealed for TokenStream {}
+}
+
+
\ No newline at end of file diff --git a/src/quote/format.rs.html b/src/quote/format.rs.html new file mode 100644 index 0000000..61e6a46 --- /dev/null +++ b/src/quote/format.rs.html @@ -0,0 +1,331 @@ +format.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+
+/// Formatting macro for constructing `Ident`s.
+///
+/// <br>
+///
+/// # Syntax
+///
+/// Syntax is copied from the [`format!`] macro, supporting both positional and
+/// named arguments.
+///
+/// Only a limited set of formatting traits are supported. The current mapping
+/// of format types to traits is:
+///
+/// * `{}` ⇒ [`IdentFragment`]
+/// * `{:o}` ⇒ [`Octal`](`std::fmt::Octal`)
+/// * `{:x}` ⇒ [`LowerHex`](`std::fmt::LowerHex`)
+/// * `{:X}` ⇒ [`UpperHex`](`std::fmt::UpperHex`)
+/// * `{:b}` ⇒ [`Binary`](`std::fmt::Binary`)
+///
+/// See [`std::fmt`] for more information.
+///
+/// <br>
+///
+/// # IdentFragment
+///
+/// Unlike `format!`, this macro uses the [`IdentFragment`] formatting trait by
+/// default. This trait is like `Display`, with a few differences:
+///
+/// * `IdentFragment` is only implemented for a limited set of types, such as
+///    unsigned integers and strings.
+/// * [`Ident`] arguments will have their `r#` prefixes stripped, if present.
+///
+/// [`Ident`]: `proc_macro2::Ident`
+///
+/// <br>
+///
+/// # Hygiene
+///
+/// The [`Span`] of the first `Ident` argument is used as the span of the final
+/// identifier, falling back to [`Span::call_site`] when no identifiers are
+/// provided.
+///
+/// ```
+/// # use quote::format_ident;
+/// # let ident = format_ident!("Ident");
+/// // If `ident` is an Ident, the span of `my_ident` will be inherited from it.
+/// let my_ident = format_ident!("My{}{}", ident, "IsCool");
+/// assert_eq!(my_ident, "MyIdentIsCool");
+/// ```
+///
+/// Alternatively, the span can be overridden by passing the `span` named
+/// argument.
+///
+/// ```
+/// # use quote::format_ident;
+/// # const IGNORE_TOKENS: &'static str = stringify! {
+/// let my_span = /* ... */;
+/// # };
+/// # let my_span = proc_macro2::Span::call_site();
+/// format_ident!("MyIdent", span = my_span);
+/// ```
+///
+/// [`Span`]: `proc_macro2::Span`
+/// [`Span::call_site`]: `proc_macro2::Span::call_site`
+///
+/// <p><br></p>
+///
+/// # Panics
+///
+/// This method will panic if the resulting formatted string is not a valid
+/// identifier.
+///
+/// <br>
+///
+/// # Examples
+///
+/// Composing raw and non-raw identifiers:
+/// ```
+/// # use quote::format_ident;
+/// let my_ident = format_ident!("My{}", "Ident");
+/// assert_eq!(my_ident, "MyIdent");
+///
+/// let raw = format_ident!("r#Raw");
+/// assert_eq!(raw, "r#Raw");
+///
+/// let my_ident_raw = format_ident!("{}Is{}", my_ident, raw);
+/// assert_eq!(my_ident_raw, "MyIdentIsRaw");
+/// ```
+///
+/// Integer formatting options:
+/// ```
+/// # use quote::format_ident;
+/// let num: u32 = 10;
+///
+/// let decimal = format_ident!("Id_{}", num);
+/// assert_eq!(decimal, "Id_10");
+///
+/// let octal = format_ident!("Id_{:o}", num);
+/// assert_eq!(octal, "Id_12");
+///
+/// let binary = format_ident!("Id_{:b}", num);
+/// assert_eq!(binary, "Id_1010");
+///
+/// let lower_hex = format_ident!("Id_{:x}", num);
+/// assert_eq!(lower_hex, "Id_a");
+///
+/// let upper_hex = format_ident!("Id_{:X}", num);
+/// assert_eq!(upper_hex, "Id_A");
+/// ```
+#[macro_export]
+macro_rules! format_ident {
+    ($fmt:expr) => {
+        $crate::format_ident_impl!([
+            ::std::option::Option::None,
+            $fmt
+        ])
+    };
+
+    ($fmt:expr, $($rest:tt)*) => {
+        $crate::format_ident_impl!([
+            ::std::option::Option::None,
+            $fmt
+        ] $($rest)*)
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! format_ident_impl {
+    // Final state
+    ([$span:expr, $($fmt:tt)*]) => {
+        $crate::__rt::mk_ident(&format!($($fmt)*), $span)
+    };
+
+    // Span argument
+    ([$old:expr, $($fmt:tt)*] span = $span:expr) => {
+        $crate::format_ident_impl!([$old, $($fmt)*] span = $span,)
+    };
+    ([$old:expr, $($fmt:tt)*] span = $span:expr, $($rest:tt)*) => {
+        $crate::format_ident_impl!([
+            ::std::option::Option::Some::<$crate::__rt::Span>($span),
+            $($fmt)*
+        ] $($rest)*)
+    };
+
+    // Named argument
+    ([$span:expr, $($fmt:tt)*] $name:ident = $arg:expr) => {
+        $crate::format_ident_impl!([$span, $($fmt)*] $name = $arg,)
+    };
+    ([$span:expr, $($fmt:tt)*] $name:ident = $arg:expr, $($rest:tt)*) => {
+        match $crate::__rt::IdentFragmentAdapter(&$arg) {
+            arg => $crate::format_ident_impl!([$span.or(arg.span()), $($fmt)*, $name = arg] $($rest)*),
+        }
+    };
+
+    // Positional argument
+    ([$span:expr, $($fmt:tt)*] $arg:expr) => {
+        $crate::format_ident_impl!([$span, $($fmt)*] $arg,)
+    };
+    ([$span:expr, $($fmt:tt)*] $arg:expr, $($rest:tt)*) => {
+        match $crate::__rt::IdentFragmentAdapter(&$arg) {
+            arg => $crate::format_ident_impl!([$span.or(arg.span()), $($fmt)*, arg] $($rest)*),
+        }
+    };
+}
+
+
\ No newline at end of file diff --git a/src/quote/ident_fragment.rs.html b/src/quote/ident_fragment.rs.html new file mode 100644 index 0000000..0f324ab --- /dev/null +++ b/src/quote/ident_fragment.rs.html @@ -0,0 +1,147 @@ +ident_fragment.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+
+use proc_macro2::{Ident, Span};
+use std::fmt;
+
+/// Specialized formatting trait used by `format_ident!`.
+///
+/// [`Ident`] arguments formatted using this trait will have their `r#` prefix
+/// stripped, if present.
+///
+/// See [`format_ident!`] for more information.
+pub trait IdentFragment {
+    /// Format this value as an identifier fragment.
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result;
+
+    /// Span associated with this `IdentFragment`.
+    ///
+    /// If non-`None`, may be inherited by formatted identifiers.
+    fn span(&self) -> Option<Span> {
+        None
+    }
+}
+
+impl<'a, T: IdentFragment + ?Sized> IdentFragment for &'a T {
+    fn span(&self) -> Option<Span> {
+        <T as IdentFragment>::span(*self)
+    }
+
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        IdentFragment::fmt(*self, f)
+    }
+}
+
+impl<'a, T: IdentFragment + ?Sized> IdentFragment for &'a mut T {
+    fn span(&self) -> Option<Span> {
+        <T as IdentFragment>::span(*self)
+    }
+
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        IdentFragment::fmt(*self, f)
+    }
+}
+
+impl IdentFragment for Ident {
+    fn span(&self) -> Option<Span> {
+        Some(self.span())
+    }
+
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let id = self.to_string();
+        if id.starts_with("r#") {
+            fmt::Display::fmt(&id[2..], f)
+        } else {
+            fmt::Display::fmt(&id[..], f)
+        }
+    }
+}
+
+// Limited set of types which this is implemented for, as we want to avoid types
+// which will often include non-identifier characters in their `Display` impl.
+macro_rules! ident_fragment_display {
+    ($($T:ty),*) => {
+        $(
+            impl IdentFragment for $T {
+                fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                    fmt::Display::fmt(self, f)
+                }
+            }
+        )*
+    }
+}
+
+ident_fragment_display!(bool, str, String);
+ident_fragment_display!(u8, u16, u32, u64, u128, usize);
+
+
\ No newline at end of file diff --git a/src/quote/lib.rs.html b/src/quote/lib.rs.html new file mode 100644 index 0000000..d3543a9 --- /dev/null +++ b/src/quote/lib.rs.html @@ -0,0 +1,1899 @@ +lib.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+
+//! This crate provides the [`quote!`] macro for turning Rust syntax tree data
+//! structures into tokens of source code.
+//!
+//! [`quote!`]: macro.quote.html
+//!
+//! Procedural macros in Rust receive a stream of tokens as input, execute
+//! arbitrary Rust code to determine how to manipulate those tokens, and produce
+//! a stream of tokens to hand back to the compiler to compile into the caller's
+//! crate. Quasi-quoting is a solution to one piece of that &mdash; producing
+//! tokens to return to the compiler.
+//!
+//! The idea of quasi-quoting is that we write *code* that we treat as *data*.
+//! Within the `quote!` macro, we can write what looks like code to our text
+//! editor or IDE. We get all the benefits of the editor's brace matching,
+//! syntax highlighting, indentation, and maybe autocompletion. But rather than
+//! compiling that as code into the current crate, we can treat it as data, pass
+//! it around, mutate it, and eventually hand it back to the compiler as tokens
+//! to compile into the macro caller's crate.
+//!
+//! This crate is motivated by the procedural macro use case, but is a
+//! general-purpose Rust quasi-quoting library and is not specific to procedural
+//! macros.
+//!
+//! ```toml
+//! [dependencies]
+//! quote = "1.0"
+//! ```
+//!
+//! <br>
+//!
+//! # Example
+//!
+//! The following quasi-quoted block of code is something you might find in [a]
+//! procedural macro having to do with data structure serialization. The `#var`
+//! syntax performs interpolation of runtime variables into the quoted tokens.
+//! Check out the documentation of the [`quote!`] macro for more detail about
+//! the syntax. See also the [`quote_spanned!`] macro which is important for
+//! implementing hygienic procedural macros.
+//!
+//! [a]: https://serde.rs/
+//! [`quote_spanned!`]: macro.quote_spanned.html
+//!
+//! ```
+//! # use quote::quote;
+//! #
+//! # let generics = "";
+//! # let where_clause = "";
+//! # let field_ty = "";
+//! # let item_ty = "";
+//! # let path = "";
+//! # let value = "";
+//! #
+//! let tokens = quote! {
+//!     struct SerializeWith #generics #where_clause {
+//!         value: &'a #field_ty,
+//!         phantom: core::marker::PhantomData<#item_ty>,
+//!     }
+//!
+//!     impl #generics serde::Serialize for SerializeWith #generics #where_clause {
+//!         fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+//!         where
+//!             S: serde::Serializer,
+//!         {
+//!             #path(self.value, serializer)
+//!         }
+//!     }
+//!
+//!     SerializeWith {
+//!         value: #value,
+//!         phantom: core::marker::PhantomData::<#item_ty>,
+//!     }
+//! };
+//! ```
+
+// Quote types in rustdoc of other crates get linked to here.
+#![doc(html_root_url = "https://docs.rs/quote/1.0.2")]
+
+#[cfg(all(
+    not(all(target_arch = "wasm32", target_os = "unknown")),
+    feature = "proc-macro"
+))]
+extern crate proc_macro;
+
+mod ext;
+mod format;
+mod ident_fragment;
+mod to_tokens;
+
+// Not public API.
+#[doc(hidden)]
+#[path = "runtime.rs"]
+pub mod __rt;
+
+pub use crate::ext::TokenStreamExt;
+pub use crate::ident_fragment::IdentFragment;
+pub use crate::to_tokens::ToTokens;
+
+// Not public API.
+#[doc(hidden)]
+pub mod spanned;
+
+/// The whole point.
+///
+/// Performs variable interpolation against the input and produces it as
+/// [`proc_macro2::TokenStream`].
+///
+/// Note: for returning tokens to the compiler in a procedural macro, use
+/// `.into()` on the result to convert to [`proc_macro::TokenStream`].
+///
+/// [`TokenStream`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.TokenStream.html
+///
+/// <br>
+///
+/// # Interpolation
+///
+/// Variable interpolation is done with `#var` (similar to `$var` in
+/// `macro_rules!` macros). This grabs the `var` variable that is currently in
+/// scope and inserts it in that location in the output tokens. Any type
+/// implementing the [`ToTokens`] trait can be interpolated. This includes most
+/// Rust primitive types as well as most of the syntax tree types from the [Syn]
+/// crate.
+///
+/// [`ToTokens`]: trait.ToTokens.html
+/// [Syn]: https://github.com/dtolnay/syn
+///
+/// Repetition is done using `#(...)*` or `#(...),*` again similar to
+/// `macro_rules!`. This iterates through the elements of any variable
+/// interpolated within the repetition and inserts a copy of the repetition body
+/// for each one. The variables in an interpolation may be a `Vec`, slice,
+/// `BTreeSet`, or any `Iterator`.
+///
+/// - `#(#var)*` — no separators
+/// - `#(#var),*` — the character before the asterisk is used as a separator
+/// - `#( struct #var; )*` — the repetition can contain other tokens
+/// - `#( #k => println!("{}", #v), )*` — even multiple interpolations
+///
+/// <br>
+///
+/// # Hygiene
+///
+/// Any interpolated tokens preserve the `Span` information provided by their
+/// `ToTokens` implementation. Tokens that originate within the `quote!`
+/// invocation are spanned with [`Span::call_site()`].
+///
+/// [`Span::call_site()`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.Span.html#method.call_site
+///
+/// A different span can be provided through the [`quote_spanned!`] macro.
+///
+/// [`quote_spanned!`]: macro.quote_spanned.html
+///
+/// <br>
+///
+/// # Return type
+///
+/// The macro evaluates to an expression of type `proc_macro2::TokenStream`.
+/// Meanwhile Rust procedural macros are expected to return the type
+/// `proc_macro::TokenStream`.
+///
+/// The difference between the two types is that `proc_macro` types are entirely
+/// specific to procedural macros and cannot ever exist in code outside of a
+/// procedural macro, while `proc_macro2` types may exist anywhere including
+/// tests and non-macro code like main.rs and build.rs. This is why even the
+/// procedural macro ecosystem is largely built around `proc_macro2`, because
+/// that ensures the libraries are unit testable and accessible in non-macro
+/// contexts.
+///
+/// There is a [`From`]-conversion in both directions so returning the output of
+/// `quote!` from a procedural macro usually looks like `tokens.into()` or
+/// `proc_macro::TokenStream::from(tokens)`.
+///
+/// [`From`]: https://doc.rust-lang.org/std/convert/trait.From.html
+///
+/// <br>
+///
+/// # Examples
+///
+/// ### Procedural macro
+///
+/// The structure of a basic procedural macro is as follows. Refer to the [Syn]
+/// crate for further useful guidance on using `quote!` as part of a procedural
+/// macro.
+///
+/// [Syn]: https://github.com/dtolnay/syn
+///
+/// ```
+/// # #[cfg(any())]
+/// extern crate proc_macro;
+/// # extern crate proc_macro2;
+///
+/// # #[cfg(any())]
+/// use proc_macro::TokenStream;
+/// # use proc_macro2::TokenStream;
+/// use quote::quote;
+///
+/// # const IGNORE_TOKENS: &'static str = stringify! {
+/// #[proc_macro_derive(HeapSize)]
+/// # };
+/// pub fn derive_heap_size(input: TokenStream) -> TokenStream {
+///     // Parse the input and figure out what implementation to generate...
+///     # const IGNORE_TOKENS: &'static str = stringify! {
+///     let name = /* ... */;
+///     let expr = /* ... */;
+///     # };
+///     #
+///     # let name = 0;
+///     # let expr = 0;
+///
+///     let expanded = quote! {
+///         // The generated impl.
+///         impl heapsize::HeapSize for #name {
+///             fn heap_size_of_children(&self) -> usize {
+///                 #expr
+///             }
+///         }
+///     };
+///
+///     // Hand the output tokens back to the compiler.
+///     TokenStream::from(expanded)
+/// }
+/// ```
+///
+/// <p><br></p>
+///
+/// ### Combining quoted fragments
+///
+/// Usually you don't end up constructing an entire final `TokenStream` in one
+/// piece. Different parts may come from different helper functions. The tokens
+/// produced by `quote!` themselves implement `ToTokens` and so can be
+/// interpolated into later `quote!` invocations to build up a final result.
+///
+/// ```
+/// # use quote::quote;
+/// #
+/// let type_definition = quote! {...};
+/// let methods = quote! {...};
+///
+/// let tokens = quote! {
+///     #type_definition
+///     #methods
+/// };
+/// ```
+///
+/// <p><br></p>
+///
+/// ### Constructing identifiers
+///
+/// Suppose we have an identifier `ident` which came from somewhere in a macro
+/// input and we need to modify it in some way for the macro output. Let's
+/// consider prepending the identifier with an underscore.
+///
+/// Simply interpolating the identifier next to an underscore will not have the
+/// behavior of concatenating them. The underscore and the identifier will
+/// continue to be two separate tokens as if you had written `_ x`.
+///
+/// ```
+/// # use proc_macro2::{self as syn, Span};
+/// # use quote::quote;
+/// #
+/// # let ident = syn::Ident::new("i", Span::call_site());
+/// #
+/// // incorrect
+/// quote! {
+///     let mut _#ident = 0;
+/// }
+/// # ;
+/// ```
+///
+/// The solution is to build a new identifier token with the correct value. As
+/// this is such a common case, the [`format_ident!`] macro provides a
+/// convenient utility for doing so correctly.
+///
+/// ```
+/// # use proc_macro2::{Ident, Span};
+/// # use quote::{format_ident, quote};
+/// #
+/// # let ident = Ident::new("i", Span::call_site());
+/// #
+/// let varname = format_ident!("_{}", ident);
+/// quote! {
+///     let mut #varname = 0;
+/// }
+/// # ;
+/// ```
+///
+/// Alternatively, the APIs provided by Syn and proc-macro2 can be used to
+/// directly build the identifier. This is roughly equivalent to the above, but
+/// will not handle `ident` being a raw identifier.
+///
+/// ```
+/// # use proc_macro2::{self as syn, Span};
+/// # use quote::quote;
+/// #
+/// # let ident = syn::Ident::new("i", Span::call_site());
+/// #
+/// let concatenated = format!("_{}", ident);
+/// let varname = syn::Ident::new(&concatenated, ident.span());
+/// quote! {
+///     let mut #varname = 0;
+/// }
+/// # ;
+/// ```
+///
+/// <p><br></p>
+///
+/// ### Making method calls
+///
+/// Let's say our macro requires some type specified in the macro input to have
+/// a constructor called `new`. We have the type in a variable called
+/// `field_type` of type `syn::Type` and want to invoke the constructor.
+///
+/// ```
+/// # use quote::quote;
+/// #
+/// # let field_type = quote!(...);
+/// #
+/// // incorrect
+/// quote! {
+///     let value = #field_type::new();
+/// }
+/// # ;
+/// ```
+///
+/// This works only sometimes. If `field_type` is `String`, the expanded code
+/// contains `String::new()` which is fine. But if `field_type` is something
+/// like `Vec<i32>` then the expanded code is `Vec<i32>::new()` which is invalid
+/// syntax. Ordinarily in handwritten Rust we would write `Vec::<i32>::new()`
+/// but for macros often the following is more convenient.
+///
+/// ```
+/// # use quote::quote;
+/// #
+/// # let field_type = quote!(...);
+/// #
+/// quote! {
+///     let value = <#field_type>::new();
+/// }
+/// # ;
+/// ```
+///
+/// This expands to `<Vec<i32>>::new()` which behaves correctly.
+///
+/// A similar pattern is appropriate for trait methods.
+///
+/// ```
+/// # use quote::quote;
+/// #
+/// # let field_type = quote!(...);
+/// #
+/// quote! {
+///     let value = <#field_type as core::default::Default>::default();
+/// }
+/// # ;
+/// ```
+///
+/// <p><br></p>
+///
+/// ### Interpolating text inside of doc comments
+///
+/// Neither doc comments nor string literals get interpolation behavior in
+/// quote:
+///
+/// ```compile_fail
+/// quote! {
+///     /// try to interpolate: #ident
+///     ///
+///     /// ...
+/// }
+/// ```
+///
+/// ```compile_fail
+/// quote! {
+///     #[doc = "try to interpolate: #ident"]
+/// }
+/// ```
+///
+/// Macro calls in a doc attribute are not valid syntax:
+///
+/// ```compile_fail
+/// quote! {
+///     #[doc = concat!("try to interpolate: ", stringify!(#ident))]
+/// }
+/// ```
+///
+/// Instead the best way to build doc comments that involve variables is by
+/// formatting the doc string literal outside of quote.
+///
+/// ```rust
+/// # use proc_macro2::{Ident, Span};
+/// # use quote::quote;
+/// #
+/// # const IGNORE: &str = stringify! {
+/// let msg = format!(...);
+/// # };
+/// #
+/// # let ident = Ident::new("var", Span::call_site());
+/// # let msg = format!("try to interpolate: {}", ident);
+/// quote! {
+///     #[doc = #msg]
+///     ///
+///     /// ...
+/// }
+/// # ;
+/// ```
+///
+/// <p><br></p>
+///
+/// ### Indexing into a tuple struct
+///
+/// When interpolating indices of a tuple or tuple struct, we need them not to
+/// appears suffixed as integer literals by interpolating them as [`syn::Index`]
+/// instead.
+///
+/// [`syn::Index`]: https://docs.rs/syn/1.0/syn/struct.Index.html
+///
+/// ```compile_fail
+/// let i = 0usize..self.fields.len();
+///
+/// // expands to 0 + self.0usize.heap_size() + self.1usize.heap_size() + ...
+/// // which is not valid syntax
+/// quote! {
+///     0 #( + self.#i.heap_size() )*
+/// }
+/// ```
+///
+/// ```
+/// # use proc_macro2::{Ident, TokenStream};
+/// # use quote::quote;
+/// #
+/// # mod syn {
+/// #     use proc_macro2::{Literal, TokenStream};
+/// #     use quote::{ToTokens, TokenStreamExt};
+/// #
+/// #     pub struct Index(usize);
+/// #
+/// #     impl From<usize> for Index {
+/// #         fn from(i: usize) -> Self {
+/// #             Index(i)
+/// #         }
+/// #     }
+/// #
+/// #     impl ToTokens for Index {
+/// #         fn to_tokens(&self, tokens: &mut TokenStream) {
+/// #             tokens.append(Literal::usize_unsuffixed(self.0));
+/// #         }
+/// #     }
+/// # }
+/// #
+/// # struct Struct {
+/// #     fields: Vec<Ident>,
+/// # }
+/// #
+/// # impl Struct {
+/// #     fn example(&self) -> TokenStream {
+/// let i = (0..self.fields.len()).map(syn::Index::from);
+///
+/// // expands to 0 + self.0.heap_size() + self.1.heap_size() + ...
+/// quote! {
+///     0 #( + self.#i.heap_size() )*
+/// }
+/// #     }
+/// # }
+/// ```
+#[macro_export]
+macro_rules! quote {
+    ($($tt:tt)*) => {
+        $crate::quote_spanned!($crate::__rt::Span::call_site()=> $($tt)*)
+    };
+}
+
+/// Same as `quote!`, but applies a given span to all tokens originating within
+/// the macro invocation.
+///
+/// <br>
+///
+/// # Syntax
+///
+/// A span expression of type [`Span`], followed by `=>`, followed by the tokens
+/// to quote. The span expression should be brief &mdash; use a variable for
+/// anything more than a few characters. There should be no space before the
+/// `=>` token.
+///
+/// [`Span`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.Span.html
+///
+/// ```
+/// # use proc_macro2::Span;
+/// # use quote::quote_spanned;
+/// #
+/// # const IGNORE_TOKENS: &'static str = stringify! {
+/// let span = /* ... */;
+/// # };
+/// # let span = Span::call_site();
+/// # let init = 0;
+///
+/// // On one line, use parentheses.
+/// let tokens = quote_spanned!(span=> Box::into_raw(Box::new(#init)));
+///
+/// // On multiple lines, place the span at the top and use braces.
+/// let tokens = quote_spanned! {span=>
+///     Box::into_raw(Box::new(#init))
+/// };
+/// ```
+///
+/// The lack of space before the `=>` should look jarring to Rust programmers
+/// and this is intentional. The formatting is designed to be visibly
+/// off-balance and draw the eye a particular way, due to the span expression
+/// being evaluated in the context of the procedural macro and the remaining
+/// tokens being evaluated in the generated code.
+///
+/// <br>
+///
+/// # Hygiene
+///
+/// Any interpolated tokens preserve the `Span` information provided by their
+/// `ToTokens` implementation. Tokens that originate within the `quote_spanned!`
+/// invocation are spanned with the given span argument.
+///
+/// <br>
+///
+/// # Example
+///
+/// The following procedural macro code uses `quote_spanned!` to assert that a
+/// particular Rust type implements the [`Sync`] trait so that references can be
+/// safely shared between threads.
+///
+/// [`Sync`]: https://doc.rust-lang.org/std/marker/trait.Sync.html
+///
+/// ```
+/// # use quote::{quote_spanned, TokenStreamExt, ToTokens};
+/// # use proc_macro2::{Span, TokenStream};
+/// #
+/// # struct Type;
+/// #
+/// # impl Type {
+/// #     fn span(&self) -> Span {
+/// #         Span::call_site()
+/// #     }
+/// # }
+/// #
+/// # impl ToTokens for Type {
+/// #     fn to_tokens(&self, _tokens: &mut TokenStream) {}
+/// # }
+/// #
+/// # let ty = Type;
+/// # let call_site = Span::call_site();
+/// #
+/// let ty_span = ty.span();
+/// let assert_sync = quote_spanned! {ty_span=>
+///     struct _AssertSync where #ty: Sync;
+/// };
+/// ```
+///
+/// If the assertion fails, the user will see an error like the following. The
+/// input span of their type is hightlighted in the error.
+///
+/// ```text
+/// error[E0277]: the trait bound `*const (): std::marker::Sync` is not satisfied
+///   --> src/main.rs:10:21
+///    |
+/// 10 |     static ref PTR: *const () = &();
+///    |                     ^^^^^^^^^ `*const ()` cannot be shared between threads safely
+/// ```
+///
+/// In this example it is important for the where-clause to be spanned with the
+/// line/column information of the user's input type so that error messages are
+/// placed appropriately by the compiler.
+#[macro_export]
+macro_rules! quote_spanned {
+    ($span:expr=> $($tt:tt)*) => {{
+        let mut _s = $crate::__rt::TokenStream::new();
+        let _span: $crate::__rt::Span = $span;
+        $crate::quote_each_token!(_s _span $($tt)*);
+        _s
+    }};
+}
+
+// Extract the names of all #metavariables and pass them to the $call macro.
+//
+// in:   pounded_var_names!(then!(...) a #b c #( #d )* #e)
+// out:  then!(... b);
+//       then!(... d);
+//       then!(... e);
+#[macro_export]
+#[doc(hidden)]
+macro_rules! pounded_var_names {
+    ($call:ident! $extra:tt $($tts:tt)*) => {
+        $crate::pounded_var_names_with_context!($call! $extra
+            (@ $($tts)*)
+            ($($tts)* @)
+        )
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! pounded_var_names_with_context {
+    ($call:ident! $extra:tt ($($b1:tt)*) ($($curr:tt)*)) => {
+        $(
+            $crate::pounded_var_with_context!($call! $extra $b1 $curr);
+        )*
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! pounded_var_with_context {
+    ($call:ident! $extra:tt $b1:tt ( $($inner:tt)* )) => {
+        $crate::pounded_var_names!($call! $extra $($inner)*);
+    };
+
+    ($call:ident! $extra:tt $b1:tt [ $($inner:tt)* ]) => {
+        $crate::pounded_var_names!($call! $extra $($inner)*);
+    };
+
+    ($call:ident! $extra:tt $b1:tt { $($inner:tt)* }) => {
+        $crate::pounded_var_names!($call! $extra $($inner)*);
+    };
+
+    ($call:ident!($($extra:tt)*) # $var:ident) => {
+        $crate::$call!($($extra)* $var);
+    };
+
+    ($call:ident! $extra:tt $b1:tt $curr:tt) => {};
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_bind_into_iter {
+    ($has_iter:ident $var:ident) => {
+        // `mut` may be unused if $var occurs multiple times in the list.
+        #[allow(unused_mut)]
+        let (mut $var, i) = $var.quote_into_iter();
+        let $has_iter = $has_iter | i;
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_bind_next_or_break {
+    ($var:ident) => {
+        let $var = match $var.next() {
+            Some(_x) => $crate::__rt::RepInterp(_x),
+            None => break,
+        };
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_each_token {
+    ($tokens:ident $span:ident $($tts:tt)*) => {
+        $crate::quote_tokens_with_context!($tokens $span
+            (@ @ @ @ @ @ $($tts)*)
+            (@ @ @ @ @ $($tts)* @)
+            (@ @ @ @ $($tts)* @ @)
+            (@ @ @ $(($tts))* @ @ @)
+            (@ @ $($tts)* @ @ @ @)
+            (@ $($tts)* @ @ @ @ @)
+            ($($tts)* @ @ @ @ @ @)
+        );
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_tokens_with_context {
+    ($tokens:ident $span:ident
+        ($($b3:tt)*) ($($b2:tt)*) ($($b1:tt)*)
+        ($($curr:tt)*)
+        ($($a1:tt)*) ($($a2:tt)*) ($($a3:tt)*)
+    ) => {
+        $(
+            $crate::quote_token_with_context!($tokens $span $b3 $b2 $b1 $curr $a1 $a2 $a3);
+        )*
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_token_with_context {
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt @ $a1:tt $a2:tt $a3:tt) => {};
+
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt (#) ( $($inner:tt)* ) * $a3:tt) => {{
+        use $crate::__rt::ext::*;
+        let has_iter = $crate::__rt::ThereIsNoIteratorInRepetition;
+        $crate::pounded_var_names!(quote_bind_into_iter!(has_iter) () $($inner)*);
+        let _: $crate::__rt::HasIterator = has_iter;
+        // This is `while true` instead of `loop` because if there are no
+        // iterators used inside of this repetition then the body would not
+        // contain any `break`, so the compiler would emit unreachable code
+        // warnings on anything below the loop. We use has_iter to detect and
+        // fail to compile when there are no iterators, so here we just work
+        // around the unneeded extra warning.
+        while true {
+            $crate::pounded_var_names!(quote_bind_next_or_break!() () $($inner)*);
+            $crate::quote_each_token!($tokens $span $($inner)*);
+        }
+    }};
+    ($tokens:ident $span:ident $b3:tt $b2:tt # (( $($inner:tt)* )) * $a2:tt $a3:tt) => {};
+    ($tokens:ident $span:ident $b3:tt # ( $($inner:tt)* ) (*) $a1:tt $a2:tt $a3:tt) => {};
+
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt (#) ( $($inner:tt)* ) $sep:tt *) => {{
+        use $crate::__rt::ext::*;
+        let mut _i = 0usize;
+        let has_iter = $crate::__rt::ThereIsNoIteratorInRepetition;
+        $crate::pounded_var_names!(quote_bind_into_iter!(has_iter) () $($inner)*);
+        let _: $crate::__rt::HasIterator = has_iter;
+        while true {
+            $crate::pounded_var_names!(quote_bind_next_or_break!() () $($inner)*);
+            if _i > 0 {
+                $crate::quote_token!($tokens $span $sep);
+            }
+            _i += 1;
+            $crate::quote_each_token!($tokens $span $($inner)*);
+        }
+    }};
+    ($tokens:ident $span:ident $b3:tt $b2:tt # (( $($inner:tt)* )) $sep:tt * $a3:tt) => {};
+    ($tokens:ident $span:ident $b3:tt # ( $($inner:tt)* ) ($sep:tt) * $a2:tt $a3:tt) => {};
+    ($tokens:ident $span:ident # ( $($inner:tt)* ) * (*) $a1:tt $a2:tt $a3:tt) => {
+        // https://github.com/dtolnay/quote/issues/130
+        $crate::quote_token!($tokens $span *);
+    };
+    ($tokens:ident $span:ident # ( $($inner:tt)* ) $sep:tt (*) $a1:tt $a2:tt $a3:tt) => {};
+
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt (#) $var:ident $a2:tt $a3:tt) => {
+        $crate::ToTokens::to_tokens(&$var, &mut $tokens);
+    };
+    ($tokens:ident $span:ident $b3:tt $b2:tt # ($var:ident) $a1:tt $a2:tt $a3:tt) => {};
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt ($curr:tt) $a1:tt $a2:tt $a3:tt) => {
+        $crate::quote_token!($tokens $span $curr);
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_token {
+    ($tokens:ident $span:ident ( $($inner:tt)* )) => {
+        $tokens.extend({
+            let mut g = $crate::__rt::Group::new(
+                $crate::__rt::Delimiter::Parenthesis,
+                $crate::quote_spanned!($span=> $($inner)*),
+            );
+            g.set_span($span);
+            Some($crate::__rt::TokenTree::from(g))
+        });
+    };
+
+    ($tokens:ident $span:ident [ $($inner:tt)* ]) => {
+        $tokens.extend({
+            let mut g = $crate::__rt::Group::new(
+                $crate::__rt::Delimiter::Bracket,
+                $crate::quote_spanned!($span=> $($inner)*),
+            );
+            g.set_span($span);
+            Some($crate::__rt::TokenTree::from(g))
+        });
+    };
+
+    ($tokens:ident $span:ident { $($inner:tt)* }) => {
+        $tokens.extend({
+            let mut g = $crate::__rt::Group::new(
+                $crate::__rt::Delimiter::Brace,
+                $crate::quote_spanned!($span=> $($inner)*),
+            );
+            g.set_span($span);
+            Some($crate::__rt::TokenTree::from(g))
+        });
+    };
+
+    ($tokens:ident $span:ident +) => {
+        $crate::__rt::push_add(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident +=) => {
+        $crate::__rt::push_add_eq(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident &) => {
+        $crate::__rt::push_and(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident &&) => {
+        $crate::__rt::push_and_and(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident &=) => {
+        $crate::__rt::push_and_eq(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident @) => {
+        $crate::__rt::push_at(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident !) => {
+        $crate::__rt::push_bang(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident ^) => {
+        $crate::__rt::push_caret(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident ^=) => {
+        $crate::__rt::push_caret_eq(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident :) => {
+        $crate::__rt::push_colon(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident ::) => {
+        $crate::__rt::push_colon2(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident ,) => {
+        $crate::__rt::push_comma(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident /) => {
+        $crate::__rt::push_div(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident /=) => {
+        $crate::__rt::push_div_eq(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident .) => {
+        $crate::__rt::push_dot(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident ..) => {
+        $crate::__rt::push_dot2(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident ...) => {
+        $crate::__rt::push_dot3(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident ..=) => {
+        $crate::__rt::push_dot_dot_eq(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident =) => {
+        $crate::__rt::push_eq(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident ==) => {
+        $crate::__rt::push_eq_eq(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident >=) => {
+        $crate::__rt::push_ge(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident >) => {
+        $crate::__rt::push_gt(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident <=) => {
+        $crate::__rt::push_le(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident <) => {
+        $crate::__rt::push_lt(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident *=) => {
+        $crate::__rt::push_mul_eq(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident !=) => {
+        $crate::__rt::push_ne(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident |) => {
+        $crate::__rt::push_or(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident |=) => {
+        $crate::__rt::push_or_eq(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident ||) => {
+        $crate::__rt::push_or_or(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident #) => {
+        $crate::__rt::push_pound(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident ?) => {
+        $crate::__rt::push_question(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident ->) => {
+        $crate::__rt::push_rarrow(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident <-) => {
+        $crate::__rt::push_larrow(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident %) => {
+        $crate::__rt::push_rem(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident %=) => {
+        $crate::__rt::push_rem_eq(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident =>) => {
+        $crate::__rt::push_fat_arrow(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident ;) => {
+        $crate::__rt::push_semi(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident <<) => {
+        $crate::__rt::push_shl(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident <<=) => {
+        $crate::__rt::push_shl_eq(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident >>) => {
+        $crate::__rt::push_shr(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident >>=) => {
+        $crate::__rt::push_shr_eq(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident *) => {
+        $crate::__rt::push_star(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident -) => {
+        $crate::__rt::push_sub(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident -=) => {
+        $crate::__rt::push_sub_eq(&mut $tokens, $span);
+    };
+
+    ($tokens:ident $span:ident $other:tt) => {
+        $crate::__rt::parse(&mut $tokens, $span, stringify!($other));
+    };
+}
+
+
\ No newline at end of file diff --git a/src/quote/runtime.rs.html b/src/quote/runtime.rs.html new file mode 100644 index 0000000..8c26377 --- /dev/null +++ b/src/quote/runtime.rs.html @@ -0,0 +1,749 @@ +runtime.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+
+use crate::{IdentFragment, ToTokens, TokenStreamExt};
+use std::fmt;
+use std::ops::BitOr;
+
+pub use proc_macro2::*;
+
+pub struct HasIterator; // True
+pub struct ThereIsNoIteratorInRepetition; // False
+
+impl BitOr<ThereIsNoIteratorInRepetition> for ThereIsNoIteratorInRepetition {
+    type Output = ThereIsNoIteratorInRepetition;
+    fn bitor(self, _rhs: ThereIsNoIteratorInRepetition) -> ThereIsNoIteratorInRepetition {
+        ThereIsNoIteratorInRepetition
+    }
+}
+
+impl BitOr<ThereIsNoIteratorInRepetition> for HasIterator {
+    type Output = HasIterator;
+    fn bitor(self, _rhs: ThereIsNoIteratorInRepetition) -> HasIterator {
+        HasIterator
+    }
+}
+
+impl BitOr<HasIterator> for ThereIsNoIteratorInRepetition {
+    type Output = HasIterator;
+    fn bitor(self, _rhs: HasIterator) -> HasIterator {
+        HasIterator
+    }
+}
+
+impl BitOr<HasIterator> for HasIterator {
+    type Output = HasIterator;
+    fn bitor(self, _rhs: HasIterator) -> HasIterator {
+        HasIterator
+    }
+}
+
+/// Extension traits used by the implementation of `quote!`. These are defined
+/// in separate traits, rather than as a single trait due to ambiguity issues.
+///
+/// These traits expose a `quote_into_iter` method which should allow calling
+/// whichever impl happens to be applicable. Calling that method repeatedly on
+/// the returned value should be idempotent.
+pub mod ext {
+    use super::RepInterp;
+    use super::{HasIterator as HasIter, ThereIsNoIteratorInRepetition as DoesNotHaveIter};
+    use crate::ToTokens;
+    use std::collections::btree_set::{self, BTreeSet};
+    use std::slice;
+
+    /// Extension trait providing the `quote_into_iter` method on iterators.
+    pub trait RepIteratorExt: Iterator + Sized {
+        fn quote_into_iter(self) -> (Self, HasIter) {
+            (self, HasIter)
+        }
+    }
+
+    impl<T: Iterator> RepIteratorExt for T {}
+
+    /// Extension trait providing the `quote_into_iter` method for
+    /// non-iterable types. These types interpolate the same value in each
+    /// iteration of the repetition.
+    pub trait RepToTokensExt {
+        /// Pretend to be an iterator for the purposes of `quote_into_iter`.
+        /// This allows repeated calls to `quote_into_iter` to continue
+        /// correctly returning DoesNotHaveIter.
+        fn next(&self) -> Option<&Self> {
+            Some(self)
+        }
+
+        fn quote_into_iter(&self) -> (&Self, DoesNotHaveIter) {
+            (self, DoesNotHaveIter)
+        }
+    }
+
+    impl<T: ToTokens + ?Sized> RepToTokensExt for T {}
+
+    /// Extension trait providing the `quote_into_iter` method for types that
+    /// can be referenced as an iterator.
+    pub trait RepAsIteratorExt<'q> {
+        type Iter: Iterator;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter);
+    }
+
+    impl<'q, 'a, T: RepAsIteratorExt<'q> + ?Sized> RepAsIteratorExt<'q> for &'a T {
+        type Iter = T::Iter;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            <T as RepAsIteratorExt>::quote_into_iter(*self)
+        }
+    }
+
+    impl<'q, 'a, T: RepAsIteratorExt<'q> + ?Sized> RepAsIteratorExt<'q> for &'a mut T {
+        type Iter = T::Iter;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            <T as RepAsIteratorExt>::quote_into_iter(*self)
+        }
+    }
+
+    impl<'q, T: 'q> RepAsIteratorExt<'q> for [T] {
+        type Iter = slice::Iter<'q, T>;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            (self.iter(), HasIter)
+        }
+    }
+
+    impl<'q, T: 'q> RepAsIteratorExt<'q> for Vec<T> {
+        type Iter = slice::Iter<'q, T>;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            (self.iter(), HasIter)
+        }
+    }
+
+    impl<'q, T: 'q> RepAsIteratorExt<'q> for BTreeSet<T> {
+        type Iter = btree_set::Iter<'q, T>;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            (self.iter(), HasIter)
+        }
+    }
+
+    macro_rules! array_rep_slice {
+        ($($l:tt)*) => {
+            $(
+                impl<'q, T: 'q> RepAsIteratorExt<'q> for [T; $l] {
+                    type Iter = slice::Iter<'q, T>;
+
+                    fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+                        (self.iter(), HasIter)
+                    }
+                }
+            )*
+        }
+    }
+
+    array_rep_slice!(
+        0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
+        17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+    );
+
+    impl<'q, T: RepAsIteratorExt<'q>> RepAsIteratorExt<'q> for RepInterp<T> {
+        type Iter = T::Iter;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            self.0.quote_into_iter()
+        }
+    }
+}
+
+// Helper type used within interpolations to allow for repeated binding names.
+// Implements the relevant traits, and exports a dummy `next()` method.
+#[derive(Copy, Clone)]
+pub struct RepInterp<T>(pub T);
+
+impl<T> RepInterp<T> {
+    // This method is intended to look like `Iterator::next`, and is called when
+    // a name is bound multiple times, as the previous binding will shadow the
+    // original `Iterator` object. This allows us to avoid advancing the
+    // iterator multiple times per iteration.
+    pub fn next(self) -> Option<T> {
+        Some(self.0)
+    }
+}
+
+impl<T: Iterator> Iterator for RepInterp<T> {
+    type Item = T::Item;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.0.next()
+    }
+}
+
+impl<T: ToTokens> ToTokens for RepInterp<T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.0.to_tokens(tokens);
+    }
+}
+
+fn is_ident_start(c: u8) -> bool {
+    (b'a' <= c && c <= b'z') || (b'A' <= c && c <= b'Z') || c == b'_'
+}
+
+fn is_ident_continue(c: u8) -> bool {
+    (b'a' <= c && c <= b'z') || (b'A' <= c && c <= b'Z') || c == b'_' || (b'0' <= c && c <= b'9')
+}
+
+fn is_ident(token: &str) -> bool {
+    let mut iter = token.bytes();
+    let first_ok = iter.next().map(is_ident_start).unwrap_or(false);
+
+    first_ok && iter.all(is_ident_continue)
+}
+
+pub fn parse(tokens: &mut TokenStream, span: Span, s: &str) {
+    if is_ident(s) {
+        // Fast path, since idents are the most common token.
+        tokens.append(Ident::new(s, span));
+    } else {
+        let s: TokenStream = s.parse().expect("invalid token stream");
+        tokens.extend(s.into_iter().map(|mut t| {
+            t.set_span(span);
+            t
+        }));
+    }
+}
+
+macro_rules! push_punct {
+    ($name:ident $char1:tt) => {
+        pub fn $name(tokens: &mut TokenStream, span: Span) {
+            let mut punct = Punct::new($char1, Spacing::Alone);
+            punct.set_span(span);
+            tokens.append(punct);
+        }
+    };
+    ($name:ident $char1:tt $char2:tt) => {
+        pub fn $name(tokens: &mut TokenStream, span: Span) {
+            let mut punct = Punct::new($char1, Spacing::Joint);
+            punct.set_span(span);
+            tokens.append(punct);
+            let mut punct = Punct::new($char2, Spacing::Alone);
+            punct.set_span(span);
+            tokens.append(punct);
+        }
+    };
+    ($name:ident $char1:tt $char2:tt $char3:tt) => {
+        pub fn $name(tokens: &mut TokenStream, span: Span) {
+            let mut punct = Punct::new($char1, Spacing::Joint);
+            punct.set_span(span);
+            tokens.append(punct);
+            let mut punct = Punct::new($char2, Spacing::Joint);
+            punct.set_span(span);
+            tokens.append(punct);
+            let mut punct = Punct::new($char3, Spacing::Alone);
+            punct.set_span(span);
+            tokens.append(punct);
+        }
+    };
+}
+
+push_punct!(push_add '+');
+push_punct!(push_add_eq '+' '=');
+push_punct!(push_and '&');
+push_punct!(push_and_and '&' '&');
+push_punct!(push_and_eq '&' '=');
+push_punct!(push_at '@');
+push_punct!(push_bang '!');
+push_punct!(push_caret '^');
+push_punct!(push_caret_eq '^' '=');
+push_punct!(push_colon ':');
+push_punct!(push_colon2 ':' ':');
+push_punct!(push_comma ',');
+push_punct!(push_div '/');
+push_punct!(push_div_eq '/' '=');
+push_punct!(push_dot '.');
+push_punct!(push_dot2 '.' '.');
+push_punct!(push_dot3 '.' '.' '.');
+push_punct!(push_dot_dot_eq '.' '.' '=');
+push_punct!(push_eq '=');
+push_punct!(push_eq_eq '=' '=');
+push_punct!(push_ge '>' '=');
+push_punct!(push_gt '>');
+push_punct!(push_le '<' '=');
+push_punct!(push_lt '<');
+push_punct!(push_mul_eq '*' '=');
+push_punct!(push_ne '!' '=');
+push_punct!(push_or '|');
+push_punct!(push_or_eq '|' '=');
+push_punct!(push_or_or '|' '|');
+push_punct!(push_pound '#');
+push_punct!(push_question '?');
+push_punct!(push_rarrow '-' '>');
+push_punct!(push_larrow '<' '-');
+push_punct!(push_rem '%');
+push_punct!(push_rem_eq '%' '=');
+push_punct!(push_fat_arrow '=' '>');
+push_punct!(push_semi ';');
+push_punct!(push_shl '<' '<');
+push_punct!(push_shl_eq '<' '<' '=');
+push_punct!(push_shr '>' '>');
+push_punct!(push_shr_eq '>' '>' '=');
+push_punct!(push_star '*');
+push_punct!(push_sub '-');
+push_punct!(push_sub_eq '-' '=');
+
+// Helper method for constructing identifiers from the `format_ident!` macro,
+// handling `r#` prefixes.
+//
+// Directly parsing the input string may produce a valid identifier,
+// although the input string was invalid, due to ignored characters such as
+// whitespace and comments. Instead, we always create a non-raw identifier
+// to validate that the string is OK, and only parse again if needed.
+//
+// The `is_ident` method defined above is insufficient for validation, as it
+// will reject non-ASCII identifiers.
+pub fn mk_ident(id: &str, span: Option<Span>) -> Ident {
+    let span = span.unwrap_or_else(Span::call_site);
+
+    let is_raw = id.starts_with("r#");
+    let unraw = Ident::new(if is_raw { &id[2..] } else { id }, span);
+    if !is_raw {
+        return unraw;
+    }
+
+    // At this point, the identifier is raw, and the unraw-ed version of it was
+    // successfully converted into an identifier. Try to produce a valid raw
+    // identifier by running the `TokenStream` parser, and unwrapping the first
+    // token as an `Ident`.
+    //
+    // FIXME: When `Ident::new_raw` becomes stable, this method should be
+    // updated to call it when available.
+    match id.parse::<TokenStream>() {
+        Ok(ts) => {
+            let mut iter = ts.into_iter();
+            match (iter.next(), iter.next()) {
+                (Some(TokenTree::Ident(mut id)), None) => {
+                    id.set_span(span);
+                    id
+                }
+                _ => unreachable!("valid raw ident fails to parse"),
+            }
+        }
+        Err(_) => unreachable!("valid raw ident fails to parse"),
+    }
+}
+
+// Adapts from `IdentFragment` to `fmt::Display` for use by the `format_ident!`
+// macro, and exposes span information from these fragments.
+//
+// This struct also has forwarding implementations of the formatting traits
+// `Octal`, `LowerHex`, `UpperHex`, and `Binary` to allow for their use within
+// `format_ident!`.
+#[derive(Copy, Clone)]
+pub struct IdentFragmentAdapter<T: IdentFragment>(pub T);
+
+impl<T: IdentFragment> IdentFragmentAdapter<T> {
+    pub fn span(&self) -> Option<Span> {
+        self.0.span()
+    }
+}
+
+impl<T: IdentFragment> fmt::Display for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        IdentFragment::fmt(&self.0, f)
+    }
+}
+
+impl<T: IdentFragment + fmt::Octal> fmt::Octal for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::Octal::fmt(&self.0, f)
+    }
+}
+
+impl<T: IdentFragment + fmt::LowerHex> fmt::LowerHex for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::LowerHex::fmt(&self.0, f)
+    }
+}
+
+impl<T: IdentFragment + fmt::UpperHex> fmt::UpperHex for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::UpperHex::fmt(&self.0, f)
+    }
+}
+
+impl<T: IdentFragment + fmt::Binary> fmt::Binary for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::Binary::fmt(&self.0, f)
+    }
+}
+
+
\ No newline at end of file diff --git a/src/quote/spanned.rs.html b/src/quote/spanned.rs.html new file mode 100644 index 0000000..81f954f --- /dev/null +++ b/src/quote/spanned.rs.html @@ -0,0 +1,87 @@ +spanned.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
+use crate::ToTokens;
+use proc_macro2::{Span, TokenStream};
+
+pub trait Spanned {
+    fn __span(&self) -> Span;
+}
+
+impl Spanned for Span {
+    fn __span(&self) -> Span {
+        *self
+    }
+}
+
+impl<T: ?Sized + ToTokens> Spanned for T {
+    fn __span(&self) -> Span {
+        join_spans(self.into_token_stream())
+    }
+}
+
+fn join_spans(tokens: TokenStream) -> Span {
+    let mut iter = tokens.into_iter().filter_map(|tt| {
+        // FIXME: This shouldn't be required, since optimally spans should
+        // never be invalid. This filter_map can probably be removed when
+        // https://github.com/rust-lang/rust/issues/43081 is resolved.
+        let span = tt.span();
+        let debug = format!("{:?}", span);
+        if debug.ends_with("bytes(0..0)") {
+            None
+        } else {
+            Some(span)
+        }
+    });
+
+    let first = match iter.next() {
+        Some(span) => span,
+        None => return Span::call_site(),
+    };
+
+    iter.fold(None, |_prev, next| Some(next))
+        .and_then(|last| first.join(last))
+        .unwrap_or(first)
+}
+
+
\ No newline at end of file diff --git a/src/quote/to_tokens.rs.html b/src/quote/to_tokens.rs.html new file mode 100644 index 0000000..4ab45de --- /dev/null +++ b/src/quote/to_tokens.rs.html @@ -0,0 +1,421 @@ +to_tokens.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+
+use super::TokenStreamExt;
+
+use std::borrow::Cow;
+use std::iter;
+use std::rc::Rc;
+
+use proc_macro2::{Group, Ident, Literal, Punct, Span, TokenStream, TokenTree};
+
+/// Types that can be interpolated inside a `quote!` invocation.
+///
+/// [`quote!`]: macro.quote.html
+pub trait ToTokens {
+    /// Write `self` to the given `TokenStream`.
+    ///
+    /// The token append methods provided by the [`TokenStreamExt`] extension
+    /// trait may be useful for implementing `ToTokens`.
+    ///
+    /// [`TokenStreamExt`]: trait.TokenStreamExt.html
+    ///
+    /// # Example
+    ///
+    /// Example implementation for a struct representing Rust paths like
+    /// `std::cmp::PartialEq`:
+    ///
+    /// ```
+    /// use proc_macro2::{TokenTree, Spacing, Span, Punct, TokenStream};
+    /// use quote::{TokenStreamExt, ToTokens};
+    ///
+    /// pub struct Path {
+    ///     pub global: bool,
+    ///     pub segments: Vec<PathSegment>,
+    /// }
+    ///
+    /// impl ToTokens for Path {
+    ///     fn to_tokens(&self, tokens: &mut TokenStream) {
+    ///         for (i, segment) in self.segments.iter().enumerate() {
+    ///             if i > 0 || self.global {
+    ///                 // Double colon `::`
+    ///                 tokens.append(Punct::new(':', Spacing::Joint));
+    ///                 tokens.append(Punct::new(':', Spacing::Alone));
+    ///             }
+    ///             segment.to_tokens(tokens);
+    ///         }
+    ///     }
+    /// }
+    /// #
+    /// # pub struct PathSegment;
+    /// #
+    /// # impl ToTokens for PathSegment {
+    /// #     fn to_tokens(&self, tokens: &mut TokenStream) {
+    /// #         unimplemented!()
+    /// #     }
+    /// # }
+    /// ```
+    fn to_tokens(&self, tokens: &mut TokenStream);
+
+    /// Convert `self` directly into a `TokenStream` object.
+    ///
+    /// This method is implicitly implemented using `to_tokens`, and acts as a
+    /// convenience method for consumers of the `ToTokens` trait.
+    fn to_token_stream(&self) -> TokenStream {
+        let mut tokens = TokenStream::new();
+        self.to_tokens(&mut tokens);
+        tokens
+    }
+
+    /// Convert `self` directly into a `TokenStream` object.
+    ///
+    /// This method is implicitly implemented using `to_tokens`, and acts as a
+    /// convenience method for consumers of the `ToTokens` trait.
+    fn into_token_stream(self) -> TokenStream
+    where
+        Self: Sized,
+    {
+        self.to_token_stream()
+    }
+}
+
+impl<'a, T: ?Sized + ToTokens> ToTokens for &'a T {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<'a, T: ?Sized + ToTokens> ToTokens for &'a mut T {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<'a, T: ?Sized + ToOwned + ToTokens> ToTokens for Cow<'a, T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<T: ?Sized + ToTokens> ToTokens for Box<T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<T: ?Sized + ToTokens> ToTokens for Rc<T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<T: ToTokens> ToTokens for Option<T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        if let Some(ref t) = *self {
+            t.to_tokens(tokens);
+        }
+    }
+}
+
+impl ToTokens for str {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(Literal::string(self));
+    }
+}
+
+impl ToTokens for String {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.as_str().to_tokens(tokens);
+    }
+}
+
+macro_rules! primitive {
+    ($($t:ident => $name:ident)*) => ($(
+        impl ToTokens for $t {
+            fn to_tokens(&self, tokens: &mut TokenStream) {
+                tokens.append(Literal::$name(*self));
+            }
+        }
+    )*)
+}
+
+primitive! {
+    i8 => i8_suffixed
+    i16 => i16_suffixed
+    i32 => i32_suffixed
+    i64 => i64_suffixed
+    i128 => i128_suffixed
+    isize => isize_suffixed
+
+    u8 => u8_suffixed
+    u16 => u16_suffixed
+    u32 => u32_suffixed
+    u64 => u64_suffixed
+    u128 => u128_suffixed
+    usize => usize_suffixed
+
+    f32 => f32_suffixed
+    f64 => f64_suffixed
+}
+
+impl ToTokens for char {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(Literal::character(*self));
+    }
+}
+
+impl ToTokens for bool {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        let word = if *self { "true" } else { "false" };
+        tokens.append(Ident::new(word, Span::call_site()));
+    }
+}
+
+impl ToTokens for Group {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(self.clone());
+    }
+}
+
+impl ToTokens for Ident {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(self.clone());
+    }
+}
+
+impl ToTokens for Punct {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(self.clone());
+    }
+}
+
+impl ToTokens for Literal {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(self.clone());
+    }
+}
+
+impl ToTokens for TokenTree {
+    fn to_tokens(&self, dst: &mut TokenStream) {
+        dst.append(self.clone());
+    }
+}
+
+impl ToTokens for TokenStream {
+    fn to_tokens(&self, dst: &mut TokenStream) {
+        dst.extend(iter::once(self.clone()));
+    }
+
+    fn into_token_stream(self) -> TokenStream {
+        self
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde/de/from_primitive.rs.html b/src/serde/de/from_primitive.rs.html new file mode 100644 index 0000000..3cb03b8 --- /dev/null +++ b/src/serde/de/from_primitive.rs.html @@ -0,0 +1,523 @@ +from_primitive.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+
+use lib::*;
+
+macro_rules! int_to_int {
+    ($dst:ident, $n:ident) => {
+        if $dst::min_value() as i64 <= $n as i64 && $n as i64 <= $dst::max_value() as i64 {
+            Some($n as $dst)
+        } else {
+            None
+        }
+    };
+}
+
+macro_rules! int_to_uint {
+    ($dst:ident, $n:ident) => {
+        if 0 <= $n && $n as u64 <= $dst::max_value() as u64 {
+            Some($n as $dst)
+        } else {
+            None
+        }
+    };
+}
+
+macro_rules! uint_to {
+    ($dst:ident, $n:ident) => {
+        if $n as u64 <= $dst::max_value() as u64 {
+            Some($n as $dst)
+        } else {
+            None
+        }
+    };
+}
+
+pub trait FromPrimitive: Sized {
+    fn from_i8(n: i8) -> Option<Self>;
+    fn from_i16(n: i16) -> Option<Self>;
+    fn from_i32(n: i32) -> Option<Self>;
+    fn from_i64(n: i64) -> Option<Self>;
+    fn from_u8(n: u8) -> Option<Self>;
+    fn from_u16(n: u16) -> Option<Self>;
+    fn from_u32(n: u32) -> Option<Self>;
+    fn from_u64(n: u64) -> Option<Self>;
+}
+
+macro_rules! impl_from_primitive_for_int {
+    ($t:ident) => {
+        impl FromPrimitive for $t {
+            #[inline]
+            fn from_i8(n: i8) -> Option<Self> {
+                int_to_int!($t, n)
+            }
+            #[inline]
+            fn from_i16(n: i16) -> Option<Self> {
+                int_to_int!($t, n)
+            }
+            #[inline]
+            fn from_i32(n: i32) -> Option<Self> {
+                int_to_int!($t, n)
+            }
+            #[inline]
+            fn from_i64(n: i64) -> Option<Self> {
+                int_to_int!($t, n)
+            }
+            #[inline]
+            fn from_u8(n: u8) -> Option<Self> {
+                uint_to!($t, n)
+            }
+            #[inline]
+            fn from_u16(n: u16) -> Option<Self> {
+                uint_to!($t, n)
+            }
+            #[inline]
+            fn from_u32(n: u32) -> Option<Self> {
+                uint_to!($t, n)
+            }
+            #[inline]
+            fn from_u64(n: u64) -> Option<Self> {
+                uint_to!($t, n)
+            }
+        }
+    };
+}
+
+macro_rules! impl_from_primitive_for_uint {
+    ($t:ident) => {
+        impl FromPrimitive for $t {
+            #[inline]
+            fn from_i8(n: i8) -> Option<Self> {
+                int_to_uint!($t, n)
+            }
+            #[inline]
+            fn from_i16(n: i16) -> Option<Self> {
+                int_to_uint!($t, n)
+            }
+            #[inline]
+            fn from_i32(n: i32) -> Option<Self> {
+                int_to_uint!($t, n)
+            }
+            #[inline]
+            fn from_i64(n: i64) -> Option<Self> {
+                int_to_uint!($t, n)
+            }
+            #[inline]
+            fn from_u8(n: u8) -> Option<Self> {
+                uint_to!($t, n)
+            }
+            #[inline]
+            fn from_u16(n: u16) -> Option<Self> {
+                uint_to!($t, n)
+            }
+            #[inline]
+            fn from_u32(n: u32) -> Option<Self> {
+                uint_to!($t, n)
+            }
+            #[inline]
+            fn from_u64(n: u64) -> Option<Self> {
+                uint_to!($t, n)
+            }
+        }
+    };
+}
+
+macro_rules! impl_from_primitive_for_float {
+    ($t:ident) => {
+        impl FromPrimitive for $t {
+            #[inline]
+            fn from_i8(n: i8) -> Option<Self> {
+                Some(n as Self)
+            }
+            #[inline]
+            fn from_i16(n: i16) -> Option<Self> {
+                Some(n as Self)
+            }
+            #[inline]
+            fn from_i32(n: i32) -> Option<Self> {
+                Some(n as Self)
+            }
+            #[inline]
+            fn from_i64(n: i64) -> Option<Self> {
+                Some(n as Self)
+            }
+            #[inline]
+            fn from_u8(n: u8) -> Option<Self> {
+                Some(n as Self)
+            }
+            #[inline]
+            fn from_u16(n: u16) -> Option<Self> {
+                Some(n as Self)
+            }
+            #[inline]
+            fn from_u32(n: u32) -> Option<Self> {
+                Some(n as Self)
+            }
+            #[inline]
+            fn from_u64(n: u64) -> Option<Self> {
+                Some(n as Self)
+            }
+        }
+    };
+}
+
+impl_from_primitive_for_int!(isize);
+impl_from_primitive_for_int!(i8);
+impl_from_primitive_for_int!(i16);
+impl_from_primitive_for_int!(i32);
+impl_from_primitive_for_int!(i64);
+impl_from_primitive_for_uint!(usize);
+impl_from_primitive_for_uint!(u8);
+impl_from_primitive_for_uint!(u16);
+impl_from_primitive_for_uint!(u32);
+impl_from_primitive_for_uint!(u64);
+impl_from_primitive_for_float!(f32);
+impl_from_primitive_for_float!(f64);
+
+serde_if_integer128! {
+    impl FromPrimitive for i128 {
+        #[inline]
+        fn from_i8(n: i8) -> Option<Self> {
+            Some(n as i128)
+        }
+        #[inline]
+        fn from_i16(n: i16) -> Option<Self> {
+            Some(n as i128)
+        }
+        #[inline]
+        fn from_i32(n: i32) -> Option<Self> {
+            Some(n as i128)
+        }
+        #[inline]
+        fn from_i64(n: i64) -> Option<Self> {
+            Some(n as i128)
+        }
+        #[inline]
+        fn from_u8(n: u8) -> Option<Self> {
+            Some(n as i128)
+        }
+        #[inline]
+        fn from_u16(n: u16) -> Option<Self> {
+            Some(n as i128)
+        }
+        #[inline]
+        fn from_u32(n: u32) -> Option<Self> {
+            Some(n as i128)
+        }
+        #[inline]
+        fn from_u64(n: u64) -> Option<Self> {
+            Some(n as i128)
+        }
+    }
+
+    impl FromPrimitive for u128 {
+        #[inline]
+        fn from_i8(n: i8) -> Option<Self> {
+            if n >= 0 {
+                Some(n as u128)
+            } else {
+                None
+            }
+        }
+        #[inline]
+        fn from_i16(n: i16) -> Option<Self> {
+            if n >= 0 {
+                Some(n as u128)
+            } else {
+                None
+            }
+        }
+        #[inline]
+        fn from_i32(n: i32) -> Option<Self> {
+            if n >= 0 {
+                Some(n as u128)
+            } else {
+                None
+            }
+        }
+        #[inline]
+        fn from_i64(n: i64) -> Option<Self> {
+            if n >= 0 {
+                Some(n as u128)
+            } else {
+                None
+            }
+        }
+        #[inline]
+        fn from_u8(n: u8) -> Option<Self> {
+            Some(n as u128)
+        }
+        #[inline]
+        fn from_u16(n: u16) -> Option<Self> {
+            Some(n as u128)
+        }
+        #[inline]
+        fn from_u32(n: u32) -> Option<Self> {
+            Some(n as u128)
+        }
+        #[inline]
+        fn from_u64(n: u64) -> Option<Self> {
+            Some(n as u128)
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde/de/ignored_any.rs.html b/src/serde/de/ignored_any.rs.html new file mode 100644 index 0000000..6854267 --- /dev/null +++ b/src/serde/de/ignored_any.rs.html @@ -0,0 +1,457 @@ +ignored_any.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+
+use lib::*;
+
+use de::{
+    Deserialize, Deserializer, EnumAccess, Error, MapAccess, SeqAccess, VariantAccess, Visitor,
+};
+
+/// An efficient way of discarding data from a deserializer.
+///
+/// Think of this like `serde_json::Value` in that it can be deserialized from
+/// any type, except that it does not store any information about the data that
+/// gets deserialized.
+///
+/// ```edition2018
+/// use std::fmt;
+/// use std::marker::PhantomData;
+///
+/// use serde::de::{
+///     self, Deserialize, DeserializeSeed, Deserializer, IgnoredAny, SeqAccess, Visitor,
+/// };
+///
+/// /// A seed that can be used to deserialize only the `n`th element of a sequence
+/// /// while efficiently discarding elements of any type before or after index `n`.
+/// ///
+/// /// For example to deserialize only the element at index 3:
+/// ///
+/// /// ```
+/// /// NthElement::new(3).deserialize(deserializer)
+/// /// ```
+/// pub struct NthElement<T> {
+///     n: usize,
+///     marker: PhantomData<T>,
+/// }
+///
+/// impl<T> NthElement<T> {
+///     pub fn new(n: usize) -> Self {
+///         NthElement {
+///             n: n,
+///             marker: PhantomData,
+///         }
+///     }
+/// }
+///
+/// impl<'de, T> Visitor<'de> for NthElement<T>
+/// where
+///     T: Deserialize<'de>,
+/// {
+///     type Value = T;
+///
+///     fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+///         write!(
+///             formatter,
+///             "a sequence in which we care about element {}",
+///             self.n
+///         )
+///     }
+///
+///     fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
+///     where
+///         A: SeqAccess<'de>,
+///     {
+///         // Skip over the first `n` elements.
+///         for i in 0..self.n {
+///             // It is an error if the sequence ends before we get to element `n`.
+///             if seq.next_element::<IgnoredAny>()?.is_none() {
+///                 return Err(de::Error::invalid_length(i, &self));
+///             }
+///         }
+///
+///         // Deserialize the one we care about.
+///         let nth = match seq.next_element()? {
+///             Some(nth) => nth,
+///             None => {
+///                 return Err(de::Error::invalid_length(self.n, &self));
+///             }
+///         };
+///
+///         // Skip over any remaining elements in the sequence after `n`.
+///         while let Some(IgnoredAny) = seq.next_element()? {
+///             // ignore
+///         }
+///
+///         Ok(nth)
+///     }
+/// }
+///
+/// impl<'de, T> DeserializeSeed<'de> for NthElement<T>
+/// where
+///     T: Deserialize<'de>,
+/// {
+///     type Value = T;
+///
+///     fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+///     where
+///         D: Deserializer<'de>,
+///     {
+///         deserializer.deserialize_seq(self)
+///     }
+/// }
+///
+/// # fn example<'de, D>(deserializer: D) -> Result<(), D::Error>
+/// # where
+/// #     D: Deserializer<'de>,
+/// # {
+/// // Deserialize only the sequence element at index 3 from this deserializer.
+/// // The element at index 3 is required to be a string. Elements before and
+/// // after index 3 are allowed to be of any type.
+/// let s: String = NthElement::new(3).deserialize(deserializer)?;
+/// #     Ok(())
+/// # }
+/// ```
+#[derive(Copy, Clone, Debug, Default)]
+pub struct IgnoredAny;
+
+impl<'de> Visitor<'de> for IgnoredAny {
+    type Value = IgnoredAny;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("anything at all")
+    }
+
+    #[inline]
+    fn visit_bool<E>(self, x: bool) -> Result<Self::Value, E> {
+        let _ = x;
+        Ok(IgnoredAny)
+    }
+
+    #[inline]
+    fn visit_i64<E>(self, x: i64) -> Result<Self::Value, E> {
+        let _ = x;
+        Ok(IgnoredAny)
+    }
+
+    #[inline]
+    fn visit_u64<E>(self, x: u64) -> Result<Self::Value, E> {
+        let _ = x;
+        Ok(IgnoredAny)
+    }
+
+    #[inline]
+    fn visit_f64<E>(self, x: f64) -> Result<Self::Value, E> {
+        let _ = x;
+        Ok(IgnoredAny)
+    }
+
+    #[inline]
+    fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        let _ = s;
+        Ok(IgnoredAny)
+    }
+
+    #[inline]
+    fn visit_none<E>(self) -> Result<Self::Value, E> {
+        Ok(IgnoredAny)
+    }
+
+    #[inline]
+    fn visit_some<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        IgnoredAny::deserialize(deserializer)
+    }
+
+    #[inline]
+    fn visit_newtype_struct<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        IgnoredAny::deserialize(deserializer)
+    }
+
+    #[inline]
+    fn visit_unit<E>(self) -> Result<Self::Value, E> {
+        Ok(IgnoredAny)
+    }
+
+    #[inline]
+    fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
+    where
+        A: SeqAccess<'de>,
+    {
+        while let Some(IgnoredAny) = try!(seq.next_element()) {
+            // Gobble
+        }
+        Ok(IgnoredAny)
+    }
+
+    #[inline]
+    fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error>
+    where
+        A: MapAccess<'de>,
+    {
+        while let Some((IgnoredAny, IgnoredAny)) = try!(map.next_entry()) {
+            // Gobble
+        }
+        Ok(IgnoredAny)
+    }
+
+    #[inline]
+    fn visit_bytes<E>(self, bytes: &[u8]) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        let _ = bytes;
+        Ok(IgnoredAny)
+    }
+
+    fn visit_enum<A>(self, data: A) -> Result<Self::Value, A::Error>
+    where
+        A: EnumAccess<'de>,
+    {
+        data.variant::<IgnoredAny>()?.1.newtype_variant()
+    }
+}
+
+impl<'de> Deserialize<'de> for IgnoredAny {
+    #[inline]
+    fn deserialize<D>(deserializer: D) -> Result<IgnoredAny, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_ignored_any(IgnoredAny)
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde/de/impls.rs.html b/src/serde/de/impls.rs.html new file mode 100644 index 0000000..17f779e --- /dev/null +++ b/src/serde/de/impls.rs.html @@ -0,0 +1,5221 @@ +impls.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+2277
+2278
+2279
+2280
+2281
+2282
+2283
+2284
+2285
+2286
+2287
+2288
+2289
+2290
+2291
+2292
+2293
+2294
+2295
+2296
+2297
+2298
+2299
+2300
+2301
+2302
+2303
+2304
+2305
+2306
+2307
+2308
+2309
+2310
+2311
+2312
+2313
+2314
+2315
+2316
+2317
+2318
+2319
+2320
+2321
+2322
+2323
+2324
+2325
+2326
+2327
+2328
+2329
+2330
+2331
+2332
+2333
+2334
+2335
+2336
+2337
+2338
+2339
+2340
+2341
+2342
+2343
+2344
+2345
+2346
+2347
+2348
+2349
+2350
+2351
+2352
+2353
+2354
+2355
+2356
+2357
+2358
+2359
+2360
+2361
+2362
+2363
+2364
+2365
+2366
+2367
+2368
+2369
+2370
+2371
+2372
+2373
+2374
+2375
+2376
+2377
+2378
+2379
+2380
+2381
+2382
+2383
+2384
+2385
+2386
+2387
+2388
+2389
+2390
+2391
+2392
+2393
+2394
+2395
+2396
+2397
+2398
+2399
+2400
+2401
+2402
+2403
+2404
+2405
+2406
+2407
+2408
+2409
+2410
+2411
+2412
+2413
+2414
+2415
+2416
+2417
+2418
+2419
+2420
+2421
+2422
+2423
+2424
+2425
+2426
+2427
+2428
+2429
+2430
+2431
+2432
+2433
+2434
+2435
+2436
+2437
+2438
+2439
+2440
+2441
+2442
+2443
+2444
+2445
+2446
+2447
+2448
+2449
+2450
+2451
+2452
+2453
+2454
+2455
+2456
+2457
+2458
+2459
+2460
+2461
+2462
+2463
+2464
+2465
+2466
+2467
+2468
+2469
+2470
+2471
+2472
+2473
+2474
+2475
+2476
+2477
+2478
+2479
+2480
+2481
+2482
+2483
+2484
+2485
+2486
+2487
+2488
+2489
+2490
+2491
+2492
+2493
+2494
+2495
+2496
+2497
+2498
+2499
+2500
+2501
+2502
+2503
+2504
+2505
+2506
+2507
+2508
+2509
+2510
+2511
+2512
+2513
+2514
+2515
+2516
+2517
+2518
+2519
+2520
+2521
+2522
+2523
+2524
+2525
+2526
+2527
+2528
+2529
+2530
+2531
+2532
+2533
+2534
+2535
+2536
+2537
+2538
+2539
+2540
+2541
+2542
+2543
+2544
+2545
+2546
+2547
+2548
+2549
+2550
+2551
+2552
+2553
+2554
+2555
+2556
+2557
+2558
+2559
+2560
+2561
+2562
+2563
+2564
+2565
+2566
+2567
+2568
+2569
+2570
+2571
+2572
+2573
+2574
+2575
+2576
+2577
+2578
+2579
+2580
+2581
+2582
+2583
+2584
+2585
+2586
+2587
+2588
+2589
+2590
+2591
+2592
+2593
+2594
+2595
+2596
+2597
+2598
+2599
+2600
+2601
+2602
+2603
+2604
+2605
+2606
+2607
+2608
+2609
+
+use lib::*;
+
+use de::{
+    Deserialize, Deserializer, EnumAccess, Error, SeqAccess, Unexpected, VariantAccess, Visitor,
+};
+
+#[cfg(any(core_duration, feature = "std", feature = "alloc"))]
+use de::MapAccess;
+
+use de::from_primitive::FromPrimitive;
+use private::de::InPlaceSeed;
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+use private::de::size_hint;
+
+////////////////////////////////////////////////////////////////////////////////
+
+struct UnitVisitor;
+
+impl<'de> Visitor<'de> for UnitVisitor {
+    type Value = ();
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("unit")
+    }
+
+    fn visit_unit<E>(self) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Ok(())
+    }
+}
+
+impl<'de> Deserialize<'de> for () {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_unit(UnitVisitor)
+    }
+}
+
+#[cfg(feature = "unstable")]
+impl<'de> Deserialize<'de> for ! {
+    fn deserialize<D>(_deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        Err(Error::custom("cannot deserialize `!`"))
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+struct BoolVisitor;
+
+impl<'de> Visitor<'de> for BoolVisitor {
+    type Value = bool;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("a boolean")
+    }
+
+    fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Ok(v)
+    }
+}
+
+impl<'de> Deserialize<'de> for bool {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_bool(BoolVisitor)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+macro_rules! visit_integer_method {
+    ($src_ty:ident, $method:ident, $from_method:ident, $group:ident, $group_ty:ident) => {
+        #[inline]
+        fn $method<E>(self, v: $src_ty) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            match FromPrimitive::$from_method(v) {
+                Some(v) => Ok(v),
+                None => Err(Error::invalid_value(Unexpected::$group(v as $group_ty), &self)),
+            }
+        }
+    }
+}
+
+macro_rules! visit_float_method {
+    ($src_ty:ident, $method:ident) => {
+        #[inline]
+        fn $method<E>(self, v: $src_ty) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            Ok(v as Self::Value)
+        }
+    }
+}
+
+macro_rules! impl_deserialize_num {
+    ($ty:ident, $method:ident, $($visit:ident),*) => {
+        impl<'de> Deserialize<'de> for $ty {
+            #[inline]
+            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            where
+                D: Deserializer<'de>,
+            {
+                struct PrimitiveVisitor;
+
+                impl<'de> Visitor<'de> for PrimitiveVisitor {
+                    type Value = $ty;
+
+                    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                        formatter.write_str(stringify!($ty))
+                    }
+
+                    $(
+                        impl_deserialize_num!($visit $ty);
+                    )*
+                }
+
+                deserializer.$method(PrimitiveVisitor)
+            }
+        }
+    };
+
+    (integer $ty:ident) => {
+        visit_integer_method!(i8, visit_i8, from_i8, Signed, i64);
+        visit_integer_method!(i16, visit_i16, from_i16, Signed, i64);
+        visit_integer_method!(i32, visit_i32, from_i32, Signed, i64);
+        visit_integer_method!(i64, visit_i64, from_i64, Signed, i64);
+
+        visit_integer_method!(u8, visit_u8, from_u8, Unsigned, u64);
+        visit_integer_method!(u16, visit_u16, from_u16, Unsigned, u64);
+        visit_integer_method!(u32, visit_u32, from_u32, Unsigned, u64);
+        visit_integer_method!(u64, visit_u64, from_u64, Unsigned, u64);
+    };
+
+    (float $ty:ident) => {
+        visit_float_method!(f32, visit_f32);
+        visit_float_method!(f64, visit_f64);
+    };
+}
+
+impl_deserialize_num!(i8, deserialize_i8, integer);
+impl_deserialize_num!(i16, deserialize_i16, integer);
+impl_deserialize_num!(i32, deserialize_i32, integer);
+impl_deserialize_num!(i64, deserialize_i64, integer);
+impl_deserialize_num!(isize, deserialize_i64, integer);
+
+impl_deserialize_num!(u8, deserialize_u8, integer);
+impl_deserialize_num!(u16, deserialize_u16, integer);
+impl_deserialize_num!(u32, deserialize_u32, integer);
+impl_deserialize_num!(u64, deserialize_u64, integer);
+impl_deserialize_num!(usize, deserialize_u64, integer);
+
+impl_deserialize_num!(f32, deserialize_f32, integer, float);
+impl_deserialize_num!(f64, deserialize_f64, integer, float);
+
+serde_if_integer128! {
+    impl<'de> Deserialize<'de> for i128 {
+        #[inline]
+        fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            struct PrimitiveVisitor;
+
+            impl<'de> Visitor<'de> for PrimitiveVisitor {
+                type Value = i128;
+
+                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("i128")
+                }
+
+                impl_deserialize_num!(integer i128);
+
+                #[inline]
+                fn visit_i128<E>(self, v: i128) -> Result<Self::Value, E>
+                where
+                    E: Error,
+                {
+                    Ok(v)
+                }
+
+                #[inline]
+                fn visit_u128<E>(self, v: u128) -> Result<Self::Value, E>
+                where
+                    E: Error,
+                {
+                    if v <= i128::max_value() as u128 {
+                        Ok(v as i128)
+                    } else {
+                        Err(Error::invalid_value(Unexpected::Other("u128"), &self))
+                    }
+                }
+            }
+
+            deserializer.deserialize_i128(PrimitiveVisitor)
+        }
+    }
+
+    impl<'de> Deserialize<'de> for u128 {
+        #[inline]
+        fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            struct PrimitiveVisitor;
+
+            impl<'de> Visitor<'de> for PrimitiveVisitor {
+                type Value = u128;
+
+                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("u128")
+                }
+
+                impl_deserialize_num!(integer u128);
+
+                #[inline]
+                fn visit_i128<E>(self, v: i128) -> Result<Self::Value, E>
+                where
+                    E: Error,
+                {
+                    if v >= 0 {
+                        Ok(v as u128)
+                    } else {
+                        Err(Error::invalid_value(Unexpected::Other("i128"), &self))
+                    }
+                }
+
+                #[inline]
+                fn visit_u128<E>(self, v: u128) -> Result<Self::Value, E>
+                where
+                    E: Error,
+                {
+                    Ok(v)
+                }
+            }
+
+            deserializer.deserialize_u128(PrimitiveVisitor)
+        }
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+struct CharVisitor;
+
+impl<'de> Visitor<'de> for CharVisitor {
+    type Value = char;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("a character")
+    }
+
+    #[inline]
+    fn visit_char<E>(self, v: char) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Ok(v)
+    }
+
+    #[inline]
+    fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        let mut iter = v.chars();
+        match (iter.next(), iter.next()) {
+            (Some(c), None) => Ok(c),
+            _ => Err(Error::invalid_value(Unexpected::Str(v), &self)),
+        }
+    }
+}
+
+impl<'de> Deserialize<'de> for char {
+    #[inline]
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_char(CharVisitor)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+struct StringVisitor;
+#[cfg(any(feature = "std", feature = "alloc"))]
+struct StringInPlaceVisitor<'a>(&'a mut String);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'de> Visitor<'de> for StringVisitor {
+    type Value = String;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("a string")
+    }
+
+    fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Ok(v.to_owned())
+    }
+
+    fn visit_string<E>(self, v: String) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Ok(v)
+    }
+
+    fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        match str::from_utf8(v) {
+            Ok(s) => Ok(s.to_owned()),
+            Err(_) => Err(Error::invalid_value(Unexpected::Bytes(v), &self)),
+        }
+    }
+
+    fn visit_byte_buf<E>(self, v: Vec<u8>) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        match String::from_utf8(v) {
+            Ok(s) => Ok(s),
+            Err(e) => Err(Error::invalid_value(
+                Unexpected::Bytes(&e.into_bytes()),
+                &self,
+            )),
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, 'de> Visitor<'de> for StringInPlaceVisitor<'a> {
+    type Value = ();
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("a string")
+    }
+
+    fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        self.0.clear();
+        self.0.push_str(v);
+        Ok(())
+    }
+
+    fn visit_string<E>(self, v: String) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        *self.0 = v;
+        Ok(())
+    }
+
+    fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        match str::from_utf8(v) {
+            Ok(s) => {
+                self.0.clear();
+                self.0.push_str(s);
+                Ok(())
+            }
+            Err(_) => Err(Error::invalid_value(Unexpected::Bytes(v), &self)),
+        }
+    }
+
+    fn visit_byte_buf<E>(self, v: Vec<u8>) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        match String::from_utf8(v) {
+            Ok(s) => {
+                *self.0 = s;
+                Ok(())
+            }
+            Err(e) => Err(Error::invalid_value(
+                Unexpected::Bytes(&e.into_bytes()),
+                &self,
+            )),
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'de> Deserialize<'de> for String {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_string(StringVisitor)
+    }
+
+    fn deserialize_in_place<D>(deserializer: D, place: &mut Self) -> Result<(), D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_string(StringInPlaceVisitor(place))
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+struct StrVisitor;
+
+impl<'a> Visitor<'a> for StrVisitor {
+    type Value = &'a str;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("a borrowed string")
+    }
+
+    fn visit_borrowed_str<E>(self, v: &'a str) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Ok(v) // so easy
+    }
+
+    fn visit_borrowed_bytes<E>(self, v: &'a [u8]) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        str::from_utf8(v).map_err(|_| Error::invalid_value(Unexpected::Bytes(v), &self))
+    }
+}
+
+impl<'de: 'a, 'a> Deserialize<'de> for &'a str {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_str(StrVisitor)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+struct BytesVisitor;
+
+impl<'a> Visitor<'a> for BytesVisitor {
+    type Value = &'a [u8];
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("a borrowed byte array")
+    }
+
+    fn visit_borrowed_bytes<E>(self, v: &'a [u8]) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Ok(v)
+    }
+
+    fn visit_borrowed_str<E>(self, v: &'a str) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Ok(v.as_bytes())
+    }
+}
+
+impl<'de: 'a, 'a> Deserialize<'de> for &'a [u8] {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_bytes(BytesVisitor)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(feature = "std")]
+struct CStringVisitor;
+
+#[cfg(feature = "std")]
+impl<'de> Visitor<'de> for CStringVisitor {
+    type Value = CString;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("byte array")
+    }
+
+    fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
+    where
+        A: SeqAccess<'de>,
+    {
+        let len = size_hint::cautious(seq.size_hint());
+        let mut values = Vec::with_capacity(len);
+
+        while let Some(value) = try!(seq.next_element()) {
+            values.push(value);
+        }
+
+        CString::new(values).map_err(Error::custom)
+    }
+
+    fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        CString::new(v).map_err(Error::custom)
+    }
+
+    fn visit_byte_buf<E>(self, v: Vec<u8>) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        CString::new(v).map_err(Error::custom)
+    }
+
+    fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        CString::new(v).map_err(Error::custom)
+    }
+
+    fn visit_string<E>(self, v: String) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        CString::new(v).map_err(Error::custom)
+    }
+}
+
+#[cfg(feature = "std")]
+impl<'de> Deserialize<'de> for CString {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_byte_buf(CStringVisitor)
+    }
+}
+
+macro_rules! forwarded_impl {
+    (
+        $(#[doc = $doc:tt])*
+        ( $($id: ident),* ), $ty: ty, $func: expr
+    ) => {
+        $(#[doc = $doc])*
+        impl<'de $(, $id : Deserialize<'de>,)*> Deserialize<'de> for $ty {
+            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            where
+                D: Deserializer<'de>,
+            {
+                Deserialize::deserialize(deserializer).map($func)
+            }
+        }
+    }
+}
+
+#[cfg(all(feature = "std", de_boxed_c_str))]
+forwarded_impl!((), Box<CStr>, CString::into_boxed_c_str);
+
+#[cfg(core_reverse)]
+forwarded_impl!((T), Reverse<T>, Reverse);
+
+////////////////////////////////////////////////////////////////////////////////
+
+struct OptionVisitor<T> {
+    marker: PhantomData<T>,
+}
+
+impl<'de, T> Visitor<'de> for OptionVisitor<T>
+where
+    T: Deserialize<'de>,
+{
+    type Value = Option<T>;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("option")
+    }
+
+    #[inline]
+    fn visit_unit<E>(self) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Ok(None)
+    }
+
+    #[inline]
+    fn visit_none<E>(self) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Ok(None)
+    }
+
+    #[inline]
+    fn visit_some<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        T::deserialize(deserializer).map(Some)
+    }
+
+    #[doc(hidden)]
+    fn __private_visit_untagged_option<D>(self, deserializer: D) -> Result<Self::Value, ()>
+    where
+        D: Deserializer<'de>,
+    {
+        Ok(T::deserialize(deserializer).ok())
+    }
+}
+
+impl<'de, T> Deserialize<'de> for Option<T>
+where
+    T: Deserialize<'de>,
+{
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_option(OptionVisitor {
+            marker: PhantomData,
+        })
+    }
+
+    // The Some variant's repr is opaque, so we can't play cute tricks with its
+    // tag to have deserialize_in_place build the content in place unconditionally.
+    //
+    // FIXME: investigate whether branching on the old value being Some to
+    // deserialize_in_place the value is profitable (probably data-dependent?)
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+struct PhantomDataVisitor<T: ?Sized> {
+    marker: PhantomData<T>,
+}
+
+impl<'de, T: ?Sized> Visitor<'de> for PhantomDataVisitor<T> {
+    type Value = PhantomData<T>;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("unit")
+    }
+
+    #[inline]
+    fn visit_unit<E>(self) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Ok(PhantomData)
+    }
+}
+
+impl<'de, T: ?Sized> Deserialize<'de> for PhantomData<T> {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        let visitor = PhantomDataVisitor {
+            marker: PhantomData,
+        };
+        deserializer.deserialize_unit_struct("PhantomData", visitor)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+macro_rules! seq_impl {
+    (
+        $ty:ident < T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)* >,
+        $access:ident,
+        $clear:expr,
+        $with_capacity:expr,
+        $reserve:expr,
+        $insert:expr
+    ) => {
+        impl<'de, T $(, $typaram)*> Deserialize<'de> for $ty<T $(, $typaram)*>
+        where
+            T: Deserialize<'de> $(+ $tbound1 $(+ $tbound2)*)*,
+            $($typaram: $bound1 $(+ $bound2)*,)*
+        {
+            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            where
+                D: Deserializer<'de>,
+            {
+                struct SeqVisitor<T $(, $typaram)*> {
+                    marker: PhantomData<$ty<T $(, $typaram)*>>,
+                }
+
+                impl<'de, T $(, $typaram)*> Visitor<'de> for SeqVisitor<T $(, $typaram)*>
+                where
+                    T: Deserialize<'de> $(+ $tbound1 $(+ $tbound2)*)*,
+                    $($typaram: $bound1 $(+ $bound2)*,)*
+                {
+                    type Value = $ty<T $(, $typaram)*>;
+
+                    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                        formatter.write_str("a sequence")
+                    }
+
+                    #[inline]
+                    fn visit_seq<A>(self, mut $access: A) -> Result<Self::Value, A::Error>
+                    where
+                        A: SeqAccess<'de>,
+                    {
+                        let mut values = $with_capacity;
+
+                        while let Some(value) = try!($access.next_element()) {
+                            $insert(&mut values, value);
+                        }
+
+                        Ok(values)
+                    }
+                }
+
+                let visitor = SeqVisitor { marker: PhantomData };
+                deserializer.deserialize_seq(visitor)
+            }
+
+            fn deserialize_in_place<D>(deserializer: D, place: &mut Self) -> Result<(), D::Error>
+            where
+                D: Deserializer<'de>,
+            {
+                struct SeqInPlaceVisitor<'a, T: 'a $(, $typaram: 'a)*>(&'a mut $ty<T $(, $typaram)*>);
+
+                impl<'a, 'de, T $(, $typaram)*> Visitor<'de> for SeqInPlaceVisitor<'a, T $(, $typaram)*>
+                where
+                    T: Deserialize<'de> $(+ $tbound1 $(+ $tbound2)*)*,
+                    $($typaram: $bound1 $(+ $bound2)*,)*
+                {
+                    type Value = ();
+
+                    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                        formatter.write_str("a sequence")
+                    }
+
+                    #[inline]
+                    fn visit_seq<A>(mut self, mut $access: A) -> Result<Self::Value, A::Error>
+                    where
+                        A: SeqAccess<'de>,
+                    {
+                        $clear(&mut self.0);
+                        $reserve(&mut self.0, size_hint::cautious($access.size_hint()));
+
+                        // FIXME: try to overwrite old values here? (Vec, VecDeque, LinkedList)
+                        while let Some(value) = try!($access.next_element()) {
+                            $insert(&mut self.0, value);
+                        }
+
+                        Ok(())
+                    }
+                }
+
+                deserializer.deserialize_seq(SeqInPlaceVisitor(place))
+            }
+        }
+    }
+}
+
+// Dummy impl of reserve
+#[cfg(any(feature = "std", feature = "alloc"))]
+fn nop_reserve<T>(_seq: T, _n: usize) {}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+seq_impl!(
+    BinaryHeap<T: Ord>,
+    seq,
+    BinaryHeap::clear,
+    BinaryHeap::with_capacity(size_hint::cautious(seq.size_hint())),
+    BinaryHeap::reserve,
+    BinaryHeap::push
+);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+seq_impl!(
+    BTreeSet<T: Eq + Ord>,
+    seq,
+    BTreeSet::clear,
+    BTreeSet::new(),
+    nop_reserve,
+    BTreeSet::insert
+);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+seq_impl!(
+    LinkedList<T>,
+    seq,
+    LinkedList::clear,
+    LinkedList::new(),
+    nop_reserve,
+    LinkedList::push_back
+);
+
+#[cfg(feature = "std")]
+seq_impl!(
+    HashSet<T: Eq + Hash, S: BuildHasher + Default>,
+    seq,
+    HashSet::clear,
+    HashSet::with_capacity_and_hasher(size_hint::cautious(seq.size_hint()), S::default()),
+    HashSet::reserve,
+    HashSet::insert);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+seq_impl!(
+    VecDeque<T>,
+    seq,
+    VecDeque::clear,
+    VecDeque::with_capacity(size_hint::cautious(seq.size_hint())),
+    VecDeque::reserve,
+    VecDeque::push_back
+);
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'de, T> Deserialize<'de> for Vec<T>
+where
+    T: Deserialize<'de>,
+{
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        struct VecVisitor<T> {
+            marker: PhantomData<T>,
+        }
+
+        impl<'de, T> Visitor<'de> for VecVisitor<T>
+        where
+            T: Deserialize<'de>,
+        {
+            type Value = Vec<T>;
+
+            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                formatter.write_str("a sequence")
+            }
+
+            fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
+            where
+                A: SeqAccess<'de>,
+            {
+                let mut values = Vec::with_capacity(size_hint::cautious(seq.size_hint()));
+
+                while let Some(value) = try!(seq.next_element()) {
+                    values.push(value);
+                }
+
+                Ok(values)
+            }
+        }
+
+        let visitor = VecVisitor {
+            marker: PhantomData,
+        };
+        deserializer.deserialize_seq(visitor)
+    }
+
+    fn deserialize_in_place<D>(deserializer: D, place: &mut Self) -> Result<(), D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        struct VecInPlaceVisitor<'a, T: 'a>(&'a mut Vec<T>);
+
+        impl<'a, 'de, T> Visitor<'de> for VecInPlaceVisitor<'a, T>
+        where
+            T: Deserialize<'de>,
+        {
+            type Value = ();
+
+            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                formatter.write_str("a sequence")
+            }
+
+            fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
+            where
+                A: SeqAccess<'de>,
+            {
+                let hint = size_hint::cautious(seq.size_hint());
+                if let Some(additional) = hint.checked_sub(self.0.len()) {
+                    self.0.reserve(additional);
+                }
+
+                for i in 0..self.0.len() {
+                    let next = {
+                        let next_place = InPlaceSeed(&mut self.0[i]);
+                        try!(seq.next_element_seed(next_place))
+                    };
+                    if next.is_none() {
+                        self.0.truncate(i);
+                        return Ok(());
+                    }
+                }
+
+                while let Some(value) = try!(seq.next_element()) {
+                    self.0.push(value);
+                }
+
+                Ok(())
+            }
+        }
+
+        deserializer.deserialize_seq(VecInPlaceVisitor(place))
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+struct ArrayVisitor<A> {
+    marker: PhantomData<A>,
+}
+struct ArrayInPlaceVisitor<'a, A: 'a>(&'a mut A);
+
+impl<A> ArrayVisitor<A> {
+    fn new() -> Self {
+        ArrayVisitor {
+            marker: PhantomData,
+        }
+    }
+}
+
+impl<'de, T> Visitor<'de> for ArrayVisitor<[T; 0]> {
+    type Value = [T; 0];
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("an empty array")
+    }
+
+    #[inline]
+    fn visit_seq<A>(self, _: A) -> Result<Self::Value, A::Error>
+    where
+        A: SeqAccess<'de>,
+    {
+        Ok([])
+    }
+}
+
+// Does not require T: Deserialize<'de>.
+impl<'de, T> Deserialize<'de> for [T; 0] {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_tuple(0, ArrayVisitor::<[T; 0]>::new())
+    }
+}
+
+macro_rules! array_impls {
+    ($($len:expr => ($($n:tt)+))+) => {
+        $(
+            impl<'de, T> Visitor<'de> for ArrayVisitor<[T; $len]>
+            where
+                T: Deserialize<'de>,
+            {
+                type Value = [T; $len];
+
+                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str(concat!("an array of length ", $len))
+                }
+
+                #[inline]
+                fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
+                where
+                    A: SeqAccess<'de>,
+                {
+                    Ok([$(
+                        match try!(seq.next_element()) {
+                            Some(val) => val,
+                            None => return Err(Error::invalid_length($n, &self)),
+                        }
+                    ),+])
+                }
+            }
+
+            impl<'a, 'de, T> Visitor<'de> for ArrayInPlaceVisitor<'a, [T; $len]>
+            where
+                T: Deserialize<'de>,
+            {
+                type Value = ();
+
+                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str(concat!("an array of length ", $len))
+                }
+
+                #[inline]
+                fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
+                where
+                    A: SeqAccess<'de>,
+                {
+                    let mut fail_idx = None;
+                    for (idx, dest) in self.0[..].iter_mut().enumerate() {
+                        if try!(seq.next_element_seed(InPlaceSeed(dest))).is_none() {
+                            fail_idx = Some(idx);
+                            break;
+                        }
+                    }
+                    if let Some(idx) = fail_idx {
+                        return Err(Error::invalid_length(idx, &self));
+                    }
+                    Ok(())
+                }
+            }
+
+            impl<'de, T> Deserialize<'de> for [T; $len]
+            where
+                T: Deserialize<'de>,
+            {
+                fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+                where
+                    D: Deserializer<'de>,
+                {
+                    deserializer.deserialize_tuple($len, ArrayVisitor::<[T; $len]>::new())
+                }
+
+                fn deserialize_in_place<D>(deserializer: D, place: &mut Self) -> Result<(), D::Error>
+                where
+                    D: Deserializer<'de>,
+                {
+                    deserializer.deserialize_tuple($len, ArrayInPlaceVisitor(place))
+                }
+            }
+        )+
+    }
+}
+
+array_impls! {
+    1 => (0)
+    2 => (0 1)
+    3 => (0 1 2)
+    4 => (0 1 2 3)
+    5 => (0 1 2 3 4)
+    6 => (0 1 2 3 4 5)
+    7 => (0 1 2 3 4 5 6)
+    8 => (0 1 2 3 4 5 6 7)
+    9 => (0 1 2 3 4 5 6 7 8)
+    10 => (0 1 2 3 4 5 6 7 8 9)
+    11 => (0 1 2 3 4 5 6 7 8 9 10)
+    12 => (0 1 2 3 4 5 6 7 8 9 10 11)
+    13 => (0 1 2 3 4 5 6 7 8 9 10 11 12)
+    14 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13)
+    15 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14)
+    16 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
+    17 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)
+    18 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17)
+    19 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18)
+    20 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19)
+    21 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)
+    22 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21)
+    23 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22)
+    24 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23)
+    25 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24)
+    26 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25)
+    27 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26)
+    28 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27)
+    29 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28)
+    30 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29)
+    31 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30)
+    32 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31)
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+macro_rules! tuple_impls {
+    ($($len:tt => ($($n:tt $name:ident)+))+) => {
+        $(
+            impl<'de, $($name: Deserialize<'de>),+> Deserialize<'de> for ($($name,)+) {
+                #[inline]
+                fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+                where
+                    D: Deserializer<'de>,
+                {
+                    struct TupleVisitor<$($name,)+> {
+                        marker: PhantomData<($($name,)+)>,
+                    }
+
+                    impl<'de, $($name: Deserialize<'de>),+> Visitor<'de> for TupleVisitor<$($name,)+> {
+                        type Value = ($($name,)+);
+
+                        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str(concat!("a tuple of size ", $len))
+                        }
+
+                        #[inline]
+                        #[allow(non_snake_case)]
+                        fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
+                        where
+                            A: SeqAccess<'de>,
+                        {
+                            $(
+                                let $name = match try!(seq.next_element()) {
+                                    Some(value) => value,
+                                    None => return Err(Error::invalid_length($n, &self)),
+                                };
+                            )+
+
+                            Ok(($($name,)+))
+                        }
+                    }
+
+                    deserializer.deserialize_tuple($len, TupleVisitor { marker: PhantomData })
+                }
+
+                #[inline]
+                fn deserialize_in_place<D>(deserializer: D, place: &mut Self) -> Result<(), D::Error>
+                where
+                    D: Deserializer<'de>,
+                {
+                    struct TupleInPlaceVisitor<'a, $($name: 'a,)+>(&'a mut ($($name,)+));
+
+                    impl<'a, 'de, $($name: Deserialize<'de>),+> Visitor<'de> for TupleInPlaceVisitor<'a, $($name,)+> {
+                        type Value = ();
+
+                        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str(concat!("a tuple of size ", $len))
+                        }
+
+                        #[inline]
+                        #[allow(non_snake_case)]
+                        fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
+                        where
+                            A: SeqAccess<'de>,
+                        {
+                            $(
+                                if try!(seq.next_element_seed(InPlaceSeed(&mut (self.0).$n))).is_none() {
+                                    return Err(Error::invalid_length($n, &self));
+                                }
+                            )+
+
+                            Ok(())
+                        }
+                    }
+
+                    deserializer.deserialize_tuple($len, TupleInPlaceVisitor(place))
+                }
+            }
+        )+
+    }
+}
+
+tuple_impls! {
+    1  => (0 T0)
+    2  => (0 T0 1 T1)
+    3  => (0 T0 1 T1 2 T2)
+    4  => (0 T0 1 T1 2 T2 3 T3)
+    5  => (0 T0 1 T1 2 T2 3 T3 4 T4)
+    6  => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5)
+    7  => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6)
+    8  => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7)
+    9  => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8)
+    10 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9)
+    11 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10)
+    12 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11)
+    13 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12)
+    14 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13)
+    15 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13 14 T14)
+    16 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13 14 T14 15 T15)
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+macro_rules! map_impl {
+    (
+        $ty:ident < K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)* >,
+        $access:ident,
+        $with_capacity:expr
+    ) => {
+        impl<'de, K, V $(, $typaram)*> Deserialize<'de> for $ty<K, V $(, $typaram)*>
+        where
+            K: Deserialize<'de> $(+ $kbound1 $(+ $kbound2)*)*,
+            V: Deserialize<'de>,
+            $($typaram: $bound1 $(+ $bound2)*),*
+        {
+            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            where
+                D: Deserializer<'de>,
+            {
+                struct MapVisitor<K, V $(, $typaram)*> {
+                    marker: PhantomData<$ty<K, V $(, $typaram)*>>,
+                }
+
+                impl<'de, K, V $(, $typaram)*> Visitor<'de> for MapVisitor<K, V $(, $typaram)*>
+                where
+                    K: Deserialize<'de> $(+ $kbound1 $(+ $kbound2)*)*,
+                    V: Deserialize<'de>,
+                    $($typaram: $bound1 $(+ $bound2)*),*
+                {
+                    type Value = $ty<K, V $(, $typaram)*>;
+
+                    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                        formatter.write_str("a map")
+                    }
+
+                    #[inline]
+                    fn visit_map<A>(self, mut $access: A) -> Result<Self::Value, A::Error>
+                    where
+                        A: MapAccess<'de>,
+                    {
+                        let mut values = $with_capacity;
+
+                        while let Some((key, value)) = try!($access.next_entry()) {
+                            values.insert(key, value);
+                        }
+
+                        Ok(values)
+                    }
+                }
+
+                let visitor = MapVisitor { marker: PhantomData };
+                deserializer.deserialize_map(visitor)
+            }
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+map_impl!(
+    BTreeMap<K: Ord, V>,
+    map,
+    BTreeMap::new());
+
+#[cfg(feature = "std")]
+map_impl!(
+    HashMap<K: Eq + Hash, V, S: BuildHasher + Default>,
+    map,
+    HashMap::with_capacity_and_hasher(size_hint::cautious(map.size_hint()), S::default()));
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(feature = "std")]
+macro_rules! parse_ip_impl {
+    ($expecting:tt $ty:ty; $size:tt) => {
+        impl<'de> Deserialize<'de> for $ty {
+            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            where
+                D: Deserializer<'de>,
+            {
+                if deserializer.is_human_readable() {
+                    struct IpAddrVisitor;
+
+                    impl<'de> Visitor<'de> for IpAddrVisitor {
+                        type Value = $ty;
+
+                        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str($expecting)
+                        }
+
+                        fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
+                        where
+                            E: Error,
+                        {
+                            s.parse().map_err(Error::custom)
+                        }
+                    }
+
+                    deserializer.deserialize_str(IpAddrVisitor)
+                } else {
+                    <[u8; $size]>::deserialize(deserializer).map(<$ty>::from)
+                }
+            }
+        }
+    };
+}
+
+#[cfg(feature = "std")]
+macro_rules! variant_identifier {
+    (
+        $name_kind: ident ( $($variant: ident; $bytes: expr; $index: expr),* )
+        $expecting_message: expr,
+        $variants_name: ident
+    ) => {
+        enum $name_kind {
+            $( $variant ),*
+        }
+
+        static $variants_name: &'static [&'static str] = &[ $( stringify!($variant) ),*];
+
+        impl<'de> Deserialize<'de> for $name_kind {
+            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            where
+                D: Deserializer<'de>,
+            {
+                struct KindVisitor;
+
+                impl<'de> Visitor<'de> for KindVisitor {
+                    type Value = $name_kind;
+
+                    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                        formatter.write_str($expecting_message)
+                    }
+
+                    fn visit_u32<E>(self, value: u32) -> Result<Self::Value, E>
+                    where
+                        E: Error,
+                    {
+                        match value {
+                            $(
+                                $index => Ok($name_kind :: $variant),
+                            )*
+                            _ => Err(Error::invalid_value(Unexpected::Unsigned(value as u64), &self),),
+                        }
+                    }
+
+                    fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
+                    where
+                        E: Error,
+                    {
+                        match value {
+                            $(
+                                stringify!($variant) => Ok($name_kind :: $variant),
+                            )*
+                            _ => Err(Error::unknown_variant(value, $variants_name)),
+                        }
+                    }
+
+                    fn visit_bytes<E>(self, value: &[u8]) -> Result<Self::Value, E>
+                    where
+                        E: Error,
+                    {
+                        match value {
+                            $(
+                                $bytes => Ok($name_kind :: $variant),
+                            )*
+                            _ => {
+                                match str::from_utf8(value) {
+                                    Ok(value) => Err(Error::unknown_variant(value, $variants_name)),
+                                    Err(_) => Err(Error::invalid_value(Unexpected::Bytes(value), &self)),
+                                }
+                            }
+                        }
+                    }
+                }
+
+                deserializer.deserialize_identifier(KindVisitor)
+            }
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+macro_rules! deserialize_enum {
+    (
+        $name: ident $name_kind: ident ( $($variant: ident; $bytes: expr; $index: expr),* )
+        $expecting_message: expr,
+        $deserializer: expr
+    ) => {
+        variant_identifier!{
+            $name_kind ( $($variant; $bytes; $index),* )
+            $expecting_message,
+            VARIANTS
+        }
+
+        struct EnumVisitor;
+        impl<'de> Visitor<'de> for EnumVisitor {
+            type Value = $name;
+
+            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                formatter.write_str(concat!("a ", stringify!($name)))
+            }
+
+
+            fn visit_enum<A>(self, data: A) -> Result<Self::Value, A::Error>
+            where
+                A: EnumAccess<'de>,
+            {
+                match try!(data.variant()) {
+                    $(
+                        ($name_kind :: $variant, v) => v.newtype_variant().map($name :: $variant),
+                    )*
+                }
+            }
+        }
+        $deserializer.deserialize_enum(stringify!($name), VARIANTS, EnumVisitor)
+    }
+}
+
+#[cfg(feature = "std")]
+impl<'de> Deserialize<'de> for net::IpAddr {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        if deserializer.is_human_readable() {
+            struct IpAddrVisitor;
+
+            impl<'de> Visitor<'de> for IpAddrVisitor {
+                type Value = net::IpAddr;
+
+                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("IP address")
+                }
+
+                fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
+                where
+                    E: Error,
+                {
+                    s.parse().map_err(Error::custom)
+                }
+            }
+
+            deserializer.deserialize_str(IpAddrVisitor)
+        } else {
+            use lib::net::IpAddr;
+            deserialize_enum! {
+                IpAddr IpAddrKind (V4; b"V4"; 0, V6; b"V6"; 1)
+                "`V4` or `V6`",
+                deserializer
+            }
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+parse_ip_impl!("IPv4 address" net::Ipv4Addr; 4);
+
+#[cfg(feature = "std")]
+parse_ip_impl!("IPv6 address" net::Ipv6Addr; 16);
+
+#[cfg(feature = "std")]
+macro_rules! parse_socket_impl {
+    ($expecting:tt $ty:ty, $new:expr) => {
+        impl<'de> Deserialize<'de> for $ty {
+            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            where
+                D: Deserializer<'de>,
+            {
+                if deserializer.is_human_readable() {
+                    struct SocketAddrVisitor;
+
+                    impl<'de> Visitor<'de> for SocketAddrVisitor {
+                        type Value = $ty;
+
+                        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                            formatter.write_str($expecting)
+                        }
+
+                        fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
+                        where
+                            E: Error,
+                        {
+                            s.parse().map_err(Error::custom)
+                        }
+                    }
+
+                    deserializer.deserialize_str(SocketAddrVisitor)
+                } else {
+                    <(_, u16)>::deserialize(deserializer).map(|(ip, port)| $new(ip, port))
+                }
+            }
+        }
+    };
+}
+
+#[cfg(feature = "std")]
+impl<'de> Deserialize<'de> for net::SocketAddr {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        if deserializer.is_human_readable() {
+            struct SocketAddrVisitor;
+
+            impl<'de> Visitor<'de> for SocketAddrVisitor {
+                type Value = net::SocketAddr;
+
+                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("socket address")
+                }
+
+                fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
+                where
+                    E: Error,
+                {
+                    s.parse().map_err(Error::custom)
+                }
+            }
+
+            deserializer.deserialize_str(SocketAddrVisitor)
+        } else {
+            use lib::net::SocketAddr;
+            deserialize_enum! {
+                SocketAddr SocketAddrKind (V4; b"V4"; 0, V6; b"V6"; 1)
+                "`V4` or `V6`",
+                deserializer
+            }
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+parse_socket_impl!("IPv4 socket address" net::SocketAddrV4, net::SocketAddrV4::new);
+
+#[cfg(feature = "std")]
+parse_socket_impl!("IPv6 socket address" net::SocketAddrV6, |ip, port| net::SocketAddrV6::new(
+    ip, port, 0, 0
+));
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(feature = "std")]
+struct PathVisitor;
+
+#[cfg(feature = "std")]
+impl<'a> Visitor<'a> for PathVisitor {
+    type Value = &'a Path;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("a borrowed path")
+    }
+
+    fn visit_borrowed_str<E>(self, v: &'a str) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Ok(v.as_ref())
+    }
+
+    fn visit_borrowed_bytes<E>(self, v: &'a [u8]) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        str::from_utf8(v)
+            .map(AsRef::as_ref)
+            .map_err(|_| Error::invalid_value(Unexpected::Bytes(v), &self))
+    }
+}
+
+#[cfg(feature = "std")]
+impl<'de: 'a, 'a> Deserialize<'de> for &'a Path {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_str(PathVisitor)
+    }
+}
+
+#[cfg(feature = "std")]
+struct PathBufVisitor;
+
+#[cfg(feature = "std")]
+impl<'de> Visitor<'de> for PathBufVisitor {
+    type Value = PathBuf;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("path string")
+    }
+
+    fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Ok(From::from(v))
+    }
+
+    fn visit_string<E>(self, v: String) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Ok(From::from(v))
+    }
+
+    fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        str::from_utf8(v)
+            .map(From::from)
+            .map_err(|_| Error::invalid_value(Unexpected::Bytes(v), &self))
+    }
+
+    fn visit_byte_buf<E>(self, v: Vec<u8>) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        String::from_utf8(v)
+            .map(From::from)
+            .map_err(|e| Error::invalid_value(Unexpected::Bytes(&e.into_bytes()), &self))
+    }
+}
+
+#[cfg(feature = "std")]
+impl<'de> Deserialize<'de> for PathBuf {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_string(PathBufVisitor)
+    }
+}
+
+#[cfg(all(feature = "std", de_boxed_path))]
+forwarded_impl!((), Box<Path>, PathBuf::into_boxed_path);
+
+////////////////////////////////////////////////////////////////////////////////
+
+// If this were outside of the serde crate, it would just use:
+//
+//    #[derive(Deserialize)]
+//    #[serde(variant_identifier)]
+#[cfg(all(feature = "std", any(unix, windows)))]
+variant_identifier! {
+    OsStringKind (Unix; b"Unix"; 0, Windows; b"Windows"; 1)
+    "`Unix` or `Windows`",
+    OSSTR_VARIANTS
+}
+
+#[cfg(all(feature = "std", any(unix, windows)))]
+struct OsStringVisitor;
+
+#[cfg(all(feature = "std", any(unix, windows)))]
+impl<'de> Visitor<'de> for OsStringVisitor {
+    type Value = OsString;
+
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str("os string")
+    }
+
+    #[cfg(unix)]
+    fn visit_enum<A>(self, data: A) -> Result<Self::Value, A::Error>
+    where
+        A: EnumAccess<'de>,
+    {
+        use std::os::unix::ffi::OsStringExt;
+
+        match try!(data.variant()) {
+            (OsStringKind::Unix, v) => v.newtype_variant().map(OsString::from_vec),
+            (OsStringKind::Windows, _) => Err(Error::custom(
+                "cannot deserialize Windows OS string on Unix",
+            )),
+        }
+    }
+
+    #[cfg(windows)]
+    fn visit_enum<A>(self, data: A) -> Result<Self::Value, A::Error>
+    where
+        A: EnumAccess<'de>,
+    {
+        use std::os::windows::ffi::OsStringExt;
+
+        match try!(data.variant()) {
+            (OsStringKind::Windows, v) => v
+                .newtype_variant::<Vec<u16>>()
+                .map(|vec| OsString::from_wide(&vec)),
+            (OsStringKind::Unix, _) => Err(Error::custom(
+                "cannot deserialize Unix OS string on Windows",
+            )),
+        }
+    }
+}
+
+#[cfg(all(feature = "std", any(unix, windows)))]
+impl<'de> Deserialize<'de> for OsString {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        deserializer.deserialize_enum("OsString", OSSTR_VARIANTS, OsStringVisitor)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+forwarded_impl!((T), Box<T>, Box::new);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+forwarded_impl!((T), Box<[T]>, Vec::into_boxed_slice);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+forwarded_impl!((), Box<str>, String::into_boxed_str);
+
+#[cfg(all(
+    not(de_rc_dst),
+    feature = "rc",
+    any(feature = "std", feature = "alloc")
+))]
+forwarded_impl! {
+    /// This impl requires the [`"rc"`] Cargo feature of Serde.
+    ///
+    /// Deserializing a data structure containing `Arc` will not attempt to
+    /// deduplicate `Arc` references to the same data. Every deserialized `Arc`
+    /// will end up with a strong count of 1.
+    ///
+    /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
+    (T), Arc<T>, Arc::new
+}
+
+#[cfg(all(
+    not(de_rc_dst),
+    feature = "rc",
+    any(feature = "std", feature = "alloc")
+))]
+forwarded_impl! {
+    /// This impl requires the [`"rc"`] Cargo feature of Serde.
+    ///
+    /// Deserializing a data structure containing `Rc` will not attempt to
+    /// deduplicate `Rc` references to the same data. Every deserialized `Rc`
+    /// will end up with a strong count of 1.
+    ///
+    /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
+    (T), Rc<T>, Rc::new
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'de, 'a, T: ?Sized> Deserialize<'de> for Cow<'a, T>
+where
+    T: ToOwned,
+    T::Owned: Deserialize<'de>,
+{
+    #[inline]
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        T::Owned::deserialize(deserializer).map(Cow::Owned)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// This impl requires the [`"rc"`] Cargo feature of Serde. The resulting
+/// `Weak<T>` has a reference count of 0 and cannot be upgraded.
+///
+/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
+#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))]
+impl<'de, T: ?Sized> Deserialize<'de> for RcWeak<T>
+where
+    T: Deserialize<'de>,
+{
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        try!(Option::<T>::deserialize(deserializer));
+        Ok(RcWeak::new())
+    }
+}
+
+/// This impl requires the [`"rc"`] Cargo feature of Serde. The resulting
+/// `Weak<T>` has a reference count of 0 and cannot be upgraded.
+///
+/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
+#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))]
+impl<'de, T: ?Sized> Deserialize<'de> for ArcWeak<T>
+where
+    T: Deserialize<'de>,
+{
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        try!(Option::<T>::deserialize(deserializer));
+        Ok(ArcWeak::new())
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(all(de_rc_dst, feature = "rc", any(feature = "std", feature = "alloc")))]
+macro_rules! box_forwarded_impl {
+    (
+        $(#[doc = $doc:tt])*
+        $t:ident
+    ) => {
+        $(#[doc = $doc])*
+        impl<'de, T: ?Sized> Deserialize<'de> for $t<T>
+        where
+            Box<T>: Deserialize<'de>,
+        {
+            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            where
+                D: Deserializer<'de>,
+            {
+                Box::deserialize(deserializer).map(Into::into)
+            }
+        }
+    };
+}
+
+#[cfg(all(de_rc_dst, feature = "rc", any(feature = "std", feature = "alloc")))]
+box_forwarded_impl! {
+    /// This impl requires the [`"rc"`] Cargo feature of Serde.
+    ///
+    /// Deserializing a data structure containing `Rc` will not attempt to
+    /// deduplicate `Rc` references to the same data. Every deserialized `Rc`
+    /// will end up with a strong count of 1.
+    ///
+    /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
+    Rc
+}
+
+#[cfg(all(de_rc_dst, feature = "rc", any(feature = "std", feature = "alloc")))]
+box_forwarded_impl! {
+    /// This impl requires the [`"rc"`] Cargo feature of Serde.
+    ///
+    /// Deserializing a data structure containing `Arc` will not attempt to
+    /// deduplicate `Arc` references to the same data. Every deserialized `Arc`
+    /// will end up with a strong count of 1.
+    ///
+    /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
+    Arc
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+impl<'de, T> Deserialize<'de> for Cell<T>
+where
+    T: Deserialize<'de> + Copy,
+{
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        T::deserialize(deserializer).map(Cell::new)
+    }
+}
+
+forwarded_impl!((T), RefCell<T>, RefCell::new);
+
+#[cfg(feature = "std")]
+forwarded_impl!((T), Mutex<T>, Mutex::new);
+
+#[cfg(feature = "std")]
+forwarded_impl!((T), RwLock<T>, RwLock::new);
+
+////////////////////////////////////////////////////////////////////////////////
+
+// This is a cleaned-up version of the impl generated by:
+//
+//     #[derive(Deserialize)]
+//     #[serde(deny_unknown_fields)]
+//     struct Duration {
+//         secs: u64,
+//         nanos: u32,
+//     }
+#[cfg(any(core_duration, feature = "std"))]
+impl<'de> Deserialize<'de> for Duration {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        // If this were outside of the serde crate, it would just use:
+        //
+        //    #[derive(Deserialize)]
+        //    #[serde(field_identifier, rename_all = "lowercase")]
+        enum Field {
+            Secs,
+            Nanos,
+        };
+
+        impl<'de> Deserialize<'de> for Field {
+            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            where
+                D: Deserializer<'de>,
+            {
+                struct FieldVisitor;
+
+                impl<'de> Visitor<'de> for FieldVisitor {
+                    type Value = Field;
+
+                    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                        formatter.write_str("`secs` or `nanos`")
+                    }
+
+                    fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
+                    where
+                        E: Error,
+                    {
+                        match value {
+                            "secs" => Ok(Field::Secs),
+                            "nanos" => Ok(Field::Nanos),
+                            _ => Err(Error::unknown_field(value, FIELDS)),
+                        }
+                    }
+
+                    fn visit_bytes<E>(self, value: &[u8]) -> Result<Self::Value, E>
+                    where
+                        E: Error,
+                    {
+                        match value {
+                            b"secs" => Ok(Field::Secs),
+                            b"nanos" => Ok(Field::Nanos),
+                            _ => {
+                                let value = ::export::from_utf8_lossy(value);
+                                Err(Error::unknown_field(&value, FIELDS))
+                            }
+                        }
+                    }
+                }
+
+                deserializer.deserialize_identifier(FieldVisitor)
+            }
+        }
+
+        struct DurationVisitor;
+
+        impl<'de> Visitor<'de> for DurationVisitor {
+            type Value = Duration;
+
+            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                formatter.write_str("struct Duration")
+            }
+
+            fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
+            where
+                A: SeqAccess<'de>,
+            {
+                let secs: u64 = match try!(seq.next_element()) {
+                    Some(value) => value,
+                    None => {
+                        return Err(Error::invalid_length(0, &self));
+                    }
+                };
+                let nanos: u32 = match try!(seq.next_element()) {
+                    Some(value) => value,
+                    None => {
+                        return Err(Error::invalid_length(1, &self));
+                    }
+                };
+                Ok(Duration::new(secs, nanos))
+            }
+
+            fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error>
+            where
+                A: MapAccess<'de>,
+            {
+                let mut secs: Option<u64> = None;
+                let mut nanos: Option<u32> = None;
+                while let Some(key) = try!(map.next_key()) {
+                    match key {
+                        Field::Secs => {
+                            if secs.is_some() {
+                                return Err(<A::Error as Error>::duplicate_field("secs"));
+                            }
+                            secs = Some(try!(map.next_value()));
+                        }
+                        Field::Nanos => {
+                            if nanos.is_some() {
+                                return Err(<A::Error as Error>::duplicate_field("nanos"));
+                            }
+                            nanos = Some(try!(map.next_value()));
+                        }
+                    }
+                }
+                let secs = match secs {
+                    Some(secs) => secs,
+                    None => return Err(<A::Error as Error>::missing_field("secs")),
+                };
+                let nanos = match nanos {
+                    Some(nanos) => nanos,
+                    None => return Err(<A::Error as Error>::missing_field("nanos")),
+                };
+                Ok(Duration::new(secs, nanos))
+            }
+        }
+
+        const FIELDS: &'static [&'static str] = &["secs", "nanos"];
+        deserializer.deserialize_struct("Duration", FIELDS, DurationVisitor)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(feature = "std")]
+impl<'de> Deserialize<'de> for SystemTime {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        // Reuse duration
+        enum Field {
+            Secs,
+            Nanos,
+        };
+
+        impl<'de> Deserialize<'de> for Field {
+            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            where
+                D: Deserializer<'de>,
+            {
+                struct FieldVisitor;
+
+                impl<'de> Visitor<'de> for FieldVisitor {
+                    type Value = Field;
+
+                    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                        formatter.write_str("`secs_since_epoch` or `nanos_since_epoch`")
+                    }
+
+                    fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
+                    where
+                        E: Error,
+                    {
+                        match value {
+                            "secs_since_epoch" => Ok(Field::Secs),
+                            "nanos_since_epoch" => Ok(Field::Nanos),
+                            _ => Err(Error::unknown_field(value, FIELDS)),
+                        }
+                    }
+
+                    fn visit_bytes<E>(self, value: &[u8]) -> Result<Self::Value, E>
+                    where
+                        E: Error,
+                    {
+                        match value {
+                            b"secs_since_epoch" => Ok(Field::Secs),
+                            b"nanos_since_epoch" => Ok(Field::Nanos),
+                            _ => {
+                                let value = String::from_utf8_lossy(value);
+                                Err(Error::unknown_field(&value, FIELDS))
+                            }
+                        }
+                    }
+                }
+
+                deserializer.deserialize_identifier(FieldVisitor)
+            }
+        }
+
+        struct DurationVisitor;
+
+        impl<'de> Visitor<'de> for DurationVisitor {
+            type Value = Duration;
+
+            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                formatter.write_str("struct SystemTime")
+            }
+
+            fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
+            where
+                A: SeqAccess<'de>,
+            {
+                let secs: u64 = match try!(seq.next_element()) {
+                    Some(value) => value,
+                    None => {
+                        return Err(Error::invalid_length(0, &self));
+                    }
+                };
+                let nanos: u32 = match try!(seq.next_element()) {
+                    Some(value) => value,
+                    None => {
+                        return Err(Error::invalid_length(1, &self));
+                    }
+                };
+                Ok(Duration::new(secs, nanos))
+            }
+
+            fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error>
+            where
+                A: MapAccess<'de>,
+            {
+                let mut secs: Option<u64> = None;
+                let mut nanos: Option<u32> = None;
+                while let Some(key) = try!(map.next_key()) {
+                    match key {
+                        Field::Secs => {
+                            if secs.is_some() {
+                                return Err(<A::Error as Error>::duplicate_field(
+                                    "secs_since_epoch",
+                                ));
+                            }
+                            secs = Some(try!(map.next_value()));
+                        }
+                        Field::Nanos => {
+                            if nanos.is_some() {
+                                return Err(<A::Error as Error>::duplicate_field(
+                                    "nanos_since_epoch",
+                                ));
+                            }
+                            nanos = Some(try!(map.next_value()));
+                        }
+                    }
+                }
+                let secs = match secs {
+                    Some(secs) => secs,
+                    None => return Err(<A::Error as Error>::missing_field("secs_since_epoch")),
+                };
+                let nanos = match nanos {
+                    Some(nanos) => nanos,
+                    None => return Err(<A::Error as Error>::missing_field("nanos_since_epoch")),
+                };
+                Ok(Duration::new(secs, nanos))
+            }
+        }
+
+        const FIELDS: &'static [&'static str] = &["secs_since_epoch", "nanos_since_epoch"];
+        let duration = try!(deserializer.deserialize_struct("SystemTime", FIELDS, DurationVisitor));
+        Ok(UNIX_EPOCH + duration)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+// Similar to:
+//
+//     #[derive(Deserialize)]
+//     #[serde(deny_unknown_fields)]
+//     struct Range {
+//         start: u64,
+//         end: u32,
+//     }
+impl<'de, Idx> Deserialize<'de> for Range<Idx>
+where
+    Idx: Deserialize<'de>,
+{
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        let (start, end) = deserializer.deserialize_struct(
+            "Range",
+            range::FIELDS,
+            range::RangeVisitor {
+                expecting: "struct Range",
+                phantom: PhantomData,
+            },
+        )?;
+        Ok(start..end)
+    }
+}
+
+#[cfg(range_inclusive)]
+impl<'de, Idx> Deserialize<'de> for RangeInclusive<Idx>
+where
+    Idx: Deserialize<'de>,
+{
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        let (start, end) = deserializer.deserialize_struct(
+            "RangeInclusive",
+            range::FIELDS,
+            range::RangeVisitor {
+                expecting: "struct RangeInclusive",
+                phantom: PhantomData,
+            },
+        )?;
+        Ok(RangeInclusive::new(start, end))
+    }
+}
+
+mod range {
+    use lib::*;
+
+    use de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor};
+
+    pub const FIELDS: &'static [&'static str] = &["start", "end"];
+
+    // If this were outside of the serde crate, it would just use:
+    //
+    //    #[derive(Deserialize)]
+    //    #[serde(field_identifier, rename_all = "lowercase")]
+    enum Field {
+        Start,
+        End,
+    }
+
+    impl<'de> Deserialize<'de> for Field {
+        fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            struct FieldVisitor;
+
+            impl<'de> Visitor<'de> for FieldVisitor {
+                type Value = Field;
+
+                fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                    formatter.write_str("`start` or `end`")
+                }
+
+                fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
+                where
+                    E: Error,
+                {
+                    match value {
+                        "start" => Ok(Field::Start),
+                        "end" => Ok(Field::End),
+                        _ => Err(Error::unknown_field(value, FIELDS)),
+                    }
+                }
+
+                fn visit_bytes<E>(self, value: &[u8]) -> Result<Self::Value, E>
+                where
+                    E: Error,
+                {
+                    match value {
+                        b"start" => Ok(Field::Start),
+                        b"end" => Ok(Field::End),
+                        _ => {
+                            let value = ::export::from_utf8_lossy(value);
+                            Err(Error::unknown_field(&value, FIELDS))
+                        }
+                    }
+                }
+            }
+
+            deserializer.deserialize_identifier(FieldVisitor)
+        }
+    }
+
+    pub struct RangeVisitor<Idx> {
+        pub expecting: &'static str,
+        pub phantom: PhantomData<Idx>,
+    }
+
+    impl<'de, Idx> Visitor<'de> for RangeVisitor<Idx>
+    where
+        Idx: Deserialize<'de>,
+    {
+        type Value = (Idx, Idx);
+
+        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            formatter.write_str(self.expecting)
+        }
+
+        fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
+        where
+            A: SeqAccess<'de>,
+        {
+            let start: Idx = match try!(seq.next_element()) {
+                Some(value) => value,
+                None => {
+                    return Err(Error::invalid_length(0, &self));
+                }
+            };
+            let end: Idx = match try!(seq.next_element()) {
+                Some(value) => value,
+                None => {
+                    return Err(Error::invalid_length(1, &self));
+                }
+            };
+            Ok((start, end))
+        }
+
+        fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error>
+        where
+            A: MapAccess<'de>,
+        {
+            let mut start: Option<Idx> = None;
+            let mut end: Option<Idx> = None;
+            while let Some(key) = try!(map.next_key()) {
+                match key {
+                    Field::Start => {
+                        if start.is_some() {
+                            return Err(<A::Error as Error>::duplicate_field("start"));
+                        }
+                        start = Some(try!(map.next_value()));
+                    }
+                    Field::End => {
+                        if end.is_some() {
+                            return Err(<A::Error as Error>::duplicate_field("end"));
+                        }
+                        end = Some(try!(map.next_value()));
+                    }
+                }
+            }
+            let start = match start {
+                Some(start) => start,
+                None => return Err(<A::Error as Error>::missing_field("start")),
+            };
+            let end = match end {
+                Some(end) => end,
+                None => return Err(<A::Error as Error>::missing_field("end")),
+            };
+            Ok((start, end))
+        }
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(any(ops_bound, collections_bound))]
+impl<'de, T> Deserialize<'de> for Bound<T>
+where
+    T: Deserialize<'de>,
+{
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        enum Field {
+            Unbounded,
+            Included,
+            Excluded,
+        }
+
+        impl<'de> Deserialize<'de> for Field {
+            #[inline]
+            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            where
+                D: Deserializer<'de>,
+            {
+                struct FieldVisitor;
+
+                impl<'de> Visitor<'de> for FieldVisitor {
+                    type Value = Field;
+
+                    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                        formatter.write_str("`Unbounded`, `Included` or `Excluded`")
+                    }
+
+                    fn visit_u32<E>(self, value: u32) -> Result<Self::Value, E>
+                    where
+                        E: Error,
+                    {
+                        match value {
+                            0 => Ok(Field::Unbounded),
+                            1 => Ok(Field::Included),
+                            2 => Ok(Field::Excluded),
+                            _ => Err(Error::invalid_value(
+                                Unexpected::Unsigned(value as u64),
+                                &self,
+                            )),
+                        }
+                    }
+
+                    fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
+                    where
+                        E: Error,
+                    {
+                        match value {
+                            "Unbounded" => Ok(Field::Unbounded),
+                            "Included" => Ok(Field::Included),
+                            "Excluded" => Ok(Field::Excluded),
+                            _ => Err(Error::unknown_variant(value, VARIANTS)),
+                        }
+                    }
+
+                    fn visit_bytes<E>(self, value: &[u8]) -> Result<Self::Value, E>
+                    where
+                        E: Error,
+                    {
+                        match value {
+                            b"Unbounded" => Ok(Field::Unbounded),
+                            b"Included" => Ok(Field::Included),
+                            b"Excluded" => Ok(Field::Excluded),
+                            _ => match str::from_utf8(value) {
+                                Ok(value) => Err(Error::unknown_variant(value, VARIANTS)),
+                                Err(_) => {
+                                    Err(Error::invalid_value(Unexpected::Bytes(value), &self))
+                                }
+                            },
+                        }
+                    }
+                }
+
+                deserializer.deserialize_identifier(FieldVisitor)
+            }
+        }
+
+        struct BoundVisitor<T>(PhantomData<Bound<T>>);
+
+        impl<'de, T> Visitor<'de> for BoundVisitor<T>
+        where
+            T: Deserialize<'de>,
+        {
+            type Value = Bound<T>;
+
+            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                formatter.write_str("enum Bound")
+            }
+
+            fn visit_enum<A>(self, data: A) -> Result<Self::Value, A::Error>
+            where
+                A: EnumAccess<'de>,
+            {
+                match try!(data.variant()) {
+                    (Field::Unbounded, v) => v.unit_variant().map(|()| Bound::Unbounded),
+                    (Field::Included, v) => v.newtype_variant().map(Bound::Included),
+                    (Field::Excluded, v) => v.newtype_variant().map(Bound::Excluded),
+                }
+            }
+        }
+
+        const VARIANTS: &'static [&'static str] = &["Unbounded", "Included", "Excluded"];
+
+        deserializer.deserialize_enum("Bound", VARIANTS, BoundVisitor(PhantomData))
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+macro_rules! nonzero_integers {
+    ( $( $T: ident, )+ ) => {
+        $(
+            #[cfg(num_nonzero)]
+            impl<'de> Deserialize<'de> for num::$T {
+                fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+                where
+                    D: Deserializer<'de>,
+                {
+                    let value = try!(Deserialize::deserialize(deserializer));
+                    match <num::$T>::new(value) {
+                        Some(nonzero) => Ok(nonzero),
+                        None => Err(Error::custom("expected a non-zero value")),
+                    }
+                }
+            }
+        )+
+    };
+}
+
+nonzero_integers! {
+    NonZeroU8,
+    NonZeroU16,
+    NonZeroU32,
+    NonZeroU64,
+    NonZeroUsize,
+}
+
+#[cfg(num_nonzero_signed)]
+nonzero_integers! {
+    NonZeroI8,
+    NonZeroI16,
+    NonZeroI32,
+    NonZeroI64,
+    NonZeroIsize,
+}
+
+// Currently 128-bit integers do not work on Emscripten targets so we need an
+// additional `#[cfg]`
+serde_if_integer128! {
+    nonzero_integers! {
+        NonZeroU128,
+    }
+
+    #[cfg(num_nonzero_signed)]
+    nonzero_integers! {
+        NonZeroI128,
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+impl<'de, T, E> Deserialize<'de> for Result<T, E>
+where
+    T: Deserialize<'de>,
+    E: Deserialize<'de>,
+{
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        // If this were outside of the serde crate, it would just use:
+        //
+        //    #[derive(Deserialize)]
+        //    #[serde(variant_identifier)]
+        enum Field {
+            Ok,
+            Err,
+        }
+
+        impl<'de> Deserialize<'de> for Field {
+            #[inline]
+            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            where
+                D: Deserializer<'de>,
+            {
+                struct FieldVisitor;
+
+                impl<'de> Visitor<'de> for FieldVisitor {
+                    type Value = Field;
+
+                    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                        formatter.write_str("`Ok` or `Err`")
+                    }
+
+                    fn visit_u32<E>(self, value: u32) -> Result<Self::Value, E>
+                    where
+                        E: Error,
+                    {
+                        match value {
+                            0 => Ok(Field::Ok),
+                            1 => Ok(Field::Err),
+                            _ => Err(Error::invalid_value(
+                                Unexpected::Unsigned(value as u64),
+                                &self,
+                            )),
+                        }
+                    }
+
+                    fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
+                    where
+                        E: Error,
+                    {
+                        match value {
+                            "Ok" => Ok(Field::Ok),
+                            "Err" => Ok(Field::Err),
+                            _ => Err(Error::unknown_variant(value, VARIANTS)),
+                        }
+                    }
+
+                    fn visit_bytes<E>(self, value: &[u8]) -> Result<Self::Value, E>
+                    where
+                        E: Error,
+                    {
+                        match value {
+                            b"Ok" => Ok(Field::Ok),
+                            b"Err" => Ok(Field::Err),
+                            _ => match str::from_utf8(value) {
+                                Ok(value) => Err(Error::unknown_variant(value, VARIANTS)),
+                                Err(_) => {
+                                    Err(Error::invalid_value(Unexpected::Bytes(value), &self))
+                                }
+                            },
+                        }
+                    }
+                }
+
+                deserializer.deserialize_identifier(FieldVisitor)
+            }
+        }
+
+        struct ResultVisitor<T, E>(PhantomData<Result<T, E>>);
+
+        impl<'de, T, E> Visitor<'de> for ResultVisitor<T, E>
+        where
+            T: Deserialize<'de>,
+            E: Deserialize<'de>,
+        {
+            type Value = Result<T, E>;
+
+            fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                formatter.write_str("enum Result")
+            }
+
+            fn visit_enum<A>(self, data: A) -> Result<Self::Value, A::Error>
+            where
+                A: EnumAccess<'de>,
+            {
+                match try!(data.variant()) {
+                    (Field::Ok, v) => v.newtype_variant().map(Ok),
+                    (Field::Err, v) => v.newtype_variant().map(Err),
+                }
+            }
+        }
+
+        const VARIANTS: &'static [&'static str] = &["Ok", "Err"];
+
+        deserializer.deserialize_enum("Result", VARIANTS, ResultVisitor(PhantomData))
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(feature = "std")]
+impl<'de, T> Deserialize<'de> for Wrapping<T>
+where
+    T: Deserialize<'de>,
+{
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        Deserialize::deserialize(deserializer).map(Wrapping)
+    }
+}
+
+#[cfg(all(feature = "std", std_atomic))]
+macro_rules! atomic_impl {
+    ($($ty:ident)*) => {
+        $(
+            impl<'de> Deserialize<'de> for $ty {
+                fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+                where
+                    D: Deserializer<'de>,
+                {
+                    Deserialize::deserialize(deserializer).map(Self::new)
+                }
+            }
+        )*
+    };
+}
+
+#[cfg(all(feature = "std", std_atomic))]
+atomic_impl! {
+    AtomicBool
+    AtomicI8 AtomicI16 AtomicI32 AtomicIsize
+    AtomicU8 AtomicU16 AtomicU32 AtomicUsize
+}
+
+#[cfg(all(feature = "std", std_atomic64))]
+atomic_impl! {
+    AtomicI64 AtomicU64
+}
+
+
\ No newline at end of file diff --git a/src/serde/de/mod.rs.html b/src/serde/de/mod.rs.html new file mode 100644 index 0000000..17554a5 --- /dev/null +++ b/src/serde/de/mod.rs.html @@ -0,0 +1,4555 @@ +mod.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+
+//! Generic data structure deserialization framework.
+//!
+//! The two most important traits in this module are [`Deserialize`] and
+//! [`Deserializer`].
+//!
+//!  - **A type that implements `Deserialize` is a data structure** that can be
+//!    deserialized from any data format supported by Serde, and conversely
+//!  - **A type that implements `Deserializer` is a data format** that can
+//!    deserialize any data structure supported by Serde.
+//!
+//! # The Deserialize trait
+//!
+//! Serde provides [`Deserialize`] 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.
+//!
+//! Additionally, Serde provides a procedural macro called [`serde_derive`] to
+//! automatically generate [`Deserialize`] implementations for structs and enums
+//! in your program. See the [derive section of the manual] for how to use this.
+//!
+//! In rare cases it may be necessary to implement [`Deserialize`] manually for
+//! some type in your program. See the [Implementing `Deserialize`] section of
+//! the manual for more about this.
+//!
+//! Third-party crates may provide [`Deserialize`] implementations for types
+//! that they expose. For example the [`linked-hash-map`] crate provides a
+//! [`LinkedHashMap<K, V>`] type that is deserializable by Serde because the
+//! crate provides an implementation of [`Deserialize`] for it.
+//!
+//! # The Deserializer trait
+//!
+//! [`Deserializer`] implementations are provided by third-party crates, for
+//! example [`serde_json`], [`serde_yaml`] and [`bincode`].
+//!
+//! A partial list of well-maintained formats is given on the [Serde
+//! website][data formats].
+//!
+//! # Implementations of Deserialize provided by Serde
+//!
+//! 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 `OsStr`.
+//!
+//!  - **Primitive types**:
+//!    - bool
+//!    - i8, i16, i32, i64, i128, isize
+//!    - u8, u16, u32, u64, u128, usize
+//!    - f32, f64
+//!    - char
+//!  - **Compound types**:
+//!    - \[T; 0\] through \[T; 32\]
+//!    - tuples up to size 16
+//!  - **Common standard library types**:
+//!    - String
+//!    - Option\<T\>
+//!    - Result\<T, E\>
+//!    - PhantomData\<T\>
+//!  - **Wrapper types**:
+//!    - Box\<T\>
+//!    - Box\<\[T\]\>
+//!    - Box\<str\>
+//!    - Cow\<'a, T\>
+//!    - Cell\<T\>
+//!    - RefCell\<T\>
+//!    - Mutex\<T\>
+//!    - RwLock\<T\>
+//!    - Rc\<T\>&emsp;*(if* features = ["rc"] *is enabled)*
+//!    - Arc\<T\>&emsp;*(if* features = ["rc"] *is enabled)*
+//!  - **Collection types**:
+//!    - BTreeMap\<K, V\>
+//!    - BTreeSet\<T\>
+//!    - BinaryHeap\<T\>
+//!    - HashMap\<K, V, H\>
+//!    - HashSet\<T, H\>
+//!    - LinkedList\<T\>
+//!    - VecDeque\<T\>
+//!    - Vec\<T\>
+//!  - **Zero-copy types**:
+//!    - &str
+//!    - &\[u8\]
+//!  - **FFI types**:
+//!    - CString
+//!    - Box\<CStr\>
+//!    - OsString
+//!  - **Miscellaneous standard library types**:
+//!    - Duration
+//!    - SystemTime
+//!    - Path
+//!    - PathBuf
+//!    - Range\<T\>
+//!    - RangeInclusive\<T\>
+//!    - Bound\<T\>
+//!    - num::NonZero*
+//!    - `!` *(unstable)*
+//!  - **Net types**:
+//!    - IpAddr
+//!    - Ipv4Addr
+//!    - Ipv6Addr
+//!    - SocketAddr
+//!    - SocketAddrV4
+//!    - SocketAddrV6
+//!
+//! [Implementing `Deserialize`]: https://serde.rs/impl-deserialize.html
+//! [`Deserialize`]: ../trait.Deserialize.html
+//! [`Deserializer`]: ../trait.Deserializer.html
+//! [`LinkedHashMap<K, V>`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html
+//! [`bincode`]: https://github.com/TyOverby/bincode
+//! [`linked-hash-map`]: https://crates.io/crates/linked-hash-map
+//! [`serde_derive`]: https://crates.io/crates/serde_derive
+//! [`serde_json`]: https://github.com/serde-rs/json
+//! [`serde_yaml`]: https://github.com/dtolnay/serde-yaml
+//! [derive section of the manual]: https://serde.rs/derive.html
+//! [data formats]: https://serde.rs/#data-formats
+
+use lib::*;
+
+////////////////////////////////////////////////////////////////////////////////
+
+pub mod value;
+
+mod from_primitive;
+mod ignored_any;
+mod impls;
+mod utf8;
+
+pub use self::ignored_any::IgnoredAny;
+
+#[cfg(feature = "std")]
+#[doc(no_inline)]
+pub use std::error::Error as StdError;
+#[cfg(not(feature = "std"))]
+#[doc(no_inline)]
+pub use std_error::Error as StdError;
+
+////////////////////////////////////////////////////////////////////////////////
+
+macro_rules! declare_error_trait {
+    (Error: Sized $(+ $($supertrait:ident)::+)*) => {
+        /// The `Error` trait allows `Deserialize` implementations to create descriptive
+        /// error messages belonging to the `Deserializer` against which they are
+        /// currently running.
+        ///
+        /// Every `Deserializer` declares an `Error` type that encompasses both
+        /// general-purpose deserialization errors as well as errors specific to the
+        /// particular deserialization format. For example the `Error` type of
+        /// `serde_json` can represent errors like an invalid JSON escape sequence or an
+        /// unterminated string literal, in addition to the error cases that are part of
+        /// this trait.
+        ///
+        /// Most deserializers should only need to provide the `Error::custom` method
+        /// and inherit the default behavior for the other methods.
+        ///
+        /// # Example implementation
+        ///
+        /// The [example data format] presented on the website shows an error
+        /// type appropriate for a basic JSON data format.
+        ///
+        /// [example data format]: https://serde.rs/data-format.html
+        pub trait Error: Sized $(+ $($supertrait)::+)* {
+            /// Raised when there is general error when deserializing a type.
+            ///
+            /// The message should not be capitalized and should not end with a period.
+            ///
+            /// ```edition2018
+            /// # use std::str::FromStr;
+            /// #
+            /// # struct IpAddr;
+            /// #
+            /// # impl FromStr for IpAddr {
+            /// #     type Err = String;
+            /// #
+            /// #     fn from_str(_: &str) -> Result<Self, String> {
+            /// #         unimplemented!()
+            /// #     }
+            /// # }
+            /// #
+            /// use serde::de::{self, Deserialize, Deserializer};
+            ///
+            /// impl<'de> Deserialize<'de> for IpAddr {
+            ///     fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            ///     where
+            ///         D: Deserializer<'de>,
+            ///     {
+            ///         let s = String::deserialize(deserializer)?;
+            ///         s.parse().map_err(de::Error::custom)
+            ///     }
+            /// }
+            /// ```
+            fn custom<T>(msg: T) -> Self
+            where
+                T: Display;
+
+            /// Raised when a `Deserialize` receives a type different from what it was
+            /// expecting.
+            ///
+            /// The `unexp` argument provides information about what type was received.
+            /// This is the type that was present in the input file or other source data
+            /// of the Deserializer.
+            ///
+            /// The `exp` argument provides information about what type was being
+            /// expected. This is the type that is written in the program.
+            ///
+            /// For example if we try to deserialize a String out of a JSON file
+            /// containing an integer, the unexpected type is the integer and the
+            /// expected type is the string.
+            #[cold]
+            fn invalid_type(unexp: Unexpected, exp: &Expected) -> Self {
+                Error::custom(format_args!("invalid type: {}, expected {}", unexp, exp))
+            }
+
+            /// Raised when a `Deserialize` receives a value of the right type but that
+            /// is wrong for some other reason.
+            ///
+            /// The `unexp` argument provides information about what value was received.
+            /// This is the value that was present in the input file or other source
+            /// data of the Deserializer.
+            ///
+            /// The `exp` argument provides information about what value was being
+            /// expected. This is the type that is written in the program.
+            ///
+            /// For example if we try to deserialize a String out of some binary data
+            /// that is not valid UTF-8, the unexpected value is the bytes and the
+            /// expected value is a string.
+            #[cold]
+            fn invalid_value(unexp: Unexpected, exp: &Expected) -> Self {
+                Error::custom(format_args!("invalid value: {}, expected {}", unexp, exp))
+            }
+
+            /// Raised when deserializing a sequence or map and the input data contains
+            /// too many or too few elements.
+            ///
+            /// The `len` argument is the number of elements encountered. The sequence
+            /// or map may have expected more arguments or fewer arguments.
+            ///
+            /// The `exp` argument provides information about what data was being
+            /// expected. For example `exp` might say that a tuple of size 6 was
+            /// expected.
+            #[cold]
+            fn invalid_length(len: usize, exp: &Expected) -> Self {
+                Error::custom(format_args!("invalid length {}, expected {}", len, exp))
+            }
+
+            /// Raised when a `Deserialize` enum type received a variant with an
+            /// unrecognized name.
+            #[cold]
+            fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self {
+                if expected.is_empty() {
+                    Error::custom(format_args!(
+                        "unknown variant `{}`, there are no variants",
+                        variant
+                    ))
+                } else {
+                    Error::custom(format_args!(
+                        "unknown variant `{}`, expected {}",
+                        variant,
+                        OneOf { names: expected }
+                    ))
+                }
+            }
+
+            /// Raised when a `Deserialize` struct type received a field with an
+            /// unrecognized name.
+            #[cold]
+            fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self {
+                if expected.is_empty() {
+                    Error::custom(format_args!(
+                        "unknown field `{}`, there are no fields",
+                        field
+                    ))
+                } else {
+                    Error::custom(format_args!(
+                        "unknown field `{}`, expected {}",
+                        field,
+                        OneOf { names: expected }
+                    ))
+                }
+            }
+
+            /// Raised when a `Deserialize` struct type expected to receive a required
+            /// field with a particular name but that field was not present in the
+            /// input.
+            #[cold]
+            fn missing_field(field: &'static str) -> Self {
+                Error::custom(format_args!("missing field `{}`", field))
+            }
+
+            /// Raised when a `Deserialize` struct type received more than one of the
+            /// same field.
+            #[cold]
+            fn duplicate_field(field: &'static str) -> Self {
+                Error::custom(format_args!("duplicate field `{}`", field))
+            }
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+declare_error_trait!(Error: Sized + StdError);
+
+#[cfg(not(feature = "std"))]
+declare_error_trait!(Error: Sized + Debug + Display);
+
+/// `Unexpected` represents an unexpected invocation of any one of the `Visitor`
+/// trait methods.
+///
+/// This is used as an argument to the `invalid_type`, `invalid_value`, and
+/// `invalid_length` methods of the `Error` trait to build error messages.
+///
+/// ```edition2018
+/// # use std::fmt;
+/// #
+/// # use serde::de::{self, Unexpected, Visitor};
+/// #
+/// # struct Example;
+/// #
+/// # impl<'de> Visitor<'de> for Example {
+/// #     type Value = ();
+/// #
+/// #     fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+/// #         write!(formatter, "definitely not a boolean")
+/// #     }
+/// #
+/// fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
+/// where
+///     E: de::Error,
+/// {
+///     Err(de::Error::invalid_type(Unexpected::Bool(v), &self))
+/// }
+/// # }
+/// ```
+#[derive(Copy, Clone, PartialEq, Debug)]
+pub enum Unexpected<'a> {
+    /// The input contained a boolean value that was not expected.
+    Bool(bool),
+
+    /// The input contained an unsigned integer `u8`, `u16`, `u32` or `u64` that
+    /// was not expected.
+    Unsigned(u64),
+
+    /// The input contained a signed integer `i8`, `i16`, `i32` or `i64` that
+    /// was not expected.
+    Signed(i64),
+
+    /// The input contained a floating point `f32` or `f64` that was not
+    /// expected.
+    Float(f64),
+
+    /// The input contained a `char` that was not expected.
+    Char(char),
+
+    /// The input contained a `&str` or `String` that was not expected.
+    Str(&'a str),
+
+    /// The input contained a `&[u8]` or `Vec<u8>` that was not expected.
+    Bytes(&'a [u8]),
+
+    /// The input contained a unit `()` that was not expected.
+    Unit,
+
+    /// The input contained an `Option<T>` that was not expected.
+    Option,
+
+    /// The input contained a newtype struct that was not expected.
+    NewtypeStruct,
+
+    /// The input contained a sequence that was not expected.
+    Seq,
+
+    /// The input contained a map that was not expected.
+    Map,
+
+    /// The input contained an enum that was not expected.
+    Enum,
+
+    /// The input contained a unit variant that was not expected.
+    UnitVariant,
+
+    /// The input contained a newtype variant that was not expected.
+    NewtypeVariant,
+
+    /// The input contained a tuple variant that was not expected.
+    TupleVariant,
+
+    /// The input contained a struct variant that was not expected.
+    StructVariant,
+
+    /// A message stating what uncategorized thing the input contained that was
+    /// not expected.
+    ///
+    /// The message should be a noun or noun phrase, not capitalized and without
+    /// a period. An example message is "unoriginal superhero".
+    Other(&'a str),
+}
+
+impl<'a> fmt::Display for Unexpected<'a> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+        use self::Unexpected::*;
+        match *self {
+            Bool(b) => write!(formatter, "boolean `{}`", b),
+            Unsigned(i) => write!(formatter, "integer `{}`", i),
+            Signed(i) => write!(formatter, "integer `{}`", i),
+            Float(f) => write!(formatter, "floating point `{}`", f),
+            Char(c) => write!(formatter, "character `{}`", c),
+            Str(s) => write!(formatter, "string {:?}", s),
+            Bytes(_) => write!(formatter, "byte array"),
+            Unit => write!(formatter, "unit value"),
+            Option => write!(formatter, "Option value"),
+            NewtypeStruct => write!(formatter, "newtype struct"),
+            Seq => write!(formatter, "sequence"),
+            Map => write!(formatter, "map"),
+            Enum => write!(formatter, "enum"),
+            UnitVariant => write!(formatter, "unit variant"),
+            NewtypeVariant => write!(formatter, "newtype variant"),
+            TupleVariant => write!(formatter, "tuple variant"),
+            StructVariant => write!(formatter, "struct variant"),
+            Other(other) => formatter.write_str(other),
+        }
+    }
+}
+
+/// `Expected` represents an explanation of what data a `Visitor` was expecting
+/// to receive.
+///
+/// This is used as an argument to the `invalid_type`, `invalid_value`, and
+/// `invalid_length` methods of the `Error` 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.
+///
+/// Within the context of a `Visitor` implementation, the `Visitor` itself
+/// (`&self`) is an implementation of this trait.
+///
+/// ```edition2018
+/// # use std::fmt;
+/// #
+/// # use serde::de::{self, Unexpected, Visitor};
+/// #
+/// # struct Example;
+/// #
+/// # impl<'de> Visitor<'de> for Example {
+/// #     type Value = ();
+/// #
+/// #     fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+/// #         write!(formatter, "definitely not a boolean")
+/// #     }
+/// #
+/// fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
+/// where
+///     E: de::Error,
+/// {
+///     Err(de::Error::invalid_type(Unexpected::Bool(v), &self))
+/// }
+/// # }
+/// ```
+///
+/// Outside of a `Visitor`, `&"..."` can be used.
+///
+/// ```edition2018
+/// # use serde::de::{self, Unexpected};
+/// #
+/// # fn example<E>() -> Result<(), E>
+/// # where
+/// #     E: de::Error,
+/// # {
+/// #     let v = true;
+/// return Err(de::Error::invalid_type(Unexpected::Bool(v), &"a negative integer"));
+/// # }
+/// ```
+pub trait Expected {
+    /// Format an explanation of what data was being expected. Same signature as
+    /// the `Display` and `Debug` traits.
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result;
+}
+
+impl<'de, T> Expected for T
+where
+    T: Visitor<'de>,
+{
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.expecting(formatter)
+    }
+}
+
+impl<'a> Expected for &'a str {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str(self)
+    }
+}
+
+impl<'a> Display for Expected + 'a {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        Expected::fmt(self, formatter)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A **data structure** that can be deserialized from any data format supported
+/// by Serde.
+///
+/// Serde provides `Deserialize` implementations for many Rust primitive and
+/// standard library types. The complete list is [here][de]. All of these can
+/// be deserialized using Serde out of the box.
+///
+/// Additionally, Serde provides a procedural macro called `serde_derive` to
+/// automatically generate `Deserialize` implementations for structs and enums
+/// in your program. See the [derive section of the manual][derive] for how to
+/// use this.
+///
+/// In rare cases it may be necessary to implement `Deserialize` manually for
+/// some type in your program. See the [Implementing
+/// `Deserialize`][impl-deserialize] section of the manual for more about this.
+///
+/// Third-party crates may provide `Deserialize` implementations for types that
+/// they expose. For example the `linked-hash-map` crate provides a
+/// `LinkedHashMap<K, V>` type that is deserializable by Serde because the crate
+/// provides an implementation of `Deserialize` for it.
+///
+/// [de]: https://docs.serde.rs/serde/de/index.html
+/// [derive]: https://serde.rs/derive.html
+/// [impl-deserialize]: https://serde.rs/impl-deserialize.html
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed by `Self` when deserialized. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+pub trait Deserialize<'de>: Sized {
+    /// Deserialize this value from the given Serde deserializer.
+    ///
+    /// See the [Implementing `Deserialize`][impl-deserialize] section of the
+    /// manual for more information about how to implement this method.
+    ///
+    /// [impl-deserialize]: https://serde.rs/impl-deserialize.html
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>;
+
+    /// Deserializes a value into `self` from the given Deserializer.
+    ///
+    /// The purpose of this method is to allow the deserializer to reuse
+    /// resources and avoid copies. As such, if this method returns an error,
+    /// `self` will be in an indeterminate state where some parts of the struct
+    /// have been overwritten. Although whatever state that is will be
+    /// memory-safe.
+    ///
+    /// This is generally useful when repeatedly deserializing values that
+    /// are processed one at a time, where the value of `self` doesn't matter
+    /// when the next deserialization occurs.
+    ///
+    /// If you manually implement this, your recursive deserializations should
+    /// use `deserialize_in_place`.
+    ///
+    /// This method is stable and an official public API, but hidden from the
+    /// documentation because it is almost never what newbies are looking for.
+    /// Showing it in rustdoc would cause it to be featured more prominently
+    /// than it deserves.
+    #[doc(hidden)]
+    fn deserialize_in_place<D>(deserializer: D, place: &mut Self) -> Result<(), D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        // Default implementation just delegates to `deserialize` impl.
+        *place = Deserialize::deserialize(deserializer)?;
+        Ok(())
+    }
+}
+
+/// A data structure that can be deserialized without borrowing any data from
+/// the deserializer.
+///
+/// This is primarily useful for trait bounds on functions. For example a
+/// `from_str` function may be able to deserialize a data structure that borrows
+/// from the input string, but a `from_reader` function may only deserialize
+/// owned data.
+///
+/// ```edition2018
+/// # use serde::de::{Deserialize, DeserializeOwned};
+/// # use std::io::{Read, Result};
+/// #
+/// # trait Ignore {
+/// fn from_str<'a, T>(s: &'a str) -> Result<T>
+/// where
+///     T: Deserialize<'a>;
+///
+/// fn from_reader<R, T>(rdr: R) -> Result<T>
+/// where
+///     R: Read,
+///     T: DeserializeOwned;
+/// # }
+/// ```
+///
+/// # Lifetime
+///
+/// The relationship between `Deserialize` and `DeserializeOwned` in trait
+/// bounds is explained in more detail on the page [Understanding deserializer
+/// lifetimes].
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+pub trait DeserializeOwned: for<'de> Deserialize<'de> {}
+impl<T> DeserializeOwned for T where T: for<'de> Deserialize<'de> {}
+
+/// `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.
+///
+/// As one example of stateful deserialization consider deserializing a JSON
+/// array into an existing buffer. Using the `Deserialize` trait we could
+/// deserialize a JSON array into a `Vec<T>` but it would be a freshly allocated
+/// `Vec<T>`; there is no way for `Deserialize` to reuse a previously allocated
+/// buffer. Using `DeserializeSeed` instead makes this possible as in the
+/// example code below.
+///
+/// The canonical API for stateless deserialization looks like this:
+///
+/// ```edition2018
+/// # use serde::Deserialize;
+/// #
+/// # enum Error {}
+/// #
+/// fn func<'de, T: Deserialize<'de>>() -> Result<T, Error>
+/// # {
+/// #     unimplemented!()
+/// # }
+/// ```
+///
+/// Adjusting an API like this to support stateful deserialization is a matter
+/// of accepting a seed as input:
+///
+/// ```edition2018
+/// # use serde::de::DeserializeSeed;
+/// #
+/// # enum Error {}
+/// #
+/// fn func_seed<'de, T: DeserializeSeed<'de>>(seed: T) -> Result<T::Value, Error>
+/// # {
+/// #     let _ = seed;
+/// #     unimplemented!()
+/// # }
+/// ```
+///
+/// In practice the majority of deserialization is stateless. An API expecting a
+/// seed can be appeased by passing `std::marker::PhantomData` as a seed in the
+/// case of stateless deserialization.
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed by `Self::Value` when deserialized. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example
+///
+/// Suppose we have JSON that looks like `[[1, 2], [3, 4, 5], [6]]` and we need
+/// to deserialize it into a flat representation like `vec![1, 2, 3, 4, 5, 6]`.
+/// Allocating a brand new `Vec<T>` for each subarray would be slow. Instead we
+/// would like to allocate a single `Vec<T>` and then deserialize each subarray
+/// into it. This requires stateful deserialization using the `DeserializeSeed`
+/// trait.
+///
+/// ```edition2018
+/// use std::fmt;
+/// use std::marker::PhantomData;
+///
+/// use serde::de::{Deserialize, DeserializeSeed, Deserializer, SeqAccess, Visitor};
+///
+/// // A DeserializeSeed implementation that uses stateful deserialization to
+/// // append array elements onto the end of an existing vector. The preexisting
+/// // state ("seed") in this case is the Vec<T>. The `deserialize` method of
+/// // `ExtendVec` will be traversing the inner arrays of the JSON input and
+/// // appending each integer into the existing Vec.
+/// struct ExtendVec<'a, T: 'a>(&'a mut Vec<T>);
+///
+/// impl<'de, 'a, T> DeserializeSeed<'de> for ExtendVec<'a, T>
+/// where
+///     T: Deserialize<'de>,
+/// {
+///     // The return type of the `deserialize` method. This implementation
+///     // appends onto an existing vector but does not create any new data
+///     // structure, so the return type is ().
+///     type Value = ();
+///
+///     fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+///     where
+///         D: Deserializer<'de>,
+///     {
+///         // Visitor implementation that will walk an inner array of the JSON
+///         // input.
+///         struct ExtendVecVisitor<'a, T: 'a>(&'a mut Vec<T>);
+///
+///         impl<'de, 'a, T> Visitor<'de> for ExtendVecVisitor<'a, T>
+///         where
+///             T: Deserialize<'de>,
+///         {
+///             type Value = ();
+///
+///             fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+///                 write!(formatter, "an array of integers")
+///             }
+///
+///             fn visit_seq<A>(self, mut seq: A) -> Result<(), A::Error>
+///             where
+///                 A: SeqAccess<'de>,
+///             {
+///                 // Visit each element in the inner array and push it onto
+///                 // the existing vector.
+///                 while let Some(elem) = seq.next_element()? {
+///                     self.0.push(elem);
+///                 }
+///                 Ok(())
+///             }
+///         }
+///
+///         deserializer.deserialize_seq(ExtendVecVisitor(self.0))
+///     }
+/// }
+///
+/// // Visitor implementation that will walk the outer array of the JSON input.
+/// struct FlattenedVecVisitor<T>(PhantomData<T>);
+///
+/// impl<'de, T> Visitor<'de> for FlattenedVecVisitor<T>
+/// where
+///     T: Deserialize<'de>,
+/// {
+///     // This Visitor constructs a single Vec<T> to hold the flattened
+///     // contents of the inner arrays.
+///     type Value = Vec<T>;
+///
+///     fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+///         write!(formatter, "an array of arrays")
+///     }
+///
+///     fn visit_seq<A>(self, mut seq: A) -> Result<Vec<T>, A::Error>
+///     where
+///         A: SeqAccess<'de>,
+///     {
+///         // Create a single Vec to hold the flattened contents.
+///         let mut vec = Vec::new();
+///
+///         // Each iteration through this loop is one inner array.
+///         while let Some(()) = seq.next_element_seed(ExtendVec(&mut vec))? {
+///             // Nothing to do; inner array has been appended into `vec`.
+///         }
+///
+///         // Return the finished vec.
+///         Ok(vec)
+///     }
+/// }
+///
+/// # fn example<'de, D>(deserializer: D) -> Result<(), D::Error>
+/// # where
+/// #     D: Deserializer<'de>,
+/// # {
+/// let visitor = FlattenedVecVisitor(PhantomData);
+/// let flattened: Vec<u64> = deserializer.deserialize_seq(visitor)?;
+/// #     Ok(())
+/// # }
+/// ```
+pub trait DeserializeSeed<'de>: Sized {
+    /// The type produced by using this seed.
+    type Value;
+
+    /// Equivalent to the more common `Deserialize::deserialize` method, except
+    /// with some initial piece of data (the seed) passed in.
+    fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+    where
+        D: Deserializer<'de>;
+}
+
+impl<'de, T> DeserializeSeed<'de> for PhantomData<T>
+where
+    T: Deserialize<'de>,
+{
+    type Value = T;
+
+    #[inline]
+    fn deserialize<D>(self, deserializer: D) -> Result<T, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        T::deserialize(deserializer)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A **data format** that can deserialize any data structure supported by
+/// Serde.
+///
+/// The role of this trait is to define the deserialization half of the [Serde
+/// data model], which is a way to categorize every Rust data type into one of
+/// 29 possible types. Each method of the `Deserializer` trait corresponds to one
+/// of the types of the data model.
+///
+/// Implementations of `Deserialize` map themselves into this data model by
+/// passing to the `Deserializer` a `Visitor` implementation that can receive
+/// these various types.
+///
+/// The types that make up the Serde data model are:
+///
+///  - **14 primitive types**
+///    - bool
+///    - i8, i16, i32, i64, i128
+///    - u8, u16, u32, u64, u128
+///    - f32, f64
+///    - char
+///  - **string**
+///    - UTF-8 bytes with a length and no null terminator.
+///    - When serializing, all strings are handled equally. When deserializing,
+///      there are three flavors of strings: transient, owned, and borrowed.
+///  - **byte array** - \[u8\]
+///    - Similar to strings, during deserialization byte arrays can be
+///      transient, owned, or borrowed.
+///  - **option**
+///    - Either none or some value.
+///  - **unit**
+///    - The type of `()` in Rust. It represents an anonymous value containing
+///      no data.
+///  - **unit_struct**
+///    - For example `struct Unit` or `PhantomData<T>`. It represents a named
+///      value containing no data.
+///  - **unit_variant**
+///    - For example the `E::A` and `E::B` in `enum E { A, B }`.
+///  - **newtype_struct**
+///    - For example `struct Millimeters(u8)`.
+///  - **newtype_variant**
+///    - For example the `E::N` in `enum E { N(u8) }`.
+///  - **seq**
+///    - A variably sized heterogeneous sequence of values, for example `Vec<T>`
+///      or `HashSet<T>`. When serializing, the length may or may not be known
+///      before iterating through all the data. When deserializing, the length
+///      is determined by looking at the serialized data.
+///  - **tuple**
+///    - A statically sized heterogeneous sequence of values for which the
+///      length will be known at deserialization time without looking at the
+///      serialized data, for example `(u8,)` or `(String, u64, Vec<T>)` or
+///      `[u64; 10]`.
+///  - **tuple_struct**
+///    - A named tuple, for example `struct Rgb(u8, u8, u8)`.
+///  - **tuple_variant**
+///    - For example the `E::T` in `enum E { T(u8, u8) }`.
+///  - **map**
+///    - A heterogeneous key-value pairing, for example `BTreeMap<K, V>`.
+///  - **struct**
+///    - A heterogeneous key-value pairing in which the keys are strings and
+///      will be known at deserialization time without looking at the serialized
+///      data, for example `struct S { r: u8, g: u8, b: u8 }`.
+///  - **struct_variant**
+///    - For example the `E::S` in `enum E { S { r: u8, g: u8, b: u8 } }`.
+///
+/// The `Deserializer` trait supports two entry point styles which enables
+/// different kinds of deserialization.
+///
+/// 1. The `deserialize` method. Self-describing data formats like JSON are able
+///    to look at the serialized data and tell what it represents. For example
+///    the JSON deserializer may see an opening curly brace (`{`) and know that
+///    it is seeing a map. If the data format supports
+///    `Deserializer::deserialize_any`, it will drive the Visitor using whatever
+///    type it sees in the input. JSON uses this approach when deserializing
+///    `serde_json::Value` which is an enum that can represent any JSON
+///    document. Without knowing what is in a JSON document, we can deserialize
+///    it to `serde_json::Value` by going through
+///    `Deserializer::deserialize_any`.
+///
+/// 2. The various `deserialize_*` methods. Non-self-describing formats like
+///    Bincode need to be told what is in the input in order to deserialize it.
+///    The `deserialize_*` methods are hints to the deserializer for how to
+///    interpret the next piece of input. Non-self-describing formats are not
+///    able to deserialize something like `serde_json::Value` which relies on
+///    `Deserializer::deserialize_any`.
+///
+/// When implementing `Deserialize`, you should avoid relying on
+/// `Deserializer::deserialize_any` unless you need to be told by the
+/// Deserializer what type is in the input. Know that relying on
+/// `Deserializer::deserialize_any` means your data type will be able to
+/// deserialize from self-describing formats only, ruling out Bincode and many
+/// others.
+///
+/// [Serde data model]: https://serde.rs/data-model.html
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed from the input when deserializing. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website contains example code for
+/// a basic JSON `Deserializer`.
+///
+/// [example data format]: https://serde.rs/data-format.html
+pub trait Deserializer<'de>: Sized {
+    /// The error type that can be returned if some error occurs during
+    /// deserialization.
+    type Error: Error;
+
+    /// Require the `Deserializer` to figure out how to drive the visitor based
+    /// on what data type is in the input.
+    ///
+    /// When implementing `Deserialize`, you should avoid relying on
+    /// `Deserializer::deserialize_any` unless you need to be told by the
+    /// Deserializer what type is in the input. Know that relying on
+    /// `Deserializer::deserialize_any` means your data type will be able to
+    /// deserialize from self-describing formats only, ruling out Bincode and
+    /// many others.
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a `bool` value.
+    fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting an `i8` value.
+    fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting an `i16` value.
+    fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting an `i32` value.
+    fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting an `i64` value.
+    fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    serde_if_integer128! {
+        /// Hint that the `Deserialize` type is expecting an `i128` value.
+        ///
+        /// This method is available only on Rust compiler versions >=1.26. The
+        /// default behavior unconditionally returns an error.
+        fn deserialize_i128<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>
+        {
+            let _ = visitor;
+            Err(Error::custom("i128 is not supported"))
+        }
+    }
+
+    /// Hint that the `Deserialize` type is expecting a `u8` value.
+    fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a `u16` value.
+    fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a `u32` value.
+    fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a `u64` value.
+    fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    serde_if_integer128! {
+        /// Hint that the `Deserialize` type is expecting an `u128` value.
+        ///
+        /// This method is available only on Rust compiler versions >=1.26. The
+        /// default behavior unconditionally returns an error.
+        fn deserialize_u128<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>
+        {
+            let _ = visitor;
+            Err(Error::custom("u128 is not supported"))
+        }
+    }
+
+    /// Hint that the `Deserialize` type is expecting a `f32` value.
+    fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a `f64` value.
+    fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a `char` value.
+    fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a string value and does
+    /// not benefit from taking ownership of buffered data owned by the
+    /// `Deserializer`.
+    ///
+    /// If the `Visitor` would benefit from taking ownership of `String` data,
+    /// indiciate this to the `Deserializer` by using `deserialize_string`
+    /// instead.
+    fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a string value and would
+    /// benefit from taking ownership of buffered data owned by the
+    /// `Deserializer`.
+    ///
+    /// If the `Visitor` would not benefit from taking ownership of `String`
+    /// data, indicate that to the `Deserializer` by using `deserialize_str`
+    /// instead.
+    fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a byte array and does not
+    /// benefit from taking ownership of buffered data owned by the
+    /// `Deserializer`.
+    ///
+    /// If the `Visitor` would benefit from taking ownership of `Vec<u8>` data,
+    /// indicate this to the `Deserializer` by using `deserialize_byte_buf`
+    /// instead.
+    fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a byte array and would
+    /// benefit from taking ownership of buffered data owned by the
+    /// `Deserializer`.
+    ///
+    /// If the `Visitor` would not benefit from taking ownership of `Vec<u8>`
+    /// data, indicate that to the `Deserializer` by using `deserialize_bytes`
+    /// instead.
+    fn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting an optional value.
+    ///
+    /// This allows deserializers that encode an optional value as a nullable
+    /// value to convert the null value into `None` and a regular value into
+    /// `Some(value)`.
+    fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a unit value.
+    fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a unit struct with a
+    /// particular name.
+    fn deserialize_unit_struct<V>(
+        self,
+        name: &'static str,
+        visitor: V,
+    ) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a newtype struct with a
+    /// particular name.
+    fn deserialize_newtype_struct<V>(
+        self,
+        name: &'static str,
+        visitor: V,
+    ) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a sequence of values.
+    fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a sequence of values and
+    /// knows how many values there are without looking at the serialized data.
+    fn deserialize_tuple<V>(self, len: usize, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a tuple struct with a
+    /// particular name and number of fields.
+    fn deserialize_tuple_struct<V>(
+        self,
+        name: &'static str,
+        len: usize,
+        visitor: V,
+    ) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a map of key-value pairs.
+    fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting a struct with a particular
+    /// name and fields.
+    fn deserialize_struct<V>(
+        self,
+        name: &'static str,
+        fields: &'static [&'static str],
+        visitor: V,
+    ) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting an enum value with a
+    /// particular name and possible variants.
+    fn deserialize_enum<V>(
+        self,
+        name: &'static str,
+        variants: &'static [&'static str],
+        visitor: V,
+    ) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type is expecting the name of a struct
+    /// field or the discriminant of an enum variant.
+    fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Hint that the `Deserialize` type needs to deserialize a value whose type
+    /// doesn't matter because it is ignored.
+    ///
+    /// Deserializers for non-self-describing formats may not support this mode.
+    fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Determine whether `Deserialize` implementations should expect to
+    /// deserialize their human-readable form.
+    ///
+    /// Some types have a human-readable form that may be somewhat expensive to
+    /// construct, as well as a binary form that is compact and efficient.
+    /// Generally text-based formats like JSON and YAML will prefer to use the
+    /// human-readable one and binary formats like Bincode will prefer the
+    /// compact one.
+    ///
+    /// ```edition2018
+    /// # use std::ops::Add;
+    /// # use std::str::FromStr;
+    /// #
+    /// # struct Timestamp;
+    /// #
+    /// # impl Timestamp {
+    /// #     const EPOCH: Timestamp = Timestamp;
+    /// # }
+    /// #
+    /// # impl FromStr for Timestamp {
+    /// #     type Err = String;
+    /// #     fn from_str(_: &str) -> Result<Self, Self::Err> {
+    /// #         unimplemented!()
+    /// #     }
+    /// # }
+    /// #
+    /// # struct Duration;
+    /// #
+    /// # impl Duration {
+    /// #     fn seconds(_: u64) -> Self { unimplemented!() }
+    /// # }
+    /// #
+    /// # impl Add<Duration> for Timestamp {
+    /// #     type Output = Timestamp;
+    /// #     fn add(self, _: Duration) -> Self::Output {
+    /// #         unimplemented!()
+    /// #     }
+    /// # }
+    /// #
+    /// use serde::de::{self, Deserialize, Deserializer};
+    ///
+    /// impl<'de> Deserialize<'de> for Timestamp {
+    ///     fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    ///     where
+    ///         D: Deserializer<'de>,
+    ///     {
+    ///         if deserializer.is_human_readable() {
+    ///             // Deserialize from a human-readable string like "2015-05-15T17:01:00Z".
+    ///             let s = String::deserialize(deserializer)?;
+    ///             Timestamp::from_str(&s).map_err(de::Error::custom)
+    ///         } else {
+    ///             // Deserialize from a compact binary representation, seconds since
+    ///             // the Unix epoch.
+    ///             let n = u64::deserialize(deserializer)?;
+    ///             Ok(Timestamp::EPOCH + Duration::seconds(n))
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    ///
+    /// The default implementation of this method returns `true`. Data formats
+    /// may override this to `false` to request a compact form for types that
+    /// support one. Note that modifying this method to change a format from
+    /// human-readable to compact or vice versa should be regarded as a breaking
+    /// change, as a value serialized in human-readable mode is not required to
+    /// deserialize from the same data in compact mode.
+    #[inline]
+    fn is_human_readable(&self) -> bool {
+        true
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// This trait represents a visitor that walks through a deserializer.
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the requirement for lifetime of data
+/// that may be borrowed by `Self::Value`. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example
+///
+/// ```edition2018
+/// # use std::fmt;
+/// #
+/// # use serde::de::{self, Unexpected, Visitor};
+/// #
+/// /// A visitor that deserializes a long string - a string containing at least
+/// /// some minimum number of bytes.
+/// struct LongString {
+///     min: usize,
+/// }
+///
+/// impl<'de> Visitor<'de> for LongString {
+///     type Value = String;
+///
+///     fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+///         write!(formatter, "a string containing at least {} bytes", self.min)
+///     }
+///
+///     fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
+///     where
+///         E: de::Error,
+///     {
+///         if s.len() >= self.min {
+///             Ok(s.to_owned())
+///         } else {
+///             Err(de::Error::invalid_value(Unexpected::Str(s), &self))
+///         }
+///     }
+/// }
+/// ```
+pub trait Visitor<'de>: Sized {
+    /// The value produced by this visitor.
+    type Value;
+
+    /// Format a message stating what data this Visitor expects to receive.
+    ///
+    /// 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.
+    ///
+    /// ```edition2018
+    /// # use std::fmt;
+    /// #
+    /// # struct S {
+    /// #     max: usize,
+    /// # }
+    /// #
+    /// # impl<'de> serde::de::Visitor<'de> for S {
+    /// #     type Value = ();
+    /// #
+    /// fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+    ///     write!(formatter, "an integer between 0 and {}", self.max)
+    /// }
+    /// # }
+    /// ```
+    fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result;
+
+    /// The input contains a boolean.
+    ///
+    /// The default implementation fails with a type error.
+    fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Err(Error::invalid_type(Unexpected::Bool(v), &self))
+    }
+
+    /// The input contains an `i8`.
+    ///
+    /// The default implementation forwards to [`visit_i64`].
+    ///
+    /// [`visit_i64`]: #method.visit_i64
+    fn visit_i8<E>(self, v: i8) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        self.visit_i64(v as i64)
+    }
+
+    /// The input contains an `i16`.
+    ///
+    /// The default implementation forwards to [`visit_i64`].
+    ///
+    /// [`visit_i64`]: #method.visit_i64
+    fn visit_i16<E>(self, v: i16) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        self.visit_i64(v as i64)
+    }
+
+    /// The input contains an `i32`.
+    ///
+    /// The default implementation forwards to [`visit_i64`].
+    ///
+    /// [`visit_i64`]: #method.visit_i64
+    fn visit_i32<E>(self, v: i32) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        self.visit_i64(v as i64)
+    }
+
+    /// The input contains an `i64`.
+    ///
+    /// The default implementation fails with a type error.
+    fn visit_i64<E>(self, v: i64) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Err(Error::invalid_type(Unexpected::Signed(v), &self))
+    }
+
+    serde_if_integer128! {
+        /// The input contains a `i128`.
+        ///
+        /// This method is available only on Rust compiler versions >=1.26. The
+        /// default implementation fails with a type error.
+        fn visit_i128<E>(self, v: i128) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            let _ = v;
+            Err(Error::invalid_type(Unexpected::Other("i128"), &self))
+        }
+    }
+
+    /// The input contains a `u8`.
+    ///
+    /// The default implementation forwards to [`visit_u64`].
+    ///
+    /// [`visit_u64`]: #method.visit_u64
+    fn visit_u8<E>(self, v: u8) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        self.visit_u64(v as u64)
+    }
+
+    /// The input contains a `u16`.
+    ///
+    /// The default implementation forwards to [`visit_u64`].
+    ///
+    /// [`visit_u64`]: #method.visit_u64
+    fn visit_u16<E>(self, v: u16) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        self.visit_u64(v as u64)
+    }
+
+    /// The input contains a `u32`.
+    ///
+    /// The default implementation forwards to [`visit_u64`].
+    ///
+    /// [`visit_u64`]: #method.visit_u64
+    fn visit_u32<E>(self, v: u32) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        self.visit_u64(v as u64)
+    }
+
+    /// The input contains a `u64`.
+    ///
+    /// The default implementation fails with a type error.
+    fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Err(Error::invalid_type(Unexpected::Unsigned(v), &self))
+    }
+
+    serde_if_integer128! {
+        /// The input contains a `u128`.
+        ///
+        /// This method is available only on Rust compiler versions >=1.26. The
+        /// default implementation fails with a type error.
+        fn visit_u128<E>(self, v: u128) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            let _ = v;
+            Err(Error::invalid_type(Unexpected::Other("u128"), &self))
+        }
+    }
+
+    /// The input contains an `f32`.
+    ///
+    /// The default implementation forwards to [`visit_f64`].
+    ///
+    /// [`visit_f64`]: #method.visit_f64
+    fn visit_f32<E>(self, v: f32) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        self.visit_f64(v as f64)
+    }
+
+    /// The input contains an `f64`.
+    ///
+    /// The default implementation fails with a type error.
+    fn visit_f64<E>(self, v: f64) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Err(Error::invalid_type(Unexpected::Float(v), &self))
+    }
+
+    /// The input contains a `char`.
+    ///
+    /// The default implementation forwards to [`visit_str`] as a one-character
+    /// string.
+    ///
+    /// [`visit_str`]: #method.visit_str
+    #[inline]
+    fn visit_char<E>(self, v: char) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        self.visit_str(utf8::encode(v).as_str())
+    }
+
+    /// The input contains a string. The lifetime of the string is ephemeral and
+    /// it may be destroyed after this method returns.
+    ///
+    /// This method allows the `Deserializer` to avoid a copy by retaining
+    /// ownership of any buffered data. `Deserialize` implementations that do
+    /// not benefit from taking ownership of `String` data should indicate that
+    /// to the deserializer by using `Deserializer::deserialize_str` rather than
+    /// `Deserializer::deserialize_string`.
+    ///
+    /// It is never correct to implement `visit_string` without implementing
+    /// `visit_str`. Implement neither, both, or just `visit_str`.
+    fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Err(Error::invalid_type(Unexpected::Str(v), &self))
+    }
+
+    /// The input contains a string that lives at least as long as the
+    /// `Deserializer`.
+    ///
+    /// This enables zero-copy deserialization of strings in some formats. For
+    /// example JSON input containing the JSON string `"borrowed"` can be
+    /// deserialized with zero copying into a `&'a str` as long as the input
+    /// data outlives `'a`.
+    ///
+    /// The default implementation forwards to `visit_str`.
+    #[inline]
+    fn visit_borrowed_str<E>(self, v: &'de str) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        self.visit_str(v)
+    }
+
+    /// The input contains a string and ownership of the string is being given
+    /// to the `Visitor`.
+    ///
+    /// This method allows the `Visitor` to avoid a copy by taking ownership of
+    /// a string created by the `Deserializer`. `Deserialize` implementations
+    /// that benefit from taking ownership of `String` data should indicate that
+    /// to the deserializer by using `Deserializer::deserialize_string` rather
+    /// than `Deserializer::deserialize_str`, although not every deserializer
+    /// will honor such a request.
+    ///
+    /// It is never correct to implement `visit_string` without implementing
+    /// `visit_str`. Implement neither, both, or just `visit_str`.
+    ///
+    /// The default implementation forwards to `visit_str` and then drops the
+    /// `String`.
+    #[inline]
+    #[cfg(any(feature = "std", feature = "alloc"))]
+    fn visit_string<E>(self, v: String) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        self.visit_str(&v)
+    }
+
+    /// The input contains a byte array. The lifetime of the byte array is
+    /// ephemeral and it may be destroyed after this method returns.
+    ///
+    /// This method allows the `Deserializer` to avoid a copy by retaining
+    /// ownership of any buffered data. `Deserialize` implementations that do
+    /// not benefit from taking ownership of `Vec<u8>` data should indicate that
+    /// to the deserializer by using `Deserializer::deserialize_bytes` rather
+    /// than `Deserializer::deserialize_byte_buf`.
+    ///
+    /// It is never correct to implement `visit_byte_buf` without implementing
+    /// `visit_bytes`. Implement neither, both, or just `visit_bytes`.
+    fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        let _ = v;
+        Err(Error::invalid_type(Unexpected::Bytes(v), &self))
+    }
+
+    /// The input contains a byte array that lives at least as long as the
+    /// `Deserializer`.
+    ///
+    /// This enables zero-copy deserialization of bytes in some formats. For
+    /// example Bincode data containing bytes can be deserialized with zero
+    /// copying into a `&'a [u8]` as long as the input data outlives `'a`.
+    ///
+    /// The default implementation forwards to `visit_bytes`.
+    #[inline]
+    fn visit_borrowed_bytes<E>(self, v: &'de [u8]) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        self.visit_bytes(v)
+    }
+
+    /// The input contains a byte array and ownership of the byte array is being
+    /// given to the `Visitor`.
+    ///
+    /// This method allows the `Visitor` to avoid a copy by taking ownership of
+    /// a byte buffer created by the `Deserializer`. `Deserialize`
+    /// implementations that benefit from taking ownership of `Vec<u8>` data
+    /// should indicate that to the deserializer by using
+    /// `Deserializer::deserialize_byte_buf` rather than
+    /// `Deserializer::deserialize_bytes`, although not every deserializer will
+    /// honor such a request.
+    ///
+    /// It is never correct to implement `visit_byte_buf` without implementing
+    /// `visit_bytes`. Implement neither, both, or just `visit_bytes`.
+    ///
+    /// The default implementation forwards to `visit_bytes` and then drops the
+    /// `Vec<u8>`.
+    #[cfg(any(feature = "std", feature = "alloc"))]
+    fn visit_byte_buf<E>(self, v: Vec<u8>) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        self.visit_bytes(&v)
+    }
+
+    /// The input contains an optional that is absent.
+    ///
+    /// The default implementation fails with a type error.
+    fn visit_none<E>(self) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Err(Error::invalid_type(Unexpected::Option, &self))
+    }
+
+    /// The input contains an optional that is present.
+    ///
+    /// The default implementation fails with a type error.
+    fn visit_some<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        let _ = deserializer;
+        Err(Error::invalid_type(Unexpected::Option, &self))
+    }
+
+    /// The input contains a unit `()`.
+    ///
+    /// The default implementation fails with a type error.
+    fn visit_unit<E>(self) -> Result<Self::Value, E>
+    where
+        E: Error,
+    {
+        Err(Error::invalid_type(Unexpected::Unit, &self))
+    }
+
+    /// The input contains a newtype struct.
+    ///
+    /// The content of the newtype struct may be read from the given
+    /// `Deserializer`.
+    ///
+    /// The default implementation fails with a type error.
+    fn visit_newtype_struct<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        let _ = deserializer;
+        Err(Error::invalid_type(Unexpected::NewtypeStruct, &self))
+    }
+
+    /// The input contains a sequence of elements.
+    ///
+    /// The default implementation fails with a type error.
+    fn visit_seq<A>(self, seq: A) -> Result<Self::Value, A::Error>
+    where
+        A: SeqAccess<'de>,
+    {
+        let _ = seq;
+        Err(Error::invalid_type(Unexpected::Seq, &self))
+    }
+
+    /// The input contains a key-value map.
+    ///
+    /// The default implementation fails with a type error.
+    fn visit_map<A>(self, map: A) -> Result<Self::Value, A::Error>
+    where
+        A: MapAccess<'de>,
+    {
+        let _ = map;
+        Err(Error::invalid_type(Unexpected::Map, &self))
+    }
+
+    /// The input contains an enum.
+    ///
+    /// The default implementation fails with a type error.
+    fn visit_enum<A>(self, data: A) -> Result<Self::Value, A::Error>
+    where
+        A: EnumAccess<'de>,
+    {
+        let _ = data;
+        Err(Error::invalid_type(Unexpected::Enum, &self))
+    }
+
+    // Used when deserializing a flattened Option field. Not public API.
+    #[doc(hidden)]
+    fn __private_visit_untagged_option<D>(self, _: D) -> Result<Self::Value, ()>
+    where
+        D: Deserializer<'de>,
+    {
+        Err(())
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// Provides a `Visitor` access to each element of a sequence in the input.
+///
+/// This is a trait that a `Deserializer` passes to a `Visitor` implementation,
+/// which deserializes each item in a sequence.
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed by deserialized sequence elements. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SeqAccess` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
+pub trait SeqAccess<'de> {
+    /// The error type that can be returned if some error occurs during
+    /// deserialization.
+    type Error: Error;
+
+    /// This returns `Ok(Some(value))` for the next value in the sequence, or
+    /// `Ok(None)` if there are no more remaining items.
+    ///
+    /// `Deserialize` implementations should typically use
+    /// `SeqAccess::next_element` instead.
+    fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
+    where
+        T: DeserializeSeed<'de>;
+
+    /// This returns `Ok(Some(value))` for the next value in the sequence, or
+    /// `Ok(None)` if there are no more remaining items.
+    ///
+    /// This method exists as a convenience for `Deserialize` implementations.
+    /// `SeqAccess` implementations should not override the default behavior.
+    #[inline]
+    fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error>
+    where
+        T: Deserialize<'de>,
+    {
+        self.next_element_seed(PhantomData)
+    }
+
+    /// Returns the number of elements remaining in the sequence, if known.
+    #[inline]
+    fn size_hint(&self) -> Option<usize> {
+        None
+    }
+}
+
+impl<'de, 'a, A> SeqAccess<'de> for &'a mut A
+where
+    A: SeqAccess<'de>,
+{
+    type Error = A::Error;
+
+    #[inline]
+    fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
+    where
+        T: DeserializeSeed<'de>,
+    {
+        (**self).next_element_seed(seed)
+    }
+
+    #[inline]
+    fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error>
+    where
+        T: Deserialize<'de>,
+    {
+        (**self).next_element()
+    }
+
+    #[inline]
+    fn size_hint(&self) -> Option<usize> {
+        (**self).size_hint()
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// Provides a `Visitor` access to each entry of a map in the input.
+///
+/// This is a trait that a `Deserializer` passes to a `Visitor` implementation.
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed by deserialized map entries. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `MapAccess` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
+pub trait MapAccess<'de> {
+    /// The error type that can be returned if some error occurs during
+    /// deserialization.
+    type Error: Error;
+
+    /// This returns `Ok(Some(key))` for the next key in the map, or `Ok(None)`
+    /// if there are no more remaining entries.
+    ///
+    /// `Deserialize` implementations should typically use
+    /// `MapAccess::next_key` or `MapAccess::next_entry` instead.
+    fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>, Self::Error>
+    where
+        K: DeserializeSeed<'de>;
+
+    /// This returns a `Ok(value)` for the next value in the map.
+    ///
+    /// `Deserialize` implementations should typically use
+    /// `MapAccess::next_value` instead.
+    ///
+    /// # Panics
+    ///
+    /// Calling `next_value_seed` before `next_key_seed` is incorrect and is
+    /// allowed to panic or return bogus results.
+    fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value, Self::Error>
+    where
+        V: DeserializeSeed<'de>;
+
+    /// This returns `Ok(Some((key, value)))` for the next (key-value) pair in
+    /// the map, or `Ok(None)` if there are no more remaining items.
+    ///
+    /// `MapAccess` implementations should override the default behavior if a
+    /// more efficient implementation is possible.
+    ///
+    /// `Deserialize` implementations should typically use
+    /// `MapAccess::next_entry` instead.
+    #[inline]
+    fn next_entry_seed<K, V>(
+        &mut self,
+        kseed: K,
+        vseed: V,
+    ) -> Result<Option<(K::Value, V::Value)>, Self::Error>
+    where
+        K: DeserializeSeed<'de>,
+        V: DeserializeSeed<'de>,
+    {
+        match try!(self.next_key_seed(kseed)) {
+            Some(key) => {
+                let value = try!(self.next_value_seed(vseed));
+                Ok(Some((key, value)))
+            }
+            None => Ok(None),
+        }
+    }
+
+    /// This returns `Ok(Some(key))` for the next key in the map, or `Ok(None)`
+    /// if there are no more remaining entries.
+    ///
+    /// This method exists as a convenience for `Deserialize` implementations.
+    /// `MapAccess` implementations should not override the default behavior.
+    #[inline]
+    fn next_key<K>(&mut self) -> Result<Option<K>, Self::Error>
+    where
+        K: Deserialize<'de>,
+    {
+        self.next_key_seed(PhantomData)
+    }
+
+    /// This returns a `Ok(value)` for the next value in the map.
+    ///
+    /// This method exists as a convenience for `Deserialize` implementations.
+    /// `MapAccess` implementations should not override the default behavior.
+    ///
+    /// # Panics
+    ///
+    /// Calling `next_value` before `next_key` is incorrect and is allowed to
+    /// panic or return bogus results.
+    #[inline]
+    fn next_value<V>(&mut self) -> Result<V, Self::Error>
+    where
+        V: Deserialize<'de>,
+    {
+        self.next_value_seed(PhantomData)
+    }
+
+    /// This returns `Ok(Some((key, value)))` for the next (key-value) pair in
+    /// the map, or `Ok(None)` if there are no more remaining items.
+    ///
+    /// This method exists as a convenience for `Deserialize` implementations.
+    /// `MapAccess` implementations should not override the default behavior.
+    #[inline]
+    fn next_entry<K, V>(&mut self) -> Result<Option<(K, V)>, Self::Error>
+    where
+        K: Deserialize<'de>,
+        V: Deserialize<'de>,
+    {
+        self.next_entry_seed(PhantomData, PhantomData)
+    }
+
+    /// Returns the number of entries remaining in the map, if known.
+    #[inline]
+    fn size_hint(&self) -> Option<usize> {
+        None
+    }
+}
+
+impl<'de, 'a, A> MapAccess<'de> for &'a mut A
+where
+    A: MapAccess<'de>,
+{
+    type Error = A::Error;
+
+    #[inline]
+    fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>, Self::Error>
+    where
+        K: DeserializeSeed<'de>,
+    {
+        (**self).next_key_seed(seed)
+    }
+
+    #[inline]
+    fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value, Self::Error>
+    where
+        V: DeserializeSeed<'de>,
+    {
+        (**self).next_value_seed(seed)
+    }
+
+    #[inline]
+    fn next_entry_seed<K, V>(
+        &mut self,
+        kseed: K,
+        vseed: V,
+    ) -> Result<Option<(K::Value, V::Value)>, Self::Error>
+    where
+        K: DeserializeSeed<'de>,
+        V: DeserializeSeed<'de>,
+    {
+        (**self).next_entry_seed(kseed, vseed)
+    }
+
+    #[inline]
+    fn next_entry<K, V>(&mut self) -> Result<Option<(K, V)>, Self::Error>
+    where
+        K: Deserialize<'de>,
+        V: Deserialize<'de>,
+    {
+        (**self).next_entry()
+    }
+
+    #[inline]
+    fn next_key<K>(&mut self) -> Result<Option<K>, Self::Error>
+    where
+        K: Deserialize<'de>,
+    {
+        (**self).next_key()
+    }
+
+    #[inline]
+    fn next_value<V>(&mut self) -> Result<V, Self::Error>
+    where
+        V: Deserialize<'de>,
+    {
+        (**self).next_value()
+    }
+
+    #[inline]
+    fn size_hint(&self) -> Option<usize> {
+        (**self).size_hint()
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// Provides a `Visitor` access to the data of an enum in the input.
+///
+/// `EnumAccess` is created by the `Deserializer` and passed to the
+/// `Visitor` in order to identify which variant of an enum to deserialize.
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed by the deserialized enum variant. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `EnumAccess` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
+pub trait EnumAccess<'de>: Sized {
+    /// The error type that can be returned if some error occurs during
+    /// deserialization.
+    type Error: Error;
+    /// The `Visitor` that will be used to deserialize the content of the enum
+    /// variant.
+    type Variant: VariantAccess<'de, Error = Self::Error>;
+
+    /// `variant` is called to identify which variant to deserialize.
+    ///
+    /// `Deserialize` implementations should typically use `EnumAccess::variant`
+    /// instead.
+    fn variant_seed<V>(self, seed: V) -> Result<(V::Value, Self::Variant), Self::Error>
+    where
+        V: DeserializeSeed<'de>;
+
+    /// `variant` is called to identify which variant to deserialize.
+    ///
+    /// This method exists as a convenience for `Deserialize` implementations.
+    /// `EnumAccess` implementations should not override the default behavior.
+    #[inline]
+    fn variant<V>(self) -> Result<(V, Self::Variant), Self::Error>
+    where
+        V: Deserialize<'de>,
+    {
+        self.variant_seed(PhantomData)
+    }
+}
+
+/// `VariantAccess` is a visitor that is created by the `Deserializer` and
+/// passed to the `Deserialize` to deserialize the content of a particular enum
+/// variant.
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed by the deserialized enum variant. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `VariantAccess` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
+pub trait VariantAccess<'de>: Sized {
+    /// The error type that can be returned if some error occurs during
+    /// deserialization. Must match the error type of our `EnumAccess`.
+    type Error: Error;
+
+    /// Called when deserializing a variant with no values.
+    ///
+    /// If the data contains a different type of variant, the following
+    /// `invalid_type` error should be constructed:
+    ///
+    /// ```edition2018
+    /// # use serde::de::{self, value, DeserializeSeed, Visitor, VariantAccess, Unexpected};
+    /// #
+    /// # struct X;
+    /// #
+    /// # impl<'de> VariantAccess<'de> for X {
+    /// #     type Error = value::Error;
+    /// #
+    /// fn unit_variant(self) -> Result<(), Self::Error> {
+    ///     // What the data actually contained; suppose it is a tuple variant.
+    ///     let unexp = Unexpected::TupleVariant;
+    ///     Err(de::Error::invalid_type(unexp, &"unit variant"))
+    /// }
+    /// #
+    /// #     fn newtype_variant_seed<T>(self, _: T) -> Result<T::Value, Self::Error>
+    /// #     where
+    /// #         T: DeserializeSeed<'de>,
+    /// #     { unimplemented!() }
+    /// #
+    /// #     fn tuple_variant<V>(self, _: usize, _: V) -> Result<V::Value, Self::Error>
+    /// #     where
+    /// #         V: Visitor<'de>,
+    /// #     { unimplemented!() }
+    /// #
+    /// #     fn struct_variant<V>(self, _: &[&str], _: V) -> Result<V::Value, Self::Error>
+    /// #     where
+    /// #         V: Visitor<'de>,
+    /// #     { unimplemented!() }
+    /// # }
+    /// ```
+    fn unit_variant(self) -> Result<(), Self::Error>;
+
+    /// Called when deserializing a variant with a single value.
+    ///
+    /// `Deserialize` implementations should typically use
+    /// `VariantAccess::newtype_variant` instead.
+    ///
+    /// If the data contains a different type of variant, the following
+    /// `invalid_type` error should be constructed:
+    ///
+    /// ```edition2018
+    /// # use serde::de::{self, value, DeserializeSeed, Visitor, VariantAccess, Unexpected};
+    /// #
+    /// # struct X;
+    /// #
+    /// # impl<'de> VariantAccess<'de> for X {
+    /// #     type Error = value::Error;
+    /// #
+    /// #     fn unit_variant(self) -> Result<(), Self::Error> {
+    /// #         unimplemented!()
+    /// #     }
+    /// #
+    /// fn newtype_variant_seed<T>(self, _seed: T) -> Result<T::Value, Self::Error>
+    /// where
+    ///     T: DeserializeSeed<'de>,
+    /// {
+    ///     // What the data actually contained; suppose it is a unit variant.
+    ///     let unexp = Unexpected::UnitVariant;
+    ///     Err(de::Error::invalid_type(unexp, &"newtype variant"))
+    /// }
+    /// #
+    /// #     fn tuple_variant<V>(self, _: usize, _: V) -> Result<V::Value, Self::Error>
+    /// #     where
+    /// #         V: Visitor<'de>,
+    /// #     { unimplemented!() }
+    /// #
+    /// #     fn struct_variant<V>(self, _: &[&str], _: V) -> Result<V::Value, Self::Error>
+    /// #     where
+    /// #         V: Visitor<'de>,
+    /// #     { unimplemented!() }
+    /// # }
+    /// ```
+    fn newtype_variant_seed<T>(self, seed: T) -> Result<T::Value, Self::Error>
+    where
+        T: DeserializeSeed<'de>;
+
+    /// Called when deserializing a variant with a single value.
+    ///
+    /// This method exists as a convenience for `Deserialize` implementations.
+    /// `VariantAccess` implementations should not override the default
+    /// behavior.
+    #[inline]
+    fn newtype_variant<T>(self) -> Result<T, Self::Error>
+    where
+        T: Deserialize<'de>,
+    {
+        self.newtype_variant_seed(PhantomData)
+    }
+
+    /// Called when deserializing a tuple-like variant.
+    ///
+    /// The `len` is the number of fields expected in the tuple variant.
+    ///
+    /// If the data contains a different type of variant, the following
+    /// `invalid_type` error should be constructed:
+    ///
+    /// ```edition2018
+    /// # use serde::de::{self, value, DeserializeSeed, Visitor, VariantAccess, Unexpected};
+    /// #
+    /// # struct X;
+    /// #
+    /// # impl<'de> VariantAccess<'de> for X {
+    /// #     type Error = value::Error;
+    /// #
+    /// #     fn unit_variant(self) -> Result<(), Self::Error> {
+    /// #         unimplemented!()
+    /// #     }
+    /// #
+    /// #     fn newtype_variant_seed<T>(self, _: T) -> Result<T::Value, Self::Error>
+    /// #     where
+    /// #         T: DeserializeSeed<'de>,
+    /// #     { unimplemented!() }
+    /// #
+    /// fn tuple_variant<V>(
+    ///     self,
+    ///     _len: usize,
+    ///     _visitor: V,
+    /// ) -> Result<V::Value, Self::Error>
+    /// where
+    ///     V: Visitor<'de>,
+    /// {
+    ///     // What the data actually contained; suppose it is a unit variant.
+    ///     let unexp = Unexpected::UnitVariant;
+    ///     Err(de::Error::invalid_type(unexp, &"tuple variant"))
+    /// }
+    /// #
+    /// #     fn struct_variant<V>(self, _: &[&str], _: V) -> Result<V::Value, Self::Error>
+    /// #     where
+    /// #         V: Visitor<'de>,
+    /// #     { unimplemented!() }
+    /// # }
+    /// ```
+    fn tuple_variant<V>(self, len: usize, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+
+    /// Called when deserializing a struct-like variant.
+    ///
+    /// The `fields` are the names of the fields of the struct variant.
+    ///
+    /// If the data contains a different type of variant, the following
+    /// `invalid_type` error should be constructed:
+    ///
+    /// ```edition2018
+    /// # use serde::de::{self, value, DeserializeSeed, Visitor, VariantAccess, Unexpected};
+    /// #
+    /// # struct X;
+    /// #
+    /// # impl<'de> VariantAccess<'de> for X {
+    /// #     type Error = value::Error;
+    /// #
+    /// #     fn unit_variant(self) -> Result<(), Self::Error> {
+    /// #         unimplemented!()
+    /// #     }
+    /// #
+    /// #     fn newtype_variant_seed<T>(self, _: T) -> Result<T::Value, Self::Error>
+    /// #     where
+    /// #         T: DeserializeSeed<'de>,
+    /// #     { unimplemented!() }
+    /// #
+    /// #     fn tuple_variant<V>(self, _: usize, _: V) -> Result<V::Value, Self::Error>
+    /// #     where
+    /// #         V: Visitor<'de>,
+    /// #     { unimplemented!() }
+    /// #
+    /// fn struct_variant<V>(
+    ///     self,
+    ///     _fields: &'static [&'static str],
+    ///     _visitor: V,
+    /// ) -> Result<V::Value, Self::Error>
+    /// where
+    ///     V: Visitor<'de>,
+    /// {
+    ///     // What the data actually contained; suppose it is a unit variant.
+    ///     let unexp = Unexpected::UnitVariant;
+    ///     Err(de::Error::invalid_type(unexp, &"struct variant"))
+    /// }
+    /// # }
+    /// ```
+    fn struct_variant<V>(
+        self,
+        fields: &'static [&'static str],
+        visitor: V,
+    ) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// Converts an existing value into a `Deserializer` from which other values can
+/// be deserialized.
+///
+/// # Lifetime
+///
+/// The `'de` lifetime of this trait is the lifetime of data that may be
+/// borrowed from the resulting `Deserializer`. See the page [Understanding
+/// deserializer lifetimes] for a more detailed explanation of these lifetimes.
+///
+/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html
+///
+/// # Example
+///
+/// ```edition2018
+/// use std::str::FromStr;
+/// use serde::Deserialize;
+/// use serde::de::{value, IntoDeserializer};
+///
+/// #[derive(Deserialize)]
+/// enum Setting {
+///     On,
+///     Off,
+/// }
+///
+/// impl FromStr for Setting {
+///     type Err = value::Error;
+///
+///     fn from_str(s: &str) -> Result<Self, Self::Err> {
+///         Self::deserialize(s.into_deserializer())
+///     }
+/// }
+/// ```
+pub trait IntoDeserializer<'de, E: Error = value::Error> {
+    /// The type of the deserializer being converted into.
+    type Deserializer: Deserializer<'de, Error = E>;
+
+    /// Convert this value into a deserializer.
+    fn into_deserializer(self) -> Self::Deserializer;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// Used in error messages.
+///
+/// - expected `a`
+/// - expected `a` or `b`
+/// - expected one of `a`, `b`, `c`
+///
+/// The slice of names must not be empty.
+struct OneOf {
+    names: &'static [&'static str],
+}
+
+impl Display for OneOf {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match self.names.len() {
+            0 => panic!(), // special case elsewhere
+            1 => write!(formatter, "`{}`", self.names[0]),
+            2 => write!(formatter, "`{}` or `{}`", self.names[0], self.names[1]),
+            _ => {
+                try!(write!(formatter, "one of "));
+                for (i, alt) in self.names.iter().enumerate() {
+                    if i > 0 {
+                        try!(write!(formatter, ", "));
+                    }
+                    try!(write!(formatter, "`{}`", alt));
+                }
+                Ok(())
+            }
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde/de/utf8.rs.html b/src/serde/de/utf8.rs.html new file mode 100644 index 0000000..54762a0 --- /dev/null +++ b/src/serde/de/utf8.rs.html @@ -0,0 +1,95 @@ +utf8.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
+use lib::*;
+
+const TAG_CONT: u8 = 0b1000_0000;
+const TAG_TWO_B: u8 = 0b1100_0000;
+const TAG_THREE_B: u8 = 0b1110_0000;
+const TAG_FOUR_B: u8 = 0b1111_0000;
+const MAX_ONE_B: u32 = 0x80;
+const MAX_TWO_B: u32 = 0x800;
+const MAX_THREE_B: u32 = 0x10000;
+
+#[inline]
+pub fn encode(c: char) -> Encode {
+    let code = c as u32;
+    let mut buf = [0; 4];
+    let pos = if code < MAX_ONE_B {
+        buf[3] = code as u8;
+        3
+    } else if code < MAX_TWO_B {
+        buf[2] = (code >> 6 & 0x1F) as u8 | TAG_TWO_B;
+        buf[3] = (code & 0x3F) as u8 | TAG_CONT;
+        2
+    } else if code < MAX_THREE_B {
+        buf[1] = (code >> 12 & 0x0F) as u8 | TAG_THREE_B;
+        buf[2] = (code >> 6 & 0x3F) as u8 | TAG_CONT;
+        buf[3] = (code & 0x3F) as u8 | TAG_CONT;
+        1
+    } else {
+        buf[0] = (code >> 18 & 0x07) as u8 | TAG_FOUR_B;
+        buf[1] = (code >> 12 & 0x3F) as u8 | TAG_CONT;
+        buf[2] = (code >> 6 & 0x3F) as u8 | TAG_CONT;
+        buf[3] = (code & 0x3F) as u8 | TAG_CONT;
+        0
+    };
+    Encode { buf: buf, pos: pos }
+}
+
+pub struct Encode {
+    buf: [u8; 4],
+    pos: usize,
+}
+
+impl Encode {
+    pub fn as_str(&self) -> &str {
+        str::from_utf8(&self.buf[self.pos..]).unwrap()
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde/de/value.rs.html b/src/serde/de/value.rs.html new file mode 100644 index 0000000..425f6bf --- /dev/null +++ b/src/serde/de/value.rs.html @@ -0,0 +1,2997 @@ +value.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+
+//! Building blocks for deserializing basic values using the `IntoDeserializer`
+//! trait.
+//!
+//! ```edition2018
+//! use std::str::FromStr;
+//! use serde::Deserialize;
+//! use serde::de::{value, IntoDeserializer};
+//!
+//! #[derive(Deserialize)]
+//! enum Setting {
+//!     On,
+//!     Off,
+//! }
+//!
+//! impl FromStr for Setting {
+//!     type Err = value::Error;
+//!
+//!     fn from_str(s: &str) -> Result<Self, Self::Err> {
+//!         Self::deserialize(s.into_deserializer())
+//!     }
+//! }
+//! ```
+
+use lib::*;
+
+use self::private::{First, Second};
+use de::{self, Expected, IntoDeserializer, SeqAccess};
+use private::de::size_hint;
+use ser;
+
+////////////////////////////////////////////////////////////////////////////////
+
+// For structs that contain a PhantomData. We do not want the trait
+// bound `E: Clone` inferred by derive(Clone).
+macro_rules! impl_copy_clone {
+    ($ty:ident $(<$lifetime:tt>)*) => {
+        impl<$($lifetime,)* E> Copy for $ty<$($lifetime,)* E> {}
+
+        impl<$($lifetime,)* E> Clone for $ty<$($lifetime,)* E> {
+            fn clone(&self) -> Self {
+                *self
+            }
+        }
+    };
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A minimal representation of all possible errors that can occur using the
+/// `IntoDeserializer` trait.
+#[derive(Clone, Debug, PartialEq)]
+pub struct Error {
+    err: ErrorImpl,
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+type ErrorImpl = Box<str>;
+#[cfg(not(any(feature = "std", feature = "alloc")))]
+type ErrorImpl = ();
+
+impl de::Error for Error {
+    #[cfg(any(feature = "std", feature = "alloc"))]
+    #[cold]
+    fn custom<T>(msg: T) -> Self
+    where
+        T: Display,
+    {
+        Error {
+            err: msg.to_string().into_boxed_str(),
+        }
+    }
+
+    #[cfg(not(any(feature = "std", feature = "alloc")))]
+    #[cold]
+    fn custom<T>(msg: T) -> Self
+    where
+        T: Display,
+    {
+        let _ = msg;
+        Error { err: () }
+    }
+}
+
+impl ser::Error for Error {
+    #[cold]
+    fn custom<T>(msg: T) -> Self
+    where
+        T: Display,
+    {
+        de::Error::custom(msg)
+    }
+}
+
+impl Display for Error {
+    #[cfg(any(feature = "std", feature = "alloc"))]
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+        formatter.write_str(&self.err)
+    }
+
+    #[cfg(not(any(feature = "std", feature = "alloc")))]
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+        formatter.write_str("Serde deserialization error")
+    }
+}
+
+#[cfg(feature = "std")]
+impl error::Error for Error {
+    fn description(&self) -> &str {
+        &self.err
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+impl<'de, E> IntoDeserializer<'de, E> for ()
+where
+    E: de::Error,
+{
+    type Deserializer = UnitDeserializer<E>;
+
+    fn into_deserializer(self) -> UnitDeserializer<E> {
+        UnitDeserializer {
+            marker: PhantomData,
+        }
+    }
+}
+
+/// A deserializer holding a `()`.
+#[derive(Debug)]
+pub struct UnitDeserializer<E> {
+    marker: PhantomData<E>,
+}
+
+impl_copy_clone!(UnitDeserializer);
+
+impl<'de, E> de::Deserializer<'de> for UnitDeserializer<E>
+where
+    E: de::Error,
+{
+    type Error = E;
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf unit unit_struct newtype_struct seq tuple tuple_struct
+        map struct enum identifier ignored_any
+    }
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        visitor.visit_unit()
+    }
+
+    fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        visitor.visit_none()
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A deserializer that cannot be instantiated.
+#[cfg(feature = "unstable")]
+pub struct NeverDeserializer<E> {
+    never: !,
+    marker: PhantomData<E>,
+}
+
+#[cfg(feature = "unstable")]
+impl<'de, E> IntoDeserializer<'de, E> for !
+where
+    E: de::Error,
+{
+    type Deserializer = NeverDeserializer<E>;
+
+    fn into_deserializer(self) -> Self::Deserializer {
+        self
+    }
+}
+
+#[cfg(feature = "unstable")]
+impl<'de, E> de::Deserializer<'de> for NeverDeserializer<E>
+where
+    E: de::Error,
+{
+    type Error = E;
+
+    fn deserialize_any<V>(self, _visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        self.never
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct enum identifier ignored_any
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+macro_rules! primitive_deserializer {
+    ($ty:ty, $doc:tt, $name:ident, $method:ident $($cast:tt)*) => {
+        #[doc = "A deserializer holding"]
+        #[doc = $doc]
+        #[derive(Debug)]
+        pub struct $name<E> {
+            value: $ty,
+            marker: PhantomData<E>
+        }
+
+        impl_copy_clone!($name);
+
+        impl<'de, E> IntoDeserializer<'de, E> for $ty
+        where
+            E: de::Error,
+        {
+            type Deserializer = $name<E>;
+
+            fn into_deserializer(self) -> $name<E> {
+                $name {
+                    value: self,
+                    marker: PhantomData,
+                }
+            }
+        }
+
+        impl<'de, E> de::Deserializer<'de> for $name<E>
+        where
+            E: de::Error,
+        {
+            type Error = E;
+
+            forward_to_deserialize_any! {
+                bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str
+                string bytes byte_buf option unit unit_struct newtype_struct seq
+                tuple tuple_struct map struct enum identifier ignored_any
+            }
+
+            fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+            where
+                V: de::Visitor<'de>,
+            {
+                visitor.$method(self.value $($cast)*)
+            }
+        }
+    }
+}
+
+primitive_deserializer!(bool, "a `bool`.", BoolDeserializer, visit_bool);
+primitive_deserializer!(i8, "an `i8`.", I8Deserializer, visit_i8);
+primitive_deserializer!(i16, "an `i16`.", I16Deserializer, visit_i16);
+primitive_deserializer!(i32, "an `i32`.", I32Deserializer, visit_i32);
+primitive_deserializer!(i64, "an `i64`.", I64Deserializer, visit_i64);
+primitive_deserializer!(isize, "an `isize`.", IsizeDeserializer, visit_i64 as i64);
+primitive_deserializer!(u8, "a `u8`.", U8Deserializer, visit_u8);
+primitive_deserializer!(u16, "a `u16`.", U16Deserializer, visit_u16);
+primitive_deserializer!(u64, "a `u64`.", U64Deserializer, visit_u64);
+primitive_deserializer!(usize, "a `usize`.", UsizeDeserializer, visit_u64 as u64);
+primitive_deserializer!(f32, "an `f32`.", F32Deserializer, visit_f32);
+primitive_deserializer!(f64, "an `f64`.", F64Deserializer, visit_f64);
+primitive_deserializer!(char, "a `char`.", CharDeserializer, visit_char);
+
+serde_if_integer128! {
+    primitive_deserializer!(i128, "an `i128`.", I128Deserializer, visit_i128);
+    primitive_deserializer!(u128, "a `u128`.", U128Deserializer, visit_u128);
+}
+
+/// A deserializer holding a `u32`.
+#[derive(Debug)]
+pub struct U32Deserializer<E> {
+    value: u32,
+    marker: PhantomData<E>,
+}
+
+impl_copy_clone!(U32Deserializer);
+
+impl<'de, E> IntoDeserializer<'de, E> for u32
+where
+    E: de::Error,
+{
+    type Deserializer = U32Deserializer<E>;
+
+    fn into_deserializer(self) -> U32Deserializer<E> {
+        U32Deserializer {
+            value: self,
+            marker: PhantomData,
+        }
+    }
+}
+
+impl<'de, E> de::Deserializer<'de> for U32Deserializer<E>
+where
+    E: de::Error,
+{
+    type Error = E;
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct identifier ignored_any
+    }
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        visitor.visit_u32(self.value)
+    }
+
+    fn deserialize_enum<V>(
+        self,
+        name: &str,
+        variants: &'static [&'static str],
+        visitor: V,
+    ) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        let _ = name;
+        let _ = variants;
+        visitor.visit_enum(self)
+    }
+}
+
+impl<'de, E> de::EnumAccess<'de> for U32Deserializer<E>
+where
+    E: de::Error,
+{
+    type Error = E;
+    type Variant = private::UnitOnly<E>;
+
+    fn variant_seed<T>(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error>
+    where
+        T: de::DeserializeSeed<'de>,
+    {
+        seed.deserialize(self).map(private::unit_only)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A deserializer holding a `&str`.
+#[derive(Debug)]
+pub struct StrDeserializer<'a, E> {
+    value: &'a str,
+    marker: PhantomData<E>,
+}
+
+impl_copy_clone!(StrDeserializer<'de>);
+
+impl<'de, 'a, E> IntoDeserializer<'de, E> for &'a str
+where
+    E: de::Error,
+{
+    type Deserializer = StrDeserializer<'a, E>;
+
+    fn into_deserializer(self) -> StrDeserializer<'a, E> {
+        StrDeserializer {
+            value: self,
+            marker: PhantomData,
+        }
+    }
+}
+
+impl<'de, 'a, E> de::Deserializer<'de> for StrDeserializer<'a, E>
+where
+    E: de::Error,
+{
+    type Error = E;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        visitor.visit_str(self.value)
+    }
+
+    fn deserialize_enum<V>(
+        self,
+        name: &str,
+        variants: &'static [&'static str],
+        visitor: V,
+    ) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        let _ = name;
+        let _ = variants;
+        visitor.visit_enum(self)
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct identifier ignored_any
+    }
+}
+
+impl<'de, 'a, E> de::EnumAccess<'de> for StrDeserializer<'a, E>
+where
+    E: de::Error,
+{
+    type Error = E;
+    type Variant = private::UnitOnly<E>;
+
+    fn variant_seed<T>(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error>
+    where
+        T: de::DeserializeSeed<'de>,
+    {
+        seed.deserialize(self).map(private::unit_only)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A deserializer holding a `&str` with a lifetime tied to another
+/// deserializer.
+#[derive(Debug)]
+pub struct BorrowedStrDeserializer<'de, E> {
+    value: &'de str,
+    marker: PhantomData<E>,
+}
+
+impl_copy_clone!(BorrowedStrDeserializer<'de>);
+
+impl<'de, E> BorrowedStrDeserializer<'de, E> {
+    /// Create a new borrowed deserializer from the given string.
+    pub fn new(value: &'de str) -> BorrowedStrDeserializer<'de, E> {
+        BorrowedStrDeserializer {
+            value: value,
+            marker: PhantomData,
+        }
+    }
+}
+
+impl<'de, E> de::Deserializer<'de> for BorrowedStrDeserializer<'de, E>
+where
+    E: de::Error,
+{
+    type Error = E;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        visitor.visit_borrowed_str(self.value)
+    }
+
+    fn deserialize_enum<V>(
+        self,
+        name: &str,
+        variants: &'static [&'static str],
+        visitor: V,
+    ) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        let _ = name;
+        let _ = variants;
+        visitor.visit_enum(self)
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct identifier ignored_any
+    }
+}
+
+impl<'de, E> de::EnumAccess<'de> for BorrowedStrDeserializer<'de, E>
+where
+    E: de::Error,
+{
+    type Error = E;
+    type Variant = private::UnitOnly<E>;
+
+    fn variant_seed<T>(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error>
+    where
+        T: de::DeserializeSeed<'de>,
+    {
+        seed.deserialize(self).map(private::unit_only)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A deserializer holding a `String`.
+#[cfg(any(feature = "std", feature = "alloc"))]
+#[derive(Debug)]
+pub struct StringDeserializer<E> {
+    value: String,
+    marker: PhantomData<E>,
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<E> Clone for StringDeserializer<E> {
+    fn clone(&self) -> Self {
+        StringDeserializer {
+            value: self.value.clone(),
+            marker: PhantomData,
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'de, E> IntoDeserializer<'de, E> for String
+where
+    E: de::Error,
+{
+    type Deserializer = StringDeserializer<E>;
+
+    fn into_deserializer(self) -> StringDeserializer<E> {
+        StringDeserializer {
+            value: self,
+            marker: PhantomData,
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'de, E> de::Deserializer<'de> for StringDeserializer<E>
+where
+    E: de::Error,
+{
+    type Error = E;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        visitor.visit_string(self.value)
+    }
+
+    fn deserialize_enum<V>(
+        self,
+        name: &str,
+        variants: &'static [&'static str],
+        visitor: V,
+    ) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        let _ = name;
+        let _ = variants;
+        visitor.visit_enum(self)
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct identifier ignored_any
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'de, 'a, E> de::EnumAccess<'de> for StringDeserializer<E>
+where
+    E: de::Error,
+{
+    type Error = E;
+    type Variant = private::UnitOnly<E>;
+
+    fn variant_seed<T>(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error>
+    where
+        T: de::DeserializeSeed<'de>,
+    {
+        seed.deserialize(self).map(private::unit_only)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A deserializer holding a `Cow<str>`.
+#[cfg(any(feature = "std", feature = "alloc"))]
+#[derive(Debug)]
+pub struct CowStrDeserializer<'a, E> {
+    value: Cow<'a, str>,
+    marker: PhantomData<E>,
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, E> Clone for CowStrDeserializer<'a, E> {
+    fn clone(&self) -> Self {
+        CowStrDeserializer {
+            value: self.value.clone(),
+            marker: PhantomData,
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'de, 'a, E> IntoDeserializer<'de, E> for Cow<'a, str>
+where
+    E: de::Error,
+{
+    type Deserializer = CowStrDeserializer<'a, E>;
+
+    fn into_deserializer(self) -> CowStrDeserializer<'a, E> {
+        CowStrDeserializer {
+            value: self,
+            marker: PhantomData,
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'de, 'a, E> de::Deserializer<'de> for CowStrDeserializer<'a, E>
+where
+    E: de::Error,
+{
+    type Error = E;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        match self.value {
+            Cow::Borrowed(string) => visitor.visit_str(string),
+            Cow::Owned(string) => visitor.visit_string(string),
+        }
+    }
+
+    fn deserialize_enum<V>(
+        self,
+        name: &str,
+        variants: &'static [&'static str],
+        visitor: V,
+    ) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        let _ = name;
+        let _ = variants;
+        visitor.visit_enum(self)
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct identifier ignored_any
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'de, 'a, E> de::EnumAccess<'de> for CowStrDeserializer<'a, E>
+where
+    E: de::Error,
+{
+    type Error = E;
+    type Variant = private::UnitOnly<E>;
+
+    fn variant_seed<T>(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error>
+    where
+        T: de::DeserializeSeed<'de>,
+    {
+        seed.deserialize(self).map(private::unit_only)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A deserializer holding a `&[u8]` with a lifetime tied to another
+/// deserializer.
+#[derive(Debug)]
+pub struct BorrowedBytesDeserializer<'de, E> {
+    value: &'de [u8],
+    marker: PhantomData<E>,
+}
+
+impl_copy_clone!(BorrowedBytesDeserializer<'de>);
+
+impl<'de, E> BorrowedBytesDeserializer<'de, E> {
+    /// Create a new borrowed deserializer from the given byte slice.
+    pub fn new(value: &'de [u8]) -> BorrowedBytesDeserializer<'de, E> {
+        BorrowedBytesDeserializer {
+            value: value,
+            marker: PhantomData,
+        }
+    }
+}
+
+impl<'de, E> de::Deserializer<'de> for BorrowedBytesDeserializer<'de, E>
+where
+    E: de::Error,
+{
+    type Error = E;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        visitor.visit_borrowed_bytes(self.value)
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct identifier ignored_any enum
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A deserializer that iterates over a sequence.
+#[derive(Clone, Debug)]
+pub struct SeqDeserializer<I, E> {
+    iter: iter::Fuse<I>,
+    count: usize,
+    marker: PhantomData<E>,
+}
+
+impl<I, E> SeqDeserializer<I, E>
+where
+    I: Iterator,
+{
+    /// Construct a new `SeqDeserializer<I, E>`.
+    pub fn new(iter: I) -> Self {
+        SeqDeserializer {
+            iter: iter.fuse(),
+            count: 0,
+            marker: PhantomData,
+        }
+    }
+}
+
+impl<I, E> SeqDeserializer<I, E>
+where
+    I: Iterator,
+    E: de::Error,
+{
+    /// Check for remaining elements after passing a `SeqDeserializer` to
+    /// `Visitor::visit_seq`.
+    pub fn end(self) -> Result<(), E> {
+        let remaining = self.iter.count();
+        if remaining == 0 {
+            Ok(())
+        } else {
+            // First argument is the number of elements in the data, second
+            // argument is the number of elements expected by the Deserialize.
+            Err(de::Error::invalid_length(
+                self.count + remaining,
+                &ExpectedInSeq(self.count),
+            ))
+        }
+    }
+}
+
+impl<'de, I, T, E> de::Deserializer<'de> for SeqDeserializer<I, E>
+where
+    I: Iterator<Item = T>,
+    T: IntoDeserializer<'de, E>,
+    E: de::Error,
+{
+    type Error = E;
+
+    fn deserialize_any<V>(mut self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        let v = try!(visitor.visit_seq(&mut self));
+        try!(self.end());
+        Ok(v)
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct enum identifier ignored_any
+    }
+}
+
+impl<'de, I, T, E> de::SeqAccess<'de> for SeqDeserializer<I, E>
+where
+    I: Iterator<Item = T>,
+    T: IntoDeserializer<'de, E>,
+    E: de::Error,
+{
+    type Error = E;
+
+    fn next_element_seed<V>(&mut self, seed: V) -> Result<Option<V::Value>, Self::Error>
+    where
+        V: de::DeserializeSeed<'de>,
+    {
+        match self.iter.next() {
+            Some(value) => {
+                self.count += 1;
+                seed.deserialize(value.into_deserializer()).map(Some)
+            }
+            None => Ok(None),
+        }
+    }
+
+    fn size_hint(&self) -> Option<usize> {
+        size_hint::from_bounds(&self.iter)
+    }
+}
+
+struct ExpectedInSeq(usize);
+
+impl Expected for ExpectedInSeq {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        if self.0 == 1 {
+            write!(formatter, "1 element in sequence")
+        } else {
+            write!(formatter, "{} elements in sequence", self.0)
+        }
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'de, T, E> IntoDeserializer<'de, E> for Vec<T>
+where
+    T: IntoDeserializer<'de, E>,
+    E: de::Error,
+{
+    type Deserializer = SeqDeserializer<<Self as IntoIterator>::IntoIter, E>;
+
+    fn into_deserializer(self) -> Self::Deserializer {
+        SeqDeserializer::new(self.into_iter())
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'de, T, E> IntoDeserializer<'de, E> for BTreeSet<T>
+where
+    T: IntoDeserializer<'de, E> + Eq + Ord,
+    E: de::Error,
+{
+    type Deserializer = SeqDeserializer<<Self as IntoIterator>::IntoIter, E>;
+
+    fn into_deserializer(self) -> Self::Deserializer {
+        SeqDeserializer::new(self.into_iter())
+    }
+}
+
+#[cfg(feature = "std")]
+impl<'de, T, S, E> IntoDeserializer<'de, E> for HashSet<T, S>
+where
+    T: IntoDeserializer<'de, E> + Eq + Hash,
+    S: BuildHasher,
+    E: de::Error,
+{
+    type Deserializer = SeqDeserializer<<Self as IntoIterator>::IntoIter, E>;
+
+    fn into_deserializer(self) -> Self::Deserializer {
+        SeqDeserializer::new(self.into_iter())
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A deserializer holding a `SeqAccess`.
+#[derive(Clone, Debug)]
+pub struct SeqAccessDeserializer<A> {
+    seq: A,
+}
+
+impl<A> SeqAccessDeserializer<A> {
+    /// Construct a new `SeqAccessDeserializer<A>`.
+    pub fn new(seq: A) -> Self {
+        SeqAccessDeserializer { seq: seq }
+    }
+}
+
+impl<'de, A> de::Deserializer<'de> for SeqAccessDeserializer<A>
+where
+    A: de::SeqAccess<'de>,
+{
+    type Error = A::Error;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        visitor.visit_seq(self.seq)
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct enum identifier ignored_any
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A deserializer that iterates over a map.
+pub struct MapDeserializer<'de, I, E>
+where
+    I: Iterator,
+    I::Item: private::Pair,
+{
+    iter: iter::Fuse<I>,
+    value: Option<Second<I::Item>>,
+    count: usize,
+    lifetime: PhantomData<&'de ()>,
+    error: PhantomData<E>,
+}
+
+impl<'de, I, E> MapDeserializer<'de, I, E>
+where
+    I: Iterator,
+    I::Item: private::Pair,
+{
+    /// Construct a new `MapDeserializer<I, E>`.
+    pub fn new(iter: I) -> Self {
+        MapDeserializer {
+            iter: iter.fuse(),
+            value: None,
+            count: 0,
+            lifetime: PhantomData,
+            error: PhantomData,
+        }
+    }
+}
+
+impl<'de, I, E> MapDeserializer<'de, I, E>
+where
+    I: Iterator,
+    I::Item: private::Pair,
+    E: de::Error,
+{
+    /// Check for remaining elements after passing a `MapDeserializer` to
+    /// `Visitor::visit_map`.
+    pub fn end(self) -> Result<(), E> {
+        let remaining = self.iter.count();
+        if remaining == 0 {
+            Ok(())
+        } else {
+            // First argument is the number of elements in the data, second
+            // argument is the number of elements expected by the Deserialize.
+            Err(de::Error::invalid_length(
+                self.count + remaining,
+                &ExpectedInMap(self.count),
+            ))
+        }
+    }
+}
+
+impl<'de, I, E> MapDeserializer<'de, I, E>
+where
+    I: Iterator,
+    I::Item: private::Pair,
+{
+    fn next_pair(&mut self) -> Option<(First<I::Item>, Second<I::Item>)> {
+        match self.iter.next() {
+            Some(kv) => {
+                self.count += 1;
+                Some(private::Pair::split(kv))
+            }
+            None => None,
+        }
+    }
+}
+
+impl<'de, I, E> de::Deserializer<'de> for MapDeserializer<'de, I, E>
+where
+    I: Iterator,
+    I::Item: private::Pair,
+    First<I::Item>: IntoDeserializer<'de, E>,
+    Second<I::Item>: IntoDeserializer<'de, E>,
+    E: de::Error,
+{
+    type Error = E;
+
+    fn deserialize_any<V>(mut self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        let value = try!(visitor.visit_map(&mut self));
+        try!(self.end());
+        Ok(value)
+    }
+
+    fn deserialize_seq<V>(mut self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        let value = try!(visitor.visit_seq(&mut self));
+        try!(self.end());
+        Ok(value)
+    }
+
+    fn deserialize_tuple<V>(self, len: usize, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        let _ = len;
+        self.deserialize_seq(visitor)
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct tuple_struct map
+        struct enum identifier ignored_any
+    }
+}
+
+impl<'de, I, E> de::MapAccess<'de> for MapDeserializer<'de, I, E>
+where
+    I: Iterator,
+    I::Item: private::Pair,
+    First<I::Item>: IntoDeserializer<'de, E>,
+    Second<I::Item>: IntoDeserializer<'de, E>,
+    E: de::Error,
+{
+    type Error = E;
+
+    fn next_key_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
+    where
+        T: de::DeserializeSeed<'de>,
+    {
+        match self.next_pair() {
+            Some((key, value)) => {
+                self.value = Some(value);
+                seed.deserialize(key.into_deserializer()).map(Some)
+            }
+            None => Ok(None),
+        }
+    }
+
+    fn next_value_seed<T>(&mut self, seed: T) -> Result<T::Value, Self::Error>
+    where
+        T: de::DeserializeSeed<'de>,
+    {
+        let value = self.value.take();
+        // Panic because this indicates a bug in the program rather than an
+        // expected failure.
+        let value = value.expect("MapAccess::visit_value called before visit_key");
+        seed.deserialize(value.into_deserializer())
+    }
+
+    fn next_entry_seed<TK, TV>(
+        &mut self,
+        kseed: TK,
+        vseed: TV,
+    ) -> Result<Option<(TK::Value, TV::Value)>, Self::Error>
+    where
+        TK: de::DeserializeSeed<'de>,
+        TV: de::DeserializeSeed<'de>,
+    {
+        match self.next_pair() {
+            Some((key, value)) => {
+                let key = try!(kseed.deserialize(key.into_deserializer()));
+                let value = try!(vseed.deserialize(value.into_deserializer()));
+                Ok(Some((key, value)))
+            }
+            None => Ok(None),
+        }
+    }
+
+    fn size_hint(&self) -> Option<usize> {
+        size_hint::from_bounds(&self.iter)
+    }
+}
+
+impl<'de, I, E> de::SeqAccess<'de> for MapDeserializer<'de, I, E>
+where
+    I: Iterator,
+    I::Item: private::Pair,
+    First<I::Item>: IntoDeserializer<'de, E>,
+    Second<I::Item>: IntoDeserializer<'de, E>,
+    E: de::Error,
+{
+    type Error = E;
+
+    fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
+    where
+        T: de::DeserializeSeed<'de>,
+    {
+        match self.next_pair() {
+            Some((k, v)) => {
+                let de = PairDeserializer(k, v, PhantomData);
+                seed.deserialize(de).map(Some)
+            }
+            None => Ok(None),
+        }
+    }
+
+    fn size_hint(&self) -> Option<usize> {
+        size_hint::from_bounds(&self.iter)
+    }
+}
+
+// Cannot #[derive(Clone)] because of the bound `Second<I::Item>: Clone`.
+impl<'de, I, E> Clone for MapDeserializer<'de, I, E>
+where
+    I: Iterator + Clone,
+    I::Item: private::Pair,
+    Second<I::Item>: Clone,
+{
+    fn clone(&self) -> Self {
+        MapDeserializer {
+            iter: self.iter.clone(),
+            value: self.value.clone(),
+            count: self.count,
+            lifetime: self.lifetime,
+            error: self.error,
+        }
+    }
+}
+
+// Cannot #[derive(Debug)] because of the bound `Second<I::Item>: Debug`.
+impl<'de, I, E> Debug for MapDeserializer<'de, I, E>
+where
+    I: Iterator + Debug,
+    I::Item: private::Pair,
+    Second<I::Item>: Debug,
+{
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter
+            .debug_struct("MapDeserializer")
+            .field("iter", &self.iter)
+            .field("value", &self.value)
+            .field("count", &self.count)
+            .field("lifetime", &self.lifetime)
+            .field("error", &self.error)
+            .finish()
+    }
+}
+
+// Used in the `impl SeqAccess for MapDeserializer` to visit the map as a
+// sequence of pairs.
+struct PairDeserializer<A, B, E>(A, B, PhantomData<E>);
+
+impl<'de, A, B, E> de::Deserializer<'de> for PairDeserializer<A, B, E>
+where
+    A: IntoDeserializer<'de, E>,
+    B: IntoDeserializer<'de, E>,
+    E: de::Error,
+{
+    type Error = E;
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct tuple_struct map
+        struct enum identifier ignored_any
+    }
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        self.deserialize_seq(visitor)
+    }
+
+    fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        let mut pair_visitor = PairVisitor(Some(self.0), Some(self.1), PhantomData);
+        let pair = try!(visitor.visit_seq(&mut pair_visitor));
+        if pair_visitor.1.is_none() {
+            Ok(pair)
+        } else {
+            let remaining = pair_visitor.size_hint().unwrap();
+            // First argument is the number of elements in the data, second
+            // argument is the number of elements expected by the Deserialize.
+            Err(de::Error::invalid_length(2, &ExpectedInSeq(2 - remaining)))
+        }
+    }
+
+    fn deserialize_tuple<V>(self, len: usize, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        if len == 2 {
+            self.deserialize_seq(visitor)
+        } else {
+            // First argument is the number of elements in the data, second
+            // argument is the number of elements expected by the Deserialize.
+            Err(de::Error::invalid_length(2, &ExpectedInSeq(len)))
+        }
+    }
+}
+
+struct PairVisitor<A, B, E>(Option<A>, Option<B>, PhantomData<E>);
+
+impl<'de, A, B, E> de::SeqAccess<'de> for PairVisitor<A, B, E>
+where
+    A: IntoDeserializer<'de, E>,
+    B: IntoDeserializer<'de, E>,
+    E: de::Error,
+{
+    type Error = E;
+
+    fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
+    where
+        T: de::DeserializeSeed<'de>,
+    {
+        if let Some(k) = self.0.take() {
+            seed.deserialize(k.into_deserializer()).map(Some)
+        } else if let Some(v) = self.1.take() {
+            seed.deserialize(v.into_deserializer()).map(Some)
+        } else {
+            Ok(None)
+        }
+    }
+
+    fn size_hint(&self) -> Option<usize> {
+        if self.0.is_some() {
+            Some(2)
+        } else if self.1.is_some() {
+            Some(1)
+        } else {
+            Some(0)
+        }
+    }
+}
+
+struct ExpectedInMap(usize);
+
+impl Expected for ExpectedInMap {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        if self.0 == 1 {
+            write!(formatter, "1 element in map")
+        } else {
+            write!(formatter, "{} elements in map", self.0)
+        }
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'de, K, V, E> IntoDeserializer<'de, E> for BTreeMap<K, V>
+where
+    K: IntoDeserializer<'de, E> + Eq + Ord,
+    V: IntoDeserializer<'de, E>,
+    E: de::Error,
+{
+    type Deserializer = MapDeserializer<'de, <Self as IntoIterator>::IntoIter, E>;
+
+    fn into_deserializer(self) -> Self::Deserializer {
+        MapDeserializer::new(self.into_iter())
+    }
+}
+
+#[cfg(feature = "std")]
+impl<'de, K, V, S, E> IntoDeserializer<'de, E> for HashMap<K, V, S>
+where
+    K: IntoDeserializer<'de, E> + Eq + Hash,
+    V: IntoDeserializer<'de, E>,
+    S: BuildHasher,
+    E: de::Error,
+{
+    type Deserializer = MapDeserializer<'de, <Self as IntoIterator>::IntoIter, E>;
+
+    fn into_deserializer(self) -> Self::Deserializer {
+        MapDeserializer::new(self.into_iter())
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A deserializer holding a `MapAccess`.
+#[derive(Clone, Debug)]
+pub struct MapAccessDeserializer<A> {
+    map: A,
+}
+
+impl<A> MapAccessDeserializer<A> {
+    /// Construct a new `MapAccessDeserializer<A>`.
+    pub fn new(map: A) -> Self {
+        MapAccessDeserializer { map: map }
+    }
+}
+
+impl<'de, A> de::Deserializer<'de> for MapAccessDeserializer<A>
+where
+    A: de::MapAccess<'de>,
+{
+    type Error = A::Error;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        visitor.visit_map(self.map)
+    }
+
+    fn deserialize_enum<V>(
+        self,
+        _name: &str,
+        _variants: &'static [&'static str],
+        visitor: V,
+    ) -> Result<V::Value, Self::Error>
+    where
+        V: de::Visitor<'de>,
+    {
+        visitor.visit_enum(self)
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct identifier ignored_any
+    }
+}
+
+impl<'de, A> de::EnumAccess<'de> for MapAccessDeserializer<A>
+where
+    A: de::MapAccess<'de>,
+{
+    type Error = A::Error;
+    type Variant = private::MapAsEnum<A>;
+
+    fn variant_seed<T>(mut self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error>
+    where
+        T: de::DeserializeSeed<'de>,
+    {
+        match self.map.next_key_seed(seed)? {
+            Some(key) => Ok((key, private::map_as_enum(self.map))),
+            None => Err(de::Error::invalid_type(de::Unexpected::Map, &"enum")),
+        }
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+mod private {
+    use lib::*;
+
+    use de::{self, DeserializeSeed, Deserializer, MapAccess, Unexpected, VariantAccess, Visitor};
+
+    #[derive(Clone, Debug)]
+    pub struct UnitOnly<E> {
+        marker: PhantomData<E>,
+    }
+
+    pub fn unit_only<T, E>(t: T) -> (T, UnitOnly<E>) {
+        (
+            t,
+            UnitOnly {
+                marker: PhantomData,
+            },
+        )
+    }
+
+    impl<'de, E> de::VariantAccess<'de> for UnitOnly<E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+
+        fn unit_variant(self) -> Result<(), Self::Error> {
+            Ok(())
+        }
+
+        fn newtype_variant_seed<T>(self, _seed: T) -> Result<T::Value, Self::Error>
+        where
+            T: de::DeserializeSeed<'de>,
+        {
+            Err(de::Error::invalid_type(
+                Unexpected::UnitVariant,
+                &"newtype variant",
+            ))
+        }
+
+        fn tuple_variant<V>(self, _len: usize, _visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: de::Visitor<'de>,
+        {
+            Err(de::Error::invalid_type(
+                Unexpected::UnitVariant,
+                &"tuple variant",
+            ))
+        }
+
+        fn struct_variant<V>(
+            self,
+            _fields: &'static [&'static str],
+            _visitor: V,
+        ) -> Result<V::Value, Self::Error>
+        where
+            V: de::Visitor<'de>,
+        {
+            Err(de::Error::invalid_type(
+                Unexpected::UnitVariant,
+                &"struct variant",
+            ))
+        }
+    }
+
+    #[derive(Clone, Debug)]
+    pub struct MapAsEnum<A> {
+        map: A,
+    }
+
+    pub fn map_as_enum<A>(map: A) -> MapAsEnum<A> {
+        MapAsEnum { map: map }
+    }
+
+    impl<'de, A> VariantAccess<'de> for MapAsEnum<A>
+    where
+        A: MapAccess<'de>,
+    {
+        type Error = A::Error;
+
+        fn unit_variant(mut self) -> Result<(), Self::Error> {
+            self.map.next_value()
+        }
+
+        fn newtype_variant_seed<T>(mut self, seed: T) -> Result<T::Value, Self::Error>
+        where
+            T: DeserializeSeed<'de>,
+        {
+            self.map.next_value_seed(seed)
+        }
+
+        fn tuple_variant<V>(mut self, len: usize, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.map.next_value_seed(SeedTupleVariant {
+                len: len,
+                visitor: visitor,
+            })
+        }
+
+        fn struct_variant<V>(
+            mut self,
+            _fields: &'static [&'static str],
+            visitor: V,
+        ) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.map
+                .next_value_seed(SeedStructVariant { visitor: visitor })
+        }
+    }
+
+    struct SeedTupleVariant<V> {
+        len: usize,
+        visitor: V,
+    }
+
+    impl<'de, V> DeserializeSeed<'de> for SeedTupleVariant<V>
+    where
+        V: Visitor<'de>,
+    {
+        type Value = V::Value;
+
+        fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            deserializer.deserialize_tuple(self.len, self.visitor)
+        }
+    }
+
+    struct SeedStructVariant<V> {
+        visitor: V,
+    }
+
+    impl<'de, V> DeserializeSeed<'de> for SeedStructVariant<V>
+    where
+        V: Visitor<'de>,
+    {
+        type Value = V::Value;
+
+        fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            deserializer.deserialize_map(self.visitor)
+        }
+    }
+
+    /// Avoid having to restate the generic types on `MapDeserializer`. The
+    /// `Iterator::Item` contains enough information to figure out K and V.
+    pub trait Pair {
+        type First;
+        type Second;
+        fn split(self) -> (Self::First, Self::Second);
+    }
+
+    impl<A, B> Pair for (A, B) {
+        type First = A;
+        type Second = B;
+        fn split(self) -> (A, B) {
+            self
+        }
+    }
+
+    pub type First<T> = <T as Pair>::First;
+    pub type Second<T> = <T as Pair>::Second;
+}
+
+
\ No newline at end of file diff --git a/src/serde/export.rs.html b/src/serde/export.rs.html new file mode 100644 index 0000000..d2b63b6 --- /dev/null +++ b/src/serde/export.rs.html @@ -0,0 +1,81 @@ +export.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
+pub use lib::clone::Clone;
+pub use lib::convert::{From, Into};
+pub use lib::default::Default;
+pub use lib::fmt::{self, Formatter};
+pub use lib::marker::PhantomData;
+pub use lib::option::Option::{self, None, Some};
+pub use lib::result::Result::{self, Err, Ok};
+
+pub use self::string::from_utf8_lossy;
+
+#[cfg(any(feature = "alloc", feature = "std"))]
+pub use lib::{ToString, Vec};
+
+#[cfg(core_try_from)]
+pub use lib::convert::TryFrom;
+
+mod string {
+    use lib::*;
+
+    #[cfg(any(feature = "std", feature = "alloc"))]
+    pub fn from_utf8_lossy(bytes: &[u8]) -> Cow<str> {
+        String::from_utf8_lossy(bytes)
+    }
+
+    // The generated code calls this like:
+    //
+    //     let value = &_serde::export::from_utf8_lossy(bytes);
+    //     Err(_serde::de::Error::unknown_variant(value, VARIANTS))
+    //
+    // so it is okay for the return type to be different from the std case as long
+    // as the above works.
+    #[cfg(not(any(feature = "std", feature = "alloc")))]
+    pub fn from_utf8_lossy(bytes: &[u8]) -> &str {
+        // Three unicode replacement characters if it fails. They look like a
+        // white-on-black question mark. The user will recognize it as invalid
+        // UTF-8.
+        str::from_utf8(bytes).unwrap_or("\u{fffd}\u{fffd}\u{fffd}")
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde/integer128.rs.html b/src/serde/integer128.rs.html new file mode 100644 index 0000000..56c6821 --- /dev/null +++ b/src/serde/integer128.rs.html @@ -0,0 +1,167 @@ +integer128.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+
+/// Conditional compilation depending on whether Serde is built with support for
+/// 128-bit integers.
+///
+/// Data formats that wish to support Rust compiler versions older than 1.26
+/// (or targets that lack 128-bit integers) may place the i128 / u128 methods
+/// of their Serializer and Deserializer behind this macro.
+///
+/// Data formats that require a minimum Rust compiler version of at least 1.26,
+/// or do not target platforms that lack 128-bit integers, do not need to
+/// bother with this macro and may assume support for 128-bit integers.
+///
+/// ```edition2018
+/// # use serde::private::ser::Error;
+/// #
+/// # struct MySerializer;
+/// #
+/// use serde::{serde_if_integer128, Serializer};
+///
+/// impl Serializer for MySerializer {
+///     type Ok = ();
+///     type Error = Error;
+///
+///     fn serialize_i64(self, v: i64) -> Result<Self::Ok, Self::Error> {
+///         /* ... */
+/// #         unimplemented!()
+///     }
+///
+///     /* ... */
+///
+///     serde_if_integer128! {
+///         fn serialize_i128(self, v: i128) -> Result<Self::Ok, Self::Error> {
+///             /* ... */
+/// #             unimplemented!()
+///         }
+///
+///         fn serialize_u128(self, v: u128) -> Result<Self::Ok, Self::Error> {
+///             /* ... */
+/// #             unimplemented!()
+///         }
+///     }
+/// #
+/// #     serde::__serialize_unimplemented! {
+/// #         bool i8 i16 i32 u8 u16 u32 u64 f32 f64 char str bytes none some
+/// #         unit unit_struct unit_variant newtype_struct newtype_variant seq
+/// #         tuple tuple_struct tuple_variant map struct struct_variant
+/// #     }
+/// }
+/// ```
+///
+/// When Serde is built with support for 128-bit integers, this macro expands
+/// transparently into just the input tokens.
+///
+/// ```edition2018
+/// macro_rules! serde_if_integer128 {
+///     ($($tt:tt)*) => {
+///         $($tt)*
+///     };
+/// }
+/// ```
+///
+/// When built without support for 128-bit integers, this macro expands to
+/// nothing.
+///
+/// ```edition2018
+/// macro_rules! serde_if_integer128 {
+///     ($($tt:tt)*) => {};
+/// }
+/// ```
+#[cfg(integer128)]
+#[macro_export]
+macro_rules! serde_if_integer128 {
+    ($($tt:tt)*) => {
+        $($tt)*
+    };
+}
+
+#[cfg(not(integer128))]
+#[macro_export]
+#[doc(hidden)]
+macro_rules! serde_if_integer128 {
+    ($($tt:tt)*) => {};
+}
+
+
\ No newline at end of file diff --git a/src/serde/lib.rs.html b/src/serde/lib.rs.html new file mode 100644 index 0000000..d3b390d --- /dev/null +++ b/src/serde/lib.rs.html @@ -0,0 +1,547 @@ +lib.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+
+//! # Serde
+//!
+//! Serde is a framework for ***ser***ializing and ***de***serializing Rust data
+//! structures efficiently and generically.
+//!
+//! The Serde ecosystem consists of data structures that know how to serialize
+//! and deserialize themselves along with data formats that know how to
+//! serialize and deserialize other things. Serde provides the layer by which
+//! these two groups interact with each other, allowing any supported data
+//! structure to be serialized and deserialized using any supported data format.
+//!
+//! See the Serde website [https://serde.rs/] for additional documentation and
+//! usage examples.
+//!
+//! [https://serde.rs/]: https://serde.rs/
+//!
+//! ## Design
+//!
+//! Where many other languages rely on runtime reflection for serializing data,
+//! Serde is instead built on Rust's powerful trait system. A data structure
+//! that knows how to serialize and deserialize itself is one that implements
+//! Serde's `Serialize` and `Deserialize` traits (or uses Serde's derive
+//! attribute to automatically generate implementations at compile time). This
+//! avoids any overhead of reflection or runtime type information. In fact in
+//! many situations the interaction between data structure and data format can
+//! be completely optimized away by the Rust compiler, leaving Serde
+//! serialization to perform the same speed as a handwritten serializer for the
+//! specific selection of data structure and data format.
+//!
+//! ## Data formats
+//!
+//! The following is a partial list of data formats that have been implemented
+//! for Serde by the community.
+//!
+//! - [JSON], the ubiquitous JavaScript Object Notation used by many HTTP APIs.
+//! - [Bincode], a compact binary format
+//!   used for IPC within the Servo rendering engine.
+//! - [CBOR], a Concise Binary Object Representation designed for small message
+//!   size without the need for version negotiation.
+//! - [YAML], a popular human-friendly configuration language that ain't markup
+//!   language.
+//! - [MessagePack], an efficient binary format that resembles a compact JSON.
+//! - [TOML], a minimal configuration format used by [Cargo].
+//! - [Pickle], a format common in the Python world.
+//! - [RON], a Rusty Object Notation.
+//! - [BSON], the data storage and network transfer format used by MongoDB.
+//! - [Avro], a binary format used within Apache Hadoop, with support for schema
+//!   definition.
+//! - [JSON5], A superset of JSON including some productions from ES5.
+//! - [Postcard], a no\_std and embedded-systems friendly compact binary format.
+//! - [URL], the x-www-form-urlencoded format.
+//! - [Envy], a way to deserialize environment variables into Rust structs.
+//!   *(deserialization only)*
+//! - [Envy Store], a way to deserialize [AWS Parameter Store] parameters into
+//!   Rust structs. *(deserialization only)*
+//!
+//! [JSON]: https://github.com/serde-rs/json
+//! [Bincode]: https://github.com/TyOverby/bincode
+//! [CBOR]: https://github.com/pyfisch/cbor
+//! [YAML]: https://github.com/dtolnay/serde-yaml
+//! [MessagePack]: https://github.com/3Hren/msgpack-rust
+//! [TOML]: https://github.com/alexcrichton/toml-rs
+//! [Pickle]: https://github.com/birkenfeld/serde-pickle
+//! [RON]: https://github.com/ron-rs/ron
+//! [BSON]: https://github.com/zonyitoo/bson-rs
+//! [Avro]: https://github.com/flavray/avro-rs
+//! [JSON5]: https://github.com/callum-oakley/json5-rs
+//! [Postcard]: https://github.com/jamesmunns/postcard
+//! [URL]: https://github.com/nox/serde_urlencoded
+//! [Envy]: https://github.com/softprops/envy
+//! [Envy Store]: https://github.com/softprops/envy-store
+//! [Cargo]: http://doc.crates.io/manifest.html
+//! [AWS Parameter Store]: https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html
+
+////////////////////////////////////////////////////////////////////////////////
+
+// Serde types in rustdoc of other crates get linked to here.
+#![doc(html_root_url = "https://docs.rs/serde/1.0.104")]
+// Support using Serde without the standard library!
+#![cfg_attr(not(feature = "std"), no_std)]
+// Unstable functionality only if the user asks for it. For tracking and
+// discussion of these features please refer to this issue:
+//
+//    https://github.com/serde-rs/serde/issues/812
+#![cfg_attr(feature = "unstable", feature(specialization, never_type))]
+#![allow(unknown_lints, bare_trait_objects, deprecated)]
+#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
+#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
+// Ignored clippy and clippy_pedantic lints
+#![cfg_attr(
+    feature = "cargo-clippy",
+    allow(
+        // not available in our oldest supported compiler
+        checked_conversions,
+        empty_enum,
+        redundant_field_names,
+        redundant_static_lifetimes,
+        // integer and float ser/de requires these sorts of casts
+        cast_possible_truncation,
+        cast_possible_wrap,
+        cast_sign_loss,
+        // things are often more readable this way
+        cast_lossless,
+        module_name_repetitions,
+        single_match_else,
+        type_complexity,
+        use_self,
+        zero_prefixed_literal,
+        // not practical
+        needless_pass_by_value,
+        similar_names,
+        too_many_lines,
+        // preference
+        doc_markdown,
+        // false positive
+        needless_doctest_main,
+        // noisy
+        must_use_candidate,
+    )
+)]
+// Rustc lints.
+#![deny(missing_docs, unused_imports)]
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(feature = "alloc")]
+extern crate alloc;
+
+/// A facade around all the types we need from the `std`, `core`, and `alloc`
+/// crates. This avoids elaborate import wrangling having to happen in every
+/// module.
+mod lib {
+    mod core {
+        #[cfg(not(feature = "std"))]
+        pub use core::*;
+        #[cfg(feature = "std")]
+        pub use std::*;
+    }
+
+    pub use self::core::{cmp, iter, mem, num, slice, str};
+    pub use self::core::{f32, f64};
+    pub use self::core::{i16, i32, i64, i8, isize};
+    pub use self::core::{u16, u32, u64, u8, usize};
+
+    pub use self::core::cell::{Cell, RefCell};
+    pub use self::core::clone::{self, Clone};
+    pub use self::core::convert::{self, From, Into};
+    pub use self::core::default::{self, Default};
+    pub use self::core::fmt::{self, Debug, Display};
+    pub use self::core::marker::{self, PhantomData};
+    pub use self::core::ops::Range;
+    pub use self::core::option::{self, Option};
+    pub use self::core::result::{self, Result};
+
+    #[cfg(all(feature = "alloc", not(feature = "std")))]
+    pub use alloc::borrow::{Cow, ToOwned};
+    #[cfg(feature = "std")]
+    pub use std::borrow::{Cow, ToOwned};
+
+    #[cfg(all(feature = "alloc", not(feature = "std")))]
+    pub use alloc::string::{String, ToString};
+    #[cfg(feature = "std")]
+    pub use std::string::{String, ToString};
+
+    #[cfg(all(feature = "alloc", not(feature = "std")))]
+    pub use alloc::vec::Vec;
+    #[cfg(feature = "std")]
+    pub use std::vec::Vec;
+
+    #[cfg(all(feature = "alloc", not(feature = "std")))]
+    pub use alloc::boxed::Box;
+    #[cfg(feature = "std")]
+    pub use std::boxed::Box;
+
+    #[cfg(all(feature = "rc", feature = "alloc", not(feature = "std")))]
+    pub use alloc::rc::{Rc, Weak as RcWeak};
+    #[cfg(all(feature = "rc", feature = "std"))]
+    pub use std::rc::{Rc, Weak as RcWeak};
+
+    #[cfg(all(feature = "rc", feature = "alloc", not(feature = "std")))]
+    pub use alloc::sync::{Arc, Weak as ArcWeak};
+    #[cfg(all(feature = "rc", feature = "std"))]
+    pub use std::sync::{Arc, Weak as ArcWeak};
+
+    #[cfg(all(feature = "alloc", not(feature = "std")))]
+    pub use alloc::collections::{BTreeMap, BTreeSet, BinaryHeap, LinkedList, VecDeque};
+    #[cfg(feature = "std")]
+    pub use std::collections::{BTreeMap, BTreeSet, BinaryHeap, LinkedList, VecDeque};
+
+    #[cfg(feature = "std")]
+    pub use std::{error, net};
+
+    #[cfg(feature = "std")]
+    pub use std::collections::{HashMap, HashSet};
+    #[cfg(feature = "std")]
+    pub use std::ffi::{CStr, CString, OsStr, OsString};
+    #[cfg(feature = "std")]
+    pub use std::hash::{BuildHasher, Hash};
+    #[cfg(feature = "std")]
+    pub use std::io::Write;
+    #[cfg(feature = "std")]
+    pub use std::num::Wrapping;
+    #[cfg(feature = "std")]
+    pub use std::path::{Path, PathBuf};
+    #[cfg(feature = "std")]
+    pub use std::sync::{Mutex, RwLock};
+    #[cfg(feature = "std")]
+    pub use std::time::{SystemTime, UNIX_EPOCH};
+
+    #[cfg(all(feature = "std", collections_bound))]
+    pub use std::collections::Bound;
+
+    #[cfg(core_reverse)]
+    pub use self::core::cmp::Reverse;
+
+    #[cfg(ops_bound)]
+    pub use self::core::ops::Bound;
+
+    #[cfg(range_inclusive)]
+    pub use self::core::ops::RangeInclusive;
+
+    #[cfg(all(feature = "std", std_atomic))]
+    pub use std::sync::atomic::{
+        AtomicBool, AtomicI16, AtomicI32, AtomicI8, AtomicIsize, AtomicU16, AtomicU32, AtomicU8,
+        AtomicUsize, Ordering,
+    };
+    #[cfg(all(feature = "std", std_atomic64))]
+    pub use std::sync::atomic::{AtomicI64, AtomicU64};
+
+    #[cfg(any(core_duration, feature = "std"))]
+    pub use self::core::time::Duration;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[macro_use]
+mod macros;
+
+#[macro_use]
+mod integer128;
+
+pub mod de;
+pub mod ser;
+
+#[doc(inline)]
+pub use de::{Deserialize, Deserializer};
+#[doc(inline)]
+pub use ser::{Serialize, Serializer};
+
+// Generated code uses these to support no_std. Not public API.
+#[doc(hidden)]
+pub mod export;
+
+// Helpers used by generated code and doc tests. Not public API.
+#[doc(hidden)]
+pub mod private;
+
+#[cfg(not(feature = "std"))]
+mod std_error;
+
+// Re-export #[derive(Serialize, Deserialize)].
+//
+// The reason re-exporting is not enabled by default is that disabling it would
+// be annoying for crates that provide handwritten impls or data formats. They
+// would need to disable default features and then explicitly re-enable std.
+#[cfg(feature = "serde_derive")]
+#[allow(unused_imports)]
+#[macro_use]
+extern crate serde_derive;
+#[cfg(feature = "serde_derive")]
+#[doc(hidden)]
+pub use serde_derive::*;
+
+
\ No newline at end of file diff --git a/src/serde/macros.rs.html b/src/serde/macros.rs.html new file mode 100644 index 0000000..93926de --- /dev/null +++ b/src/serde/macros.rs.html @@ -0,0 +1,475 @@ +macros.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+
+// Super explicit first paragraph because this shows up at the top level and
+// trips up people who are just looking for basic Serialize / Deserialize
+// documentation.
+//
+/// Helper macro when implementing the `Deserializer` part of a new data format
+/// for Serde.
+///
+/// Some [`Deserializer`] implementations for self-describing formats do not
+/// care what hint the [`Visitor`] gives them, they just want to blindly call
+/// the [`Visitor`] method corresponding to the data they can tell is in the
+/// input. This requires repetitive implementations of all the [`Deserializer`]
+/// trait methods.
+///
+/// ```edition2018
+/// # use serde::forward_to_deserialize_any;
+/// # use serde::de::{value, Deserializer, Visitor};
+/// #
+/// # struct MyDeserializer;
+/// #
+/// # impl<'de> Deserializer<'de> for MyDeserializer {
+/// #     type Error = value::Error;
+/// #
+/// #     fn deserialize_any<V>(self, _: V) -> Result<V::Value, Self::Error>
+/// #     where
+/// #         V: Visitor<'de>,
+/// #     {
+/// #         unimplemented!()
+/// #     }
+/// #
+/// #[inline]
+/// fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+/// where
+///     V: Visitor<'de>,
+/// {
+///     self.deserialize_any(visitor)
+/// }
+/// #
+/// #     forward_to_deserialize_any! {
+/// #         i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+/// #         bytes byte_buf option unit unit_struct newtype_struct seq tuple
+/// #         tuple_struct map struct enum identifier ignored_any
+/// #     }
+/// # }
+/// ```
+///
+/// The `forward_to_deserialize_any!` macro implements these simple forwarding
+/// methods so that they forward directly to [`Deserializer::deserialize_any`].
+/// You can choose which methods to forward.
+///
+/// ```edition2018
+/// # use serde::forward_to_deserialize_any;
+/// # use serde::de::{value, Deserializer, Visitor};
+/// #
+/// # struct MyDeserializer;
+/// #
+/// impl<'de> Deserializer<'de> for MyDeserializer {
+/// #   type Error = value::Error;
+/// #
+///     fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+///     where
+///         V: Visitor<'de>,
+///     {
+///         /* ... */
+/// #       let _ = visitor;
+/// #       unimplemented!()
+///     }
+///
+///     forward_to_deserialize_any! {
+///         bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+///         bytes byte_buf option unit unit_struct newtype_struct seq tuple
+///         tuple_struct map struct enum identifier ignored_any
+///     }
+/// }
+/// ```
+///
+/// The macro assumes the convention that your `Deserializer` lifetime parameter
+/// is called `'de` and that the `Visitor` type parameters on each method are
+/// called `V`. A different type parameter and a different lifetime can be
+/// specified explicitly if necessary.
+///
+/// ```edition2018
+/// # use std::marker::PhantomData;
+/// #
+/// # use serde::forward_to_deserialize_any;
+/// # use serde::de::{value, Deserializer, Visitor};
+/// #
+/// # struct MyDeserializer<V>(PhantomData<V>);
+/// #
+/// # impl<'q, V> Deserializer<'q> for MyDeserializer<V> {
+/// #     type Error = value::Error;
+/// #
+/// #     fn deserialize_any<W>(self, visitor: W) -> Result<W::Value, Self::Error>
+/// #     where
+/// #         W: Visitor<'q>,
+/// #     {
+/// #         unimplemented!()
+/// #     }
+/// #
+/// forward_to_deserialize_any! {
+///     <W: Visitor<'q>>
+///     bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+///     bytes byte_buf option unit unit_struct newtype_struct seq tuple
+///     tuple_struct map struct enum identifier ignored_any
+/// }
+/// # }
+/// ```
+///
+/// [`Deserializer`]: trait.Deserializer.html
+/// [`Visitor`]: de/trait.Visitor.html
+/// [`Deserializer::deserialize_any`]: trait.Deserializer.html#tymethod.deserialize_any
+#[macro_export(local_inner_macros)]
+macro_rules! forward_to_deserialize_any {
+    (<$visitor:ident: Visitor<$lifetime:tt>> $($func:ident)*) => {
+        $(forward_to_deserialize_any_helper!{$func<$lifetime, $visitor>})*
+    };
+    // This case must be after the previous one.
+    ($($func:ident)*) => {
+        $(forward_to_deserialize_any_helper!{$func<'de, V>})*
+    };
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! forward_to_deserialize_any_method {
+    ($func:ident<$l:tt, $v:ident>($($arg:ident : $ty:ty),*)) => {
+        #[inline]
+        fn $func<$v>(self, $($arg: $ty,)* visitor: $v) -> $crate::export::Result<$v::Value, Self::Error>
+        where
+            $v: $crate::de::Visitor<$l>,
+        {
+            $(
+                let _ = $arg;
+            )*
+            self.deserialize_any(visitor)
+        }
+    };
+}
+
+#[doc(hidden)]
+#[macro_export(local_inner_macros)]
+macro_rules! forward_to_deserialize_any_helper {
+    (bool<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_bool<$l, $v>()}
+    };
+    (i8<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_i8<$l, $v>()}
+    };
+    (i16<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_i16<$l, $v>()}
+    };
+    (i32<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_i32<$l, $v>()}
+    };
+    (i64<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_i64<$l, $v>()}
+    };
+    (i128<$l:tt, $v:ident>) => {
+        serde_if_integer128! {
+            forward_to_deserialize_any_method!{deserialize_i128<$l, $v>()}
+        }
+    };
+    (u8<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_u8<$l, $v>()}
+    };
+    (u16<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_u16<$l, $v>()}
+    };
+    (u32<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_u32<$l, $v>()}
+    };
+    (u64<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_u64<$l, $v>()}
+    };
+    (u128<$l:tt, $v:ident>) => {
+        serde_if_integer128! {
+            forward_to_deserialize_any_method!{deserialize_u128<$l, $v>()}
+        }
+    };
+    (f32<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_f32<$l, $v>()}
+    };
+    (f64<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_f64<$l, $v>()}
+    };
+    (char<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_char<$l, $v>()}
+    };
+    (str<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_str<$l, $v>()}
+    };
+    (string<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_string<$l, $v>()}
+    };
+    (bytes<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_bytes<$l, $v>()}
+    };
+    (byte_buf<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_byte_buf<$l, $v>()}
+    };
+    (option<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_option<$l, $v>()}
+    };
+    (unit<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_unit<$l, $v>()}
+    };
+    (unit_struct<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_unit_struct<$l, $v>(name: &'static str)}
+    };
+    (newtype_struct<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_newtype_struct<$l, $v>(name: &'static str)}
+    };
+    (seq<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_seq<$l, $v>()}
+    };
+    (tuple<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_tuple<$l, $v>(len: usize)}
+    };
+    (tuple_struct<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_tuple_struct<$l, $v>(name: &'static str, len: usize)}
+    };
+    (map<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_map<$l, $v>()}
+    };
+    (struct<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_struct<$l, $v>(name: &'static str, fields: &'static [&'static str])}
+    };
+    (enum<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_enum<$l, $v>(name: &'static str, variants: &'static [&'static str])}
+    };
+    (identifier<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_identifier<$l, $v>()}
+    };
+    (ignored_any<$l:tt, $v:ident>) => {
+        forward_to_deserialize_any_method!{deserialize_ignored_any<$l, $v>()}
+    };
+}
+
+
\ No newline at end of file diff --git a/src/serde/private/de.rs.html b/src/serde/private/de.rs.html new file mode 100644 index 0000000..24db1cc --- /dev/null +++ b/src/serde/private/de.rs.html @@ -0,0 +1,5891 @@ +de.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+2277
+2278
+2279
+2280
+2281
+2282
+2283
+2284
+2285
+2286
+2287
+2288
+2289
+2290
+2291
+2292
+2293
+2294
+2295
+2296
+2297
+2298
+2299
+2300
+2301
+2302
+2303
+2304
+2305
+2306
+2307
+2308
+2309
+2310
+2311
+2312
+2313
+2314
+2315
+2316
+2317
+2318
+2319
+2320
+2321
+2322
+2323
+2324
+2325
+2326
+2327
+2328
+2329
+2330
+2331
+2332
+2333
+2334
+2335
+2336
+2337
+2338
+2339
+2340
+2341
+2342
+2343
+2344
+2345
+2346
+2347
+2348
+2349
+2350
+2351
+2352
+2353
+2354
+2355
+2356
+2357
+2358
+2359
+2360
+2361
+2362
+2363
+2364
+2365
+2366
+2367
+2368
+2369
+2370
+2371
+2372
+2373
+2374
+2375
+2376
+2377
+2378
+2379
+2380
+2381
+2382
+2383
+2384
+2385
+2386
+2387
+2388
+2389
+2390
+2391
+2392
+2393
+2394
+2395
+2396
+2397
+2398
+2399
+2400
+2401
+2402
+2403
+2404
+2405
+2406
+2407
+2408
+2409
+2410
+2411
+2412
+2413
+2414
+2415
+2416
+2417
+2418
+2419
+2420
+2421
+2422
+2423
+2424
+2425
+2426
+2427
+2428
+2429
+2430
+2431
+2432
+2433
+2434
+2435
+2436
+2437
+2438
+2439
+2440
+2441
+2442
+2443
+2444
+2445
+2446
+2447
+2448
+2449
+2450
+2451
+2452
+2453
+2454
+2455
+2456
+2457
+2458
+2459
+2460
+2461
+2462
+2463
+2464
+2465
+2466
+2467
+2468
+2469
+2470
+2471
+2472
+2473
+2474
+2475
+2476
+2477
+2478
+2479
+2480
+2481
+2482
+2483
+2484
+2485
+2486
+2487
+2488
+2489
+2490
+2491
+2492
+2493
+2494
+2495
+2496
+2497
+2498
+2499
+2500
+2501
+2502
+2503
+2504
+2505
+2506
+2507
+2508
+2509
+2510
+2511
+2512
+2513
+2514
+2515
+2516
+2517
+2518
+2519
+2520
+2521
+2522
+2523
+2524
+2525
+2526
+2527
+2528
+2529
+2530
+2531
+2532
+2533
+2534
+2535
+2536
+2537
+2538
+2539
+2540
+2541
+2542
+2543
+2544
+2545
+2546
+2547
+2548
+2549
+2550
+2551
+2552
+2553
+2554
+2555
+2556
+2557
+2558
+2559
+2560
+2561
+2562
+2563
+2564
+2565
+2566
+2567
+2568
+2569
+2570
+2571
+2572
+2573
+2574
+2575
+2576
+2577
+2578
+2579
+2580
+2581
+2582
+2583
+2584
+2585
+2586
+2587
+2588
+2589
+2590
+2591
+2592
+2593
+2594
+2595
+2596
+2597
+2598
+2599
+2600
+2601
+2602
+2603
+2604
+2605
+2606
+2607
+2608
+2609
+2610
+2611
+2612
+2613
+2614
+2615
+2616
+2617
+2618
+2619
+2620
+2621
+2622
+2623
+2624
+2625
+2626
+2627
+2628
+2629
+2630
+2631
+2632
+2633
+2634
+2635
+2636
+2637
+2638
+2639
+2640
+2641
+2642
+2643
+2644
+2645
+2646
+2647
+2648
+2649
+2650
+2651
+2652
+2653
+2654
+2655
+2656
+2657
+2658
+2659
+2660
+2661
+2662
+2663
+2664
+2665
+2666
+2667
+2668
+2669
+2670
+2671
+2672
+2673
+2674
+2675
+2676
+2677
+2678
+2679
+2680
+2681
+2682
+2683
+2684
+2685
+2686
+2687
+2688
+2689
+2690
+2691
+2692
+2693
+2694
+2695
+2696
+2697
+2698
+2699
+2700
+2701
+2702
+2703
+2704
+2705
+2706
+2707
+2708
+2709
+2710
+2711
+2712
+2713
+2714
+2715
+2716
+2717
+2718
+2719
+2720
+2721
+2722
+2723
+2724
+2725
+2726
+2727
+2728
+2729
+2730
+2731
+2732
+2733
+2734
+2735
+2736
+2737
+2738
+2739
+2740
+2741
+2742
+2743
+2744
+2745
+2746
+2747
+2748
+2749
+2750
+2751
+2752
+2753
+2754
+2755
+2756
+2757
+2758
+2759
+2760
+2761
+2762
+2763
+2764
+2765
+2766
+2767
+2768
+2769
+2770
+2771
+2772
+2773
+2774
+2775
+2776
+2777
+2778
+2779
+2780
+2781
+2782
+2783
+2784
+2785
+2786
+2787
+2788
+2789
+2790
+2791
+2792
+2793
+2794
+2795
+2796
+2797
+2798
+2799
+2800
+2801
+2802
+2803
+2804
+2805
+2806
+2807
+2808
+2809
+2810
+2811
+2812
+2813
+2814
+2815
+2816
+2817
+2818
+2819
+2820
+2821
+2822
+2823
+2824
+2825
+2826
+2827
+2828
+2829
+2830
+2831
+2832
+2833
+2834
+2835
+2836
+2837
+2838
+2839
+2840
+2841
+2842
+2843
+2844
+2845
+2846
+2847
+2848
+2849
+2850
+2851
+2852
+2853
+2854
+2855
+2856
+2857
+2858
+2859
+2860
+2861
+2862
+2863
+2864
+2865
+2866
+2867
+2868
+2869
+2870
+2871
+2872
+2873
+2874
+2875
+2876
+2877
+2878
+2879
+2880
+2881
+2882
+2883
+2884
+2885
+2886
+2887
+2888
+2889
+2890
+2891
+2892
+2893
+2894
+2895
+2896
+2897
+2898
+2899
+2900
+2901
+2902
+2903
+2904
+2905
+2906
+2907
+2908
+2909
+2910
+2911
+2912
+2913
+2914
+2915
+2916
+2917
+2918
+2919
+2920
+2921
+2922
+2923
+2924
+2925
+2926
+2927
+2928
+2929
+2930
+2931
+2932
+2933
+2934
+2935
+2936
+2937
+2938
+2939
+2940
+2941
+2942
+2943
+2944
+
+use lib::*;
+
+use de::{Deserialize, DeserializeSeed, Deserializer, Error, IntoDeserializer, Visitor};
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+use de::{MapAccess, Unexpected};
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+pub use self::content::{
+    Content, ContentDeserializer, ContentRefDeserializer, EnumDeserializer,
+    InternallyTaggedUnitVisitor, TagContentOtherField, TagContentOtherFieldVisitor,
+    TagOrContentField, TagOrContentFieldVisitor, TaggedContentVisitor, UntaggedUnitVisitor,
+};
+
+/// If the missing field is of type `Option<T>` then treat is as `None`,
+/// otherwise it is an error.
+pub fn missing_field<'de, V, E>(field: &'static str) -> Result<V, E>
+where
+    V: Deserialize<'de>,
+    E: Error,
+{
+    struct MissingFieldDeserializer<E>(&'static str, PhantomData<E>);
+
+    impl<'de, E> Deserializer<'de> for MissingFieldDeserializer<E>
+    where
+        E: Error,
+    {
+        type Error = E;
+
+        fn deserialize_any<V>(self, _visitor: V) -> Result<V::Value, E>
+        where
+            V: Visitor<'de>,
+        {
+            Err(Error::missing_field(self.0))
+        }
+
+        fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, E>
+        where
+            V: Visitor<'de>,
+        {
+            visitor.visit_none()
+        }
+
+        forward_to_deserialize_any! {
+            bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+            bytes byte_buf unit unit_struct newtype_struct seq tuple
+            tuple_struct map struct enum identifier ignored_any
+        }
+    }
+
+    let deserializer = MissingFieldDeserializer(field, PhantomData);
+    Deserialize::deserialize(deserializer)
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+pub fn borrow_cow_str<'de: 'a, 'a, D>(deserializer: D) -> Result<Cow<'a, str>, D::Error>
+where
+    D: Deserializer<'de>,
+{
+    struct CowStrVisitor;
+
+    impl<'a> Visitor<'a> for CowStrVisitor {
+        type Value = Cow<'a, str>;
+
+        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            formatter.write_str("a string")
+        }
+
+        fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            Ok(Cow::Owned(v.to_owned()))
+        }
+
+        fn visit_borrowed_str<E>(self, v: &'a str) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            Ok(Cow::Borrowed(v))
+        }
+
+        fn visit_string<E>(self, v: String) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            Ok(Cow::Owned(v))
+        }
+
+        fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            match str::from_utf8(v) {
+                Ok(s) => Ok(Cow::Owned(s.to_owned())),
+                Err(_) => Err(Error::invalid_value(Unexpected::Bytes(v), &self)),
+            }
+        }
+
+        fn visit_borrowed_bytes<E>(self, v: &'a [u8]) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            match str::from_utf8(v) {
+                Ok(s) => Ok(Cow::Borrowed(s)),
+                Err(_) => Err(Error::invalid_value(Unexpected::Bytes(v), &self)),
+            }
+        }
+
+        fn visit_byte_buf<E>(self, v: Vec<u8>) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            match String::from_utf8(v) {
+                Ok(s) => Ok(Cow::Owned(s)),
+                Err(e) => Err(Error::invalid_value(
+                    Unexpected::Bytes(&e.into_bytes()),
+                    &self,
+                )),
+            }
+        }
+    }
+
+    deserializer.deserialize_str(CowStrVisitor)
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+pub fn borrow_cow_bytes<'de: 'a, 'a, D>(deserializer: D) -> Result<Cow<'a, [u8]>, D::Error>
+where
+    D: Deserializer<'de>,
+{
+    struct CowBytesVisitor;
+
+    impl<'a> Visitor<'a> for CowBytesVisitor {
+        type Value = Cow<'a, [u8]>;
+
+        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            formatter.write_str("a byte array")
+        }
+
+        fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            Ok(Cow::Owned(v.as_bytes().to_vec()))
+        }
+
+        fn visit_borrowed_str<E>(self, v: &'a str) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            Ok(Cow::Borrowed(v.as_bytes()))
+        }
+
+        fn visit_string<E>(self, v: String) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            Ok(Cow::Owned(v.into_bytes()))
+        }
+
+        fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            Ok(Cow::Owned(v.to_vec()))
+        }
+
+        fn visit_borrowed_bytes<E>(self, v: &'a [u8]) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            Ok(Cow::Borrowed(v))
+        }
+
+        fn visit_byte_buf<E>(self, v: Vec<u8>) -> Result<Self::Value, E>
+        where
+            E: Error,
+        {
+            Ok(Cow::Owned(v))
+        }
+    }
+
+    deserializer.deserialize_bytes(CowBytesVisitor)
+}
+
+pub mod size_hint {
+    use lib::*;
+
+    pub fn from_bounds<I>(iter: &I) -> Option<usize>
+    where
+        I: Iterator,
+    {
+        helper(iter.size_hint())
+    }
+
+    #[inline]
+    pub fn cautious(hint: Option<usize>) -> usize {
+        cmp::min(hint.unwrap_or(0), 4096)
+    }
+
+    fn helper(bounds: (usize, Option<usize>)) -> Option<usize> {
+        match bounds {
+            (lower, Some(upper)) if lower == upper => Some(upper),
+            _ => None,
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+mod content {
+    // This module is private and nothing here should be used outside of
+    // generated code.
+    //
+    // We will iterate on the implementation for a few releases and only have to
+    // worry about backward compatibility for the `untagged` and `tag` attributes
+    // rather than for this entire mechanism.
+    //
+    // This issue is tracking making some of this stuff public:
+    // https://github.com/serde-rs/serde/issues/741
+
+    use lib::*;
+
+    use super::size_hint;
+    use de::{
+        self, Deserialize, DeserializeSeed, Deserializer, EnumAccess, Expected, IgnoredAny,
+        MapAccess, SeqAccess, Unexpected, Visitor,
+    };
+
+    /// Used from generated code to buffer the contents of the Deserializer when
+    /// deserializing untagged enums and internally tagged enums.
+    ///
+    /// Not public API. Use serde-value instead.
+    #[derive(Debug)]
+    pub enum Content<'de> {
+        Bool(bool),
+
+        U8(u8),
+        U16(u16),
+        U32(u32),
+        U64(u64),
+
+        I8(i8),
+        I16(i16),
+        I32(i32),
+        I64(i64),
+
+        F32(f32),
+        F64(f64),
+
+        Char(char),
+        String(String),
+        Str(&'de str),
+        ByteBuf(Vec<u8>),
+        Bytes(&'de [u8]),
+
+        None,
+        Some(Box<Content<'de>>),
+
+        Unit,
+        Newtype(Box<Content<'de>>),
+        Seq(Vec<Content<'de>>),
+        Map(Vec<(Content<'de>, Content<'de>)>),
+    }
+
+    impl<'de> Content<'de> {
+        pub fn as_str(&self) -> Option<&str> {
+            match *self {
+                Content::Str(x) => Some(x),
+                Content::String(ref x) => Some(x),
+                Content::Bytes(x) => str::from_utf8(x).ok(),
+                Content::ByteBuf(ref x) => str::from_utf8(x).ok(),
+                _ => None,
+            }
+        }
+
+        #[cold]
+        fn unexpected(&self) -> Unexpected {
+            match *self {
+                Content::Bool(b) => Unexpected::Bool(b),
+                Content::U8(n) => Unexpected::Unsigned(n as u64),
+                Content::U16(n) => Unexpected::Unsigned(n as u64),
+                Content::U32(n) => Unexpected::Unsigned(n as u64),
+                Content::U64(n) => Unexpected::Unsigned(n),
+                Content::I8(n) => Unexpected::Signed(n as i64),
+                Content::I16(n) => Unexpected::Signed(n as i64),
+                Content::I32(n) => Unexpected::Signed(n as i64),
+                Content::I64(n) => Unexpected::Signed(n),
+                Content::F32(f) => Unexpected::Float(f as f64),
+                Content::F64(f) => Unexpected::Float(f),
+                Content::Char(c) => Unexpected::Char(c),
+                Content::String(ref s) => Unexpected::Str(s),
+                Content::Str(s) => Unexpected::Str(s),
+                Content::ByteBuf(ref b) => Unexpected::Bytes(b),
+                Content::Bytes(b) => Unexpected::Bytes(b),
+                Content::None | Content::Some(_) => Unexpected::Option,
+                Content::Unit => Unexpected::Unit,
+                Content::Newtype(_) => Unexpected::NewtypeStruct,
+                Content::Seq(_) => Unexpected::Seq,
+                Content::Map(_) => Unexpected::Map,
+            }
+        }
+    }
+
+    impl<'de> Deserialize<'de> for Content<'de> {
+        fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            // Untagged and internally tagged enums are only supported in
+            // self-describing formats.
+            let visitor = ContentVisitor { value: PhantomData };
+            deserializer.deserialize_any(visitor)
+        }
+    }
+
+    struct ContentVisitor<'de> {
+        value: PhantomData<Content<'de>>,
+    }
+
+    impl<'de> ContentVisitor<'de> {
+        fn new() -> Self {
+            ContentVisitor { value: PhantomData }
+        }
+    }
+
+    impl<'de> Visitor<'de> for ContentVisitor<'de> {
+        type Value = Content<'de>;
+
+        fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+            fmt.write_str("any value")
+        }
+
+        fn visit_bool<F>(self, value: bool) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::Bool(value))
+        }
+
+        fn visit_i8<F>(self, value: i8) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::I8(value))
+        }
+
+        fn visit_i16<F>(self, value: i16) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::I16(value))
+        }
+
+        fn visit_i32<F>(self, value: i32) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::I32(value))
+        }
+
+        fn visit_i64<F>(self, value: i64) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::I64(value))
+        }
+
+        fn visit_u8<F>(self, value: u8) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::U8(value))
+        }
+
+        fn visit_u16<F>(self, value: u16) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::U16(value))
+        }
+
+        fn visit_u32<F>(self, value: u32) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::U32(value))
+        }
+
+        fn visit_u64<F>(self, value: u64) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::U64(value))
+        }
+
+        fn visit_f32<F>(self, value: f32) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::F32(value))
+        }
+
+        fn visit_f64<F>(self, value: f64) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::F64(value))
+        }
+
+        fn visit_char<F>(self, value: char) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::Char(value))
+        }
+
+        fn visit_str<F>(self, value: &str) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::String(value.into()))
+        }
+
+        fn visit_borrowed_str<F>(self, value: &'de str) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::Str(value))
+        }
+
+        fn visit_string<F>(self, value: String) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::String(value))
+        }
+
+        fn visit_bytes<F>(self, value: &[u8]) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::ByteBuf(value.into()))
+        }
+
+        fn visit_borrowed_bytes<F>(self, value: &'de [u8]) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::Bytes(value))
+        }
+
+        fn visit_byte_buf<F>(self, value: Vec<u8>) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::ByteBuf(value))
+        }
+
+        fn visit_unit<F>(self) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::Unit)
+        }
+
+        fn visit_none<F>(self) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            Ok(Content::None)
+        }
+
+        fn visit_some<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            Deserialize::deserialize(deserializer).map(|v| Content::Some(Box::new(v)))
+        }
+
+        fn visit_newtype_struct<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            Deserialize::deserialize(deserializer).map(|v| Content::Newtype(Box::new(v)))
+        }
+
+        fn visit_seq<V>(self, mut visitor: V) -> Result<Self::Value, V::Error>
+        where
+            V: SeqAccess<'de>,
+        {
+            let mut vec = Vec::with_capacity(size_hint::cautious(visitor.size_hint()));
+            while let Some(e) = try!(visitor.next_element()) {
+                vec.push(e);
+            }
+            Ok(Content::Seq(vec))
+        }
+
+        fn visit_map<V>(self, mut visitor: V) -> Result<Self::Value, V::Error>
+        where
+            V: MapAccess<'de>,
+        {
+            let mut vec = Vec::with_capacity(size_hint::cautious(visitor.size_hint()));
+            while let Some(kv) = try!(visitor.next_entry()) {
+                vec.push(kv);
+            }
+            Ok(Content::Map(vec))
+        }
+
+        fn visit_enum<V>(self, _visitor: V) -> Result<Self::Value, V::Error>
+        where
+            V: EnumAccess<'de>,
+        {
+            Err(de::Error::custom(
+                "untagged and internally tagged enums do not support enum input",
+            ))
+        }
+    }
+
+    /// This is the type of the map keys in an internally tagged enum.
+    ///
+    /// Not public API.
+    pub enum TagOrContent<'de> {
+        Tag,
+        Content(Content<'de>),
+    }
+
+    struct TagOrContentVisitor<'de> {
+        name: &'static str,
+        value: PhantomData<TagOrContent<'de>>,
+    }
+
+    impl<'de> TagOrContentVisitor<'de> {
+        fn new(name: &'static str) -> Self {
+            TagOrContentVisitor {
+                name: name,
+                value: PhantomData,
+            }
+        }
+    }
+
+    impl<'de> DeserializeSeed<'de> for TagOrContentVisitor<'de> {
+        type Value = TagOrContent<'de>;
+
+        fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            // Internally tagged enums are only supported in self-describing
+            // formats.
+            deserializer.deserialize_any(self)
+        }
+    }
+
+    impl<'de> Visitor<'de> for TagOrContentVisitor<'de> {
+        type Value = TagOrContent<'de>;
+
+        fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+            write!(fmt, "a type tag `{}` or any other value", self.name)
+        }
+
+        fn visit_bool<F>(self, value: bool) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            ContentVisitor::new()
+                .visit_bool(value)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_i8<F>(self, value: i8) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            ContentVisitor::new()
+                .visit_i8(value)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_i16<F>(self, value: i16) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            ContentVisitor::new()
+                .visit_i16(value)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_i32<F>(self, value: i32) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            ContentVisitor::new()
+                .visit_i32(value)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_i64<F>(self, value: i64) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            ContentVisitor::new()
+                .visit_i64(value)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_u8<F>(self, value: u8) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            ContentVisitor::new()
+                .visit_u8(value)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_u16<F>(self, value: u16) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            ContentVisitor::new()
+                .visit_u16(value)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_u32<F>(self, value: u32) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            ContentVisitor::new()
+                .visit_u32(value)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_u64<F>(self, value: u64) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            ContentVisitor::new()
+                .visit_u64(value)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_f32<F>(self, value: f32) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            ContentVisitor::new()
+                .visit_f32(value)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_f64<F>(self, value: f64) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            ContentVisitor::new()
+                .visit_f64(value)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_char<F>(self, value: char) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            ContentVisitor::new()
+                .visit_char(value)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_str<F>(self, value: &str) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            if value == self.name {
+                Ok(TagOrContent::Tag)
+            } else {
+                ContentVisitor::new()
+                    .visit_str(value)
+                    .map(TagOrContent::Content)
+            }
+        }
+
+        fn visit_borrowed_str<F>(self, value: &'de str) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            if value == self.name {
+                Ok(TagOrContent::Tag)
+            } else {
+                ContentVisitor::new()
+                    .visit_borrowed_str(value)
+                    .map(TagOrContent::Content)
+            }
+        }
+
+        fn visit_string<F>(self, value: String) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            if value == self.name {
+                Ok(TagOrContent::Tag)
+            } else {
+                ContentVisitor::new()
+                    .visit_string(value)
+                    .map(TagOrContent::Content)
+            }
+        }
+
+        fn visit_bytes<F>(self, value: &[u8]) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            if value == self.name.as_bytes() {
+                Ok(TagOrContent::Tag)
+            } else {
+                ContentVisitor::new()
+                    .visit_bytes(value)
+                    .map(TagOrContent::Content)
+            }
+        }
+
+        fn visit_borrowed_bytes<F>(self, value: &'de [u8]) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            if value == self.name.as_bytes() {
+                Ok(TagOrContent::Tag)
+            } else {
+                ContentVisitor::new()
+                    .visit_borrowed_bytes(value)
+                    .map(TagOrContent::Content)
+            }
+        }
+
+        fn visit_byte_buf<F>(self, value: Vec<u8>) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            if value == self.name.as_bytes() {
+                Ok(TagOrContent::Tag)
+            } else {
+                ContentVisitor::new()
+                    .visit_byte_buf(value)
+                    .map(TagOrContent::Content)
+            }
+        }
+
+        fn visit_unit<F>(self) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            ContentVisitor::new()
+                .visit_unit()
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_none<F>(self) -> Result<Self::Value, F>
+        where
+            F: de::Error,
+        {
+            ContentVisitor::new()
+                .visit_none()
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_some<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            ContentVisitor::new()
+                .visit_some(deserializer)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_newtype_struct<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            ContentVisitor::new()
+                .visit_newtype_struct(deserializer)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_seq<V>(self, visitor: V) -> Result<Self::Value, V::Error>
+        where
+            V: SeqAccess<'de>,
+        {
+            ContentVisitor::new()
+                .visit_seq(visitor)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_map<V>(self, visitor: V) -> Result<Self::Value, V::Error>
+        where
+            V: MapAccess<'de>,
+        {
+            ContentVisitor::new()
+                .visit_map(visitor)
+                .map(TagOrContent::Content)
+        }
+
+        fn visit_enum<V>(self, visitor: V) -> Result<Self::Value, V::Error>
+        where
+            V: EnumAccess<'de>,
+        {
+            ContentVisitor::new()
+                .visit_enum(visitor)
+                .map(TagOrContent::Content)
+        }
+    }
+
+    /// Used by generated code to deserialize an internally tagged enum.
+    ///
+    /// Not public API.
+    pub struct TaggedContent<'de, T> {
+        pub tag: T,
+        pub content: Content<'de>,
+    }
+
+    /// Not public API.
+    pub struct TaggedContentVisitor<'de, T> {
+        tag_name: &'static str,
+        value: PhantomData<TaggedContent<'de, T>>,
+    }
+
+    impl<'de, T> TaggedContentVisitor<'de, T> {
+        /// Visitor for the content of an internally tagged enum with the given
+        /// tag name.
+        pub fn new(name: &'static str) -> Self {
+            TaggedContentVisitor {
+                tag_name: name,
+                value: PhantomData,
+            }
+        }
+    }
+
+    impl<'de, T> DeserializeSeed<'de> for TaggedContentVisitor<'de, T>
+    where
+        T: Deserialize<'de>,
+    {
+        type Value = TaggedContent<'de, T>;
+
+        fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            // Internally tagged enums are only supported in self-describing
+            // formats.
+            deserializer.deserialize_any(self)
+        }
+    }
+
+    impl<'de, T> Visitor<'de> for TaggedContentVisitor<'de, T>
+    where
+        T: Deserialize<'de>,
+    {
+        type Value = TaggedContent<'de, T>;
+
+        fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+            fmt.write_str("internally tagged enum")
+        }
+
+        fn visit_seq<S>(self, mut seq: S) -> Result<Self::Value, S::Error>
+        where
+            S: SeqAccess<'de>,
+        {
+            let tag = match try!(seq.next_element()) {
+                Some(tag) => tag,
+                None => {
+                    return Err(de::Error::missing_field(self.tag_name));
+                }
+            };
+            let rest = de::value::SeqAccessDeserializer::new(seq);
+            Ok(TaggedContent {
+                tag: tag,
+                content: try!(Content::deserialize(rest)),
+            })
+        }
+
+        fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
+        where
+            M: MapAccess<'de>,
+        {
+            let mut tag = None;
+            let mut vec = Vec::with_capacity(size_hint::cautious(map.size_hint()));
+            while let Some(k) = try!(map.next_key_seed(TagOrContentVisitor::new(self.tag_name))) {
+                match k {
+                    TagOrContent::Tag => {
+                        if tag.is_some() {
+                            return Err(de::Error::duplicate_field(self.tag_name));
+                        }
+                        tag = Some(try!(map.next_value()));
+                    }
+                    TagOrContent::Content(k) => {
+                        let v = try!(map.next_value());
+                        vec.push((k, v));
+                    }
+                }
+            }
+            match tag {
+                None => Err(de::Error::missing_field(self.tag_name)),
+                Some(tag) => Ok(TaggedContent {
+                    tag: tag,
+                    content: Content::Map(vec),
+                }),
+            }
+        }
+    }
+
+    /// Used by generated code to deserialize an adjacently tagged enum.
+    ///
+    /// Not public API.
+    pub enum TagOrContentField {
+        Tag,
+        Content,
+    }
+
+    /// Not public API.
+    pub struct TagOrContentFieldVisitor {
+        pub tag: &'static str,
+        pub content: &'static str,
+    }
+
+    impl<'de> DeserializeSeed<'de> for TagOrContentFieldVisitor {
+        type Value = TagOrContentField;
+
+        fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            deserializer.deserialize_str(self)
+        }
+    }
+
+    impl<'de> Visitor<'de> for TagOrContentFieldVisitor {
+        type Value = TagOrContentField;
+
+        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            write!(formatter, "{:?} or {:?}", self.tag, self.content)
+        }
+
+        fn visit_str<E>(self, field: &str) -> Result<Self::Value, E>
+        where
+            E: de::Error,
+        {
+            if field == self.tag {
+                Ok(TagOrContentField::Tag)
+            } else if field == self.content {
+                Ok(TagOrContentField::Content)
+            } else {
+                Err(de::Error::invalid_value(Unexpected::Str(field), &self))
+            }
+        }
+    }
+
+    /// Used by generated code to deserialize an adjacently tagged enum when
+    /// ignoring unrelated fields is allowed.
+    ///
+    /// Not public API.
+    pub enum TagContentOtherField {
+        Tag,
+        Content,
+        Other,
+    }
+
+    /// Not public API.
+    pub struct TagContentOtherFieldVisitor {
+        pub tag: &'static str,
+        pub content: &'static str,
+    }
+
+    impl<'de> DeserializeSeed<'de> for TagContentOtherFieldVisitor {
+        type Value = TagContentOtherField;
+
+        fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+        where
+            D: Deserializer<'de>,
+        {
+            deserializer.deserialize_str(self)
+        }
+    }
+
+    impl<'de> Visitor<'de> for TagContentOtherFieldVisitor {
+        type Value = TagContentOtherField;
+
+        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            write!(
+                formatter,
+                "{:?}, {:?}, or other ignored fields",
+                self.tag, self.content
+            )
+        }
+
+        fn visit_str<E>(self, field: &str) -> Result<Self::Value, E>
+        where
+            E: de::Error,
+        {
+            if field == self.tag {
+                Ok(TagContentOtherField::Tag)
+            } else if field == self.content {
+                Ok(TagContentOtherField::Content)
+            } else {
+                Ok(TagContentOtherField::Other)
+            }
+        }
+    }
+
+    /// Not public API
+    pub struct ContentDeserializer<'de, E> {
+        content: Content<'de>,
+        err: PhantomData<E>,
+    }
+
+    impl<'de, E> ContentDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        #[cold]
+        fn invalid_type(self, exp: &Expected) -> E {
+            de::Error::invalid_type(self.content.unexpected(), exp)
+        }
+
+        fn deserialize_integer<V>(self, visitor: V) -> Result<V::Value, E>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::U8(v) => visitor.visit_u8(v),
+                Content::U16(v) => visitor.visit_u16(v),
+                Content::U32(v) => visitor.visit_u32(v),
+                Content::U64(v) => visitor.visit_u64(v),
+                Content::I8(v) => visitor.visit_i8(v),
+                Content::I16(v) => visitor.visit_i16(v),
+                Content::I32(v) => visitor.visit_i32(v),
+                Content::I64(v) => visitor.visit_i64(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+    }
+
+    fn visit_content_seq<'de, V, E>(content: Vec<Content<'de>>, visitor: V) -> Result<V::Value, E>
+    where
+        V: Visitor<'de>,
+        E: de::Error,
+    {
+        let seq = content.into_iter().map(ContentDeserializer::new);
+        let mut seq_visitor = de::value::SeqDeserializer::new(seq);
+        let value = try!(visitor.visit_seq(&mut seq_visitor));
+        try!(seq_visitor.end());
+        Ok(value)
+    }
+
+    fn visit_content_map<'de, V, E>(
+        content: Vec<(Content<'de>, Content<'de>)>,
+        visitor: V,
+    ) -> Result<V::Value, E>
+    where
+        V: Visitor<'de>,
+        E: de::Error,
+    {
+        let map = content
+            .into_iter()
+            .map(|(k, v)| (ContentDeserializer::new(k), ContentDeserializer::new(v)));
+        let mut map_visitor = de::value::MapDeserializer::new(map);
+        let value = try!(visitor.visit_map(&mut map_visitor));
+        try!(map_visitor.end());
+        Ok(value)
+    }
+
+    /// Used when deserializing an internally tagged enum because the content
+    /// will be used exactly once.
+    impl<'de, E> Deserializer<'de> for ContentDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+
+        fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::Bool(v) => visitor.visit_bool(v),
+                Content::U8(v) => visitor.visit_u8(v),
+                Content::U16(v) => visitor.visit_u16(v),
+                Content::U32(v) => visitor.visit_u32(v),
+                Content::U64(v) => visitor.visit_u64(v),
+                Content::I8(v) => visitor.visit_i8(v),
+                Content::I16(v) => visitor.visit_i16(v),
+                Content::I32(v) => visitor.visit_i32(v),
+                Content::I64(v) => visitor.visit_i64(v),
+                Content::F32(v) => visitor.visit_f32(v),
+                Content::F64(v) => visitor.visit_f64(v),
+                Content::Char(v) => visitor.visit_char(v),
+                Content::String(v) => visitor.visit_string(v),
+                Content::Str(v) => visitor.visit_borrowed_str(v),
+                Content::ByteBuf(v) => visitor.visit_byte_buf(v),
+                Content::Bytes(v) => visitor.visit_borrowed_bytes(v),
+                Content::Unit => visitor.visit_unit(),
+                Content::None => visitor.visit_none(),
+                Content::Some(v) => visitor.visit_some(ContentDeserializer::new(*v)),
+                Content::Newtype(v) => visitor.visit_newtype_struct(ContentDeserializer::new(*v)),
+                Content::Seq(v) => visit_content_seq(v, visitor),
+                Content::Map(v) => visit_content_map(v, visitor),
+            }
+        }
+
+        fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::Bool(v) => visitor.visit_bool(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::F32(v) => visitor.visit_f32(v),
+                Content::F64(v) => visitor.visit_f64(v),
+                Content::U64(v) => visitor.visit_u64(v),
+                Content::I64(v) => visitor.visit_i64(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::F64(v) => visitor.visit_f64(v),
+                Content::U64(v) => visitor.visit_u64(v),
+                Content::I64(v) => visitor.visit_i64(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::Char(v) => visitor.visit_char(v),
+                Content::String(v) => visitor.visit_string(v),
+                Content::Str(v) => visitor.visit_borrowed_str(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_string(visitor)
+        }
+
+        fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::String(v) => visitor.visit_string(v),
+                Content::Str(v) => visitor.visit_borrowed_str(v),
+                Content::ByteBuf(v) => visitor.visit_byte_buf(v),
+                Content::Bytes(v) => visitor.visit_borrowed_bytes(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_byte_buf(visitor)
+        }
+
+        fn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::String(v) => visitor.visit_string(v),
+                Content::Str(v) => visitor.visit_borrowed_str(v),
+                Content::ByteBuf(v) => visitor.visit_byte_buf(v),
+                Content::Bytes(v) => visitor.visit_borrowed_bytes(v),
+                Content::Seq(v) => visit_content_seq(v, visitor),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::None => visitor.visit_none(),
+                Content::Some(v) => visitor.visit_some(ContentDeserializer::new(*v)),
+                Content::Unit => visitor.visit_unit(),
+                _ => visitor.visit_some(self),
+            }
+        }
+
+        fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::Unit => visitor.visit_unit(),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_unit_struct<V>(
+            self,
+            _name: &'static str,
+            visitor: V,
+        ) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                // As a special case, allow deserializing untagged newtype
+                // variant containing unit struct.
+                //
+                //     #[derive(Deserialize)]
+                //     struct Info;
+                //
+                //     #[derive(Deserialize)]
+                //     #[serde(tag = "topic")]
+                //     enum Message {
+                //         Info(Info),
+                //     }
+                //
+                // We want {"topic":"Info"} to deserialize even though
+                // ordinarily unit structs do not deserialize from empty map.
+                Content::Map(ref v) if v.is_empty() => visitor.visit_unit(),
+                _ => self.deserialize_any(visitor),
+            }
+        }
+
+        fn deserialize_newtype_struct<V>(
+            self,
+            _name: &str,
+            visitor: V,
+        ) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::Newtype(v) => visitor.visit_newtype_struct(ContentDeserializer::new(*v)),
+                _ => visitor.visit_newtype_struct(self),
+            }
+        }
+
+        fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::Seq(v) => visit_content_seq(v, visitor),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_tuple<V>(self, _len: usize, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_seq(visitor)
+        }
+
+        fn deserialize_tuple_struct<V>(
+            self,
+            _name: &'static str,
+            _len: usize,
+            visitor: V,
+        ) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_seq(visitor)
+        }
+
+        fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::Map(v) => visit_content_map(v, visitor),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_struct<V>(
+            self,
+            _name: &'static str,
+            _fields: &'static [&'static str],
+            visitor: V,
+        ) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::Seq(v) => visit_content_seq(v, visitor),
+                Content::Map(v) => visit_content_map(v, visitor),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_enum<V>(
+            self,
+            _name: &str,
+            _variants: &'static [&'static str],
+            visitor: V,
+        ) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            let (variant, value) = match self.content {
+                Content::Map(value) => {
+                    let mut iter = value.into_iter();
+                    let (variant, value) = match iter.next() {
+                        Some(v) => v,
+                        None => {
+                            return Err(de::Error::invalid_value(
+                                de::Unexpected::Map,
+                                &"map with a single key",
+                            ));
+                        }
+                    };
+                    // enums are encoded in json as maps with a single key:value pair
+                    if iter.next().is_some() {
+                        return Err(de::Error::invalid_value(
+                            de::Unexpected::Map,
+                            &"map with a single key",
+                        ));
+                    }
+                    (variant, Some(value))
+                }
+                s @ Content::String(_) | s @ Content::Str(_) => (s, None),
+                other => {
+                    return Err(de::Error::invalid_type(
+                        other.unexpected(),
+                        &"string or map",
+                    ));
+                }
+            };
+
+            visitor.visit_enum(EnumDeserializer::new(variant, value))
+        }
+
+        fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match self.content {
+                Content::String(v) => visitor.visit_string(v),
+                Content::Str(v) => visitor.visit_borrowed_str(v),
+                Content::ByteBuf(v) => visitor.visit_byte_buf(v),
+                Content::Bytes(v) => visitor.visit_borrowed_bytes(v),
+                Content::U8(v) => visitor.visit_u8(v),
+                Content::U64(v) => visitor.visit_u64(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            drop(self);
+            visitor.visit_unit()
+        }
+    }
+
+    impl<'de, E> ContentDeserializer<'de, E> {
+        /// private API, don't use
+        pub fn new(content: Content<'de>) -> Self {
+            ContentDeserializer {
+                content: content,
+                err: PhantomData,
+            }
+        }
+    }
+
+    pub struct EnumDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        variant: Content<'de>,
+        value: Option<Content<'de>>,
+        err: PhantomData<E>,
+    }
+
+    impl<'de, E> EnumDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        pub fn new(variant: Content<'de>, value: Option<Content<'de>>) -> EnumDeserializer<'de, E> {
+            EnumDeserializer {
+                variant: variant,
+                value: value,
+                err: PhantomData,
+            }
+        }
+    }
+
+    impl<'de, E> de::EnumAccess<'de> for EnumDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+        type Variant = VariantDeserializer<'de, Self::Error>;
+
+        fn variant_seed<V>(self, seed: V) -> Result<(V::Value, Self::Variant), E>
+        where
+            V: de::DeserializeSeed<'de>,
+        {
+            let visitor = VariantDeserializer {
+                value: self.value,
+                err: PhantomData,
+            };
+            seed.deserialize(ContentDeserializer::new(self.variant))
+                .map(|v| (v, visitor))
+        }
+    }
+
+    pub struct VariantDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        value: Option<Content<'de>>,
+        err: PhantomData<E>,
+    }
+
+    impl<'de, E> de::VariantAccess<'de> for VariantDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+
+        fn unit_variant(self) -> Result<(), E> {
+            match self.value {
+                Some(value) => de::Deserialize::deserialize(ContentDeserializer::new(value)),
+                None => Ok(()),
+            }
+        }
+
+        fn newtype_variant_seed<T>(self, seed: T) -> Result<T::Value, E>
+        where
+            T: de::DeserializeSeed<'de>,
+        {
+            match self.value {
+                Some(value) => seed.deserialize(ContentDeserializer::new(value)),
+                None => Err(de::Error::invalid_type(
+                    de::Unexpected::UnitVariant,
+                    &"newtype variant",
+                )),
+            }
+        }
+
+        fn tuple_variant<V>(self, _len: usize, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: de::Visitor<'de>,
+        {
+            match self.value {
+                Some(Content::Seq(v)) => {
+                    de::Deserializer::deserialize_any(SeqDeserializer::new(v), visitor)
+                }
+                Some(other) => Err(de::Error::invalid_type(
+                    other.unexpected(),
+                    &"tuple variant",
+                )),
+                None => Err(de::Error::invalid_type(
+                    de::Unexpected::UnitVariant,
+                    &"tuple variant",
+                )),
+            }
+        }
+
+        fn struct_variant<V>(
+            self,
+            _fields: &'static [&'static str],
+            visitor: V,
+        ) -> Result<V::Value, Self::Error>
+        where
+            V: de::Visitor<'de>,
+        {
+            match self.value {
+                Some(Content::Map(v)) => {
+                    de::Deserializer::deserialize_any(MapDeserializer::new(v), visitor)
+                }
+                Some(Content::Seq(v)) => {
+                    de::Deserializer::deserialize_any(SeqDeserializer::new(v), visitor)
+                }
+                Some(other) => Err(de::Error::invalid_type(
+                    other.unexpected(),
+                    &"struct variant",
+                )),
+                _ => Err(de::Error::invalid_type(
+                    de::Unexpected::UnitVariant,
+                    &"struct variant",
+                )),
+            }
+        }
+    }
+
+    struct SeqDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        iter: <Vec<Content<'de>> as IntoIterator>::IntoIter,
+        err: PhantomData<E>,
+    }
+
+    impl<'de, E> SeqDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        fn new(vec: Vec<Content<'de>>) -> Self {
+            SeqDeserializer {
+                iter: vec.into_iter(),
+                err: PhantomData,
+            }
+        }
+    }
+
+    impl<'de, E> de::Deserializer<'de> for SeqDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+
+        #[inline]
+        fn deserialize_any<V>(mut self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: de::Visitor<'de>,
+        {
+            let len = self.iter.len();
+            if len == 0 {
+                visitor.visit_unit()
+            } else {
+                let ret = try!(visitor.visit_seq(&mut self));
+                let remaining = self.iter.len();
+                if remaining == 0 {
+                    Ok(ret)
+                } else {
+                    Err(de::Error::invalid_length(len, &"fewer elements in array"))
+                }
+            }
+        }
+
+        forward_to_deserialize_any! {
+            bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+            bytes byte_buf option unit unit_struct newtype_struct seq tuple
+            tuple_struct map struct enum identifier ignored_any
+        }
+    }
+
+    impl<'de, E> de::SeqAccess<'de> for SeqDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+
+        fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
+        where
+            T: de::DeserializeSeed<'de>,
+        {
+            match self.iter.next() {
+                Some(value) => seed.deserialize(ContentDeserializer::new(value)).map(Some),
+                None => Ok(None),
+            }
+        }
+
+        fn size_hint(&self) -> Option<usize> {
+            size_hint::from_bounds(&self.iter)
+        }
+    }
+
+    struct MapDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        iter: <Vec<(Content<'de>, Content<'de>)> as IntoIterator>::IntoIter,
+        value: Option<Content<'de>>,
+        err: PhantomData<E>,
+    }
+
+    impl<'de, E> MapDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        fn new(map: Vec<(Content<'de>, Content<'de>)>) -> Self {
+            MapDeserializer {
+                iter: map.into_iter(),
+                value: None,
+                err: PhantomData,
+            }
+        }
+    }
+
+    impl<'de, E> de::MapAccess<'de> for MapDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+
+        fn next_key_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
+        where
+            T: de::DeserializeSeed<'de>,
+        {
+            match self.iter.next() {
+                Some((key, value)) => {
+                    self.value = Some(value);
+                    seed.deserialize(ContentDeserializer::new(key)).map(Some)
+                }
+                None => Ok(None),
+            }
+        }
+
+        fn next_value_seed<T>(&mut self, seed: T) -> Result<T::Value, Self::Error>
+        where
+            T: de::DeserializeSeed<'de>,
+        {
+            match self.value.take() {
+                Some(value) => seed.deserialize(ContentDeserializer::new(value)),
+                None => Err(de::Error::custom("value is missing")),
+            }
+        }
+
+        fn size_hint(&self) -> Option<usize> {
+            size_hint::from_bounds(&self.iter)
+        }
+    }
+
+    impl<'de, E> de::Deserializer<'de> for MapDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+
+        #[inline]
+        fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: de::Visitor<'de>,
+        {
+            visitor.visit_map(self)
+        }
+
+        forward_to_deserialize_any! {
+            bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+            bytes byte_buf option unit unit_struct newtype_struct seq tuple
+            tuple_struct map struct enum identifier ignored_any
+        }
+    }
+
+    /// Not public API.
+    pub struct ContentRefDeserializer<'a, 'de: 'a, E> {
+        content: &'a Content<'de>,
+        err: PhantomData<E>,
+    }
+
+    impl<'a, 'de, E> ContentRefDeserializer<'a, 'de, E>
+    where
+        E: de::Error,
+    {
+        #[cold]
+        fn invalid_type(self, exp: &Expected) -> E {
+            de::Error::invalid_type(self.content.unexpected(), exp)
+        }
+
+        fn deserialize_integer<V>(self, visitor: V) -> Result<V::Value, E>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::U8(v) => visitor.visit_u8(v),
+                Content::U16(v) => visitor.visit_u16(v),
+                Content::U32(v) => visitor.visit_u32(v),
+                Content::U64(v) => visitor.visit_u64(v),
+                Content::I8(v) => visitor.visit_i8(v),
+                Content::I16(v) => visitor.visit_i16(v),
+                Content::I32(v) => visitor.visit_i32(v),
+                Content::I64(v) => visitor.visit_i64(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+    }
+
+    fn visit_content_seq_ref<'a, 'de, V, E>(
+        content: &'a [Content<'de>],
+        visitor: V,
+    ) -> Result<V::Value, E>
+    where
+        V: Visitor<'de>,
+        E: de::Error,
+    {
+        let seq = content.iter().map(ContentRefDeserializer::new);
+        let mut seq_visitor = de::value::SeqDeserializer::new(seq);
+        let value = try!(visitor.visit_seq(&mut seq_visitor));
+        try!(seq_visitor.end());
+        Ok(value)
+    }
+
+    fn visit_content_map_ref<'a, 'de, V, E>(
+        content: &'a [(Content<'de>, Content<'de>)],
+        visitor: V,
+    ) -> Result<V::Value, E>
+    where
+        V: Visitor<'de>,
+        E: de::Error,
+    {
+        let map = content.iter().map(|&(ref k, ref v)| {
+            (
+                ContentRefDeserializer::new(k),
+                ContentRefDeserializer::new(v),
+            )
+        });
+        let mut map_visitor = de::value::MapDeserializer::new(map);
+        let value = try!(visitor.visit_map(&mut map_visitor));
+        try!(map_visitor.end());
+        Ok(value)
+    }
+
+    /// Used when deserializing an untagged enum because the content may need
+    /// to be used more than once.
+    impl<'de, 'a, E> Deserializer<'de> for ContentRefDeserializer<'a, 'de, E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+
+        fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, E>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::Bool(v) => visitor.visit_bool(v),
+                Content::U8(v) => visitor.visit_u8(v),
+                Content::U16(v) => visitor.visit_u16(v),
+                Content::U32(v) => visitor.visit_u32(v),
+                Content::U64(v) => visitor.visit_u64(v),
+                Content::I8(v) => visitor.visit_i8(v),
+                Content::I16(v) => visitor.visit_i16(v),
+                Content::I32(v) => visitor.visit_i32(v),
+                Content::I64(v) => visitor.visit_i64(v),
+                Content::F32(v) => visitor.visit_f32(v),
+                Content::F64(v) => visitor.visit_f64(v),
+                Content::Char(v) => visitor.visit_char(v),
+                Content::String(ref v) => visitor.visit_str(v),
+                Content::Str(v) => visitor.visit_borrowed_str(v),
+                Content::ByteBuf(ref v) => visitor.visit_bytes(v),
+                Content::Bytes(v) => visitor.visit_borrowed_bytes(v),
+                Content::Unit => visitor.visit_unit(),
+                Content::None => visitor.visit_none(),
+                Content::Some(ref v) => visitor.visit_some(ContentRefDeserializer::new(v)),
+                Content::Newtype(ref v) => {
+                    visitor.visit_newtype_struct(ContentRefDeserializer::new(v))
+                }
+                Content::Seq(ref v) => visit_content_seq_ref(v, visitor),
+                Content::Map(ref v) => visit_content_map_ref(v, visitor),
+            }
+        }
+
+        fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::Bool(v) => visitor.visit_bool(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_integer(visitor)
+        }
+
+        fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::F32(v) => visitor.visit_f32(v),
+                Content::F64(v) => visitor.visit_f64(v),
+                Content::U64(v) => visitor.visit_u64(v),
+                Content::I64(v) => visitor.visit_i64(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::F64(v) => visitor.visit_f64(v),
+                Content::U64(v) => visitor.visit_u64(v),
+                Content::I64(v) => visitor.visit_i64(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::Char(v) => visitor.visit_char(v),
+                Content::String(ref v) => visitor.visit_str(v),
+                Content::Str(v) => visitor.visit_borrowed_str(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::String(ref v) => visitor.visit_str(v),
+                Content::Str(v) => visitor.visit_borrowed_str(v),
+                Content::ByteBuf(ref v) => visitor.visit_bytes(v),
+                Content::Bytes(v) => visitor.visit_borrowed_bytes(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_str(visitor)
+        }
+
+        fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::String(ref v) => visitor.visit_str(v),
+                Content::Str(v) => visitor.visit_borrowed_str(v),
+                Content::ByteBuf(ref v) => visitor.visit_bytes(v),
+                Content::Bytes(v) => visitor.visit_borrowed_bytes(v),
+                Content::Seq(ref v) => visit_content_seq_ref(v, visitor),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_bytes(visitor)
+        }
+
+        fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, E>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::None => visitor.visit_none(),
+                Content::Some(ref v) => visitor.visit_some(ContentRefDeserializer::new(v)),
+                Content::Unit => visitor.visit_unit(),
+                _ => visitor.visit_some(self),
+            }
+        }
+
+        fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::Unit => visitor.visit_unit(),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_unit_struct<V>(
+            self,
+            _name: &'static str,
+            visitor: V,
+        ) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_unit(visitor)
+        }
+
+        fn deserialize_newtype_struct<V>(self, _name: &str, visitor: V) -> Result<V::Value, E>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::Newtype(ref v) => {
+                    visitor.visit_newtype_struct(ContentRefDeserializer::new(v))
+                }
+                _ => visitor.visit_newtype_struct(self),
+            }
+        }
+
+        fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::Seq(ref v) => visit_content_seq_ref(v, visitor),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_tuple<V>(self, _len: usize, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_seq(visitor)
+        }
+
+        fn deserialize_tuple_struct<V>(
+            self,
+            _name: &'static str,
+            _len: usize,
+            visitor: V,
+        ) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            self.deserialize_seq(visitor)
+        }
+
+        fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::Map(ref v) => visit_content_map_ref(v, visitor),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_struct<V>(
+            self,
+            _name: &'static str,
+            _fields: &'static [&'static str],
+            visitor: V,
+        ) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::Seq(ref v) => visit_content_seq_ref(v, visitor),
+                Content::Map(ref v) => visit_content_map_ref(v, visitor),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_enum<V>(
+            self,
+            _name: &str,
+            _variants: &'static [&'static str],
+            visitor: V,
+        ) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            let (variant, value) = match *self.content {
+                Content::Map(ref value) => {
+                    let mut iter = value.iter();
+                    let &(ref variant, ref value) = match iter.next() {
+                        Some(v) => v,
+                        None => {
+                            return Err(de::Error::invalid_value(
+                                de::Unexpected::Map,
+                                &"map with a single key",
+                            ));
+                        }
+                    };
+                    // enums are encoded in json as maps with a single key:value pair
+                    if iter.next().is_some() {
+                        return Err(de::Error::invalid_value(
+                            de::Unexpected::Map,
+                            &"map with a single key",
+                        ));
+                    }
+                    (variant, Some(value))
+                }
+                ref s @ Content::String(_) | ref s @ Content::Str(_) => (s, None),
+                ref other => {
+                    return Err(de::Error::invalid_type(
+                        other.unexpected(),
+                        &"string or map",
+                    ));
+                }
+            };
+
+            visitor.visit_enum(EnumRefDeserializer {
+                variant: variant,
+                value: value,
+                err: PhantomData,
+            })
+        }
+
+        fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            match *self.content {
+                Content::String(ref v) => visitor.visit_str(v),
+                Content::Str(v) => visitor.visit_borrowed_str(v),
+                Content::ByteBuf(ref v) => visitor.visit_bytes(v),
+                Content::Bytes(v) => visitor.visit_borrowed_bytes(v),
+                Content::U8(v) => visitor.visit_u8(v),
+                Content::U64(v) => visitor.visit_u64(v),
+                _ => Err(self.invalid_type(&visitor)),
+            }
+        }
+
+        fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: Visitor<'de>,
+        {
+            visitor.visit_unit()
+        }
+    }
+
+    impl<'a, 'de, E> ContentRefDeserializer<'a, 'de, E> {
+        /// private API, don't use
+        pub fn new(content: &'a Content<'de>) -> Self {
+            ContentRefDeserializer {
+                content: content,
+                err: PhantomData,
+            }
+        }
+    }
+
+    struct EnumRefDeserializer<'a, 'de: 'a, E>
+    where
+        E: de::Error,
+    {
+        variant: &'a Content<'de>,
+        value: Option<&'a Content<'de>>,
+        err: PhantomData<E>,
+    }
+
+    impl<'de, 'a, E> de::EnumAccess<'de> for EnumRefDeserializer<'a, 'de, E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+        type Variant = VariantRefDeserializer<'a, 'de, Self::Error>;
+
+        fn variant_seed<V>(self, seed: V) -> Result<(V::Value, Self::Variant), Self::Error>
+        where
+            V: de::DeserializeSeed<'de>,
+        {
+            let visitor = VariantRefDeserializer {
+                value: self.value,
+                err: PhantomData,
+            };
+            seed.deserialize(ContentRefDeserializer::new(self.variant))
+                .map(|v| (v, visitor))
+        }
+    }
+
+    struct VariantRefDeserializer<'a, 'de: 'a, E>
+    where
+        E: de::Error,
+    {
+        value: Option<&'a Content<'de>>,
+        err: PhantomData<E>,
+    }
+
+    impl<'de, 'a, E> de::VariantAccess<'de> for VariantRefDeserializer<'a, 'de, E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+
+        fn unit_variant(self) -> Result<(), E> {
+            match self.value {
+                Some(value) => de::Deserialize::deserialize(ContentRefDeserializer::new(value)),
+                None => Ok(()),
+            }
+        }
+
+        fn newtype_variant_seed<T>(self, seed: T) -> Result<T::Value, E>
+        where
+            T: de::DeserializeSeed<'de>,
+        {
+            match self.value {
+                Some(value) => seed.deserialize(ContentRefDeserializer::new(value)),
+                None => Err(de::Error::invalid_type(
+                    de::Unexpected::UnitVariant,
+                    &"newtype variant",
+                )),
+            }
+        }
+
+        fn tuple_variant<V>(self, _len: usize, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: de::Visitor<'de>,
+        {
+            match self.value {
+                Some(&Content::Seq(ref v)) => {
+                    de::Deserializer::deserialize_any(SeqRefDeserializer::new(v), visitor)
+                }
+                Some(other) => Err(de::Error::invalid_type(
+                    other.unexpected(),
+                    &"tuple variant",
+                )),
+                None => Err(de::Error::invalid_type(
+                    de::Unexpected::UnitVariant,
+                    &"tuple variant",
+                )),
+            }
+        }
+
+        fn struct_variant<V>(
+            self,
+            _fields: &'static [&'static str],
+            visitor: V,
+        ) -> Result<V::Value, Self::Error>
+        where
+            V: de::Visitor<'de>,
+        {
+            match self.value {
+                Some(&Content::Map(ref v)) => {
+                    de::Deserializer::deserialize_any(MapRefDeserializer::new(v), visitor)
+                }
+                Some(&Content::Seq(ref v)) => {
+                    de::Deserializer::deserialize_any(SeqRefDeserializer::new(v), visitor)
+                }
+                Some(other) => Err(de::Error::invalid_type(
+                    other.unexpected(),
+                    &"struct variant",
+                )),
+                _ => Err(de::Error::invalid_type(
+                    de::Unexpected::UnitVariant,
+                    &"struct variant",
+                )),
+            }
+        }
+    }
+
+    struct SeqRefDeserializer<'a, 'de: 'a, E>
+    where
+        E: de::Error,
+    {
+        iter: <&'a [Content<'de>] as IntoIterator>::IntoIter,
+        err: PhantomData<E>,
+    }
+
+    impl<'a, 'de, E> SeqRefDeserializer<'a, 'de, E>
+    where
+        E: de::Error,
+    {
+        fn new(slice: &'a [Content<'de>]) -> Self {
+            SeqRefDeserializer {
+                iter: slice.iter(),
+                err: PhantomData,
+            }
+        }
+    }
+
+    impl<'de, 'a, E> de::Deserializer<'de> for SeqRefDeserializer<'a, 'de, E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+
+        #[inline]
+        fn deserialize_any<V>(mut self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: de::Visitor<'de>,
+        {
+            let len = self.iter.len();
+            if len == 0 {
+                visitor.visit_unit()
+            } else {
+                let ret = try!(visitor.visit_seq(&mut self));
+                let remaining = self.iter.len();
+                if remaining == 0 {
+                    Ok(ret)
+                } else {
+                    Err(de::Error::invalid_length(len, &"fewer elements in array"))
+                }
+            }
+        }
+
+        forward_to_deserialize_any! {
+            bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+            bytes byte_buf option unit unit_struct newtype_struct seq tuple
+            tuple_struct map struct enum identifier ignored_any
+        }
+    }
+
+    impl<'de, 'a, E> de::SeqAccess<'de> for SeqRefDeserializer<'a, 'de, E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+
+        fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
+        where
+            T: de::DeserializeSeed<'de>,
+        {
+            match self.iter.next() {
+                Some(value) => seed
+                    .deserialize(ContentRefDeserializer::new(value))
+                    .map(Some),
+                None => Ok(None),
+            }
+        }
+
+        fn size_hint(&self) -> Option<usize> {
+            size_hint::from_bounds(&self.iter)
+        }
+    }
+
+    struct MapRefDeserializer<'a, 'de: 'a, E>
+    where
+        E: de::Error,
+    {
+        iter: <&'a [(Content<'de>, Content<'de>)] as IntoIterator>::IntoIter,
+        value: Option<&'a Content<'de>>,
+        err: PhantomData<E>,
+    }
+
+    impl<'a, 'de, E> MapRefDeserializer<'a, 'de, E>
+    where
+        E: de::Error,
+    {
+        fn new(map: &'a [(Content<'de>, Content<'de>)]) -> Self {
+            MapRefDeserializer {
+                iter: map.iter(),
+                value: None,
+                err: PhantomData,
+            }
+        }
+    }
+
+    impl<'de, 'a, E> de::MapAccess<'de> for MapRefDeserializer<'a, 'de, E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+
+        fn next_key_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
+        where
+            T: de::DeserializeSeed<'de>,
+        {
+            match self.iter.next() {
+                Some(&(ref key, ref value)) => {
+                    self.value = Some(value);
+                    seed.deserialize(ContentRefDeserializer::new(key)).map(Some)
+                }
+                None => Ok(None),
+            }
+        }
+
+        fn next_value_seed<T>(&mut self, seed: T) -> Result<T::Value, Self::Error>
+        where
+            T: de::DeserializeSeed<'de>,
+        {
+            match self.value.take() {
+                Some(value) => seed.deserialize(ContentRefDeserializer::new(value)),
+                None => Err(de::Error::custom("value is missing")),
+            }
+        }
+
+        fn size_hint(&self) -> Option<usize> {
+            size_hint::from_bounds(&self.iter)
+        }
+    }
+
+    impl<'de, 'a, E> de::Deserializer<'de> for MapRefDeserializer<'a, 'de, E>
+    where
+        E: de::Error,
+    {
+        type Error = E;
+
+        #[inline]
+        fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+        where
+            V: de::Visitor<'de>,
+        {
+            visitor.visit_map(self)
+        }
+
+        forward_to_deserialize_any! {
+            bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+            bytes byte_buf option unit unit_struct newtype_struct seq tuple
+            tuple_struct map struct enum identifier ignored_any
+        }
+    }
+
+    impl<'de, E> de::IntoDeserializer<'de, E> for ContentDeserializer<'de, E>
+    where
+        E: de::Error,
+    {
+        type Deserializer = Self;
+
+        fn into_deserializer(self) -> Self {
+            self
+        }
+    }
+
+    impl<'de, 'a, E> de::IntoDeserializer<'de, E> for ContentRefDeserializer<'a, 'de, E>
+    where
+        E: de::Error,
+    {
+        type Deserializer = Self;
+
+        fn into_deserializer(self) -> Self {
+            self
+        }
+    }
+
+    /// Visitor for deserializing an internally tagged unit variant.
+    ///
+    /// Not public API.
+    pub struct InternallyTaggedUnitVisitor<'a> {
+        type_name: &'a str,
+        variant_name: &'a str,
+    }
+
+    impl<'a> InternallyTaggedUnitVisitor<'a> {
+        /// Not public API.
+        pub fn new(type_name: &'a str, variant_name: &'a str) -> Self {
+            InternallyTaggedUnitVisitor {
+                type_name: type_name,
+                variant_name: variant_name,
+            }
+        }
+    }
+
+    impl<'de, 'a> Visitor<'de> for InternallyTaggedUnitVisitor<'a> {
+        type Value = ();
+
+        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            write!(
+                formatter,
+                "unit variant {}::{}",
+                self.type_name, self.variant_name
+            )
+        }
+
+        fn visit_seq<S>(self, _: S) -> Result<(), S::Error>
+        where
+            S: SeqAccess<'de>,
+        {
+            Ok(())
+        }
+
+        fn visit_map<M>(self, mut access: M) -> Result<(), M::Error>
+        where
+            M: MapAccess<'de>,
+        {
+            while let Some(_) = try!(access.next_entry::<IgnoredAny, IgnoredAny>()) {}
+            Ok(())
+        }
+    }
+
+    /// Visitor for deserializing an untagged unit variant.
+    ///
+    /// Not public API.
+    pub struct UntaggedUnitVisitor<'a> {
+        type_name: &'a str,
+        variant_name: &'a str,
+    }
+
+    impl<'a> UntaggedUnitVisitor<'a> {
+        /// Not public API.
+        pub fn new(type_name: &'a str, variant_name: &'a str) -> Self {
+            UntaggedUnitVisitor {
+                type_name: type_name,
+                variant_name: variant_name,
+            }
+        }
+    }
+
+    impl<'de, 'a> Visitor<'de> for UntaggedUnitVisitor<'a> {
+        type Value = ();
+
+        fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            write!(
+                formatter,
+                "unit variant {}::{}",
+                self.type_name, self.variant_name
+            )
+        }
+
+        fn visit_unit<E>(self) -> Result<(), E>
+        where
+            E: de::Error,
+        {
+            Ok(())
+        }
+
+        fn visit_none<E>(self) -> Result<(), E>
+        where
+            E: de::Error,
+        {
+            Ok(())
+        }
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+// Like `IntoDeserializer` but also implemented for `&[u8]`. This is used for
+// the newtype fallthrough case of `field_identifier`.
+//
+//    #[derive(Deserialize)]
+//    #[serde(field_identifier)]
+//    enum F {
+//        A,
+//        B,
+//        Other(String), // deserialized using IdentifierDeserializer
+//    }
+pub trait IdentifierDeserializer<'de, E: Error> {
+    type Deserializer: Deserializer<'de, Error = E>;
+
+    fn from(self) -> Self::Deserializer;
+}
+
+impl<'de, E> IdentifierDeserializer<'de, E> for u32
+where
+    E: Error,
+{
+    type Deserializer = <u32 as IntoDeserializer<'de, E>>::Deserializer;
+
+    fn from(self) -> Self::Deserializer {
+        self.into_deserializer()
+    }
+}
+
+pub struct StrDeserializer<'a, E> {
+    value: &'a str,
+    marker: PhantomData<E>,
+}
+
+impl<'a, E> IdentifierDeserializer<'a, E> for &'a str
+where
+    E: Error,
+{
+    type Deserializer = StrDeserializer<'a, E>;
+
+    fn from(self) -> Self::Deserializer {
+        StrDeserializer {
+            value: self,
+            marker: PhantomData,
+        }
+    }
+}
+
+impl<'de, 'a, E> Deserializer<'de> for StrDeserializer<'a, E>
+where
+    E: Error,
+{
+    type Error = E;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>,
+    {
+        visitor.visit_str(self.value)
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct enum identifier ignored_any
+    }
+}
+
+pub struct BytesDeserializer<'a, E> {
+    value: &'a [u8],
+    marker: PhantomData<E>,
+}
+
+impl<'a, E> IdentifierDeserializer<'a, E> for &'a [u8]
+where
+    E: Error,
+{
+    type Deserializer = BytesDeserializer<'a, E>;
+
+    fn from(self) -> Self::Deserializer {
+        BytesDeserializer {
+            value: self,
+            marker: PhantomData,
+        }
+    }
+}
+
+impl<'de, 'a, E> Deserializer<'de> for BytesDeserializer<'a, E>
+where
+    E: Error,
+{
+    type Error = E;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>,
+    {
+        visitor.visit_bytes(self.value)
+    }
+
+    forward_to_deserialize_any! {
+        bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string
+        bytes byte_buf option unit unit_struct newtype_struct seq tuple
+        tuple_struct map struct enum identifier ignored_any
+    }
+}
+
+/// A DeserializeSeed helper for implementing deserialize_in_place Visitors.
+///
+/// Wraps a mutable reference and calls deserialize_in_place on it.
+pub struct InPlaceSeed<'a, T: 'a>(pub &'a mut T);
+
+impl<'a, 'de, T> DeserializeSeed<'de> for InPlaceSeed<'a, T>
+where
+    T: Deserialize<'de>,
+{
+    type Value = ();
+    fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        T::deserialize_in_place(deserializer, self.0)
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+pub struct FlatMapDeserializer<'a, 'de: 'a, E>(
+    pub &'a mut Vec<Option<(Content<'de>, Content<'de>)>>,
+    pub PhantomData<E>,
+);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, 'de, E> FlatMapDeserializer<'a, 'de, E>
+where
+    E: Error,
+{
+    fn deserialize_other<V>() -> Result<V, E> {
+        Err(Error::custom("can only flatten structs and maps"))
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+macro_rules! forward_to_deserialize_other {
+    ($($func:ident ( $($arg:ty),* ))*) => {
+        $(
+            fn $func<V>(self, $(_: $arg,)* _visitor: V) -> Result<V::Value, Self::Error>
+            where
+                V: Visitor<'de>,
+            {
+                Self::deserialize_other()
+            }
+        )*
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, 'de, E> Deserializer<'de> for FlatMapDeserializer<'a, 'de, E>
+where
+    E: Error,
+{
+    type Error = E;
+
+    fn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>,
+    {
+        visitor.visit_map(FlatInternallyTaggedAccess {
+            iter: self.0.iter_mut(),
+            pending: None,
+            _marker: PhantomData,
+        })
+    }
+
+    fn deserialize_enum<V>(
+        self,
+        name: &'static str,
+        variants: &'static [&'static str],
+        visitor: V,
+    ) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>,
+    {
+        for item in self.0.iter_mut() {
+            // items in the vector are nulled out when used.  So we can only use
+            // an item if it's still filled in and if the field is one we care
+            // about.
+            let use_item = match *item {
+                None => false,
+                Some((ref c, _)) => c.as_str().map_or(false, |x| variants.contains(&x)),
+            };
+
+            if use_item {
+                let (key, value) = item.take().unwrap();
+                return visitor.visit_enum(EnumDeserializer::new(key, Some(value)));
+            }
+        }
+
+        Err(Error::custom(format_args!(
+            "no variant of enum {} found in flattened data",
+            name
+        )))
+    }
+
+    fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>,
+    {
+        visitor.visit_map(FlatMapAccess::new(self.0.iter()))
+    }
+
+    fn deserialize_struct<V>(
+        self,
+        _: &'static str,
+        fields: &'static [&'static str],
+        visitor: V,
+    ) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>,
+    {
+        visitor.visit_map(FlatStructAccess::new(self.0.iter_mut(), fields))
+    }
+
+    fn deserialize_newtype_struct<V>(self, _name: &str, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>,
+    {
+        visitor.visit_newtype_struct(self)
+    }
+
+    fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Self::Error>
+    where
+        V: Visitor<'de>,
+    {
+        match visitor.__private_visit_untagged_option(self) {
+            Ok(value) => Ok(value),
+            Err(()) => Self::deserialize_other(),
+        }
+    }
+
+    forward_to_deserialize_other! {
+        deserialize_bool()
+        deserialize_i8()
+        deserialize_i16()
+        deserialize_i32()
+        deserialize_i64()
+        deserialize_u8()
+        deserialize_u16()
+        deserialize_u32()
+        deserialize_u64()
+        deserialize_f32()
+        deserialize_f64()
+        deserialize_char()
+        deserialize_str()
+        deserialize_string()
+        deserialize_bytes()
+        deserialize_byte_buf()
+        deserialize_unit()
+        deserialize_unit_struct(&'static str)
+        deserialize_seq()
+        deserialize_tuple(usize)
+        deserialize_tuple_struct(&'static str, usize)
+        deserialize_identifier()
+        deserialize_ignored_any()
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+pub struct FlatMapAccess<'a, 'de: 'a, E> {
+    iter: slice::Iter<'a, Option<(Content<'de>, Content<'de>)>>,
+    pending_content: Option<&'a Content<'de>>,
+    _marker: PhantomData<E>,
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, 'de, E> FlatMapAccess<'a, 'de, E> {
+    fn new(
+        iter: slice::Iter<'a, Option<(Content<'de>, Content<'de>)>>,
+    ) -> FlatMapAccess<'a, 'de, E> {
+        FlatMapAccess {
+            iter: iter,
+            pending_content: None,
+            _marker: PhantomData,
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, 'de, E> MapAccess<'de> for FlatMapAccess<'a, 'de, E>
+where
+    E: Error,
+{
+    type Error = E;
+
+    fn next_key_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
+    where
+        T: DeserializeSeed<'de>,
+    {
+        while let Some(item) = self.iter.next() {
+            // Items in the vector are nulled out when used by a struct.
+            if let Some((ref key, ref content)) = *item {
+                self.pending_content = Some(content);
+                return seed.deserialize(ContentRefDeserializer::new(key)).map(Some);
+            }
+        }
+        Ok(None)
+    }
+
+    fn next_value_seed<T>(&mut self, seed: T) -> Result<T::Value, Self::Error>
+    where
+        T: DeserializeSeed<'de>,
+    {
+        match self.pending_content.take() {
+            Some(value) => seed.deserialize(ContentRefDeserializer::new(value)),
+            None => Err(Error::custom("value is missing")),
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+pub struct FlatStructAccess<'a, 'de: 'a, E> {
+    iter: slice::IterMut<'a, Option<(Content<'de>, Content<'de>)>>,
+    pending_content: Option<Content<'de>>,
+    fields: &'static [&'static str],
+    _marker: PhantomData<E>,
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, 'de, E> FlatStructAccess<'a, 'de, E> {
+    fn new(
+        iter: slice::IterMut<'a, Option<(Content<'de>, Content<'de>)>>,
+        fields: &'static [&'static str],
+    ) -> FlatStructAccess<'a, 'de, E> {
+        FlatStructAccess {
+            iter: iter,
+            pending_content: None,
+            fields: fields,
+            _marker: PhantomData,
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, 'de, E> MapAccess<'de> for FlatStructAccess<'a, 'de, E>
+where
+    E: Error,
+{
+    type Error = E;
+
+    fn next_key_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
+    where
+        T: DeserializeSeed<'de>,
+    {
+        while let Some(item) = self.iter.next() {
+            // items in the vector are nulled out when used.  So we can only use
+            // an item if it's still filled in and if the field is one we care
+            // about.  In case we do not know which fields we want, we take them all.
+            let use_item = match *item {
+                None => false,
+                Some((ref c, _)) => c.as_str().map_or(false, |key| self.fields.contains(&key)),
+            };
+
+            if use_item {
+                let (key, content) = item.take().unwrap();
+                self.pending_content = Some(content);
+                return seed.deserialize(ContentDeserializer::new(key)).map(Some);
+            }
+        }
+        Ok(None)
+    }
+
+    fn next_value_seed<T>(&mut self, seed: T) -> Result<T::Value, Self::Error>
+    where
+        T: DeserializeSeed<'de>,
+    {
+        match self.pending_content.take() {
+            Some(value) => seed.deserialize(ContentDeserializer::new(value)),
+            None => Err(Error::custom("value is missing")),
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+pub struct FlatInternallyTaggedAccess<'a, 'de: 'a, E> {
+    iter: slice::IterMut<'a, Option<(Content<'de>, Content<'de>)>>,
+    pending: Option<&'a Content<'de>>,
+    _marker: PhantomData<E>,
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, 'de, E> MapAccess<'de> for FlatInternallyTaggedAccess<'a, 'de, E>
+where
+    E: Error,
+{
+    type Error = E;
+
+    fn next_key_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error>
+    where
+        T: DeserializeSeed<'de>,
+    {
+        while let Some(item) = self.iter.next() {
+            if let Some((ref key, ref content)) = *item {
+                // Do not take(), instead borrow this entry. The internally tagged
+                // enum does its own buffering so we can't tell whether this entry
+                // is going to be consumed. Borrowing here leaves the entry
+                // available for later flattened fields.
+                self.pending = Some(content);
+                return seed.deserialize(ContentRefDeserializer::new(key)).map(Some);
+            }
+        }
+        Ok(None)
+    }
+
+    fn next_value_seed<T>(&mut self, seed: T) -> Result<T::Value, Self::Error>
+    where
+        T: DeserializeSeed<'de>,
+    {
+        match self.pending.take() {
+            Some(value) => seed.deserialize(ContentRefDeserializer::new(value)),
+            None => panic!("value is missing"),
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde/private/macros.rs.html b/src/serde/private/macros.rs.html new file mode 100644 index 0000000..e15fe3c --- /dev/null +++ b/src/serde/private/macros.rs.html @@ -0,0 +1,283 @@ +macros.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __private_serialize {
+    () => {
+        trait Serialize {
+            fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+            where
+                S: $crate::Serializer;
+        }
+    };
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __private_deserialize {
+    () => {
+        trait Deserialize<'de>: Sized {
+            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+            where
+                D: $crate::Deserializer<'de>;
+        }
+    };
+}
+
+/// Used only by Serde doc tests. Not public API.
+#[doc(hidden)]
+#[macro_export(local_inner_macros)]
+macro_rules! __serialize_unimplemented {
+    ($($func:ident)*) => {
+        $(
+            __serialize_unimplemented_helper!($func);
+        )*
+    };
+}
+
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __serialize_unimplemented_method {
+    ($func:ident $(<$t:ident>)* ($($arg:ty),*) -> $ret:ident) => {
+        fn $func $(<$t: ?Sized + $crate::Serialize>)* (self $(, _: $arg)*) -> $crate::export::Result<Self::$ret, Self::Error> {
+            unimplemented!()
+        }
+    };
+}
+
+#[doc(hidden)]
+#[macro_export(local_inner_macros)]
+macro_rules! __serialize_unimplemented_helper {
+    (bool) => {
+        __serialize_unimplemented_method!(serialize_bool(bool) -> Ok);
+    };
+    (i8) => {
+        __serialize_unimplemented_method!(serialize_i8(i8) -> Ok);
+    };
+    (i16) => {
+        __serialize_unimplemented_method!(serialize_i16(i16) -> Ok);
+    };
+    (i32) => {
+        __serialize_unimplemented_method!(serialize_i32(i32) -> Ok);
+    };
+    (i64) => {
+        __serialize_unimplemented_method!(serialize_i64(i64) -> Ok);
+    };
+    (u8) => {
+        __serialize_unimplemented_method!(serialize_u8(u8) -> Ok);
+    };
+    (u16) => {
+        __serialize_unimplemented_method!(serialize_u16(u16) -> Ok);
+    };
+    (u32) => {
+        __serialize_unimplemented_method!(serialize_u32(u32) -> Ok);
+    };
+    (u64) => {
+        __serialize_unimplemented_method!(serialize_u64(u64) -> Ok);
+    };
+    (f32) => {
+        __serialize_unimplemented_method!(serialize_f32(f32) -> Ok);
+    };
+    (f64) => {
+        __serialize_unimplemented_method!(serialize_f64(f64) -> Ok);
+    };
+    (char) => {
+        __serialize_unimplemented_method!(serialize_char(char) -> Ok);
+    };
+    (str) => {
+        __serialize_unimplemented_method!(serialize_str(&str) -> Ok);
+    };
+    (bytes) => {
+        __serialize_unimplemented_method!(serialize_bytes(&[u8]) -> Ok);
+    };
+    (none) => {
+        __serialize_unimplemented_method!(serialize_none() -> Ok);
+    };
+    (some) => {
+        __serialize_unimplemented_method!(serialize_some<T>(&T) -> Ok);
+    };
+    (unit) => {
+        __serialize_unimplemented_method!(serialize_unit() -> Ok);
+    };
+    (unit_struct) => {
+        __serialize_unimplemented_method!(serialize_unit_struct(&str) -> Ok);
+    };
+    (unit_variant) => {
+        __serialize_unimplemented_method!(serialize_unit_variant(&str, u32, &str) -> Ok);
+    };
+    (newtype_struct) => {
+        __serialize_unimplemented_method!(serialize_newtype_struct<T>(&str, &T) -> Ok);
+    };
+    (newtype_variant) => {
+        __serialize_unimplemented_method!(serialize_newtype_variant<T>(&str, u32, &str, &T) -> Ok);
+    };
+    (seq) => {
+        type SerializeSeq = $crate::ser::Impossible<Self::Ok, Self::Error>;
+        __serialize_unimplemented_method!(serialize_seq(Option<usize>) -> SerializeSeq);
+    };
+    (tuple) => {
+        type SerializeTuple = $crate::ser::Impossible<Self::Ok, Self::Error>;
+        __serialize_unimplemented_method!(serialize_tuple(usize) -> SerializeTuple);
+    };
+    (tuple_struct) => {
+        type SerializeTupleStruct = $crate::ser::Impossible<Self::Ok, Self::Error>;
+        __serialize_unimplemented_method!(serialize_tuple_struct(&str, usize) -> SerializeTupleStruct);
+    };
+    (tuple_variant) => {
+        type SerializeTupleVariant = $crate::ser::Impossible<Self::Ok, Self::Error>;
+        __serialize_unimplemented_method!(serialize_tuple_variant(&str, u32, &str, usize) -> SerializeTupleVariant);
+    };
+    (map) => {
+        type SerializeMap = $crate::ser::Impossible<Self::Ok, Self::Error>;
+        __serialize_unimplemented_method!(serialize_map(Option<usize>) -> SerializeMap);
+    };
+    (struct) => {
+        type SerializeStruct = $crate::ser::Impossible<Self::Ok, Self::Error>;
+        __serialize_unimplemented_method!(serialize_struct(&str, usize) -> SerializeStruct);
+    };
+    (struct_variant) => {
+        type SerializeStructVariant = $crate::ser::Impossible<Self::Ok, Self::Error>;
+        __serialize_unimplemented_method!(serialize_struct_variant(&str, u32, &str, usize) -> SerializeStructVariant);
+    };
+}
+
+
\ No newline at end of file diff --git a/src/serde/private/mod.rs.html b/src/serde/private/mod.rs.html new file mode 100644 index 0000000..b8dc5da --- /dev/null +++ b/src/serde/private/mod.rs.html @@ -0,0 +1,11 @@ +mod.rs.html -- source
1
+2
+3
+4
+
+mod macros;
+
+pub mod de;
+pub mod ser;
+
+
\ No newline at end of file diff --git a/src/serde/private/ser.rs.html b/src/serde/private/ser.rs.html new file mode 100644 index 0000000..e876f89 --- /dev/null +++ b/src/serde/private/ser.rs.html @@ -0,0 +1,2655 @@ +ser.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+
+use lib::*;
+
+use ser::{self, Impossible, Serialize, SerializeMap, SerializeStruct, Serializer};
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+use self::content::{
+    Content, ContentSerializer, SerializeStructVariantAsMapValue, SerializeTupleVariantAsMapValue,
+};
+
+/// Used to check that serde(getter) attributes return the expected type.
+/// Not public API.
+pub fn constrain<T: ?Sized>(t: &T) -> &T {
+    t
+}
+
+/// Not public API.
+pub fn serialize_tagged_newtype<S, T>(
+    serializer: S,
+    type_ident: &'static str,
+    variant_ident: &'static str,
+    tag: &'static str,
+    variant_name: &'static str,
+    value: &T,
+) -> Result<S::Ok, S::Error>
+where
+    S: Serializer,
+    T: Serialize,
+{
+    value.serialize(TaggedSerializer {
+        type_ident: type_ident,
+        variant_ident: variant_ident,
+        tag: tag,
+        variant_name: variant_name,
+        delegate: serializer,
+    })
+}
+
+struct TaggedSerializer<S> {
+    type_ident: &'static str,
+    variant_ident: &'static str,
+    tag: &'static str,
+    variant_name: &'static str,
+    delegate: S,
+}
+
+enum Unsupported {
+    Boolean,
+    Integer,
+    Float,
+    Char,
+    String,
+    ByteArray,
+    Optional,
+    Unit,
+    #[cfg(any(feature = "std", feature = "alloc"))]
+    UnitStruct,
+    Sequence,
+    Tuple,
+    TupleStruct,
+    Enum,
+}
+
+impl Display for Unsupported {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match *self {
+            Unsupported::Boolean => formatter.write_str("a boolean"),
+            Unsupported::Integer => formatter.write_str("an integer"),
+            Unsupported::Float => formatter.write_str("a float"),
+            Unsupported::Char => formatter.write_str("a char"),
+            Unsupported::String => formatter.write_str("a string"),
+            Unsupported::ByteArray => formatter.write_str("a byte array"),
+            Unsupported::Optional => formatter.write_str("an optional"),
+            Unsupported::Unit => formatter.write_str("unit"),
+            #[cfg(any(feature = "std", feature = "alloc"))]
+            Unsupported::UnitStruct => formatter.write_str("unit struct"),
+            Unsupported::Sequence => formatter.write_str("a sequence"),
+            Unsupported::Tuple => formatter.write_str("a tuple"),
+            Unsupported::TupleStruct => formatter.write_str("a tuple struct"),
+            Unsupported::Enum => formatter.write_str("an enum"),
+        }
+    }
+}
+
+impl<S> TaggedSerializer<S>
+where
+    S: Serializer,
+{
+    fn bad_type(self, what: Unsupported) -> S::Error {
+        ser::Error::custom(format_args!(
+            "cannot serialize tagged newtype variant {}::{} containing {}",
+            self.type_ident, self.variant_ident, what
+        ))
+    }
+}
+
+impl<S> Serializer for TaggedSerializer<S>
+where
+    S: Serializer,
+{
+    type Ok = S::Ok;
+    type Error = S::Error;
+
+    type SerializeSeq = Impossible<S::Ok, S::Error>;
+    type SerializeTuple = Impossible<S::Ok, S::Error>;
+    type SerializeTupleStruct = Impossible<S::Ok, S::Error>;
+    type SerializeMap = S::SerializeMap;
+    type SerializeStruct = S::SerializeStruct;
+
+    #[cfg(not(any(feature = "std", feature = "alloc")))]
+    type SerializeTupleVariant = Impossible<S::Ok, S::Error>;
+    #[cfg(any(feature = "std", feature = "alloc"))]
+    type SerializeTupleVariant = SerializeTupleVariantAsMapValue<S::SerializeMap>;
+
+    #[cfg(not(any(feature = "std", feature = "alloc")))]
+    type SerializeStructVariant = Impossible<S::Ok, S::Error>;
+    #[cfg(any(feature = "std", feature = "alloc"))]
+    type SerializeStructVariant = SerializeStructVariantAsMapValue<S::SerializeMap>;
+
+    fn serialize_bool(self, _: bool) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::Boolean))
+    }
+
+    fn serialize_i8(self, _: i8) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_i16(self, _: i16) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_i32(self, _: i32) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_i64(self, _: i64) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_u8(self, _: u8) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_u16(self, _: u16) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_u32(self, _: u32) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_u64(self, _: u64) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_f32(self, _: f32) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::Float))
+    }
+
+    fn serialize_f64(self, _: f64) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::Float))
+    }
+
+    fn serialize_char(self, _: char) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::Char))
+    }
+
+    fn serialize_str(self, _: &str) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::String))
+    }
+
+    fn serialize_bytes(self, _: &[u8]) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::ByteArray))
+    }
+
+    fn serialize_none(self) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::Optional))
+    }
+
+    fn serialize_some<T: ?Sized>(self, _: &T) -> Result<Self::Ok, Self::Error>
+    where
+        T: Serialize,
+    {
+        Err(self.bad_type(Unsupported::Optional))
+    }
+
+    fn serialize_unit(self) -> Result<Self::Ok, Self::Error> {
+        Err(self.bad_type(Unsupported::Unit))
+    }
+
+    fn serialize_unit_struct(self, _: &'static str) -> Result<Self::Ok, Self::Error> {
+        let mut map = try!(self.delegate.serialize_map(Some(1)));
+        try!(map.serialize_entry(self.tag, self.variant_name));
+        map.end()
+    }
+
+    fn serialize_unit_variant(
+        self,
+        _: &'static str,
+        _: u32,
+        inner_variant: &'static str,
+    ) -> Result<Self::Ok, Self::Error> {
+        let mut map = try!(self.delegate.serialize_map(Some(2)));
+        try!(map.serialize_entry(self.tag, self.variant_name));
+        try!(map.serialize_entry(inner_variant, &()));
+        map.end()
+    }
+
+    fn serialize_newtype_struct<T: ?Sized>(
+        self,
+        _: &'static str,
+        value: &T,
+    ) -> Result<Self::Ok, Self::Error>
+    where
+        T: Serialize,
+    {
+        value.serialize(self)
+    }
+
+    fn serialize_newtype_variant<T: ?Sized>(
+        self,
+        _: &'static str,
+        _: u32,
+        inner_variant: &'static str,
+        inner_value: &T,
+    ) -> Result<Self::Ok, Self::Error>
+    where
+        T: Serialize,
+    {
+        let mut map = try!(self.delegate.serialize_map(Some(2)));
+        try!(map.serialize_entry(self.tag, self.variant_name));
+        try!(map.serialize_entry(inner_variant, inner_value));
+        map.end()
+    }
+
+    fn serialize_seq(self, _: Option<usize>) -> Result<Self::SerializeSeq, Self::Error> {
+        Err(self.bad_type(Unsupported::Sequence))
+    }
+
+    fn serialize_tuple(self, _: usize) -> Result<Self::SerializeTuple, Self::Error> {
+        Err(self.bad_type(Unsupported::Tuple))
+    }
+
+    fn serialize_tuple_struct(
+        self,
+        _: &'static str,
+        _: usize,
+    ) -> Result<Self::SerializeTupleStruct, Self::Error> {
+        Err(self.bad_type(Unsupported::TupleStruct))
+    }
+
+    #[cfg(not(any(feature = "std", feature = "alloc")))]
+    fn serialize_tuple_variant(
+        self,
+        _: &'static str,
+        _: u32,
+        _: &'static str,
+        _: usize,
+    ) -> Result<Self::SerializeTupleVariant, Self::Error> {
+        // Lack of push-based serialization means we need to buffer the content
+        // of the tuple variant, so it requires std.
+        Err(self.bad_type(Unsupported::Enum))
+    }
+
+    #[cfg(any(feature = "std", feature = "alloc"))]
+    fn serialize_tuple_variant(
+        self,
+        _: &'static str,
+        _: u32,
+        inner_variant: &'static str,
+        len: usize,
+    ) -> Result<Self::SerializeTupleVariant, Self::Error> {
+        let mut map = try!(self.delegate.serialize_map(Some(2)));
+        try!(map.serialize_entry(self.tag, self.variant_name));
+        try!(map.serialize_key(inner_variant));
+        Ok(SerializeTupleVariantAsMapValue::new(
+            map,
+            inner_variant,
+            len,
+        ))
+    }
+
+    fn serialize_map(self, len: Option<usize>) -> Result<Self::SerializeMap, Self::Error> {
+        let mut map = try!(self.delegate.serialize_map(len.map(|len| len + 1)));
+        try!(map.serialize_entry(self.tag, self.variant_name));
+        Ok(map)
+    }
+
+    fn serialize_struct(
+        self,
+        name: &'static str,
+        len: usize,
+    ) -> Result<Self::SerializeStruct, Self::Error> {
+        let mut state = try!(self.delegate.serialize_struct(name, len + 1));
+        try!(state.serialize_field(self.tag, self.variant_name));
+        Ok(state)
+    }
+
+    #[cfg(not(any(feature = "std", feature = "alloc")))]
+    fn serialize_struct_variant(
+        self,
+        _: &'static str,
+        _: u32,
+        _: &'static str,
+        _: usize,
+    ) -> Result<Self::SerializeStructVariant, Self::Error> {
+        // Lack of push-based serialization means we need to buffer the content
+        // of the struct variant, so it requires std.
+        Err(self.bad_type(Unsupported::Enum))
+    }
+
+    #[cfg(any(feature = "std", feature = "alloc"))]
+    fn serialize_struct_variant(
+        self,
+        _: &'static str,
+        _: u32,
+        inner_variant: &'static str,
+        len: usize,
+    ) -> Result<Self::SerializeStructVariant, Self::Error> {
+        let mut map = try!(self.delegate.serialize_map(Some(2)));
+        try!(map.serialize_entry(self.tag, self.variant_name));
+        try!(map.serialize_key(inner_variant));
+        Ok(SerializeStructVariantAsMapValue::new(
+            map,
+            inner_variant,
+            len,
+        ))
+    }
+
+    #[cfg(not(any(feature = "std", feature = "alloc")))]
+    fn collect_str<T: ?Sized>(self, _: &T) -> Result<Self::Ok, Self::Error>
+    where
+        T: Display,
+    {
+        Err(self.bad_type(Unsupported::String))
+    }
+}
+
+/// Used only by Serde doc tests. Not public API.
+#[doc(hidden)]
+#[derive(Debug)]
+pub struct Error;
+
+impl ser::Error for Error {
+    fn custom<T>(_: T) -> Self
+    where
+        T: Display,
+    {
+        unimplemented!()
+    }
+}
+
+#[cfg(feature = "std")]
+impl error::Error for Error {
+    fn description(&self) -> &str {
+        unimplemented!()
+    }
+}
+
+impl Display for Error {
+    fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
+        unimplemented!()
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+mod content {
+    use lib::*;
+
+    use ser::{self, Serialize, Serializer};
+
+    pub struct SerializeTupleVariantAsMapValue<M> {
+        map: M,
+        name: &'static str,
+        fields: Vec<Content>,
+    }
+
+    impl<M> SerializeTupleVariantAsMapValue<M> {
+        pub fn new(map: M, name: &'static str, len: usize) -> Self {
+            SerializeTupleVariantAsMapValue {
+                map: map,
+                name: name,
+                fields: Vec::with_capacity(len),
+            }
+        }
+    }
+
+    impl<M> ser::SerializeTupleVariant for SerializeTupleVariantAsMapValue<M>
+    where
+        M: ser::SerializeMap,
+    {
+        type Ok = M::Ok;
+        type Error = M::Error;
+
+        fn serialize_field<T: ?Sized>(&mut self, value: &T) -> Result<(), M::Error>
+        where
+            T: Serialize,
+        {
+            let value = try!(value.serialize(ContentSerializer::<M::Error>::new()));
+            self.fields.push(value);
+            Ok(())
+        }
+
+        fn end(mut self) -> Result<M::Ok, M::Error> {
+            try!(self
+                .map
+                .serialize_value(&Content::TupleStruct(self.name, self.fields)));
+            self.map.end()
+        }
+    }
+
+    pub struct SerializeStructVariantAsMapValue<M> {
+        map: M,
+        name: &'static str,
+        fields: Vec<(&'static str, Content)>,
+    }
+
+    impl<M> SerializeStructVariantAsMapValue<M> {
+        pub fn new(map: M, name: &'static str, len: usize) -> Self {
+            SerializeStructVariantAsMapValue {
+                map: map,
+                name: name,
+                fields: Vec::with_capacity(len),
+            }
+        }
+    }
+
+    impl<M> ser::SerializeStructVariant for SerializeStructVariantAsMapValue<M>
+    where
+        M: ser::SerializeMap,
+    {
+        type Ok = M::Ok;
+        type Error = M::Error;
+
+        fn serialize_field<T: ?Sized>(
+            &mut self,
+            key: &'static str,
+            value: &T,
+        ) -> Result<(), M::Error>
+        where
+            T: Serialize,
+        {
+            let value = try!(value.serialize(ContentSerializer::<M::Error>::new()));
+            self.fields.push((key, value));
+            Ok(())
+        }
+
+        fn end(mut self) -> Result<M::Ok, M::Error> {
+            try!(self
+                .map
+                .serialize_value(&Content::Struct(self.name, self.fields)));
+            self.map.end()
+        }
+    }
+
+    #[derive(Debug)]
+    pub enum Content {
+        Bool(bool),
+
+        U8(u8),
+        U16(u16),
+        U32(u32),
+        U64(u64),
+
+        I8(i8),
+        I16(i16),
+        I32(i32),
+        I64(i64),
+
+        F32(f32),
+        F64(f64),
+
+        Char(char),
+        String(String),
+        Bytes(Vec<u8>),
+
+        None,
+        Some(Box<Content>),
+
+        Unit,
+        UnitStruct(&'static str),
+        UnitVariant(&'static str, u32, &'static str),
+        NewtypeStruct(&'static str, Box<Content>),
+        NewtypeVariant(&'static str, u32, &'static str, Box<Content>),
+
+        Seq(Vec<Content>),
+        Tuple(Vec<Content>),
+        TupleStruct(&'static str, Vec<Content>),
+        TupleVariant(&'static str, u32, &'static str, Vec<Content>),
+        Map(Vec<(Content, Content)>),
+        Struct(&'static str, Vec<(&'static str, Content)>),
+        StructVariant(
+            &'static str,
+            u32,
+            &'static str,
+            Vec<(&'static str, Content)>,
+        ),
+    }
+
+    impl Serialize for Content {
+        fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+        where
+            S: Serializer,
+        {
+            match *self {
+                Content::Bool(b) => serializer.serialize_bool(b),
+                Content::U8(u) => serializer.serialize_u8(u),
+                Content::U16(u) => serializer.serialize_u16(u),
+                Content::U32(u) => serializer.serialize_u32(u),
+                Content::U64(u) => serializer.serialize_u64(u),
+                Content::I8(i) => serializer.serialize_i8(i),
+                Content::I16(i) => serializer.serialize_i16(i),
+                Content::I32(i) => serializer.serialize_i32(i),
+                Content::I64(i) => serializer.serialize_i64(i),
+                Content::F32(f) => serializer.serialize_f32(f),
+                Content::F64(f) => serializer.serialize_f64(f),
+                Content::Char(c) => serializer.serialize_char(c),
+                Content::String(ref s) => serializer.serialize_str(s),
+                Content::Bytes(ref b) => serializer.serialize_bytes(b),
+                Content::None => serializer.serialize_none(),
+                Content::Some(ref c) => serializer.serialize_some(&**c),
+                Content::Unit => serializer.serialize_unit(),
+                Content::UnitStruct(n) => serializer.serialize_unit_struct(n),
+                Content::UnitVariant(n, i, v) => serializer.serialize_unit_variant(n, i, v),
+                Content::NewtypeStruct(n, ref c) => serializer.serialize_newtype_struct(n, &**c),
+                Content::NewtypeVariant(n, i, v, ref c) => {
+                    serializer.serialize_newtype_variant(n, i, v, &**c)
+                }
+                Content::Seq(ref elements) => elements.serialize(serializer),
+                Content::Tuple(ref elements) => {
+                    use ser::SerializeTuple;
+                    let mut tuple = try!(serializer.serialize_tuple(elements.len()));
+                    for e in elements {
+                        try!(tuple.serialize_element(e));
+                    }
+                    tuple.end()
+                }
+                Content::TupleStruct(n, ref fields) => {
+                    use ser::SerializeTupleStruct;
+                    let mut ts = try!(serializer.serialize_tuple_struct(n, fields.len()));
+                    for f in fields {
+                        try!(ts.serialize_field(f));
+                    }
+                    ts.end()
+                }
+                Content::TupleVariant(n, i, v, ref fields) => {
+                    use ser::SerializeTupleVariant;
+                    let mut tv = try!(serializer.serialize_tuple_variant(n, i, v, fields.len()));
+                    for f in fields {
+                        try!(tv.serialize_field(f));
+                    }
+                    tv.end()
+                }
+                Content::Map(ref entries) => {
+                    use ser::SerializeMap;
+                    let mut map = try!(serializer.serialize_map(Some(entries.len())));
+                    for &(ref k, ref v) in entries {
+                        try!(map.serialize_entry(k, v));
+                    }
+                    map.end()
+                }
+                Content::Struct(n, ref fields) => {
+                    use ser::SerializeStruct;
+                    let mut s = try!(serializer.serialize_struct(n, fields.len()));
+                    for &(k, ref v) in fields {
+                        try!(s.serialize_field(k, v));
+                    }
+                    s.end()
+                }
+                Content::StructVariant(n, i, v, ref fields) => {
+                    use ser::SerializeStructVariant;
+                    let mut sv = try!(serializer.serialize_struct_variant(n, i, v, fields.len()));
+                    for &(k, ref v) in fields {
+                        try!(sv.serialize_field(k, v));
+                    }
+                    sv.end()
+                }
+            }
+        }
+    }
+
+    pub struct ContentSerializer<E> {
+        error: PhantomData<E>,
+    }
+
+    impl<E> ContentSerializer<E> {
+        pub fn new() -> Self {
+            ContentSerializer { error: PhantomData }
+        }
+    }
+
+    impl<E> Serializer for ContentSerializer<E>
+    where
+        E: ser::Error,
+    {
+        type Ok = Content;
+        type Error = E;
+
+        type SerializeSeq = SerializeSeq<E>;
+        type SerializeTuple = SerializeTuple<E>;
+        type SerializeTupleStruct = SerializeTupleStruct<E>;
+        type SerializeTupleVariant = SerializeTupleVariant<E>;
+        type SerializeMap = SerializeMap<E>;
+        type SerializeStruct = SerializeStruct<E>;
+        type SerializeStructVariant = SerializeStructVariant<E>;
+
+        fn serialize_bool(self, v: bool) -> Result<Content, E> {
+            Ok(Content::Bool(v))
+        }
+
+        fn serialize_i8(self, v: i8) -> Result<Content, E> {
+            Ok(Content::I8(v))
+        }
+
+        fn serialize_i16(self, v: i16) -> Result<Content, E> {
+            Ok(Content::I16(v))
+        }
+
+        fn serialize_i32(self, v: i32) -> Result<Content, E> {
+            Ok(Content::I32(v))
+        }
+
+        fn serialize_i64(self, v: i64) -> Result<Content, E> {
+            Ok(Content::I64(v))
+        }
+
+        fn serialize_u8(self, v: u8) -> Result<Content, E> {
+            Ok(Content::U8(v))
+        }
+
+        fn serialize_u16(self, v: u16) -> Result<Content, E> {
+            Ok(Content::U16(v))
+        }
+
+        fn serialize_u32(self, v: u32) -> Result<Content, E> {
+            Ok(Content::U32(v))
+        }
+
+        fn serialize_u64(self, v: u64) -> Result<Content, E> {
+            Ok(Content::U64(v))
+        }
+
+        fn serialize_f32(self, v: f32) -> Result<Content, E> {
+            Ok(Content::F32(v))
+        }
+
+        fn serialize_f64(self, v: f64) -> Result<Content, E> {
+            Ok(Content::F64(v))
+        }
+
+        fn serialize_char(self, v: char) -> Result<Content, E> {
+            Ok(Content::Char(v))
+        }
+
+        fn serialize_str(self, value: &str) -> Result<Content, E> {
+            Ok(Content::String(value.to_owned()))
+        }
+
+        fn serialize_bytes(self, value: &[u8]) -> Result<Content, E> {
+            Ok(Content::Bytes(value.to_owned()))
+        }
+
+        fn serialize_none(self) -> Result<Content, E> {
+            Ok(Content::None)
+        }
+
+        fn serialize_some<T: ?Sized>(self, value: &T) -> Result<Content, E>
+        where
+            T: Serialize,
+        {
+            Ok(Content::Some(Box::new(try!(value.serialize(self)))))
+        }
+
+        fn serialize_unit(self) -> Result<Content, E> {
+            Ok(Content::Unit)
+        }
+
+        fn serialize_unit_struct(self, name: &'static str) -> Result<Content, E> {
+            Ok(Content::UnitStruct(name))
+        }
+
+        fn serialize_unit_variant(
+            self,
+            name: &'static str,
+            variant_index: u32,
+            variant: &'static str,
+        ) -> Result<Content, E> {
+            Ok(Content::UnitVariant(name, variant_index, variant))
+        }
+
+        fn serialize_newtype_struct<T: ?Sized>(
+            self,
+            name: &'static str,
+            value: &T,
+        ) -> Result<Content, E>
+        where
+            T: Serialize,
+        {
+            Ok(Content::NewtypeStruct(
+                name,
+                Box::new(try!(value.serialize(self))),
+            ))
+        }
+
+        fn serialize_newtype_variant<T: ?Sized>(
+            self,
+            name: &'static str,
+            variant_index: u32,
+            variant: &'static str,
+            value: &T,
+        ) -> Result<Content, E>
+        where
+            T: Serialize,
+        {
+            Ok(Content::NewtypeVariant(
+                name,
+                variant_index,
+                variant,
+                Box::new(try!(value.serialize(self))),
+            ))
+        }
+
+        fn serialize_seq(self, len: Option<usize>) -> Result<Self::SerializeSeq, E> {
+            Ok(SerializeSeq {
+                elements: Vec::with_capacity(len.unwrap_or(0)),
+                error: PhantomData,
+            })
+        }
+
+        fn serialize_tuple(self, len: usize) -> Result<Self::SerializeTuple, E> {
+            Ok(SerializeTuple {
+                elements: Vec::with_capacity(len),
+                error: PhantomData,
+            })
+        }
+
+        fn serialize_tuple_struct(
+            self,
+            name: &'static str,
+            len: usize,
+        ) -> Result<Self::SerializeTupleStruct, E> {
+            Ok(SerializeTupleStruct {
+                name: name,
+                fields: Vec::with_capacity(len),
+                error: PhantomData,
+            })
+        }
+
+        fn serialize_tuple_variant(
+            self,
+            name: &'static str,
+            variant_index: u32,
+            variant: &'static str,
+            len: usize,
+        ) -> Result<Self::SerializeTupleVariant, E> {
+            Ok(SerializeTupleVariant {
+                name: name,
+                variant_index: variant_index,
+                variant: variant,
+                fields: Vec::with_capacity(len),
+                error: PhantomData,
+            })
+        }
+
+        fn serialize_map(self, len: Option<usize>) -> Result<Self::SerializeMap, E> {
+            Ok(SerializeMap {
+                entries: Vec::with_capacity(len.unwrap_or(0)),
+                key: None,
+                error: PhantomData,
+            })
+        }
+
+        fn serialize_struct(
+            self,
+            name: &'static str,
+            len: usize,
+        ) -> Result<Self::SerializeStruct, E> {
+            Ok(SerializeStruct {
+                name: name,
+                fields: Vec::with_capacity(len),
+                error: PhantomData,
+            })
+        }
+
+        fn serialize_struct_variant(
+            self,
+            name: &'static str,
+            variant_index: u32,
+            variant: &'static str,
+            len: usize,
+        ) -> Result<Self::SerializeStructVariant, E> {
+            Ok(SerializeStructVariant {
+                name: name,
+                variant_index: variant_index,
+                variant: variant,
+                fields: Vec::with_capacity(len),
+                error: PhantomData,
+            })
+        }
+    }
+
+    pub struct SerializeSeq<E> {
+        elements: Vec<Content>,
+        error: PhantomData<E>,
+    }
+
+    impl<E> ser::SerializeSeq for SerializeSeq<E>
+    where
+        E: ser::Error,
+    {
+        type Ok = Content;
+        type Error = E;
+
+        fn serialize_element<T: ?Sized>(&mut self, value: &T) -> Result<(), E>
+        where
+            T: Serialize,
+        {
+            let value = try!(value.serialize(ContentSerializer::<E>::new()));
+            self.elements.push(value);
+            Ok(())
+        }
+
+        fn end(self) -> Result<Content, E> {
+            Ok(Content::Seq(self.elements))
+        }
+    }
+
+    pub struct SerializeTuple<E> {
+        elements: Vec<Content>,
+        error: PhantomData<E>,
+    }
+
+    impl<E> ser::SerializeTuple for SerializeTuple<E>
+    where
+        E: ser::Error,
+    {
+        type Ok = Content;
+        type Error = E;
+
+        fn serialize_element<T: ?Sized>(&mut self, value: &T) -> Result<(), E>
+        where
+            T: Serialize,
+        {
+            let value = try!(value.serialize(ContentSerializer::<E>::new()));
+            self.elements.push(value);
+            Ok(())
+        }
+
+        fn end(self) -> Result<Content, E> {
+            Ok(Content::Tuple(self.elements))
+        }
+    }
+
+    pub struct SerializeTupleStruct<E> {
+        name: &'static str,
+        fields: Vec<Content>,
+        error: PhantomData<E>,
+    }
+
+    impl<E> ser::SerializeTupleStruct for SerializeTupleStruct<E>
+    where
+        E: ser::Error,
+    {
+        type Ok = Content;
+        type Error = E;
+
+        fn serialize_field<T: ?Sized>(&mut self, value: &T) -> Result<(), E>
+        where
+            T: Serialize,
+        {
+            let value = try!(value.serialize(ContentSerializer::<E>::new()));
+            self.fields.push(value);
+            Ok(())
+        }
+
+        fn end(self) -> Result<Content, E> {
+            Ok(Content::TupleStruct(self.name, self.fields))
+        }
+    }
+
+    pub struct SerializeTupleVariant<E> {
+        name: &'static str,
+        variant_index: u32,
+        variant: &'static str,
+        fields: Vec<Content>,
+        error: PhantomData<E>,
+    }
+
+    impl<E> ser::SerializeTupleVariant for SerializeTupleVariant<E>
+    where
+        E: ser::Error,
+    {
+        type Ok = Content;
+        type Error = E;
+
+        fn serialize_field<T: ?Sized>(&mut self, value: &T) -> Result<(), E>
+        where
+            T: Serialize,
+        {
+            let value = try!(value.serialize(ContentSerializer::<E>::new()));
+            self.fields.push(value);
+            Ok(())
+        }
+
+        fn end(self) -> Result<Content, E> {
+            Ok(Content::TupleVariant(
+                self.name,
+                self.variant_index,
+                self.variant,
+                self.fields,
+            ))
+        }
+    }
+
+    pub struct SerializeMap<E> {
+        entries: Vec<(Content, Content)>,
+        key: Option<Content>,
+        error: PhantomData<E>,
+    }
+
+    impl<E> ser::SerializeMap for SerializeMap<E>
+    where
+        E: ser::Error,
+    {
+        type Ok = Content;
+        type Error = E;
+
+        fn serialize_key<T: ?Sized>(&mut self, key: &T) -> Result<(), E>
+        where
+            T: Serialize,
+        {
+            let key = try!(key.serialize(ContentSerializer::<E>::new()));
+            self.key = Some(key);
+            Ok(())
+        }
+
+        fn serialize_value<T: ?Sized>(&mut self, value: &T) -> Result<(), E>
+        where
+            T: Serialize,
+        {
+            let key = self
+                .key
+                .take()
+                .expect("serialize_value called before serialize_key");
+            let value = try!(value.serialize(ContentSerializer::<E>::new()));
+            self.entries.push((key, value));
+            Ok(())
+        }
+
+        fn end(self) -> Result<Content, E> {
+            Ok(Content::Map(self.entries))
+        }
+
+        fn serialize_entry<K: ?Sized, V: ?Sized>(&mut self, key: &K, value: &V) -> Result<(), E>
+        where
+            K: Serialize,
+            V: Serialize,
+        {
+            let key = try!(key.serialize(ContentSerializer::<E>::new()));
+            let value = try!(value.serialize(ContentSerializer::<E>::new()));
+            self.entries.push((key, value));
+            Ok(())
+        }
+    }
+
+    pub struct SerializeStruct<E> {
+        name: &'static str,
+        fields: Vec<(&'static str, Content)>,
+        error: PhantomData<E>,
+    }
+
+    impl<E> ser::SerializeStruct for SerializeStruct<E>
+    where
+        E: ser::Error,
+    {
+        type Ok = Content;
+        type Error = E;
+
+        fn serialize_field<T: ?Sized>(&mut self, key: &'static str, value: &T) -> Result<(), E>
+        where
+            T: Serialize,
+        {
+            let value = try!(value.serialize(ContentSerializer::<E>::new()));
+            self.fields.push((key, value));
+            Ok(())
+        }
+
+        fn end(self) -> Result<Content, E> {
+            Ok(Content::Struct(self.name, self.fields))
+        }
+    }
+
+    pub struct SerializeStructVariant<E> {
+        name: &'static str,
+        variant_index: u32,
+        variant: &'static str,
+        fields: Vec<(&'static str, Content)>,
+        error: PhantomData<E>,
+    }
+
+    impl<E> ser::SerializeStructVariant for SerializeStructVariant<E>
+    where
+        E: ser::Error,
+    {
+        type Ok = Content;
+        type Error = E;
+
+        fn serialize_field<T: ?Sized>(&mut self, key: &'static str, value: &T) -> Result<(), E>
+        where
+            T: Serialize,
+        {
+            let value = try!(value.serialize(ContentSerializer::<E>::new()));
+            self.fields.push((key, value));
+            Ok(())
+        }
+
+        fn end(self) -> Result<Content, E> {
+            Ok(Content::StructVariant(
+                self.name,
+                self.variant_index,
+                self.variant,
+                self.fields,
+            ))
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+pub struct FlatMapSerializer<'a, M: 'a>(pub &'a mut M);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, M> FlatMapSerializer<'a, M>
+where
+    M: SerializeMap + 'a,
+{
+    fn bad_type(what: Unsupported) -> M::Error {
+        ser::Error::custom(format_args!(
+            "can only flatten structs and maps (got {})",
+            what
+        ))
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, M> Serializer for FlatMapSerializer<'a, M>
+where
+    M: SerializeMap + 'a,
+{
+    type Ok = ();
+    type Error = M::Error;
+
+    type SerializeSeq = Impossible<Self::Ok, M::Error>;
+    type SerializeTuple = Impossible<Self::Ok, M::Error>;
+    type SerializeTupleStruct = Impossible<Self::Ok, M::Error>;
+    type SerializeMap = FlatMapSerializeMap<'a, M>;
+    type SerializeStruct = FlatMapSerializeStruct<'a, M>;
+    type SerializeTupleVariant = Impossible<Self::Ok, M::Error>;
+    type SerializeStructVariant = FlatMapSerializeStructVariantAsMapValue<'a, M>;
+
+    fn serialize_bool(self, _: bool) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::Boolean))
+    }
+
+    fn serialize_i8(self, _: i8) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_i16(self, _: i16) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_i32(self, _: i32) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_i64(self, _: i64) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_u8(self, _: u8) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_u16(self, _: u16) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_u32(self, _: u32) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_u64(self, _: u64) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::Integer))
+    }
+
+    fn serialize_f32(self, _: f32) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::Float))
+    }
+
+    fn serialize_f64(self, _: f64) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::Float))
+    }
+
+    fn serialize_char(self, _: char) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::Char))
+    }
+
+    fn serialize_str(self, _: &str) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::String))
+    }
+
+    fn serialize_bytes(self, _: &[u8]) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::ByteArray))
+    }
+
+    fn serialize_none(self) -> Result<Self::Ok, Self::Error> {
+        Ok(())
+    }
+
+    fn serialize_some<T: ?Sized>(self, value: &T) -> Result<Self::Ok, Self::Error>
+    where
+        T: Serialize,
+    {
+        value.serialize(self)
+    }
+
+    fn serialize_unit(self) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::Unit))
+    }
+
+    fn serialize_unit_struct(self, _: &'static str) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::UnitStruct))
+    }
+
+    fn serialize_unit_variant(
+        self,
+        _: &'static str,
+        _: u32,
+        _: &'static str,
+    ) -> Result<Self::Ok, Self::Error> {
+        Err(Self::bad_type(Unsupported::Enum))
+    }
+
+    fn serialize_newtype_struct<T: ?Sized>(
+        self,
+        _: &'static str,
+        value: &T,
+    ) -> Result<Self::Ok, Self::Error>
+    where
+        T: Serialize,
+    {
+        value.serialize(self)
+    }
+
+    fn serialize_newtype_variant<T: ?Sized>(
+        self,
+        _: &'static str,
+        _: u32,
+        variant: &'static str,
+        value: &T,
+    ) -> Result<Self::Ok, Self::Error>
+    where
+        T: Serialize,
+    {
+        try!(self.0.serialize_key(variant));
+        self.0.serialize_value(value)
+    }
+
+    fn serialize_seq(self, _: Option<usize>) -> Result<Self::SerializeSeq, Self::Error> {
+        Err(Self::bad_type(Unsupported::Sequence))
+    }
+
+    fn serialize_tuple(self, _: usize) -> Result<Self::SerializeTuple, Self::Error> {
+        Err(Self::bad_type(Unsupported::Tuple))
+    }
+
+    fn serialize_tuple_struct(
+        self,
+        _: &'static str,
+        _: usize,
+    ) -> Result<Self::SerializeTupleStruct, Self::Error> {
+        Err(Self::bad_type(Unsupported::TupleStruct))
+    }
+
+    fn serialize_tuple_variant(
+        self,
+        _: &'static str,
+        _: u32,
+        _: &'static str,
+        _: usize,
+    ) -> Result<Self::SerializeTupleVariant, Self::Error> {
+        Err(Self::bad_type(Unsupported::Enum))
+    }
+
+    fn serialize_map(self, _: Option<usize>) -> Result<Self::SerializeMap, Self::Error> {
+        Ok(FlatMapSerializeMap(self.0))
+    }
+
+    fn serialize_struct(
+        self,
+        _: &'static str,
+        _: usize,
+    ) -> Result<Self::SerializeStruct, Self::Error> {
+        Ok(FlatMapSerializeStruct(self.0))
+    }
+
+    fn serialize_struct_variant(
+        self,
+        _: &'static str,
+        _: u32,
+        inner_variant: &'static str,
+        _: usize,
+    ) -> Result<Self::SerializeStructVariant, Self::Error> {
+        try!(self.0.serialize_key(inner_variant));
+        Ok(FlatMapSerializeStructVariantAsMapValue::new(
+            self.0,
+            inner_variant,
+        ))
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+pub struct FlatMapSerializeMap<'a, M: 'a>(&'a mut M);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, M> ser::SerializeMap for FlatMapSerializeMap<'a, M>
+where
+    M: SerializeMap + 'a,
+{
+    type Ok = ();
+    type Error = M::Error;
+
+    fn serialize_key<T: ?Sized>(&mut self, key: &T) -> Result<(), Self::Error>
+    where
+        T: Serialize,
+    {
+        self.0.serialize_key(key)
+    }
+
+    fn serialize_value<T: ?Sized>(&mut self, value: &T) -> Result<(), Self::Error>
+    where
+        T: Serialize,
+    {
+        self.0.serialize_value(value)
+    }
+
+    fn end(self) -> Result<(), Self::Error> {
+        Ok(())
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+pub struct FlatMapSerializeStruct<'a, M: 'a>(&'a mut M);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, M> ser::SerializeStruct for FlatMapSerializeStruct<'a, M>
+where
+    M: SerializeMap + 'a,
+{
+    type Ok = ();
+    type Error = M::Error;
+
+    fn serialize_field<T: ?Sized>(
+        &mut self,
+        key: &'static str,
+        value: &T,
+    ) -> Result<(), Self::Error>
+    where
+        T: Serialize,
+    {
+        self.0.serialize_entry(key, value)
+    }
+
+    fn end(self) -> Result<(), Self::Error> {
+        Ok(())
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+pub struct FlatMapSerializeStructVariantAsMapValue<'a, M: 'a> {
+    map: &'a mut M,
+    name: &'static str,
+    fields: Vec<(&'static str, Content)>,
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, M> FlatMapSerializeStructVariantAsMapValue<'a, M>
+where
+    M: SerializeMap + 'a,
+{
+    fn new(map: &'a mut M, name: &'static str) -> FlatMapSerializeStructVariantAsMapValue<'a, M> {
+        FlatMapSerializeStructVariantAsMapValue {
+            map: map,
+            name: name,
+            fields: Vec::new(),
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl<'a, M> ser::SerializeStructVariant for FlatMapSerializeStructVariantAsMapValue<'a, M>
+where
+    M: SerializeMap + 'a,
+{
+    type Ok = ();
+    type Error = M::Error;
+
+    fn serialize_field<T: ?Sized>(
+        &mut self,
+        key: &'static str,
+        value: &T,
+    ) -> Result<(), Self::Error>
+    where
+        T: Serialize,
+    {
+        let value = try!(value.serialize(ContentSerializer::<M::Error>::new()));
+        self.fields.push((key, value));
+        Ok(())
+    }
+
+    fn end(self) -> Result<(), Self::Error> {
+        try!(self
+            .map
+            .serialize_value(&Content::Struct(self.name, self.fields)));
+        Ok(())
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde/ser/impls.rs.html b/src/serde/ser/impls.rs.html new file mode 100644 index 0000000..13d03fe --- /dev/null +++ b/src/serde/ser/impls.rs.html @@ -0,0 +1,1771 @@ +impls.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+
+use lib::*;
+
+use ser::{Error, Serialize, SerializeTuple, Serializer};
+
+////////////////////////////////////////////////////////////////////////////////
+
+macro_rules! primitive_impl {
+    ($ty:ident, $method:ident $($cast:tt)*) => {
+        impl Serialize for $ty {
+            #[inline]
+            fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+            where
+                S: Serializer,
+            {
+                serializer.$method(*self $($cast)*)
+            }
+        }
+    }
+}
+
+primitive_impl!(bool, serialize_bool);
+primitive_impl!(isize, serialize_i64 as i64);
+primitive_impl!(i8, serialize_i8);
+primitive_impl!(i16, serialize_i16);
+primitive_impl!(i32, serialize_i32);
+primitive_impl!(i64, serialize_i64);
+primitive_impl!(usize, serialize_u64 as u64);
+primitive_impl!(u8, serialize_u8);
+primitive_impl!(u16, serialize_u16);
+primitive_impl!(u32, serialize_u32);
+primitive_impl!(u64, serialize_u64);
+primitive_impl!(f32, serialize_f32);
+primitive_impl!(f64, serialize_f64);
+primitive_impl!(char, serialize_char);
+
+serde_if_integer128! {
+    primitive_impl!(i128, serialize_i128);
+    primitive_impl!(u128, serialize_u128);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+impl Serialize for str {
+    #[inline]
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_str(self)
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+impl Serialize for String {
+    #[inline]
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_str(self)
+    }
+}
+
+impl<'a> Serialize for fmt::Arguments<'a> {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.collect_str(self)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(feature = "std")]
+impl Serialize for CStr {
+    #[inline]
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_bytes(self.to_bytes())
+    }
+}
+
+#[cfg(feature = "std")]
+impl Serialize for CString {
+    #[inline]
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_bytes(self.to_bytes())
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+impl<T> Serialize for Option<T>
+where
+    T: Serialize,
+{
+    #[inline]
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            Some(ref value) => serializer.serialize_some(value),
+            None => serializer.serialize_none(),
+        }
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+impl<T: ?Sized> Serialize for PhantomData<T> {
+    #[inline]
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_unit_struct("PhantomData")
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+// Does not require T: Serialize.
+impl<T> Serialize for [T; 0] {
+    #[inline]
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        try!(serializer.serialize_tuple(0)).end()
+    }
+}
+
+macro_rules! array_impls {
+    ($($len:tt)+) => {
+        $(
+            impl<T> Serialize for [T; $len]
+            where
+                T: Serialize,
+            {
+                #[inline]
+                fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+                where
+                    S: Serializer,
+                {
+                    let mut seq = try!(serializer.serialize_tuple($len));
+                    for e in self {
+                        try!(seq.serialize_element(e));
+                    }
+                    seq.end()
+                }
+            }
+        )+
+    }
+}
+
+array_impls! {
+    01 02 03 04 05 06 07 08 09 10
+    11 12 13 14 15 16 17 18 19 20
+    21 22 23 24 25 26 27 28 29 30
+    31 32
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+impl<T> Serialize for [T]
+where
+    T: Serialize,
+{
+    #[inline]
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.collect_seq(self)
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+macro_rules! seq_impl {
+    ($ty:ident < T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound:ident)* >) => {
+        impl<T $(, $typaram)*> Serialize for $ty<T $(, $typaram)*>
+        where
+            T: Serialize $(+ $tbound1 $(+ $tbound2)*)*,
+            $($typaram: $bound,)*
+        {
+            #[inline]
+            fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+            where
+                S: Serializer,
+            {
+                serializer.collect_seq(self)
+            }
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+seq_impl!(BinaryHeap<T: Ord>);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+seq_impl!(BTreeSet<T: Ord>);
+
+#[cfg(feature = "std")]
+seq_impl!(HashSet<T: Eq + Hash, H: BuildHasher>);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+seq_impl!(LinkedList<T>);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+seq_impl!(Vec<T>);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+seq_impl!(VecDeque<T>);
+
+////////////////////////////////////////////////////////////////////////////////
+
+impl<Idx> Serialize for Range<Idx>
+where
+    Idx: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        use super::SerializeStruct;
+        let mut state = try!(serializer.serialize_struct("Range", 2));
+        try!(state.serialize_field("start", &self.start));
+        try!(state.serialize_field("end", &self.end));
+        state.end()
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(range_inclusive)]
+impl<Idx> Serialize for RangeInclusive<Idx>
+where
+    Idx: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        use super::SerializeStruct;
+        let mut state = try!(serializer.serialize_struct("RangeInclusive", 2));
+        try!(state.serialize_field("start", &self.start()));
+        try!(state.serialize_field("end", &self.end()));
+        state.end()
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(any(ops_bound, collections_bound))]
+impl<T> Serialize for Bound<T>
+where
+    T: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            Bound::Unbounded => serializer.serialize_unit_variant("Bound", 0, "Unbounded"),
+            Bound::Included(ref value) => {
+                serializer.serialize_newtype_variant("Bound", 1, "Included", value)
+            }
+            Bound::Excluded(ref value) => {
+                serializer.serialize_newtype_variant("Bound", 2, "Excluded", value)
+            }
+        }
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+impl Serialize for () {
+    #[inline]
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        serializer.serialize_unit()
+    }
+}
+
+#[cfg(feature = "unstable")]
+impl Serialize for ! {
+    fn serialize<S>(&self, _serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        *self
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+macro_rules! tuple_impls {
+    ($($len:expr => ($($n:tt $name:ident)+))+) => {
+        $(
+            impl<$($name),+> Serialize for ($($name,)+)
+            where
+                $($name: Serialize,)+
+            {
+                #[inline]
+                fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+                where
+                    S: Serializer,
+                {
+                    let mut tuple = try!(serializer.serialize_tuple($len));
+                    $(
+                        try!(tuple.serialize_element(&self.$n));
+                    )+
+                    tuple.end()
+                }
+            }
+        )+
+    }
+}
+
+tuple_impls! {
+    1 => (0 T0)
+    2 => (0 T0 1 T1)
+    3 => (0 T0 1 T1 2 T2)
+    4 => (0 T0 1 T1 2 T2 3 T3)
+    5 => (0 T0 1 T1 2 T2 3 T3 4 T4)
+    6 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5)
+    7 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6)
+    8 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7)
+    9 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8)
+    10 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9)
+    11 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10)
+    12 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11)
+    13 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12)
+    14 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13)
+    15 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13 14 T14)
+    16 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13 14 T14 15 T15)
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+macro_rules! map_impl {
+    ($ty:ident < K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound:ident)* >) => {
+        impl<K, V $(, $typaram)*> Serialize for $ty<K, V $(, $typaram)*>
+        where
+            K: Serialize $(+ $kbound1 $(+ $kbound2)*)*,
+            V: Serialize,
+            $($typaram: $bound,)*
+        {
+            #[inline]
+            fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+            where
+                S: Serializer,
+            {
+                serializer.collect_map(self)
+            }
+        }
+    }
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+map_impl!(BTreeMap<K: Ord, V>);
+
+#[cfg(feature = "std")]
+map_impl!(HashMap<K: Eq + Hash, V, H: BuildHasher>);
+
+////////////////////////////////////////////////////////////////////////////////
+
+macro_rules! deref_impl {
+    (
+        $(#[doc = $doc:tt])*
+        <$($desc:tt)+
+    ) => {
+        $(#[doc = $doc])*
+        impl <$($desc)+ {
+            #[inline]
+            fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+            where
+                S: Serializer,
+            {
+                (**self).serialize(serializer)
+            }
+        }
+    };
+}
+
+deref_impl!(<'a, T: ?Sized> Serialize for &'a T where T: Serialize);
+deref_impl!(<'a, T: ?Sized> Serialize for &'a mut T where T: Serialize);
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+deref_impl!(<T: ?Sized> Serialize for Box<T> where T: Serialize);
+
+#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))]
+deref_impl! {
+    /// This impl requires the [`"rc"`] Cargo feature of Serde.
+    ///
+    /// Serializing a data structure containing `Rc` will serialize a copy of
+    /// the contents of the `Rc` each time the `Rc` is referenced within the
+    /// data structure. Serialization will not attempt to deduplicate these
+    /// repeated data.
+    ///
+    /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
+    <T: ?Sized> Serialize for Rc<T> where T: Serialize
+}
+
+#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))]
+deref_impl! {
+    /// This impl requires the [`"rc"`] Cargo feature of Serde.
+    ///
+    /// Serializing a data structure containing `Arc` will serialize a copy of
+    /// the contents of the `Arc` each time the `Arc` is referenced within the
+    /// data structure. Serialization will not attempt to deduplicate these
+    /// repeated data.
+    ///
+    /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
+    <T: ?Sized> Serialize for Arc<T> where T: Serialize
+}
+
+#[cfg(any(feature = "std", feature = "alloc"))]
+deref_impl!(<'a, T: ?Sized> Serialize for Cow<'a, T> where T: Serialize + ToOwned);
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// This impl requires the [`"rc"`] Cargo feature of Serde.
+///
+/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
+#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))]
+impl<T: ?Sized> Serialize for RcWeak<T>
+where
+    T: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        self.upgrade().serialize(serializer)
+    }
+}
+
+/// This impl requires the [`"rc"`] Cargo feature of Serde.
+///
+/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
+#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))]
+impl<T: ?Sized> Serialize for ArcWeak<T>
+where
+    T: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        self.upgrade().serialize(serializer)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+macro_rules! nonzero_integers {
+    ( $( $T: ident, )+ ) => {
+        $(
+            #[cfg(num_nonzero)]
+            impl Serialize for num::$T {
+                fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+                where
+                    S: Serializer,
+                {
+                    self.get().serialize(serializer)
+                }
+            }
+        )+
+    }
+}
+
+nonzero_integers! {
+    NonZeroU8,
+    NonZeroU16,
+    NonZeroU32,
+    NonZeroU64,
+    NonZeroUsize,
+}
+
+#[cfg(num_nonzero_signed)]
+nonzero_integers! {
+    NonZeroI8,
+    NonZeroI16,
+    NonZeroI32,
+    NonZeroI64,
+    NonZeroIsize,
+}
+
+// Currently 128-bit integers do not work on Emscripten targets so we need an
+// additional `#[cfg]`
+serde_if_integer128! {
+    nonzero_integers! {
+        NonZeroU128,
+    }
+
+    #[cfg(num_nonzero_signed)]
+    nonzero_integers! {
+        NonZeroI128,
+    }
+}
+
+impl<T> Serialize for Cell<T>
+where
+    T: Serialize + Copy,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        self.get().serialize(serializer)
+    }
+}
+
+impl<T> Serialize for RefCell<T>
+where
+    T: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match self.try_borrow() {
+            Ok(value) => value.serialize(serializer),
+            Err(_) => Err(S::Error::custom("already mutably borrowed")),
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+impl<T> Serialize for Mutex<T>
+where
+    T: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match self.lock() {
+            Ok(locked) => locked.serialize(serializer),
+            Err(_) => Err(S::Error::custom("lock poison error while serializing")),
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+impl<T> Serialize for RwLock<T>
+where
+    T: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match self.read() {
+            Ok(locked) => locked.serialize(serializer),
+            Err(_) => Err(S::Error::custom("lock poison error while serializing")),
+        }
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+impl<T, E> Serialize for Result<T, E>
+where
+    T: Serialize,
+    E: Serialize,
+{
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match *self {
+            Result::Ok(ref value) => serializer.serialize_newtype_variant("Result", 0, "Ok", value),
+            Result::Err(ref value) => {
+                serializer.serialize_newtype_variant("Result", 1, "Err", value)
+            }
+        }
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(any(core_duration, feature = "std"))]
+impl Serialize for Duration {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        use super::SerializeStruct;
+        let mut state = try!(serializer.serialize_struct("Duration", 2));
+        try!(state.serialize_field("secs", &self.as_secs()));
+        try!(state.serialize_field("nanos", &self.subsec_nanos()));
+        state.end()
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(feature = "std")]
+impl Serialize for SystemTime {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        use super::SerializeStruct;
+        let duration_since_epoch = self
+            .duration_since(UNIX_EPOCH)
+            .expect("SystemTime must be later than UNIX_EPOCH");
+        let mut state = try!(serializer.serialize_struct("SystemTime", 2));
+        try!(state.serialize_field("secs_since_epoch", &duration_since_epoch.as_secs()));
+        try!(state.serialize_field("nanos_since_epoch", &duration_since_epoch.subsec_nanos()));
+        state.end()
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// Serialize a value that implements `Display` as a string, when that string is
+/// statically known to never have more than a constant `MAX_LEN` bytes.
+///
+/// Panics if the `Display` impl tries to write more than `MAX_LEN` bytes.
+#[cfg(feature = "std")]
+macro_rules! serialize_display_bounded_length {
+    ($value:expr, $max:expr, $serializer:expr) => {{
+        #[allow(deprecated)]
+        let mut buffer: [u8; $max] = unsafe { mem::uninitialized() };
+        let remaining_len = {
+            let mut remaining = &mut buffer[..];
+            write!(remaining, "{}", $value).unwrap();
+            remaining.len()
+        };
+        let written_len = buffer.len() - remaining_len;
+        let written = &buffer[..written_len];
+
+        // write! only provides fmt::Formatter to Display implementations, which
+        // has methods write_str and write_char but no method to write arbitrary
+        // bytes. Therefore `written` must be valid UTF-8.
+        let written_str = unsafe { str::from_utf8_unchecked(written) };
+        $serializer.serialize_str(written_str)
+    }};
+}
+
+#[cfg(feature = "std")]
+impl Serialize for net::IpAddr {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        if serializer.is_human_readable() {
+            match *self {
+                net::IpAddr::V4(ref a) => a.serialize(serializer),
+                net::IpAddr::V6(ref a) => a.serialize(serializer),
+            }
+        } else {
+            match *self {
+                net::IpAddr::V4(ref a) => {
+                    serializer.serialize_newtype_variant("IpAddr", 0, "V4", a)
+                }
+                net::IpAddr::V6(ref a) => {
+                    serializer.serialize_newtype_variant("IpAddr", 1, "V6", a)
+                }
+            }
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+impl Serialize for net::Ipv4Addr {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        if serializer.is_human_readable() {
+            const MAX_LEN: usize = 15;
+            debug_assert_eq!(MAX_LEN, "101.102.103.104".len());
+            serialize_display_bounded_length!(self, MAX_LEN, serializer)
+        } else {
+            self.octets().serialize(serializer)
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+impl Serialize for net::Ipv6Addr {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        if serializer.is_human_readable() {
+            const MAX_LEN: usize = 39;
+            debug_assert_eq!(MAX_LEN, "1001:1002:1003:1004:1005:1006:1007:1008".len());
+            serialize_display_bounded_length!(self, MAX_LEN, serializer)
+        } else {
+            self.octets().serialize(serializer)
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+impl Serialize for net::SocketAddr {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        if serializer.is_human_readable() {
+            match *self {
+                net::SocketAddr::V4(ref addr) => addr.serialize(serializer),
+                net::SocketAddr::V6(ref addr) => addr.serialize(serializer),
+            }
+        } else {
+            match *self {
+                net::SocketAddr::V4(ref addr) => {
+                    serializer.serialize_newtype_variant("SocketAddr", 0, "V4", addr)
+                }
+                net::SocketAddr::V6(ref addr) => {
+                    serializer.serialize_newtype_variant("SocketAddr", 1, "V6", addr)
+                }
+            }
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+impl Serialize for net::SocketAddrV4 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        if serializer.is_human_readable() {
+            const MAX_LEN: usize = 21;
+            debug_assert_eq!(MAX_LEN, "101.102.103.104:65000".len());
+            serialize_display_bounded_length!(self, MAX_LEN, serializer)
+        } else {
+            (self.ip(), self.port()).serialize(serializer)
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+impl Serialize for net::SocketAddrV6 {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        if serializer.is_human_readable() {
+            const MAX_LEN: usize = 47;
+            debug_assert_eq!(
+                MAX_LEN,
+                "[1001:1002:1003:1004:1005:1006:1007:1008]:65000".len()
+            );
+            serialize_display_bounded_length!(self, MAX_LEN, serializer)
+        } else {
+            (self.ip(), self.port()).serialize(serializer)
+        }
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(feature = "std")]
+impl Serialize for Path {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        match self.to_str() {
+            Some(s) => s.serialize(serializer),
+            None => Err(Error::custom("path contains invalid UTF-8 characters")),
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+impl Serialize for PathBuf {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        self.as_path().serialize(serializer)
+    }
+}
+
+#[cfg(all(feature = "std", any(unix, windows)))]
+impl Serialize for OsStr {
+    #[cfg(unix)]
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        use std::os::unix::ffi::OsStrExt;
+        serializer.serialize_newtype_variant("OsString", 0, "Unix", self.as_bytes())
+    }
+
+    #[cfg(windows)]
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        use std::os::windows::ffi::OsStrExt;
+        let val = self.encode_wide().collect::<Vec<_>>();
+        serializer.serialize_newtype_variant("OsString", 1, "Windows", &val)
+    }
+}
+
+#[cfg(all(feature = "std", any(unix, windows)))]
+impl Serialize for OsString {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        self.as_os_str().serialize(serializer)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(feature = "std")]
+impl<T> Serialize for Wrapping<T>
+where
+    T: Serialize,
+{
+    #[inline]
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        self.0.serialize(serializer)
+    }
+}
+
+#[cfg(core_reverse)]
+impl<T> Serialize for Reverse<T>
+where
+    T: Serialize,
+{
+    #[inline]
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        self.0.serialize(serializer)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[cfg(all(feature = "std", std_atomic))]
+macro_rules! atomic_impl {
+    ($($ty:ident)*) => {
+        $(
+            impl Serialize for $ty {
+                fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+                where
+                    S: Serializer,
+                {
+                    self.load(Ordering::SeqCst).serialize(serializer)
+                }
+            }
+        )*
+    }
+}
+
+#[cfg(all(feature = "std", std_atomic))]
+atomic_impl! {
+    AtomicBool
+    AtomicI8 AtomicI16 AtomicI32 AtomicIsize
+    AtomicU8 AtomicU16 AtomicU32 AtomicUsize
+}
+
+#[cfg(all(feature = "std", std_atomic64))]
+atomic_impl! {
+    AtomicI64 AtomicU64
+}
+
+
\ No newline at end of file diff --git a/src/serde/ser/impossible.rs.html b/src/serde/ser/impossible.rs.html new file mode 100644 index 0000000..02899ed --- /dev/null +++ b/src/serde/ser/impossible.rs.html @@ -0,0 +1,435 @@ +impossible.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+
+//! This module contains `Impossible` serializer and its implementations.
+
+use lib::*;
+
+use ser::{
+    self, Serialize, SerializeMap, SerializeSeq, SerializeStruct, SerializeStructVariant,
+    SerializeTuple, SerializeTupleStruct, SerializeTupleVariant,
+};
+
+/// Helper type for implementing a `Serializer` that does not support
+/// serializing one of the compound types.
+///
+/// This type cannot be instantiated, but implements every one of the traits
+/// corresponding to the [`Serializer`] compound types: [`SerializeSeq`],
+/// [`SerializeTuple`], [`SerializeTupleStruct`], [`SerializeTupleVariant`],
+/// [`SerializeMap`], [`SerializeStruct`], and [`SerializeStructVariant`].
+///
+/// ```edition2018
+/// # use serde::ser::{Serializer, Impossible};
+/// # use serde::private::ser::Error;
+/// #
+/// # struct MySerializer;
+/// #
+/// impl Serializer for MySerializer {
+///     type Ok = ();
+///     type Error = Error;
+///
+///     type SerializeSeq = Impossible<(), Error>;
+///     /* other associated types */
+///
+///     /// This data format does not support serializing sequences.
+///     fn serialize_seq(self,
+///                      len: Option<usize>)
+///                      -> Result<Self::SerializeSeq, Error> {
+///         // Given Impossible cannot be instantiated, the only
+///         // thing we can do here is to return an error.
+/// #         stringify! {
+///         Err(...)
+/// #         };
+/// #         unimplemented!()
+///     }
+///
+///     /* other Serializer methods */
+/// #     serde::__serialize_unimplemented! {
+/// #         bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str bytes none some
+/// #         unit unit_struct unit_variant newtype_struct newtype_variant
+/// #         tuple tuple_struct tuple_variant map struct struct_variant
+/// #     }
+/// }
+/// ```
+///
+/// [`Serializer`]: trait.Serializer.html
+/// [`SerializeSeq`]: trait.SerializeSeq.html
+/// [`SerializeTuple`]: trait.SerializeTuple.html
+/// [`SerializeTupleStruct`]: trait.SerializeTupleStruct.html
+/// [`SerializeTupleVariant`]: trait.SerializeTupleVariant.html
+/// [`SerializeMap`]: trait.SerializeMap.html
+/// [`SerializeStruct`]: trait.SerializeStruct.html
+/// [`SerializeStructVariant`]: trait.SerializeStructVariant.html
+pub struct Impossible<Ok, Error> {
+    void: Void,
+    ok: PhantomData<Ok>,
+    error: PhantomData<Error>,
+}
+
+enum Void {}
+
+impl<Ok, Error> SerializeSeq for Impossible<Ok, Error>
+where
+    Error: ser::Error,
+{
+    type Ok = Ok;
+    type Error = Error;
+
+    fn serialize_element<T: ?Sized>(&mut self, value: &T) -> Result<(), Error>
+    where
+        T: Serialize,
+    {
+        let _ = value;
+        match self.void {}
+    }
+
+    fn end(self) -> Result<Ok, Error> {
+        match self.void {}
+    }
+}
+
+impl<Ok, Error> SerializeTuple for Impossible<Ok, Error>
+where
+    Error: ser::Error,
+{
+    type Ok = Ok;
+    type Error = Error;
+
+    fn serialize_element<T: ?Sized>(&mut self, value: &T) -> Result<(), Error>
+    where
+        T: Serialize,
+    {
+        let _ = value;
+        match self.void {}
+    }
+
+    fn end(self) -> Result<Ok, Error> {
+        match self.void {}
+    }
+}
+
+impl<Ok, Error> SerializeTupleStruct for Impossible<Ok, Error>
+where
+    Error: ser::Error,
+{
+    type Ok = Ok;
+    type Error = Error;
+
+    fn serialize_field<T: ?Sized>(&mut self, value: &T) -> Result<(), Error>
+    where
+        T: Serialize,
+    {
+        let _ = value;
+        match self.void {}
+    }
+
+    fn end(self) -> Result<Ok, Error> {
+        match self.void {}
+    }
+}
+
+impl<Ok, Error> SerializeTupleVariant for Impossible<Ok, Error>
+where
+    Error: ser::Error,
+{
+    type Ok = Ok;
+    type Error = Error;
+
+    fn serialize_field<T: ?Sized>(&mut self, value: &T) -> Result<(), Error>
+    where
+        T: Serialize,
+    {
+        let _ = value;
+        match self.void {}
+    }
+
+    fn end(self) -> Result<Ok, Error> {
+        match self.void {}
+    }
+}
+
+impl<Ok, Error> SerializeMap for Impossible<Ok, Error>
+where
+    Error: ser::Error,
+{
+    type Ok = Ok;
+    type Error = Error;
+
+    fn serialize_key<T: ?Sized>(&mut self, key: &T) -> Result<(), Error>
+    where
+        T: Serialize,
+    {
+        let _ = key;
+        match self.void {}
+    }
+
+    fn serialize_value<T: ?Sized>(&mut self, value: &T) -> Result<(), Error>
+    where
+        T: Serialize,
+    {
+        let _ = value;
+        match self.void {}
+    }
+
+    fn end(self) -> Result<Ok, Error> {
+        match self.void {}
+    }
+}
+
+impl<Ok, Error> SerializeStruct for Impossible<Ok, Error>
+where
+    Error: ser::Error,
+{
+    type Ok = Ok;
+    type Error = Error;
+
+    fn serialize_field<T: ?Sized>(&mut self, key: &'static str, value: &T) -> Result<(), Error>
+    where
+        T: Serialize,
+    {
+        let _ = key;
+        let _ = value;
+        match self.void {}
+    }
+
+    fn end(self) -> Result<Ok, Error> {
+        match self.void {}
+    }
+}
+
+impl<Ok, Error> SerializeStructVariant for Impossible<Ok, Error>
+where
+    Error: ser::Error,
+{
+    type Ok = Ok;
+    type Error = Error;
+
+    fn serialize_field<T: ?Sized>(&mut self, key: &'static str, value: &T) -> Result<(), Error>
+    where
+        T: Serialize,
+    {
+        let _ = key;
+        let _ = value;
+        match self.void {}
+    }
+
+    fn end(self) -> Result<Ok, Error> {
+        match self.void {}
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde/ser/mod.rs.html b/src/serde/ser/mod.rs.html new file mode 100644 index 0000000..f1821f6 --- /dev/null +++ b/src/serde/ser/mod.rs.html @@ -0,0 +1,3993 @@ +mod.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+
+//! Generic data structure serialization framework.
+//!
+//! The two most important traits in this module are [`Serialize`] and
+//! [`Serializer`].
+//!
+//!  - **A type that implements `Serialize` is a data structure** that can be
+//!    serialized to any data format supported by Serde, and conversely
+//!  - **A type that implements `Serializer` is a data format** that can
+//!    serialize any data structure supported by Serde.
+//!
+//! # The Serialize trait
+//!
+//! Serde provides [`Serialize`] implementations for many Rust primitive and
+//! standard library types. The complete list is below. All of these can be
+//! serialized using Serde out of the box.
+//!
+//! Additionally, Serde provides a procedural macro called [`serde_derive`] to
+//! automatically generate [`Serialize`] implementations for structs and enums
+//! in your program. See the [derive section of the manual] for how to use this.
+//!
+//! In rare cases it may be necessary to implement [`Serialize`] manually for
+//! some type in your program. See the [Implementing `Serialize`] section of the
+//! manual for more about this.
+//!
+//! Third-party crates may provide [`Serialize`] implementations for types that
+//! they expose. For example the [`linked-hash-map`] crate provides a
+//! [`LinkedHashMap<K, V>`] type that is serializable by Serde because the crate
+//! provides an implementation of [`Serialize`] for it.
+//!
+//! # The Serializer trait
+//!
+//! [`Serializer`] implementations are provided by third-party crates, for
+//! example [`serde_json`], [`serde_yaml`] and [`bincode`].
+//!
+//! A partial list of well-maintained formats is given on the [Serde
+//! website][data formats].
+//!
+//! # Implementations of Serialize provided by Serde
+//!
+//!  - **Primitive types**:
+//!    - bool
+//!    - i8, i16, i32, i64, i128, isize
+//!    - u8, u16, u32, u64, u128, usize
+//!    - f32, f64
+//!    - char
+//!    - str
+//!    - &T and &mut T
+//!  - **Compound types**:
+//!    - \[T\]
+//!    - \[T; 0\] through \[T; 32\]
+//!    - tuples up to size 16
+//!  - **Common standard library types**:
+//!    - String
+//!    - Option\<T\>
+//!    - Result\<T, E\>
+//!    - PhantomData\<T\>
+//!  - **Wrapper types**:
+//!    - Box\<T\>
+//!    - Cow\<'a, T\>
+//!    - Cell\<T\>
+//!    - RefCell\<T\>
+//!    - Mutex\<T\>
+//!    - RwLock\<T\>
+//!    - Rc\<T\>&emsp;*(if* features = ["rc"] *is enabled)*
+//!    - Arc\<T\>&emsp;*(if* features = ["rc"] *is enabled)*
+//!  - **Collection types**:
+//!    - BTreeMap\<K, V\>
+//!    - BTreeSet\<T\>
+//!    - BinaryHeap\<T\>
+//!    - HashMap\<K, V, H\>
+//!    - HashSet\<T, H\>
+//!    - LinkedList\<T\>
+//!    - VecDeque\<T\>
+//!    - Vec\<T\>
+//!  - **FFI types**:
+//!    - CStr
+//!    - CString
+//!    - OsStr
+//!    - OsString
+//!  - **Miscellaneous standard library types**:
+//!    - Duration
+//!    - SystemTime
+//!    - Path
+//!    - PathBuf
+//!    - Range\<T\>
+//!    - RangeInclusive\<T\>
+//!    - Bound\<T\>
+//!    - num::NonZero*
+//!    - `!` *(unstable)*
+//!  - **Net types**:
+//!    - IpAddr
+//!    - Ipv4Addr
+//!    - Ipv6Addr
+//!    - SocketAddr
+//!    - SocketAddrV4
+//!    - SocketAddrV6
+//!
+//! [Implementing `Serialize`]: https://serde.rs/impl-serialize.html
+//! [`LinkedHashMap<K, V>`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html
+//! [`Serialize`]: ../trait.Serialize.html
+//! [`Serializer`]: ../trait.Serializer.html
+//! [`bincode`]: https://github.com/TyOverby/bincode
+//! [`linked-hash-map`]: https://crates.io/crates/linked-hash-map
+//! [`serde_derive`]: https://crates.io/crates/serde_derive
+//! [`serde_json`]: https://github.com/serde-rs/json
+//! [`serde_yaml`]: https://github.com/dtolnay/serde-yaml
+//! [derive section of the manual]: https://serde.rs/derive.html
+//! [data formats]: https://serde.rs/#data-formats
+
+use lib::*;
+
+mod impls;
+mod impossible;
+
+pub use self::impossible::Impossible;
+
+#[cfg(feature = "std")]
+#[doc(no_inline)]
+pub use std::error::Error as StdError;
+#[cfg(not(feature = "std"))]
+#[doc(no_inline)]
+pub use std_error::Error as StdError;
+
+////////////////////////////////////////////////////////////////////////////////
+
+macro_rules! declare_error_trait {
+    (Error: Sized $(+ $($supertrait:ident)::+)*) => {
+        /// Trait used by `Serialize` implementations to generically construct
+        /// errors belonging to the `Serializer` against which they are
+        /// currently running.
+        ///
+        /// # Example implementation
+        ///
+        /// The [example data format] presented on the website shows an error
+        /// type appropriate for a basic JSON data format.
+        ///
+        /// [example data format]: https://serde.rs/data-format.html
+        pub trait Error: Sized $(+ $($supertrait)::+)* {
+            /// Used when a [`Serialize`] implementation encounters any error
+            /// while serializing a type.
+            ///
+            /// The message should not be capitalized and should not end with a
+            /// period.
+            ///
+            /// For example, a filesystem [`Path`] may refuse to serialize
+            /// itself if it contains invalid UTF-8 data.
+            ///
+            /// ```edition2018
+            /// # struct Path;
+            /// #
+            /// # impl Path {
+            /// #     fn to_str(&self) -> Option<&str> {
+            /// #         unimplemented!()
+            /// #     }
+            /// # }
+            /// #
+            /// use serde::ser::{self, Serialize, Serializer};
+            ///
+            /// impl Serialize for Path {
+            ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+            ///     where
+            ///         S: Serializer,
+            ///     {
+            ///         match self.to_str() {
+            ///             Some(s) => serializer.serialize_str(s),
+            ///             None => Err(ser::Error::custom("path contains invalid UTF-8 characters")),
+            ///         }
+            ///     }
+            /// }
+            /// ```
+            ///
+            /// [`Path`]: https://doc.rust-lang.org/std/path/struct.Path.html
+            /// [`Serialize`]: ../trait.Serialize.html
+            fn custom<T>(msg: T) -> Self
+            where
+                T: Display;
+        }
+    }
+}
+
+#[cfg(feature = "std")]
+declare_error_trait!(Error: Sized + StdError);
+
+#[cfg(not(feature = "std"))]
+declare_error_trait!(Error: Sized + Debug + Display);
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A **data structure** that can be serialized into any data format supported
+/// by Serde.
+///
+/// Serde provides `Serialize` implementations for many Rust primitive and
+/// standard library types. The complete list is [here][ser]. All of these can
+/// be serialized using Serde out of the box.
+///
+/// Additionally, Serde provides a procedural macro called [`serde_derive`] to
+/// automatically generate `Serialize` implementations for structs and enums in
+/// your program. See the [derive section of the manual] for how to use this.
+///
+/// In rare cases it may be necessary to implement `Serialize` manually for some
+/// type in your program. See the [Implementing `Serialize`] section of the
+/// manual for more about this.
+///
+/// Third-party crates may provide `Serialize` implementations for types that
+/// they expose. For example the [`linked-hash-map`] crate provides a
+/// [`LinkedHashMap<K, V>`] type that is serializable by Serde because the crate
+/// provides an implementation of `Serialize` for it.
+///
+/// [Implementing `Serialize`]: https://serde.rs/impl-serialize.html
+/// [`LinkedHashMap<K, V>`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html
+/// [`linked-hash-map`]: https://crates.io/crates/linked-hash-map
+/// [`serde_derive`]: https://crates.io/crates/serde_derive
+/// [derive section of the manual]: https://serde.rs/derive.html
+/// [ser]: https://docs.serde.rs/serde/ser/index.html
+pub trait Serialize {
+    /// Serialize this value into the given Serde serializer.
+    ///
+    /// See the [Implementing `Serialize`] section of the manual for more
+    /// information about how to implement this method.
+    ///
+    /// ```edition2018
+    /// use serde::ser::{Serialize, SerializeStruct, Serializer};
+    ///
+    /// struct Person {
+    ///     name: String,
+    ///     age: u8,
+    ///     phones: Vec<String>,
+    /// }
+    ///
+    /// // This is what #[derive(Serialize)] would generate.
+    /// impl Serialize for Person {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         let mut s = serializer.serialize_struct("Person", 3)?;
+    ///         s.serialize_field("name", &self.name)?;
+    ///         s.serialize_field("age", &self.age)?;
+    ///         s.serialize_field("phones", &self.phones)?;
+    ///         s.end()
+    ///     }
+    /// }
+    /// ```
+    ///
+    /// [Implementing `Serialize`]: https://serde.rs/impl-serialize.html
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/// A **data format** that can serialize any data structure supported by Serde.
+///
+/// The role of this trait is to define the serialization half of the [Serde
+/// data model], which is a way to categorize every Rust data structure into one
+/// of 29 possible types. Each method of the `Serializer` trait corresponds to
+/// one of the types of the data model.
+///
+/// Implementations of `Serialize` map themselves into this data model by
+/// invoking exactly one of the `Serializer` methods.
+///
+/// The types that make up the Serde data model are:
+///
+///  - **14 primitive types**
+///    - bool
+///    - i8, i16, i32, i64, i128
+///    - u8, u16, u32, u64, u128
+///    - f32, f64
+///    - char
+///  - **string**
+///    - UTF-8 bytes with a length and no null terminator.
+///    - When serializing, all strings are handled equally. When deserializing,
+///      there are three flavors of strings: transient, owned, and borrowed.
+///  - **byte array** - \[u8\]
+///    - Similar to strings, during deserialization byte arrays can be
+///      transient, owned, or borrowed.
+///  - **option**
+///    - Either none or some value.
+///  - **unit**
+///    - The type of `()` in Rust. It represents an anonymous value containing
+///      no data.
+///  - **unit_struct**
+///    - For example `struct Unit` or `PhantomData<T>`. It represents a named
+///      value containing no data.
+///  - **unit_variant**
+///    - For example the `E::A` and `E::B` in `enum E { A, B }`.
+///  - **newtype_struct**
+///    - For example `struct Millimeters(u8)`.
+///  - **newtype_variant**
+///    - For example the `E::N` in `enum E { N(u8) }`.
+///  - **seq**
+///    - A variably sized heterogeneous sequence of values, for example
+///      `Vec<T>` or `HashSet<T>`. When serializing, the length may or may not
+///      be known before iterating through all the data. When deserializing,
+///      the length is determined by looking at the serialized data.
+///  - **tuple**
+///    - A statically sized heterogeneous sequence of values for which the
+///      length will be known at deserialization time without looking at the
+///      serialized data, for example `(u8,)` or `(String, u64, Vec<T>)` or
+///      `[u64; 10]`.
+///  - **tuple_struct**
+///    - A named tuple, for example `struct Rgb(u8, u8, u8)`.
+///  - **tuple_variant**
+///    - For example the `E::T` in `enum E { T(u8, u8) }`.
+///  - **map**
+///    - A heterogeneous key-value pairing, for example `BTreeMap<K, V>`.
+///  - **struct**
+///    - A heterogeneous key-value pairing in which the keys are strings and
+///      will be known at deserialization time without looking at the
+///      serialized data, for example `struct S { r: u8, g: u8, b: u8 }`.
+///  - **struct_variant**
+///    - For example the `E::S` in `enum E { S { r: u8, g: u8, b: u8 } }`.
+///
+/// Many Serde serializers produce text or binary data as output, for example
+/// JSON or Bincode. This is not a requirement of the `Serializer` trait, and
+/// there are serializers that do not produce text or binary output. One example
+/// is the `serde_json::value::Serializer` (distinct from the main `serde_json`
+/// serializer) that produces a `serde_json::Value` data structure in memory as
+/// output.
+///
+/// [Serde data model]: https://serde.rs/data-model.html
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website contains example code for
+/// a basic JSON `Serializer`.
+///
+/// [example data format]: https://serde.rs/data-format.html
+pub trait Serializer: Sized {
+    /// The output type produced by this `Serializer` during successful
+    /// serialization. Most serializers that produce text or binary output
+    /// should set `Ok = ()` and serialize into an [`io::Write`] or buffer
+    /// contained within the `Serializer` instance. Serializers that build
+    /// in-memory data structures may be simplified by using `Ok` to propagate
+    /// the data structure around.
+    ///
+    /// [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html
+    type Ok;
+
+    /// The error type when some error occurs during serialization.
+    type Error: Error;
+
+    /// Type returned from [`serialize_seq`] for serializing the content of the
+    /// sequence.
+    ///
+    /// [`serialize_seq`]: #tymethod.serialize_seq
+    type SerializeSeq: SerializeSeq<Ok = Self::Ok, Error = Self::Error>;
+
+    /// Type returned from [`serialize_tuple`] for serializing the content of
+    /// the tuple.
+    ///
+    /// [`serialize_tuple`]: #tymethod.serialize_tuple
+    type SerializeTuple: SerializeTuple<Ok = Self::Ok, Error = Self::Error>;
+
+    /// Type returned from [`serialize_tuple_struct`] for serializing the
+    /// content of the tuple struct.
+    ///
+    /// [`serialize_tuple_struct`]: #tymethod.serialize_tuple_struct
+    type SerializeTupleStruct: SerializeTupleStruct<Ok = Self::Ok, Error = Self::Error>;
+
+    /// Type returned from [`serialize_tuple_variant`] for serializing the
+    /// content of the tuple variant.
+    ///
+    /// [`serialize_tuple_variant`]: #tymethod.serialize_tuple_variant
+    type SerializeTupleVariant: SerializeTupleVariant<Ok = Self::Ok, Error = Self::Error>;
+
+    /// Type returned from [`serialize_map`] for serializing the content of the
+    /// map.
+    ///
+    /// [`serialize_map`]: #tymethod.serialize_map
+    type SerializeMap: SerializeMap<Ok = Self::Ok, Error = Self::Error>;
+
+    /// Type returned from [`serialize_struct`] for serializing the content of
+    /// the struct.
+    ///
+    /// [`serialize_struct`]: #tymethod.serialize_struct
+    type SerializeStruct: SerializeStruct<Ok = Self::Ok, Error = Self::Error>;
+
+    /// Type returned from [`serialize_struct_variant`] for serializing the
+    /// content of the struct variant.
+    ///
+    /// [`serialize_struct_variant`]: #tymethod.serialize_struct_variant
+    type SerializeStructVariant: SerializeStructVariant<Ok = Self::Ok, Error = Self::Error>;
+
+    /// Serialize a `bool` value.
+    ///
+    /// ```edition2018
+    /// # use serde::Serializer;
+    /// #
+    /// # serde::__private_serialize!();
+    /// #
+    /// impl Serialize for bool {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_bool(*self)
+    ///     }
+    /// }
+    /// ```
+    fn serialize_bool(self, v: bool) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize an `i8` value.
+    ///
+    /// If the format does not differentiate between `i8` and `i64`, a
+    /// reasonable implementation would be to cast the value to `i64` and
+    /// forward to `serialize_i64`.
+    ///
+    /// ```edition2018
+    /// # use serde::Serializer;
+    /// #
+    /// # serde::__private_serialize!();
+    /// #
+    /// impl Serialize for i8 {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_i8(*self)
+    ///     }
+    /// }
+    /// ```
+    fn serialize_i8(self, v: i8) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize an `i16` value.
+    ///
+    /// If the format does not differentiate between `i16` and `i64`, a
+    /// reasonable implementation would be to cast the value to `i64` and
+    /// forward to `serialize_i64`.
+    ///
+    /// ```edition2018
+    /// # use serde::Serializer;
+    /// #
+    /// # serde::__private_serialize!();
+    /// #
+    /// impl Serialize for i16 {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_i16(*self)
+    ///     }
+    /// }
+    /// ```
+    fn serialize_i16(self, v: i16) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize an `i32` value.
+    ///
+    /// If the format does not differentiate between `i32` and `i64`, a
+    /// reasonable implementation would be to cast the value to `i64` and
+    /// forward to `serialize_i64`.
+    ///
+    /// ```edition2018
+    /// # use serde::Serializer;
+    /// #
+    /// # serde::__private_serialize!();
+    /// #
+    /// impl Serialize for i32 {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_i32(*self)
+    ///     }
+    /// }
+    /// ```
+    fn serialize_i32(self, v: i32) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize an `i64` value.
+    ///
+    /// ```edition2018
+    /// # use serde::Serializer;
+    /// #
+    /// # serde::__private_serialize!();
+    /// #
+    /// impl Serialize for i64 {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_i64(*self)
+    ///     }
+    /// }
+    /// ```
+    fn serialize_i64(self, v: i64) -> Result<Self::Ok, Self::Error>;
+
+    serde_if_integer128! {
+        /// Serialize an `i128` value.
+        ///
+        /// ```edition2018
+        /// # use serde::Serializer;
+        /// #
+        /// # serde::__private_serialize!();
+        /// #
+        /// impl Serialize for i128 {
+        ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+        ///     where
+        ///         S: Serializer,
+        ///     {
+        ///         serializer.serialize_i128(*self)
+        ///     }
+        /// }
+        /// ```
+        ///
+        /// This method is available only on Rust compiler versions >=1.26. The
+        /// default behavior unconditionally returns an error.
+        fn serialize_i128(self, v: i128) -> Result<Self::Ok, Self::Error> {
+            let _ = v;
+            Err(Error::custom("i128 is not supported"))
+        }
+    }
+
+    /// Serialize a `u8` value.
+    ///
+    /// If the format does not differentiate between `u8` and `u64`, a
+    /// reasonable implementation would be to cast the value to `u64` and
+    /// forward to `serialize_u64`.
+    ///
+    /// ```edition2018
+    /// # use serde::Serializer;
+    /// #
+    /// # serde::__private_serialize!();
+    /// #
+    /// impl Serialize for u8 {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_u8(*self)
+    ///     }
+    /// }
+    /// ```
+    fn serialize_u8(self, v: u8) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize a `u16` value.
+    ///
+    /// If the format does not differentiate between `u16` and `u64`, a
+    /// reasonable implementation would be to cast the value to `u64` and
+    /// forward to `serialize_u64`.
+    ///
+    /// ```edition2018
+    /// # use serde::Serializer;
+    /// #
+    /// # serde::__private_serialize!();
+    /// #
+    /// impl Serialize for u16 {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_u16(*self)
+    ///     }
+    /// }
+    /// ```
+    fn serialize_u16(self, v: u16) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize a `u32` value.
+    ///
+    /// If the format does not differentiate between `u32` and `u64`, a
+    /// reasonable implementation would be to cast the value to `u64` and
+    /// forward to `serialize_u64`.
+    ///
+    /// ```edition2018
+    /// # use serde::Serializer;
+    /// #
+    /// # serde::__private_serialize!();
+    /// #
+    /// impl Serialize for u32 {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_u32(*self)
+    ///     }
+    /// }
+    /// ```
+    fn serialize_u32(self, v: u32) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize a `u64` value.
+    ///
+    /// ```edition2018
+    /// # use serde::Serializer;
+    /// #
+    /// # serde::__private_serialize!();
+    /// #
+    /// impl Serialize for u64 {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_u64(*self)
+    ///     }
+    /// }
+    /// ```
+    fn serialize_u64(self, v: u64) -> Result<Self::Ok, Self::Error>;
+
+    serde_if_integer128! {
+        /// Serialize a `u128` value.
+        ///
+        /// ```edition2018
+        /// # use serde::Serializer;
+        /// #
+        /// # serde::__private_serialize!();
+        /// #
+        /// impl Serialize for u128 {
+        ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+        ///     where
+        ///         S: Serializer,
+        ///     {
+        ///         serializer.serialize_u128(*self)
+        ///     }
+        /// }
+        /// ```
+        ///
+        /// This method is available only on Rust compiler versions >=1.26. The
+        /// default behavior unconditionally returns an error.
+        fn serialize_u128(self, v: u128) -> Result<Self::Ok, Self::Error> {
+            let _ = v;
+            Err(Error::custom("u128 is not supported"))
+        }
+    }
+
+    /// Serialize an `f32` value.
+    ///
+    /// If the format does not differentiate between `f32` and `f64`, a
+    /// reasonable implementation would be to cast the value to `f64` and
+    /// forward to `serialize_f64`.
+    ///
+    /// ```edition2018
+    /// # use serde::Serializer;
+    /// #
+    /// # serde::__private_serialize!();
+    /// #
+    /// impl Serialize for f32 {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_f32(*self)
+    ///     }
+    /// }
+    /// ```
+    fn serialize_f32(self, v: f32) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize an `f64` value.
+    ///
+    /// ```edition2018
+    /// # use serde::Serializer;
+    /// #
+    /// # serde::__private_serialize!();
+    /// #
+    /// impl Serialize for f64 {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_f64(*self)
+    ///     }
+    /// }
+    /// ```
+    fn serialize_f64(self, v: f64) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize a character.
+    ///
+    /// If the format does not support characters, it is reasonable to serialize
+    /// it as a single element `str` or a `u32`.
+    ///
+    /// ```edition2018
+    /// # use serde::Serializer;
+    /// #
+    /// # serde::__private_serialize!();
+    /// #
+    /// impl Serialize for char {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_char(*self)
+    ///     }
+    /// }
+    /// ```
+    fn serialize_char(self, v: char) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize a `&str`.
+    ///
+    /// ```edition2018
+    /// # use serde::Serializer;
+    /// #
+    /// # serde::__private_serialize!();
+    /// #
+    /// impl Serialize for str {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_str(self)
+    ///     }
+    /// }
+    /// ```
+    fn serialize_str(self, v: &str) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize a chunk of raw byte data.
+    ///
+    /// Enables serializers to serialize byte slices more compactly or more
+    /// efficiently than other types of slices. If no efficient implementation
+    /// is available, a reasonable implementation would be to forward to
+    /// `serialize_seq`. If forwarded, the implementation looks usually just
+    /// like this:
+    ///
+    /// ```edition2018
+    /// # use serde::ser::{Serializer, SerializeSeq};
+    /// # use serde::private::ser::Error;
+    /// #
+    /// # struct MySerializer;
+    /// #
+    /// # impl Serializer for MySerializer {
+    /// #     type Ok = ();
+    /// #     type Error = Error;
+    /// #
+    /// fn serialize_bytes(self, v: &[u8]) -> Result<Self::Ok, Self::Error> {
+    ///     let mut seq = self.serialize_seq(Some(v.len()))?;
+    ///     for b in v {
+    ///         seq.serialize_element(b)?;
+    ///     }
+    ///     seq.end()
+    /// }
+    /// #
+    /// #     serde::__serialize_unimplemented! {
+    /// #         bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str none some
+    /// #         unit unit_struct unit_variant newtype_struct newtype_variant
+    /// #         seq tuple tuple_struct tuple_variant map struct struct_variant
+    /// #     }
+    /// # }
+    /// ```
+    fn serialize_bytes(self, v: &[u8]) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize a [`None`] value.
+    ///
+    /// ```edition2018
+    /// # use serde::{Serialize, Serializer};
+    /// #
+    /// # enum Option<T> {
+    /// #     Some(T),
+    /// #     None,
+    /// # }
+    /// #
+    /// # use self::Option::{Some, None};
+    /// #
+    /// impl<T> Serialize for Option<T>
+    /// where
+    ///     T: Serialize,
+    /// {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         match *self {
+    ///             Some(ref value) => serializer.serialize_some(value),
+    ///             None => serializer.serialize_none(),
+    ///         }
+    ///     }
+    /// }
+    /// #
+    /// # fn main() {}
+    /// ```
+    ///
+    /// [`None`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.None
+    fn serialize_none(self) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize a [`Some(T)`] value.
+    ///
+    /// ```edition2018
+    /// # use serde::{Serialize, Serializer};
+    /// #
+    /// # enum Option<T> {
+    /// #     Some(T),
+    /// #     None,
+    /// # }
+    /// #
+    /// # use self::Option::{Some, None};
+    /// #
+    /// impl<T> Serialize for Option<T>
+    /// where
+    ///     T: Serialize,
+    /// {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         match *self {
+    ///             Some(ref value) => serializer.serialize_some(value),
+    ///             None => serializer.serialize_none(),
+    ///         }
+    ///     }
+    /// }
+    /// #
+    /// # fn main() {}
+    /// ```
+    ///
+    /// [`Some(T)`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.Some
+    fn serialize_some<T: ?Sized>(self, value: &T) -> Result<Self::Ok, Self::Error>
+    where
+        T: Serialize;
+
+    /// Serialize a `()` value.
+    ///
+    /// ```edition2018
+    /// # use serde::Serializer;
+    /// #
+    /// # serde::__private_serialize!();
+    /// #
+    /// impl Serialize for () {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_unit()
+    ///     }
+    /// }
+    /// ```
+    fn serialize_unit(self) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize a unit struct like `struct Unit` or `PhantomData<T>`.
+    ///
+    /// A reasonable implementation would be to forward to `serialize_unit`.
+    ///
+    /// ```edition2018
+    /// use serde::{Serialize, Serializer};
+    ///
+    /// struct Nothing;
+    ///
+    /// impl Serialize for Nothing {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_unit_struct("Nothing")
+    ///     }
+    /// }
+    /// ```
+    fn serialize_unit_struct(self, name: &'static str) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize a unit variant like `E::A` in `enum E { A, B }`.
+    ///
+    /// The `name` is the name of the enum, the `variant_index` is the index of
+    /// this variant within the enum, and the `variant` is the name of the
+    /// variant.
+    ///
+    /// ```edition2018
+    /// use serde::{Serialize, Serializer};
+    ///
+    /// enum E {
+    ///     A,
+    ///     B,
+    /// }
+    ///
+    /// impl Serialize for E {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         match *self {
+    ///             E::A => serializer.serialize_unit_variant("E", 0, "A"),
+    ///             E::B => serializer.serialize_unit_variant("E", 1, "B"),
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    fn serialize_unit_variant(
+        self,
+        name: &'static str,
+        variant_index: u32,
+        variant: &'static str,
+    ) -> Result<Self::Ok, Self::Error>;
+
+    /// Serialize a newtype struct like `struct Millimeters(u8)`.
+    ///
+    /// Serializers are encouraged to treat newtype structs as insignificant
+    /// wrappers around the data they contain. A reasonable implementation would
+    /// be to forward to `value.serialize(self)`.
+    ///
+    /// ```edition2018
+    /// use serde::{Serialize, Serializer};
+    ///
+    /// struct Millimeters(u8);
+    ///
+    /// impl Serialize for Millimeters {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.serialize_newtype_struct("Millimeters", &self.0)
+    ///     }
+    /// }
+    /// ```
+    fn serialize_newtype_struct<T: ?Sized>(
+        self,
+        name: &'static str,
+        value: &T,
+    ) -> Result<Self::Ok, Self::Error>
+    where
+        T: Serialize;
+
+    /// Serialize a newtype variant like `E::N` in `enum E { N(u8) }`.
+    ///
+    /// The `name` is the name of the enum, the `variant_index` is the index of
+    /// this variant within the enum, and the `variant` is the name of the
+    /// variant. The `value` is the data contained within this newtype variant.
+    ///
+    /// ```edition2018
+    /// use serde::{Serialize, Serializer};
+    ///
+    /// enum E {
+    ///     M(String),
+    ///     N(u8),
+    /// }
+    ///
+    /// impl Serialize for E {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         match *self {
+    ///             E::M(ref s) => serializer.serialize_newtype_variant("E", 0, "M", s),
+    ///             E::N(n) => serializer.serialize_newtype_variant("E", 1, "N", &n),
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    fn serialize_newtype_variant<T: ?Sized>(
+        self,
+        name: &'static str,
+        variant_index: u32,
+        variant: &'static str,
+        value: &T,
+    ) -> Result<Self::Ok, Self::Error>
+    where
+        T: Serialize;
+
+    /// Begin to serialize a variably sized sequence. This call must be
+    /// followed by zero or more calls to `serialize_element`, then a call to
+    /// `end`.
+    ///
+    /// The argument is the number of elements in the sequence, which may or may
+    /// not be computable before the sequence is iterated. Some serializers only
+    /// support sequences whose length is known up front.
+    ///
+    /// ```edition2018
+    /// # use std::marker::PhantomData;
+    /// #
+    /// # struct Vec<T>(PhantomData<T>);
+    /// #
+    /// # impl<T> Vec<T> {
+    /// #     fn len(&self) -> usize {
+    /// #         unimplemented!()
+    /// #     }
+    /// # }
+    /// #
+    /// # impl<'a, T> IntoIterator for &'a Vec<T> {
+    /// #     type Item = &'a T;
+    /// #     type IntoIter = Box<Iterator<Item = &'a T>>;
+    /// #
+    /// #     fn into_iter(self) -> Self::IntoIter {
+    /// #         unimplemented!()
+    /// #     }
+    /// # }
+    /// #
+    /// use serde::ser::{Serialize, Serializer, SerializeSeq};
+    ///
+    /// impl<T> Serialize for Vec<T>
+    /// where
+    ///     T: Serialize,
+    /// {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         let mut seq = serializer.serialize_seq(Some(self.len()))?;
+    ///         for element in self {
+    ///             seq.serialize_element(element)?;
+    ///         }
+    ///         seq.end()
+    ///     }
+    /// }
+    /// ```
+    fn serialize_seq(self, len: Option<usize>) -> Result<Self::SerializeSeq, Self::Error>;
+
+    /// Begin to serialize a statically sized sequence whose length will be
+    /// known at deserialization time without looking at the serialized data.
+    /// This call must be followed by zero or more calls to `serialize_element`,
+    /// then a call to `end`.
+    ///
+    /// ```edition2018
+    /// use serde::ser::{Serialize, Serializer, SerializeTuple};
+    ///
+    /// # mod fool {
+    /// #     trait Serialize {}
+    /// impl<A, B, C> Serialize for (A, B, C)
+    /// #     {}
+    /// # }
+    /// #
+    /// # struct Tuple3<A, B, C>(A, B, C);
+    /// #
+    /// # impl<A, B, C> Serialize for Tuple3<A, B, C>
+    /// where
+    ///     A: Serialize,
+    ///     B: Serialize,
+    ///     C: Serialize,
+    /// {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         let mut tup = serializer.serialize_tuple(3)?;
+    ///         tup.serialize_element(&self.0)?;
+    ///         tup.serialize_element(&self.1)?;
+    ///         tup.serialize_element(&self.2)?;
+    ///         tup.end()
+    ///     }
+    /// }
+    /// ```
+    ///
+    /// ```edition2018
+    /// use serde::ser::{Serialize, SerializeTuple, Serializer};
+    ///
+    /// const VRAM_SIZE: usize = 386;
+    /// struct Vram([u16; VRAM_SIZE]);
+    ///
+    /// impl Serialize for Vram {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         let mut seq = serializer.serialize_tuple(VRAM_SIZE)?;
+    ///         for element in &self.0[..] {
+    ///             seq.serialize_element(element)?;
+    ///         }
+    ///         seq.end()
+    ///     }
+    /// }
+    /// ```
+    fn serialize_tuple(self, len: usize) -> Result<Self::SerializeTuple, Self::Error>;
+
+    /// Begin to serialize a tuple struct like `struct Rgb(u8, u8, u8)`. This
+    /// call must be followed by zero or more calls to `serialize_field`, then a
+    /// call to `end`.
+    ///
+    /// The `name` is the name of the tuple struct and the `len` is the number
+    /// of data fields that will be serialized.
+    ///
+    /// ```edition2018
+    /// use serde::ser::{Serialize, SerializeTupleStruct, Serializer};
+    ///
+    /// struct Rgb(u8, u8, u8);
+    ///
+    /// impl Serialize for Rgb {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?;
+    ///         ts.serialize_field(&self.0)?;
+    ///         ts.serialize_field(&self.1)?;
+    ///         ts.serialize_field(&self.2)?;
+    ///         ts.end()
+    ///     }
+    /// }
+    /// ```
+    fn serialize_tuple_struct(
+        self,
+        name: &'static str,
+        len: usize,
+    ) -> Result<Self::SerializeTupleStruct, Self::Error>;
+
+    /// Begin to serialize a tuple variant like `E::T` in `enum E { T(u8, u8)
+    /// }`. This call must be followed by zero or more calls to
+    /// `serialize_field`, then a call to `end`.
+    ///
+    /// The `name` is the name of the enum, the `variant_index` is the index of
+    /// this variant within the enum, the `variant` is the name of the variant,
+    /// and the `len` is the number of data fields that will be serialized.
+    ///
+    /// ```edition2018
+    /// use serde::ser::{Serialize, SerializeTupleVariant, Serializer};
+    ///
+    /// enum E {
+    ///     T(u8, u8),
+    ///     U(String, u32, u32),
+    /// }
+    ///
+    /// impl Serialize for E {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         match *self {
+    ///             E::T(ref a, ref b) => {
+    ///                 let mut tv = serializer.serialize_tuple_variant("E", 0, "T", 2)?;
+    ///                 tv.serialize_field(a)?;
+    ///                 tv.serialize_field(b)?;
+    ///                 tv.end()
+    ///             }
+    ///             E::U(ref a, ref b, ref c) => {
+    ///                 let mut tv = serializer.serialize_tuple_variant("E", 1, "U", 3)?;
+    ///                 tv.serialize_field(a)?;
+    ///                 tv.serialize_field(b)?;
+    ///                 tv.serialize_field(c)?;
+    ///                 tv.end()
+    ///             }
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    fn serialize_tuple_variant(
+        self,
+        name: &'static str,
+        variant_index: u32,
+        variant: &'static str,
+        len: usize,
+    ) -> Result<Self::SerializeTupleVariant, Self::Error>;
+
+    /// Begin to serialize a map. This call must be followed by zero or more
+    /// calls to `serialize_key` and `serialize_value`, then a call to `end`.
+    ///
+    /// The argument is the number of elements in the map, which may or may not
+    /// be computable before the map is iterated. Some serializers only support
+    /// maps whose length is known up front.
+    ///
+    /// ```edition2018
+    /// # use std::marker::PhantomData;
+    /// #
+    /// # struct HashMap<K, V>(PhantomData<K>, PhantomData<V>);
+    /// #
+    /// # impl<K, V> HashMap<K, V> {
+    /// #     fn len(&self) -> usize {
+    /// #         unimplemented!()
+    /// #     }
+    /// # }
+    /// #
+    /// # impl<'a, K, V> IntoIterator for &'a HashMap<K, V> {
+    /// #     type Item = (&'a K, &'a V);
+    /// #     type IntoIter = Box<Iterator<Item = (&'a K, &'a V)>>;
+    /// #
+    /// #     fn into_iter(self) -> Self::IntoIter {
+    /// #         unimplemented!()
+    /// #     }
+    /// # }
+    /// #
+    /// use serde::ser::{Serialize, Serializer, SerializeMap};
+    ///
+    /// impl<K, V> Serialize for HashMap<K, V>
+    /// where
+    ///     K: Serialize,
+    ///     V: Serialize,
+    /// {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         let mut map = serializer.serialize_map(Some(self.len()))?;
+    ///         for (k, v) in self {
+    ///             map.serialize_entry(k, v)?;
+    ///         }
+    ///         map.end()
+    ///     }
+    /// }
+    /// ```
+    fn serialize_map(self, len: Option<usize>) -> Result<Self::SerializeMap, Self::Error>;
+
+    /// Begin to serialize a struct like `struct Rgb { r: u8, g: u8, b: u8 }`.
+    /// This call must be followed by zero or more calls to `serialize_field`,
+    /// then a call to `end`.
+    ///
+    /// The `name` is the name of the struct and the `len` is the number of
+    /// data fields that will be serialized.
+    ///
+    /// ```edition2018
+    /// use serde::ser::{Serialize, SerializeStruct, Serializer};
+    ///
+    /// struct Rgb {
+    ///     r: u8,
+    ///     g: u8,
+    ///     b: u8,
+    /// }
+    ///
+    /// impl Serialize for Rgb {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         let mut rgb = serializer.serialize_struct("Rgb", 3)?;
+    ///         rgb.serialize_field("r", &self.r)?;
+    ///         rgb.serialize_field("g", &self.g)?;
+    ///         rgb.serialize_field("b", &self.b)?;
+    ///         rgb.end()
+    ///     }
+    /// }
+    /// ```
+    fn serialize_struct(
+        self,
+        name: &'static str,
+        len: usize,
+    ) -> Result<Self::SerializeStruct, Self::Error>;
+
+    /// Begin to serialize a struct variant like `E::S` in `enum E { S { r: u8,
+    /// g: u8, b: u8 } }`. This call must be followed by zero or more calls to
+    /// `serialize_field`, then a call to `end`.
+    ///
+    /// The `name` is the name of the enum, the `variant_index` is the index of
+    /// this variant within the enum, the `variant` is the name of the variant,
+    /// and the `len` is the number of data fields that will be serialized.
+    ///
+    /// ```edition2018
+    /// use serde::ser::{Serialize, SerializeStructVariant, Serializer};
+    ///
+    /// enum E {
+    ///     S { r: u8, g: u8, b: u8 },
+    /// }
+    ///
+    /// impl Serialize for E {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         match *self {
+    ///             E::S {
+    ///                 ref r,
+    ///                 ref g,
+    ///                 ref b,
+    ///             } => {
+    ///                 let mut sv = serializer.serialize_struct_variant("E", 0, "S", 3)?;
+    ///                 sv.serialize_field("r", r)?;
+    ///                 sv.serialize_field("g", g)?;
+    ///                 sv.serialize_field("b", b)?;
+    ///                 sv.end()
+    ///             }
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    fn serialize_struct_variant(
+        self,
+        name: &'static str,
+        variant_index: u32,
+        variant: &'static str,
+        len: usize,
+    ) -> Result<Self::SerializeStructVariant, Self::Error>;
+
+    /// Collect an iterator as a sequence.
+    ///
+    /// The default implementation serializes each item yielded by the iterator
+    /// using [`serialize_seq`]. Implementors should not need to override this
+    /// method.
+    ///
+    /// ```edition2018
+    /// use serde::{Serialize, Serializer};
+    ///
+    /// struct SecretlyOneHigher {
+    ///     data: Vec<i32>,
+    /// }
+    ///
+    /// impl Serialize for SecretlyOneHigher {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.collect_seq(self.data.iter().map(|x| x + 1))
+    ///     }
+    /// }
+    /// ```
+    ///
+    /// [`serialize_seq`]: #tymethod.serialize_seq
+    fn collect_seq<I>(self, iter: I) -> Result<Self::Ok, Self::Error>
+    where
+        I: IntoIterator,
+        <I as IntoIterator>::Item: Serialize,
+    {
+        let iter = iter.into_iter();
+        let mut serializer = try!(self.serialize_seq(iter.len_hint()));
+        for item in iter {
+            try!(serializer.serialize_element(&item));
+        }
+        serializer.end()
+    }
+
+    /// Collect an iterator as a map.
+    ///
+    /// The default implementation serializes each pair yielded by the iterator
+    /// using [`serialize_map`]. Implementors should not need to override this
+    /// method.
+    ///
+    /// ```edition2018
+    /// use serde::{Serialize, Serializer};
+    /// use std::collections::BTreeSet;
+    ///
+    /// struct MapToUnit {
+    ///     keys: BTreeSet<i32>,
+    /// }
+    ///
+    /// // Serializes as a map in which the values are all unit.
+    /// impl Serialize for MapToUnit {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.collect_map(self.keys.iter().map(|k| (k, ())))
+    ///     }
+    /// }
+    /// ```
+    ///
+    /// [`serialize_map`]: #tymethod.serialize_map
+    fn collect_map<K, V, I>(self, iter: I) -> Result<Self::Ok, Self::Error>
+    where
+        K: Serialize,
+        V: Serialize,
+        I: IntoIterator<Item = (K, V)>,
+    {
+        let iter = iter.into_iter();
+        let mut serializer = try!(self.serialize_map(iter.len_hint()));
+        for (key, value) in iter {
+            try!(serializer.serialize_entry(&key, &value));
+        }
+        serializer.end()
+    }
+
+    /// Serialize a string produced by an implementation of `Display`.
+    ///
+    /// The default implementation builds a heap-allocated [`String`] and
+    /// delegates to [`serialize_str`]. Serializers are encouraged to provide a
+    /// more efficient implementation if possible.
+    ///
+    /// ```edition2018
+    /// # struct DateTime;
+    /// #
+    /// # impl DateTime {
+    /// #     fn naive_local(&self) -> () { () }
+    /// #     fn offset(&self) -> () { () }
+    /// # }
+    /// #
+    /// use serde::{Serialize, Serializer};
+    ///
+    /// impl Serialize for DateTime {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.collect_str(&format_args!("{:?}{:?}",
+    ///                                              self.naive_local(),
+    ///                                              self.offset()))
+    ///     }
+    /// }
+    /// ```
+    ///
+    /// [`String`]: https://doc.rust-lang.org/std/string/struct.String.html
+    /// [`serialize_str`]: #tymethod.serialize_str
+    #[cfg(any(feature = "std", feature = "alloc"))]
+    fn collect_str<T: ?Sized>(self, value: &T) -> Result<Self::Ok, Self::Error>
+    where
+        T: Display,
+    {
+        use lib::fmt::Write;
+        let mut string = String::new();
+        write!(string, "{}", value).unwrap();
+        self.serialize_str(&string)
+    }
+
+    /// Serialize a string produced by an implementation of `Display`.
+    ///
+    /// Serializers that use `no_std` are required to provide an implementation
+    /// of this method. If no more sensible behavior is possible, the
+    /// implementation is expected to return an error.
+    ///
+    /// ```edition2018
+    /// # struct DateTime;
+    /// #
+    /// # impl DateTime {
+    /// #     fn naive_local(&self) -> () { () }
+    /// #     fn offset(&self) -> () { () }
+    /// # }
+    /// #
+    /// use serde::{Serialize, Serializer};
+    ///
+    /// impl Serialize for DateTime {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         serializer.collect_str(&format_args!("{:?}{:?}",
+    ///                                              self.naive_local(),
+    ///                                              self.offset()))
+    ///     }
+    /// }
+    /// ```
+    #[cfg(not(any(feature = "std", feature = "alloc")))]
+    fn collect_str<T: ?Sized>(self, value: &T) -> Result<Self::Ok, Self::Error>
+    where
+        T: Display;
+
+    /// Determine whether `Serialize` implementations should serialize in
+    /// human-readable form.
+    ///
+    /// Some types have a human-readable form that may be somewhat expensive to
+    /// construct, as well as a binary form that is compact and efficient.
+    /// Generally text-based formats like JSON and YAML will prefer to use the
+    /// human-readable one and binary formats like Bincode will prefer the
+    /// compact one.
+    ///
+    /// ```edition2018
+    /// # use std::fmt::{self, Display};
+    /// #
+    /// # struct Timestamp;
+    /// #
+    /// # impl Timestamp {
+    /// #     fn seconds_since_epoch(&self) -> u64 { unimplemented!() }
+    /// # }
+    /// #
+    /// # impl Display for Timestamp {
+    /// #     fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+    /// #         unimplemented!()
+    /// #     }
+    /// # }
+    /// #
+    /// use serde::{Serialize, Serializer};
+    ///
+    /// impl Serialize for Timestamp {
+    ///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    ///     where
+    ///         S: Serializer,
+    ///     {
+    ///         if serializer.is_human_readable() {
+    ///             // Serialize to a human-readable string "2015-05-15T17:01:00Z".
+    ///             self.to_string().serialize(serializer)
+    ///         } else {
+    ///             // Serialize to a compact binary representation.
+    ///             self.seconds_since_epoch().serialize(serializer)
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    ///
+    /// The default implementation of this method returns `true`. Data formats
+    /// may override this to `false` to request a compact form for types that
+    /// support one. Note that modifying this method to change a format from
+    /// human-readable to compact or vice versa should be regarded as a breaking
+    /// change, as a value serialized in human-readable mode is not required to
+    /// deserialize from the same data in compact mode.
+    #[inline]
+    fn is_human_readable(&self) -> bool {
+        true
+    }
+}
+
+/// Returned from `Serializer::serialize_seq`.
+///
+/// # Example use
+///
+/// ```edition2018
+/// # use std::marker::PhantomData;
+/// #
+/// # struct Vec<T>(PhantomData<T>);
+/// #
+/// # impl<T> Vec<T> {
+/// #     fn len(&self) -> usize {
+/// #         unimplemented!()
+/// #     }
+/// # }
+/// #
+/// # impl<'a, T> IntoIterator for &'a Vec<T> {
+/// #     type Item = &'a T;
+/// #     type IntoIter = Box<Iterator<Item = &'a T>>;
+/// #     fn into_iter(self) -> Self::IntoIter {
+/// #         unimplemented!()
+/// #     }
+/// # }
+/// #
+/// use serde::ser::{Serialize, Serializer, SerializeSeq};
+///
+/// impl<T> Serialize for Vec<T>
+/// where
+///     T: Serialize,
+/// {
+///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+///     where
+///         S: Serializer,
+///     {
+///         let mut seq = serializer.serialize_seq(Some(self.len()))?;
+///         for element in self {
+///             seq.serialize_element(element)?;
+///         }
+///         seq.end()
+///     }
+/// }
+/// ```
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SerializeSeq` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
+pub trait SerializeSeq {
+    /// Must match the `Ok` type of our `Serializer`.
+    type Ok;
+
+    /// Must match the `Error` type of our `Serializer`.
+    type Error: Error;
+
+    /// Serialize a sequence element.
+    fn serialize_element<T: ?Sized>(&mut self, value: &T) -> Result<(), Self::Error>
+    where
+        T: Serialize;
+
+    /// Finish serializing a sequence.
+    fn end(self) -> Result<Self::Ok, Self::Error>;
+}
+
+/// Returned from `Serializer::serialize_tuple`.
+///
+/// # Example use
+///
+/// ```edition2018
+/// use serde::ser::{Serialize, Serializer, SerializeTuple};
+///
+/// # mod fool {
+/// #     trait Serialize {}
+/// impl<A, B, C> Serialize for (A, B, C)
+/// #     {}
+/// # }
+/// #
+/// # struct Tuple3<A, B, C>(A, B, C);
+/// #
+/// # impl<A, B, C> Serialize for Tuple3<A, B, C>
+/// where
+///     A: Serialize,
+///     B: Serialize,
+///     C: Serialize,
+/// {
+///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+///     where
+///         S: Serializer,
+///     {
+///         let mut tup = serializer.serialize_tuple(3)?;
+///         tup.serialize_element(&self.0)?;
+///         tup.serialize_element(&self.1)?;
+///         tup.serialize_element(&self.2)?;
+///         tup.end()
+///     }
+/// }
+/// ```
+///
+/// ```edition2018
+/// # use std::marker::PhantomData;
+/// #
+/// # struct Array<T>(PhantomData<T>);
+/// #
+/// # impl<T> Array<T> {
+/// #     fn len(&self) -> usize {
+/// #         unimplemented!()
+/// #     }
+/// # }
+/// #
+/// # impl<'a, T> IntoIterator for &'a Array<T> {
+/// #     type Item = &'a T;
+/// #     type IntoIter = Box<Iterator<Item = &'a T>>;
+/// #     fn into_iter(self) -> Self::IntoIter {
+/// #         unimplemented!()
+/// #     }
+/// # }
+/// #
+/// use serde::ser::{Serialize, Serializer, SerializeTuple};
+///
+/// # mod fool {
+/// #     trait Serialize {}
+/// impl<T> Serialize for [T; 16]
+/// #     {}
+/// # }
+/// #
+/// # impl<T> Serialize for Array<T>
+/// where
+///     T: Serialize,
+/// {
+///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+///     where
+///         S: Serializer,
+///     {
+///         let mut seq = serializer.serialize_tuple(16)?;
+///         for element in self {
+///             seq.serialize_element(element)?;
+///         }
+///         seq.end()
+///     }
+/// }
+/// ```
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SerializeTuple` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
+pub trait SerializeTuple {
+    /// Must match the `Ok` type of our `Serializer`.
+    type Ok;
+
+    /// Must match the `Error` type of our `Serializer`.
+    type Error: Error;
+
+    /// Serialize a tuple element.
+    fn serialize_element<T: ?Sized>(&mut self, value: &T) -> Result<(), Self::Error>
+    where
+        T: Serialize;
+
+    /// Finish serializing a tuple.
+    fn end(self) -> Result<Self::Ok, Self::Error>;
+}
+
+/// Returned from `Serializer::serialize_tuple_struct`.
+///
+/// # Example use
+///
+/// ```edition2018
+/// use serde::ser::{Serialize, SerializeTupleStruct, Serializer};
+///
+/// struct Rgb(u8, u8, u8);
+///
+/// impl Serialize for Rgb {
+///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+///     where
+///         S: Serializer,
+///     {
+///         let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?;
+///         ts.serialize_field(&self.0)?;
+///         ts.serialize_field(&self.1)?;
+///         ts.serialize_field(&self.2)?;
+///         ts.end()
+///     }
+/// }
+/// ```
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SerializeTupleStruct` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
+pub trait SerializeTupleStruct {
+    /// Must match the `Ok` type of our `Serializer`.
+    type Ok;
+
+    /// Must match the `Error` type of our `Serializer`.
+    type Error: Error;
+
+    /// Serialize a tuple struct field.
+    fn serialize_field<T: ?Sized>(&mut self, value: &T) -> Result<(), Self::Error>
+    where
+        T: Serialize;
+
+    /// Finish serializing a tuple struct.
+    fn end(self) -> Result<Self::Ok, Self::Error>;
+}
+
+/// Returned from `Serializer::serialize_tuple_variant`.
+///
+/// # Example use
+///
+/// ```edition2018
+/// use serde::ser::{Serialize, SerializeTupleVariant, Serializer};
+///
+/// enum E {
+///     T(u8, u8),
+///     U(String, u32, u32),
+/// }
+///
+/// impl Serialize for E {
+///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+///     where
+///         S: Serializer,
+///     {
+///         match *self {
+///             E::T(ref a, ref b) => {
+///                 let mut tv = serializer.serialize_tuple_variant("E", 0, "T", 2)?;
+///                 tv.serialize_field(a)?;
+///                 tv.serialize_field(b)?;
+///                 tv.end()
+///             }
+///             E::U(ref a, ref b, ref c) => {
+///                 let mut tv = serializer.serialize_tuple_variant("E", 1, "U", 3)?;
+///                 tv.serialize_field(a)?;
+///                 tv.serialize_field(b)?;
+///                 tv.serialize_field(c)?;
+///                 tv.end()
+///             }
+///         }
+///     }
+/// }
+/// ```
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SerializeTupleVariant` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
+pub trait SerializeTupleVariant {
+    /// Must match the `Ok` type of our `Serializer`.
+    type Ok;
+
+    /// Must match the `Error` type of our `Serializer`.
+    type Error: Error;
+
+    /// Serialize a tuple variant field.
+    fn serialize_field<T: ?Sized>(&mut self, value: &T) -> Result<(), Self::Error>
+    where
+        T: Serialize;
+
+    /// Finish serializing a tuple variant.
+    fn end(self) -> Result<Self::Ok, Self::Error>;
+}
+
+/// Returned from `Serializer::serialize_map`.
+///
+/// # Example use
+///
+/// ```edition2018
+/// # use std::marker::PhantomData;
+/// #
+/// # struct HashMap<K, V>(PhantomData<K>, PhantomData<V>);
+/// #
+/// # impl<K, V> HashMap<K, V> {
+/// #     fn len(&self) -> usize {
+/// #         unimplemented!()
+/// #     }
+/// # }
+/// #
+/// # impl<'a, K, V> IntoIterator for &'a HashMap<K, V> {
+/// #     type Item = (&'a K, &'a V);
+/// #     type IntoIter = Box<Iterator<Item = (&'a K, &'a V)>>;
+/// #
+/// #     fn into_iter(self) -> Self::IntoIter {
+/// #         unimplemented!()
+/// #     }
+/// # }
+/// #
+/// use serde::ser::{Serialize, Serializer, SerializeMap};
+///
+/// impl<K, V> Serialize for HashMap<K, V>
+/// where
+///     K: Serialize,
+///     V: Serialize,
+/// {
+///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+///     where
+///         S: Serializer,
+///     {
+///         let mut map = serializer.serialize_map(Some(self.len()))?;
+///         for (k, v) in self {
+///             map.serialize_entry(k, v)?;
+///         }
+///         map.end()
+///     }
+/// }
+/// ```
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SerializeMap` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
+pub trait SerializeMap {
+    /// Must match the `Ok` type of our `Serializer`.
+    type Ok;
+
+    /// Must match the `Error` type of our `Serializer`.
+    type Error: Error;
+
+    /// Serialize a map key.
+    ///
+    /// If possible, `Serialize` implementations are encouraged to use
+    /// `serialize_entry` instead as it may be implemented more efficiently in
+    /// some formats compared to a pair of calls to `serialize_key` and
+    /// `serialize_value`.
+    fn serialize_key<T: ?Sized>(&mut self, key: &T) -> Result<(), Self::Error>
+    where
+        T: Serialize;
+
+    /// Serialize a map value.
+    ///
+    /// # Panics
+    ///
+    /// Calling `serialize_value` before `serialize_key` is incorrect and is
+    /// allowed to panic or produce bogus results.
+    fn serialize_value<T: ?Sized>(&mut self, value: &T) -> Result<(), Self::Error>
+    where
+        T: Serialize;
+
+    /// Serialize a map entry consisting of a key and a value.
+    ///
+    /// Some [`Serialize`] types are not able to hold a key and value in memory
+    /// at the same time so `SerializeMap` implementations are required to
+    /// support [`serialize_key`] and [`serialize_value`] individually. The
+    /// `serialize_entry` method allows serializers to optimize for the case
+    /// where key and value are both available. [`Serialize`] implementations
+    /// are encouraged to use `serialize_entry` if possible.
+    ///
+    /// The default implementation delegates to [`serialize_key`] and
+    /// [`serialize_value`]. This is appropriate for serializers that do not
+    /// care about performance or are not able to optimize `serialize_entry` any
+    /// better than this.
+    ///
+    /// [`Serialize`]: ../trait.Serialize.html
+    /// [`serialize_key`]: #tymethod.serialize_key
+    /// [`serialize_value`]: #tymethod.serialize_value
+    fn serialize_entry<K: ?Sized, V: ?Sized>(
+        &mut self,
+        key: &K,
+        value: &V,
+    ) -> Result<(), Self::Error>
+    where
+        K: Serialize,
+        V: Serialize,
+    {
+        try!(self.serialize_key(key));
+        self.serialize_value(value)
+    }
+
+    /// Finish serializing a map.
+    fn end(self) -> Result<Self::Ok, Self::Error>;
+}
+
+/// Returned from `Serializer::serialize_struct`.
+///
+/// # Example use
+///
+/// ```edition2018
+/// use serde::ser::{Serialize, SerializeStruct, Serializer};
+///
+/// struct Rgb {
+///     r: u8,
+///     g: u8,
+///     b: u8,
+/// }
+///
+/// impl Serialize for Rgb {
+///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+///     where
+///         S: Serializer,
+///     {
+///         let mut rgb = serializer.serialize_struct("Rgb", 3)?;
+///         rgb.serialize_field("r", &self.r)?;
+///         rgb.serialize_field("g", &self.g)?;
+///         rgb.serialize_field("b", &self.b)?;
+///         rgb.end()
+///     }
+/// }
+/// ```
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SerializeStruct` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
+pub trait SerializeStruct {
+    /// Must match the `Ok` type of our `Serializer`.
+    type Ok;
+
+    /// Must match the `Error` type of our `Serializer`.
+    type Error: Error;
+
+    /// Serialize a struct field.
+    fn serialize_field<T: ?Sized>(
+        &mut self,
+        key: &'static str,
+        value: &T,
+    ) -> Result<(), Self::Error>
+    where
+        T: Serialize;
+
+    /// Indicate that a struct field has been skipped.
+    #[inline]
+    fn skip_field(&mut self, key: &'static str) -> Result<(), Self::Error> {
+        let _ = key;
+        Ok(())
+    }
+
+    /// Finish serializing a struct.
+    fn end(self) -> Result<Self::Ok, Self::Error>;
+}
+
+/// Returned from `Serializer::serialize_struct_variant`.
+///
+/// # Example use
+///
+/// ```edition2018
+/// use serde::ser::{Serialize, SerializeStructVariant, Serializer};
+///
+/// enum E {
+///     S { r: u8, g: u8, b: u8 },
+/// }
+///
+/// impl Serialize for E {
+///     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+///     where
+///         S: Serializer,
+///     {
+///         match *self {
+///             E::S {
+///                 ref r,
+///                 ref g,
+///                 ref b,
+///             } => {
+///                 let mut sv = serializer.serialize_struct_variant("E", 0, "S", 3)?;
+///                 sv.serialize_field("r", r)?;
+///                 sv.serialize_field("g", g)?;
+///                 sv.serialize_field("b", b)?;
+///                 sv.end()
+///             }
+///         }
+///     }
+/// }
+/// ```
+///
+/// # Example implementation
+///
+/// The [example data format] presented on the website demonstrates an
+/// implementation of `SerializeStructVariant` for a basic JSON data format.
+///
+/// [example data format]: https://serde.rs/data-format.html
+pub trait SerializeStructVariant {
+    /// Must match the `Ok` type of our `Serializer`.
+    type Ok;
+
+    /// Must match the `Error` type of our `Serializer`.
+    type Error: Error;
+
+    /// Serialize a struct variant field.
+    fn serialize_field<T: ?Sized>(
+        &mut self,
+        key: &'static str,
+        value: &T,
+    ) -> Result<(), Self::Error>
+    where
+        T: Serialize;
+
+    /// Indicate that a struct variant field has been skipped.
+    #[inline]
+    fn skip_field(&mut self, key: &'static str) -> Result<(), Self::Error> {
+        let _ = key;
+        Ok(())
+    }
+
+    /// Finish serializing a struct variant.
+    fn end(self) -> Result<Self::Ok, Self::Error>;
+}
+
+trait LenHint: Iterator {
+    fn len_hint(&self) -> Option<usize>;
+}
+
+impl<I> LenHint for I
+where
+    I: Iterator,
+{
+    #[cfg(not(feature = "unstable"))]
+    fn len_hint(&self) -> Option<usize> {
+        iterator_len_hint(self)
+    }
+
+    #[cfg(feature = "unstable")]
+    default fn len_hint(&self) -> Option<usize> {
+        iterator_len_hint(self)
+    }
+}
+
+#[cfg(feature = "unstable")]
+impl<I> LenHint for I
+where
+    I: ExactSizeIterator,
+{
+    fn len_hint(&self) -> Option<usize> {
+        Some(self.len())
+    }
+}
+
+fn iterator_len_hint<I>(iter: &I) -> Option<usize>
+where
+    I: Iterator,
+{
+    match iter.size_hint() {
+        (lo, Some(hi)) if lo == hi => Some(lo),
+        _ => None,
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/bound.rs.html b/src/serde_derive/bound.rs.html new file mode 100644 index 0000000..451183d --- /dev/null +++ b/src/serde_derive/bound.rs.html @@ -0,0 +1,637 @@ +bound.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+
+use std::collections::HashSet;
+
+use syn;
+use syn::punctuated::{Pair, Punctuated};
+use syn::visit::{self, Visit};
+
+use internals::ast::{Container, Data};
+use internals::attr;
+
+use proc_macro2::Span;
+
+// Remove the default from every type parameter because in the generated impls
+// they look like associated types: "error: associated type bindings are not
+// allowed here".
+pub fn without_defaults(generics: &syn::Generics) -> syn::Generics {
+    syn::Generics {
+        params: generics
+            .params
+            .iter()
+            .map(|param| match param {
+                syn::GenericParam::Type(param) => syn::GenericParam::Type(syn::TypeParam {
+                    eq_token: None,
+                    default: None,
+                    ..param.clone()
+                }),
+                _ => param.clone(),
+            })
+            .collect(),
+        ..generics.clone()
+    }
+}
+
+pub fn with_where_predicates(
+    generics: &syn::Generics,
+    predicates: &[syn::WherePredicate],
+) -> syn::Generics {
+    let mut generics = generics.clone();
+    generics
+        .make_where_clause()
+        .predicates
+        .extend(predicates.iter().cloned());
+    generics
+}
+
+pub fn with_where_predicates_from_fields(
+    cont: &Container,
+    generics: &syn::Generics,
+    from_field: fn(&attr::Field) -> Option<&[syn::WherePredicate]>,
+) -> syn::Generics {
+    let predicates = cont
+        .data
+        .all_fields()
+        .flat_map(|field| from_field(&field.attrs))
+        .flat_map(|predicates| predicates.to_vec());
+
+    let mut generics = generics.clone();
+    generics.make_where_clause().predicates.extend(predicates);
+    generics
+}
+
+pub fn with_where_predicates_from_variants(
+    cont: &Container,
+    generics: &syn::Generics,
+    from_variant: fn(&attr::Variant) -> Option<&[syn::WherePredicate]>,
+) -> syn::Generics {
+    let variants = match &cont.data {
+        Data::Enum(variants) => variants,
+        Data::Struct(_, _) => {
+            return generics.clone();
+        }
+    };
+
+    let predicates = variants
+        .iter()
+        .flat_map(|variant| from_variant(&variant.attrs))
+        .flat_map(|predicates| predicates.to_vec());
+
+    let mut generics = generics.clone();
+    generics.make_where_clause().predicates.extend(predicates);
+    generics
+}
+
+// Puts the given bound on any generic type parameters that are used in fields
+// for which filter returns true.
+//
+// For example, the following struct needs the bound `A: Serialize, B:
+// Serialize`.
+//
+//     struct S<'b, A, B: 'b, C> {
+//         a: A,
+//         b: Option<&'b B>
+//         #[serde(skip_serializing)]
+//         c: C,
+//     }
+pub fn with_bound(
+    cont: &Container,
+    generics: &syn::Generics,
+    filter: fn(&attr::Field, Option<&attr::Variant>) -> bool,
+    bound: &syn::Path,
+) -> syn::Generics {
+    struct FindTyParams<'ast> {
+        // Set of all generic type parameters on the current struct (A, B, C in
+        // the example). Initialized up front.
+        all_type_params: HashSet<syn::Ident>,
+
+        // Set of generic type parameters used in fields for which filter
+        // returns true (A and B in the example). Filled in as the visitor sees
+        // them.
+        relevant_type_params: HashSet<syn::Ident>,
+
+        // Fields whose type is an associated type of one of the generic type
+        // parameters.
+        associated_type_usage: Vec<&'ast syn::TypePath>,
+    }
+    impl<'ast> Visit<'ast> for FindTyParams<'ast> {
+        fn visit_field(&mut self, field: &'ast syn::Field) {
+            if let syn::Type::Path(ty) = &field.ty {
+                if let Some(Pair::Punctuated(t, _)) = ty.path.segments.pairs().next() {
+                    if self.all_type_params.contains(&t.ident) {
+                        self.associated_type_usage.push(ty);
+                    }
+                }
+            }
+            self.visit_type(&field.ty);
+        }
+
+        fn visit_path(&mut self, path: &'ast syn::Path) {
+            if let Some(seg) = path.segments.last() {
+                if seg.ident == "PhantomData" {
+                    // Hardcoded exception, because PhantomData<T> implements
+                    // Serialize and Deserialize whether or not T implements it.
+                    return;
+                }
+            }
+            if path.leading_colon.is_none() && path.segments.len() == 1 {
+                let id = &path.segments[0].ident;
+                if self.all_type_params.contains(id) {
+                    self.relevant_type_params.insert(id.clone());
+                }
+            }
+            visit::visit_path(self, path);
+        }
+
+        // Type parameter should not be considered used by a macro path.
+        //
+        //     struct TypeMacro<T> {
+        //         mac: T!(),
+        //         marker: PhantomData<T>,
+        //     }
+        fn visit_macro(&mut self, _mac: &'ast syn::Macro) {}
+    }
+
+    let all_type_params = generics
+        .type_params()
+        .map(|param| param.ident.clone())
+        .collect();
+
+    let mut visitor = FindTyParams {
+        all_type_params: all_type_params,
+        relevant_type_params: HashSet::new(),
+        associated_type_usage: Vec::new(),
+    };
+    match &cont.data {
+        Data::Enum(variants) => {
+            for variant in variants.iter() {
+                let relevant_fields = variant
+                    .fields
+                    .iter()
+                    .filter(|field| filter(&field.attrs, Some(&variant.attrs)));
+                for field in relevant_fields {
+                    visitor.visit_field(field.original);
+                }
+            }
+        }
+        Data::Struct(_, fields) => {
+            for field in fields.iter().filter(|field| filter(&field.attrs, None)) {
+                visitor.visit_field(field.original);
+            }
+        }
+    }
+
+    let relevant_type_params = visitor.relevant_type_params;
+    let associated_type_usage = visitor.associated_type_usage;
+    let new_predicates = generics
+        .type_params()
+        .map(|param| param.ident.clone())
+        .filter(|id| relevant_type_params.contains(id))
+        .map(|id| syn::TypePath {
+            qself: None,
+            path: id.into(),
+        })
+        .chain(associated_type_usage.into_iter().cloned())
+        .map(|bounded_ty| {
+            syn::WherePredicate::Type(syn::PredicateType {
+                lifetimes: None,
+                // the type parameter that is being bounded e.g. T
+                bounded_ty: syn::Type::Path(bounded_ty),
+                colon_token: <Token![:]>::default(),
+                // the bound e.g. Serialize
+                bounds: vec![syn::TypeParamBound::Trait(syn::TraitBound {
+                    paren_token: None,
+                    modifier: syn::TraitBoundModifier::None,
+                    lifetimes: None,
+                    path: bound.clone(),
+                })]
+                .into_iter()
+                .collect(),
+            })
+        });
+
+    let mut generics = generics.clone();
+    generics
+        .make_where_clause()
+        .predicates
+        .extend(new_predicates);
+    generics
+}
+
+pub fn with_self_bound(
+    cont: &Container,
+    generics: &syn::Generics,
+    bound: &syn::Path,
+) -> syn::Generics {
+    let mut generics = generics.clone();
+    generics
+        .make_where_clause()
+        .predicates
+        .push(syn::WherePredicate::Type(syn::PredicateType {
+            lifetimes: None,
+            // the type that is being bounded e.g. MyStruct<'a, T>
+            bounded_ty: type_of_item(cont),
+            colon_token: <Token![:]>::default(),
+            // the bound e.g. Default
+            bounds: vec![syn::TypeParamBound::Trait(syn::TraitBound {
+                paren_token: None,
+                modifier: syn::TraitBoundModifier::None,
+                lifetimes: None,
+                path: bound.clone(),
+            })]
+            .into_iter()
+            .collect(),
+        }));
+    generics
+}
+
+pub fn with_lifetime_bound(generics: &syn::Generics, lifetime: &str) -> syn::Generics {
+    let bound = syn::Lifetime::new(lifetime, Span::call_site());
+    let def = syn::LifetimeDef {
+        attrs: Vec::new(),
+        lifetime: bound.clone(),
+        colon_token: None,
+        bounds: Punctuated::new(),
+    };
+
+    let params = Some(syn::GenericParam::Lifetime(def))
+        .into_iter()
+        .chain(generics.params.iter().cloned().map(|mut param| {
+            match &mut param {
+                syn::GenericParam::Lifetime(param) => {
+                    param.bounds.push(bound.clone());
+                }
+                syn::GenericParam::Type(param) => {
+                    param
+                        .bounds
+                        .push(syn::TypeParamBound::Lifetime(bound.clone()));
+                }
+                syn::GenericParam::Const(_) => {}
+            }
+            param
+        }))
+        .collect();
+
+    syn::Generics {
+        params: params,
+        ..generics.clone()
+    }
+}
+
+fn type_of_item(cont: &Container) -> syn::Type {
+    syn::Type::Path(syn::TypePath {
+        qself: None,
+        path: syn::Path {
+            leading_colon: None,
+            segments: vec![syn::PathSegment {
+                ident: cont.ident.clone(),
+                arguments: syn::PathArguments::AngleBracketed(
+                    syn::AngleBracketedGenericArguments {
+                        colon2_token: None,
+                        lt_token: <Token![<]>::default(),
+                        args: cont
+                            .generics
+                            .params
+                            .iter()
+                            .map(|param| match param {
+                                syn::GenericParam::Type(param) => {
+                                    syn::GenericArgument::Type(syn::Type::Path(syn::TypePath {
+                                        qself: None,
+                                        path: param.ident.clone().into(),
+                                    }))
+                                }
+                                syn::GenericParam::Lifetime(param) => {
+                                    syn::GenericArgument::Lifetime(param.lifetime.clone())
+                                }
+                                syn::GenericParam::Const(_) => {
+                                    panic!("Serde does not support const generics yet");
+                                }
+                            })
+                            .collect(),
+                        gt_token: <Token![>]>::default(),
+                    },
+                ),
+            }]
+            .into_iter()
+            .collect(),
+        },
+    })
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/de.rs.html b/src/serde_derive/de.rs.html new file mode 100644 index 0000000..caf2c8c --- /dev/null +++ b/src/serde_derive/de.rs.html @@ -0,0 +1,6095 @@ +de.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+2277
+2278
+2279
+2280
+2281
+2282
+2283
+2284
+2285
+2286
+2287
+2288
+2289
+2290
+2291
+2292
+2293
+2294
+2295
+2296
+2297
+2298
+2299
+2300
+2301
+2302
+2303
+2304
+2305
+2306
+2307
+2308
+2309
+2310
+2311
+2312
+2313
+2314
+2315
+2316
+2317
+2318
+2319
+2320
+2321
+2322
+2323
+2324
+2325
+2326
+2327
+2328
+2329
+2330
+2331
+2332
+2333
+2334
+2335
+2336
+2337
+2338
+2339
+2340
+2341
+2342
+2343
+2344
+2345
+2346
+2347
+2348
+2349
+2350
+2351
+2352
+2353
+2354
+2355
+2356
+2357
+2358
+2359
+2360
+2361
+2362
+2363
+2364
+2365
+2366
+2367
+2368
+2369
+2370
+2371
+2372
+2373
+2374
+2375
+2376
+2377
+2378
+2379
+2380
+2381
+2382
+2383
+2384
+2385
+2386
+2387
+2388
+2389
+2390
+2391
+2392
+2393
+2394
+2395
+2396
+2397
+2398
+2399
+2400
+2401
+2402
+2403
+2404
+2405
+2406
+2407
+2408
+2409
+2410
+2411
+2412
+2413
+2414
+2415
+2416
+2417
+2418
+2419
+2420
+2421
+2422
+2423
+2424
+2425
+2426
+2427
+2428
+2429
+2430
+2431
+2432
+2433
+2434
+2435
+2436
+2437
+2438
+2439
+2440
+2441
+2442
+2443
+2444
+2445
+2446
+2447
+2448
+2449
+2450
+2451
+2452
+2453
+2454
+2455
+2456
+2457
+2458
+2459
+2460
+2461
+2462
+2463
+2464
+2465
+2466
+2467
+2468
+2469
+2470
+2471
+2472
+2473
+2474
+2475
+2476
+2477
+2478
+2479
+2480
+2481
+2482
+2483
+2484
+2485
+2486
+2487
+2488
+2489
+2490
+2491
+2492
+2493
+2494
+2495
+2496
+2497
+2498
+2499
+2500
+2501
+2502
+2503
+2504
+2505
+2506
+2507
+2508
+2509
+2510
+2511
+2512
+2513
+2514
+2515
+2516
+2517
+2518
+2519
+2520
+2521
+2522
+2523
+2524
+2525
+2526
+2527
+2528
+2529
+2530
+2531
+2532
+2533
+2534
+2535
+2536
+2537
+2538
+2539
+2540
+2541
+2542
+2543
+2544
+2545
+2546
+2547
+2548
+2549
+2550
+2551
+2552
+2553
+2554
+2555
+2556
+2557
+2558
+2559
+2560
+2561
+2562
+2563
+2564
+2565
+2566
+2567
+2568
+2569
+2570
+2571
+2572
+2573
+2574
+2575
+2576
+2577
+2578
+2579
+2580
+2581
+2582
+2583
+2584
+2585
+2586
+2587
+2588
+2589
+2590
+2591
+2592
+2593
+2594
+2595
+2596
+2597
+2598
+2599
+2600
+2601
+2602
+2603
+2604
+2605
+2606
+2607
+2608
+2609
+2610
+2611
+2612
+2613
+2614
+2615
+2616
+2617
+2618
+2619
+2620
+2621
+2622
+2623
+2624
+2625
+2626
+2627
+2628
+2629
+2630
+2631
+2632
+2633
+2634
+2635
+2636
+2637
+2638
+2639
+2640
+2641
+2642
+2643
+2644
+2645
+2646
+2647
+2648
+2649
+2650
+2651
+2652
+2653
+2654
+2655
+2656
+2657
+2658
+2659
+2660
+2661
+2662
+2663
+2664
+2665
+2666
+2667
+2668
+2669
+2670
+2671
+2672
+2673
+2674
+2675
+2676
+2677
+2678
+2679
+2680
+2681
+2682
+2683
+2684
+2685
+2686
+2687
+2688
+2689
+2690
+2691
+2692
+2693
+2694
+2695
+2696
+2697
+2698
+2699
+2700
+2701
+2702
+2703
+2704
+2705
+2706
+2707
+2708
+2709
+2710
+2711
+2712
+2713
+2714
+2715
+2716
+2717
+2718
+2719
+2720
+2721
+2722
+2723
+2724
+2725
+2726
+2727
+2728
+2729
+2730
+2731
+2732
+2733
+2734
+2735
+2736
+2737
+2738
+2739
+2740
+2741
+2742
+2743
+2744
+2745
+2746
+2747
+2748
+2749
+2750
+2751
+2752
+2753
+2754
+2755
+2756
+2757
+2758
+2759
+2760
+2761
+2762
+2763
+2764
+2765
+2766
+2767
+2768
+2769
+2770
+2771
+2772
+2773
+2774
+2775
+2776
+2777
+2778
+2779
+2780
+2781
+2782
+2783
+2784
+2785
+2786
+2787
+2788
+2789
+2790
+2791
+2792
+2793
+2794
+2795
+2796
+2797
+2798
+2799
+2800
+2801
+2802
+2803
+2804
+2805
+2806
+2807
+2808
+2809
+2810
+2811
+2812
+2813
+2814
+2815
+2816
+2817
+2818
+2819
+2820
+2821
+2822
+2823
+2824
+2825
+2826
+2827
+2828
+2829
+2830
+2831
+2832
+2833
+2834
+2835
+2836
+2837
+2838
+2839
+2840
+2841
+2842
+2843
+2844
+2845
+2846
+2847
+2848
+2849
+2850
+2851
+2852
+2853
+2854
+2855
+2856
+2857
+2858
+2859
+2860
+2861
+2862
+2863
+2864
+2865
+2866
+2867
+2868
+2869
+2870
+2871
+2872
+2873
+2874
+2875
+2876
+2877
+2878
+2879
+2880
+2881
+2882
+2883
+2884
+2885
+2886
+2887
+2888
+2889
+2890
+2891
+2892
+2893
+2894
+2895
+2896
+2897
+2898
+2899
+2900
+2901
+2902
+2903
+2904
+2905
+2906
+2907
+2908
+2909
+2910
+2911
+2912
+2913
+2914
+2915
+2916
+2917
+2918
+2919
+2920
+2921
+2922
+2923
+2924
+2925
+2926
+2927
+2928
+2929
+2930
+2931
+2932
+2933
+2934
+2935
+2936
+2937
+2938
+2939
+2940
+2941
+2942
+2943
+2944
+2945
+2946
+2947
+2948
+2949
+2950
+2951
+2952
+2953
+2954
+2955
+2956
+2957
+2958
+2959
+2960
+2961
+2962
+2963
+2964
+2965
+2966
+2967
+2968
+2969
+2970
+2971
+2972
+2973
+2974
+2975
+2976
+2977
+2978
+2979
+2980
+2981
+2982
+2983
+2984
+2985
+2986
+2987
+2988
+2989
+2990
+2991
+2992
+2993
+2994
+2995
+2996
+2997
+2998
+2999
+3000
+3001
+3002
+3003
+3004
+3005
+3006
+3007
+3008
+3009
+3010
+3011
+3012
+3013
+3014
+3015
+3016
+3017
+3018
+3019
+3020
+3021
+3022
+3023
+3024
+3025
+3026
+3027
+3028
+3029
+3030
+3031
+3032
+3033
+3034
+3035
+3036
+3037
+3038
+3039
+3040
+3041
+3042
+3043
+3044
+3045
+3046
+
+use proc_macro2::{Literal, Span, TokenStream};
+use quote::ToTokens;
+use syn::punctuated::Punctuated;
+use syn::spanned::Spanned;
+use syn::{self, Ident, Index, Member};
+
+use bound;
+use dummy;
+use fragment::{Expr, Fragment, Match, Stmts};
+use internals::ast::{Container, Data, Field, Style, Variant};
+use internals::{attr, Ctxt, Derive};
+use pretend;
+
+use std::collections::BTreeSet;
+
+pub fn expand_derive_deserialize(input: &syn::DeriveInput) -> Result<TokenStream, Vec<syn::Error>> {
+    let ctxt = Ctxt::new();
+    let cont = match Container::from_ast(&ctxt, input, Derive::Deserialize) {
+        Some(cont) => cont,
+        None => return Err(ctxt.check().unwrap_err()),
+    };
+    precondition(&ctxt, &cont);
+    ctxt.check()?;
+
+    let ident = &cont.ident;
+    let params = Parameters::new(&cont);
+    let (de_impl_generics, _, ty_generics, where_clause) = split_with_de_lifetime(&params);
+    let body = Stmts(deserialize_body(&cont, &params));
+    let delife = params.borrowed.de_lifetime();
+    let serde = cont.attrs.serde_path();
+
+    let impl_block = if let Some(remote) = cont.attrs.remote() {
+        let vis = &input.vis;
+        let used = pretend::pretend_used(&cont);
+        quote! {
+            impl #de_impl_generics #ident #ty_generics #where_clause {
+                #vis fn deserialize<__D>(__deserializer: __D) -> #serde::export::Result<#remote #ty_generics, __D::Error>
+                where
+                    __D: #serde::Deserializer<#delife>,
+                {
+                    #used
+                    #body
+                }
+            }
+        }
+    } else {
+        let fn_deserialize_in_place = deserialize_in_place_body(&cont, &params);
+
+        quote! {
+            #[automatically_derived]
+            impl #de_impl_generics #serde::Deserialize<#delife> for #ident #ty_generics #where_clause {
+                fn deserialize<__D>(__deserializer: __D) -> #serde::export::Result<Self, __D::Error>
+                where
+                    __D: #serde::Deserializer<#delife>,
+                {
+                    #body
+                }
+
+                #fn_deserialize_in_place
+            }
+        }
+    };
+
+    Ok(dummy::wrap_in_const(
+        cont.attrs.custom_serde_path(),
+        "DESERIALIZE",
+        ident,
+        impl_block,
+    ))
+}
+
+fn precondition(cx: &Ctxt, cont: &Container) {
+    precondition_sized(cx, cont);
+    precondition_no_de_lifetime(cx, cont);
+}
+
+fn precondition_sized(cx: &Ctxt, cont: &Container) {
+    if let Data::Struct(_, fields) = &cont.data {
+        if let Some(last) = fields.last() {
+            if let syn::Type::Slice(_) = *last.ty {
+                cx.error_spanned_by(
+                    cont.original,
+                    "cannot deserialize a dynamically sized struct",
+                );
+            }
+        }
+    }
+}
+
+fn precondition_no_de_lifetime(cx: &Ctxt, cont: &Container) {
+    if let BorrowedLifetimes::Borrowed(_) = borrowed_lifetimes(cont) {
+        for param in cont.generics.lifetimes() {
+            if param.lifetime.to_string() == "'de" {
+                cx.error_spanned_by(
+                    &param.lifetime,
+                    "cannot deserialize when there is a lifetime parameter called 'de",
+                );
+                return;
+            }
+        }
+    }
+}
+
+struct Parameters {
+    /// Name of the type the `derive` is on.
+    local: syn::Ident,
+
+    /// Path to the type the impl is for. Either a single `Ident` for local
+    /// types or `some::remote::Ident` for remote types. Does not include
+    /// generic parameters.
+    this: syn::Path,
+
+    /// Generics including any explicit and inferred bounds for the impl.
+    generics: syn::Generics,
+
+    /// Lifetimes borrowed from the deserializer. These will become bounds on
+    /// the `'de` lifetime of the deserializer.
+    borrowed: BorrowedLifetimes,
+
+    /// At least one field has a serde(getter) attribute, implying that the
+    /// remote type has a private field.
+    has_getter: bool,
+}
+
+impl Parameters {
+    fn new(cont: &Container) -> Self {
+        let local = cont.ident.clone();
+        let this = match cont.attrs.remote() {
+            Some(remote) => remote.clone(),
+            None => cont.ident.clone().into(),
+        };
+        let borrowed = borrowed_lifetimes(cont);
+        let generics = build_generics(cont, &borrowed);
+        let has_getter = cont.data.has_getter();
+
+        Parameters {
+            local: local,
+            this: this,
+            generics: generics,
+            borrowed: borrowed,
+            has_getter: has_getter,
+        }
+    }
+
+    /// Type name to use in error messages and `&'static str` arguments to
+    /// various Deserializer methods.
+    fn type_name(&self) -> String {
+        self.this.segments.last().unwrap().ident.to_string()
+    }
+}
+
+// All the generics in the input, plus a bound `T: Deserialize` for each generic
+// field type that will be deserialized by us, plus a bound `T: Default` for
+// each generic field type that will be set to a default value.
+fn build_generics(cont: &Container, borrowed: &BorrowedLifetimes) -> syn::Generics {
+    let generics = bound::without_defaults(cont.generics);
+
+    let generics = bound::with_where_predicates_from_fields(cont, &generics, attr::Field::de_bound);
+
+    let generics =
+        bound::with_where_predicates_from_variants(cont, &generics, attr::Variant::de_bound);
+
+    match cont.attrs.de_bound() {
+        Some(predicates) => bound::with_where_predicates(&generics, predicates),
+        None => {
+            let generics = match *cont.attrs.default() {
+                attr::Default::Default => {
+                    bound::with_self_bound(cont, &generics, &parse_quote!(_serde::export::Default))
+                }
+                attr::Default::None | attr::Default::Path(_) => generics,
+            };
+
+            let delife = borrowed.de_lifetime();
+            let generics = bound::with_bound(
+                cont,
+                &generics,
+                needs_deserialize_bound,
+                &parse_quote!(_serde::Deserialize<#delife>),
+            );
+
+            bound::with_bound(
+                cont,
+                &generics,
+                requires_default,
+                &parse_quote!(_serde::export::Default),
+            )
+        }
+    }
+}
+
+// Fields with a `skip_deserializing` or `deserialize_with` attribute, or which
+// belong to a variant with a `skip_deserializing` or `deserialize_with`
+// attribute, are not deserialized by us so we do not generate a bound. Fields
+// with a `bound` attribute specify their own bound so we do not generate one.
+// All other fields may need a `T: Deserialize` bound where T is the type of the
+// field.
+fn needs_deserialize_bound(field: &attr::Field, variant: Option<&attr::Variant>) -> bool {
+    !field.skip_deserializing()
+        && field.deserialize_with().is_none()
+        && field.de_bound().is_none()
+        && variant.map_or(true, |variant| {
+            !variant.skip_deserializing()
+                && variant.deserialize_with().is_none()
+                && variant.de_bound().is_none()
+        })
+}
+
+// Fields with a `default` attribute (not `default=...`), and fields with a
+// `skip_deserializing` attribute that do not also have `default=...`.
+fn requires_default(field: &attr::Field, _variant: Option<&attr::Variant>) -> bool {
+    if let attr::Default::Default = *field.default() {
+        true
+    } else {
+        false
+    }
+}
+
+enum BorrowedLifetimes {
+    Borrowed(BTreeSet<syn::Lifetime>),
+    Static,
+}
+
+impl BorrowedLifetimes {
+    fn de_lifetime(&self) -> syn::Lifetime {
+        match *self {
+            BorrowedLifetimes::Borrowed(_) => syn::Lifetime::new("'de", Span::call_site()),
+            BorrowedLifetimes::Static => syn::Lifetime::new("'static", Span::call_site()),
+        }
+    }
+
+    fn de_lifetime_def(&self) -> Option<syn::LifetimeDef> {
+        match self {
+            BorrowedLifetimes::Borrowed(bounds) => Some(syn::LifetimeDef {
+                attrs: Vec::new(),
+                lifetime: syn::Lifetime::new("'de", Span::call_site()),
+                colon_token: None,
+                bounds: bounds.iter().cloned().collect(),
+            }),
+            BorrowedLifetimes::Static => None,
+        }
+    }
+}
+
+// The union of lifetimes borrowed by each field of the container.
+//
+// These turn into bounds on the `'de` lifetime of the Deserialize impl. If
+// lifetimes `'a` and `'b` are borrowed but `'c` is not, the impl is:
+//
+//     impl<'de: 'a + 'b, 'a, 'b, 'c> Deserialize<'de> for S<'a, 'b, 'c>
+//
+// If any borrowed lifetime is `'static`, then `'de: 'static` would be redundant
+// and we use plain `'static` instead of `'de`.
+fn borrowed_lifetimes(cont: &Container) -> BorrowedLifetimes {
+    let mut lifetimes = BTreeSet::new();
+    for field in cont.data.all_fields() {
+        if !field.attrs.skip_deserializing() {
+            lifetimes.extend(field.attrs.borrowed_lifetimes().iter().cloned());
+        }
+    }
+    if lifetimes.iter().any(|b| b.to_string() == "'static") {
+        BorrowedLifetimes::Static
+    } else {
+        BorrowedLifetimes::Borrowed(lifetimes)
+    }
+}
+
+fn deserialize_body(cont: &Container, params: &Parameters) -> Fragment {
+    if cont.attrs.transparent() {
+        deserialize_transparent(cont, params)
+    } else if let Some(type_from) = cont.attrs.type_from() {
+        deserialize_from(type_from)
+    } else if let Some(type_try_from) = cont.attrs.type_try_from() {
+        deserialize_try_from(type_try_from)
+    } else if let attr::Identifier::No = cont.attrs.identifier() {
+        match &cont.data {
+            Data::Enum(variants) => deserialize_enum(params, variants, &cont.attrs),
+            Data::Struct(Style::Struct, fields) => {
+                deserialize_struct(None, params, fields, &cont.attrs, None, &Untagged::No)
+            }
+            Data::Struct(Style::Tuple, fields) | Data::Struct(Style::Newtype, fields) => {
+                deserialize_tuple(None, params, fields, &cont.attrs, None)
+            }
+            Data::Struct(Style::Unit, _) => deserialize_unit_struct(params, &cont.attrs),
+        }
+    } else {
+        match &cont.data {
+            Data::Enum(variants) => deserialize_custom_identifier(params, variants, &cont.attrs),
+            Data::Struct(_, _) => unreachable!("checked in serde_derive_internals"),
+        }
+    }
+}
+
+#[cfg(feature = "deserialize_in_place")]
+fn deserialize_in_place_body(cont: &Container, params: &Parameters) -> Option<Stmts> {
+    // Only remote derives have getters, and we do not generate
+    // deserialize_in_place for remote derives.
+    assert!(!params.has_getter);
+
+    if cont.attrs.transparent()
+        || cont.attrs.type_from().is_some()
+        || cont.attrs.type_try_from().is_some()
+        || cont.attrs.identifier().is_some()
+        || cont
+            .data
+            .all_fields()
+            .all(|f| f.attrs.deserialize_with().is_some())
+    {
+        return None;
+    }
+
+    let code = match &cont.data {
+        Data::Struct(Style::Struct, fields) => {
+            if let Some(code) = deserialize_struct_in_place(None, params, fields, &cont.attrs, None)
+            {
+                code
+            } else {
+                return None;
+            }
+        }
+        Data::Struct(Style::Tuple, fields) | Data::Struct(Style::Newtype, fields) => {
+            deserialize_tuple_in_place(None, params, fields, &cont.attrs, None)
+        }
+        Data::Enum(_) | Data::Struct(Style::Unit, _) => {
+            return None;
+        }
+    };
+
+    let delife = params.borrowed.de_lifetime();
+    let stmts = Stmts(code);
+
+    let fn_deserialize_in_place = quote_block! {
+        fn deserialize_in_place<__D>(__deserializer: __D, __place: &mut Self) -> _serde::export::Result<(), __D::Error>
+        where
+            __D: _serde::Deserializer<#delife>,
+        {
+            #stmts
+        }
+    };
+
+    Some(Stmts(fn_deserialize_in_place))
+}
+
+#[cfg(not(feature = "deserialize_in_place"))]
+fn deserialize_in_place_body(_cont: &Container, _params: &Parameters) -> Option<Stmts> {
+    None
+}
+
+fn deserialize_transparent(cont: &Container, params: &Parameters) -> Fragment {
+    let fields = match &cont.data {
+        Data::Struct(_, fields) => fields,
+        Data::Enum(_) => unreachable!(),
+    };
+
+    let this = &params.this;
+    let transparent_field = fields.iter().find(|f| f.attrs.transparent()).unwrap();
+
+    let path = match transparent_field.attrs.deserialize_with() {
+        Some(path) => quote!(#path),
+        None => {
+            let span = transparent_field.original.span();
+            quote_spanned!(span=> _serde::Deserialize::deserialize)
+        }
+    };
+
+    let assign = fields.iter().map(|field| {
+        let member = &field.member;
+        if field as *const Field == transparent_field as *const Field {
+            quote!(#member: __transparent)
+        } else {
+            let value = match field.attrs.default() {
+                attr::Default::Default => quote!(_serde::export::Default::default()),
+                attr::Default::Path(path) => quote!(#path()),
+                attr::Default::None => quote!(_serde::export::PhantomData),
+            };
+            quote!(#member: #value)
+        }
+    });
+
+    quote_block! {
+        _serde::export::Result::map(
+            #path(__deserializer),
+            |__transparent| #this { #(#assign),* })
+    }
+}
+
+fn deserialize_from(type_from: &syn::Type) -> Fragment {
+    quote_block! {
+        _serde::export::Result::map(
+            <#type_from as _serde::Deserialize>::deserialize(__deserializer),
+            _serde::export::From::from)
+    }
+}
+
+fn deserialize_try_from(type_try_from: &syn::Type) -> Fragment {
+    quote_block! {
+        _serde::export::Result::and_then(
+            <#type_try_from as _serde::Deserialize>::deserialize(__deserializer),
+            |v| _serde::export::TryFrom::try_from(v).map_err(_serde::de::Error::custom))
+    }
+}
+
+fn deserialize_unit_struct(params: &Parameters, cattrs: &attr::Container) -> Fragment {
+    let this = &params.this;
+    let type_name = cattrs.name().deserialize_name();
+
+    let expecting = format!("unit struct {}", params.type_name());
+
+    quote_block! {
+        struct __Visitor;
+
+        impl<'de> _serde::de::Visitor<'de> for __Visitor {
+            type Value = #this;
+
+            fn expecting(&self, __formatter: &mut _serde::export::Formatter) -> _serde::export::fmt::Result {
+                _serde::export::Formatter::write_str(__formatter, #expecting)
+            }
+
+            #[inline]
+            fn visit_unit<__E>(self) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                _serde::export::Ok(#this)
+            }
+        }
+
+        _serde::Deserializer::deserialize_unit_struct(__deserializer, #type_name, __Visitor)
+    }
+}
+
+fn deserialize_tuple(
+    variant_ident: Option<&syn::Ident>,
+    params: &Parameters,
+    fields: &[Field],
+    cattrs: &attr::Container,
+    deserializer: Option<TokenStream>,
+) -> Fragment {
+    let this = &params.this;
+    let (de_impl_generics, de_ty_generics, ty_generics, where_clause) =
+        split_with_de_lifetime(params);
+    let delife = params.borrowed.de_lifetime();
+
+    assert!(!cattrs.has_flatten());
+
+    // If there are getters (implying private fields), construct the local type
+    // and use an `Into` conversion to get the remote type. If there are no
+    // getters then construct the target type directly.
+    let construct = if params.has_getter {
+        let local = &params.local;
+        quote!(#local)
+    } else {
+        quote!(#this)
+    };
+
+    let is_enum = variant_ident.is_some();
+    let type_path = match variant_ident {
+        Some(variant_ident) => quote!(#construct::#variant_ident),
+        None => construct,
+    };
+    let expecting = match variant_ident {
+        Some(variant_ident) => format!("tuple variant {}::{}", params.type_name(), variant_ident),
+        None => format!("tuple struct {}", params.type_name()),
+    };
+
+    let nfields = fields.len();
+
+    let visit_newtype_struct = if !is_enum && nfields == 1 {
+        Some(deserialize_newtype_struct(&type_path, params, &fields[0]))
+    } else {
+        None
+    };
+
+    let visit_seq = Stmts(deserialize_seq(
+        &type_path, params, fields, false, cattrs, &expecting,
+    ));
+
+    let visitor_expr = quote! {
+        __Visitor {
+            marker: _serde::export::PhantomData::<#this #ty_generics>,
+            lifetime: _serde::export::PhantomData,
+        }
+    };
+    let dispatch = if let Some(deserializer) = deserializer {
+        quote!(_serde::Deserializer::deserialize_tuple(#deserializer, #nfields, #visitor_expr))
+    } else if is_enum {
+        quote!(_serde::de::VariantAccess::tuple_variant(__variant, #nfields, #visitor_expr))
+    } else if nfields == 1 {
+        let type_name = cattrs.name().deserialize_name();
+        quote!(_serde::Deserializer::deserialize_newtype_struct(__deserializer, #type_name, #visitor_expr))
+    } else {
+        let type_name = cattrs.name().deserialize_name();
+        quote!(_serde::Deserializer::deserialize_tuple_struct(__deserializer, #type_name, #nfields, #visitor_expr))
+    };
+
+    let all_skipped = fields.iter().all(|field| field.attrs.skip_deserializing());
+    let visitor_var = if all_skipped {
+        quote!(_)
+    } else {
+        quote!(mut __seq)
+    };
+
+    quote_block! {
+        struct __Visitor #de_impl_generics #where_clause {
+            marker: _serde::export::PhantomData<#this #ty_generics>,
+            lifetime: _serde::export::PhantomData<&#delife ()>,
+        }
+
+        impl #de_impl_generics _serde::de::Visitor<#delife> for __Visitor #de_ty_generics #where_clause {
+            type Value = #this #ty_generics;
+
+            fn expecting(&self, __formatter: &mut _serde::export::Formatter) -> _serde::export::fmt::Result {
+                _serde::export::Formatter::write_str(__formatter, #expecting)
+            }
+
+            #visit_newtype_struct
+
+            #[inline]
+            fn visit_seq<__A>(self, #visitor_var: __A) -> _serde::export::Result<Self::Value, __A::Error>
+            where
+                __A: _serde::de::SeqAccess<#delife>,
+            {
+                #visit_seq
+            }
+        }
+
+        #dispatch
+    }
+}
+
+#[cfg(feature = "deserialize_in_place")]
+fn deserialize_tuple_in_place(
+    variant_ident: Option<syn::Ident>,
+    params: &Parameters,
+    fields: &[Field],
+    cattrs: &attr::Container,
+    deserializer: Option<TokenStream>,
+) -> Fragment {
+    let this = &params.this;
+    let (de_impl_generics, de_ty_generics, ty_generics, where_clause) =
+        split_with_de_lifetime(params);
+    let delife = params.borrowed.de_lifetime();
+
+    assert!(!cattrs.has_flatten());
+
+    let is_enum = variant_ident.is_some();
+    let expecting = match variant_ident {
+        Some(variant_ident) => format!("tuple variant {}::{}", params.type_name(), variant_ident),
+        None => format!("tuple struct {}", params.type_name()),
+    };
+
+    let nfields = fields.len();
+
+    let visit_newtype_struct = if !is_enum && nfields == 1 {
+        Some(deserialize_newtype_struct_in_place(params, &fields[0]))
+    } else {
+        None
+    };
+
+    let visit_seq = Stmts(deserialize_seq_in_place(params, fields, cattrs, &expecting));
+
+    let visitor_expr = quote! {
+        __Visitor {
+            place: __place,
+            lifetime: _serde::export::PhantomData,
+        }
+    };
+
+    let dispatch = if let Some(deserializer) = deserializer {
+        quote!(_serde::Deserializer::deserialize_tuple(#deserializer, #nfields, #visitor_expr))
+    } else if is_enum {
+        quote!(_serde::de::VariantAccess::tuple_variant(__variant, #nfields, #visitor_expr))
+    } else if nfields == 1 {
+        let type_name = cattrs.name().deserialize_name();
+        quote!(_serde::Deserializer::deserialize_newtype_struct(__deserializer, #type_name, #visitor_expr))
+    } else {
+        let type_name = cattrs.name().deserialize_name();
+        quote!(_serde::Deserializer::deserialize_tuple_struct(__deserializer, #type_name, #nfields, #visitor_expr))
+    };
+
+    let all_skipped = fields.iter().all(|field| field.attrs.skip_deserializing());
+    let visitor_var = if all_skipped {
+        quote!(_)
+    } else {
+        quote!(mut __seq)
+    };
+
+    let in_place_impl_generics = de_impl_generics.in_place();
+    let in_place_ty_generics = de_ty_generics.in_place();
+    let place_life = place_lifetime();
+
+    quote_block! {
+        struct __Visitor #in_place_impl_generics #where_clause {
+            place: &#place_life mut #this #ty_generics,
+            lifetime: _serde::export::PhantomData<&#delife ()>,
+        }
+
+        impl #in_place_impl_generics _serde::de::Visitor<#delife> for __Visitor #in_place_ty_generics #where_clause {
+            type Value = ();
+
+            fn expecting(&self, __formatter: &mut _serde::export::Formatter) -> _serde::export::fmt::Result {
+                _serde::export::Formatter::write_str(__formatter, #expecting)
+            }
+
+            #visit_newtype_struct
+
+            #[inline]
+            fn visit_seq<__A>(self, #visitor_var: __A) -> _serde::export::Result<Self::Value, __A::Error>
+            where
+                __A: _serde::de::SeqAccess<#delife>,
+            {
+                #visit_seq
+            }
+        }
+
+        #dispatch
+    }
+}
+
+fn deserialize_seq(
+    type_path: &TokenStream,
+    params: &Parameters,
+    fields: &[Field],
+    is_struct: bool,
+    cattrs: &attr::Container,
+    expecting: &str,
+) -> Fragment {
+    let vars = (0..fields.len()).map(field_i as fn(_) -> _);
+
+    let deserialized_count = fields
+        .iter()
+        .filter(|field| !field.attrs.skip_deserializing())
+        .count();
+    let expecting = if deserialized_count == 1 {
+        format!("{} with 1 element", expecting)
+    } else {
+        format!("{} with {} elements", expecting, deserialized_count)
+    };
+
+    let mut index_in_seq = 0_usize;
+    let let_values = vars.clone().zip(fields).map(|(var, field)| {
+        if field.attrs.skip_deserializing() {
+            let default = Expr(expr_is_missing(field, cattrs));
+            quote! {
+                let #var = #default;
+            }
+        } else {
+            let visit = match field.attrs.deserialize_with() {
+                None => {
+                    let field_ty = field.ty;
+                    let span = field.original.span();
+                    let func =
+                        quote_spanned!(span=> _serde::de::SeqAccess::next_element::<#field_ty>);
+                    quote!(try!(#func(&mut __seq)))
+                }
+                Some(path) => {
+                    let (wrapper, wrapper_ty) = wrap_deserialize_field_with(params, field.ty, path);
+                    quote!({
+                        #wrapper
+                        _serde::export::Option::map(
+                            try!(_serde::de::SeqAccess::next_element::<#wrapper_ty>(&mut __seq)),
+                            |__wrap| __wrap.value)
+                    })
+                }
+            };
+            let value_if_none = match field.attrs.default() {
+                attr::Default::Default => quote!(_serde::export::Default::default()),
+                attr::Default::Path(path) => quote!(#path()),
+                attr::Default::None => quote!(
+                    return _serde::export::Err(_serde::de::Error::invalid_length(#index_in_seq, &#expecting));
+                ),
+            };
+            let assign = quote! {
+                let #var = match #visit {
+                    _serde::export::Some(__value) => __value,
+                    _serde::export::None => {
+                        #value_if_none
+                    }
+                };
+            };
+            index_in_seq += 1;
+            assign
+        }
+    });
+
+    let mut result = if is_struct {
+        let names = fields.iter().map(|f| &f.member);
+        quote! {
+            #type_path { #( #names: #vars ),* }
+        }
+    } else {
+        quote! {
+            #type_path ( #(#vars),* )
+        }
+    };
+
+    if params.has_getter {
+        let this = &params.this;
+        result = quote! {
+            _serde::export::Into::<#this>::into(#result)
+        };
+    }
+
+    let let_default = match cattrs.default() {
+        attr::Default::Default => Some(quote!(
+            let __default: Self::Value = _serde::export::Default::default();
+        )),
+        attr::Default::Path(path) => Some(quote!(
+            let __default: Self::Value = #path();
+        )),
+        attr::Default::None => {
+            // We don't need the default value, to prevent an unused variable warning
+            // we'll leave the line empty.
+            None
+        }
+    };
+
+    quote_block! {
+        #let_default
+        #(#let_values)*
+        _serde::export::Ok(#result)
+    }
+}
+
+#[cfg(feature = "deserialize_in_place")]
+fn deserialize_seq_in_place(
+    params: &Parameters,
+    fields: &[Field],
+    cattrs: &attr::Container,
+    expecting: &str,
+) -> Fragment {
+    let deserialized_count = fields
+        .iter()
+        .filter(|field| !field.attrs.skip_deserializing())
+        .count();
+    let expecting = if deserialized_count == 1 {
+        format!("{} with 1 element", expecting)
+    } else {
+        format!("{} with {} elements", expecting, deserialized_count)
+    };
+
+    let mut index_in_seq = 0usize;
+    let write_values = fields.iter().map(|field| {
+        let member = &field.member;
+
+        if field.attrs.skip_deserializing() {
+            let default = Expr(expr_is_missing(field, cattrs));
+            quote! {
+                self.place.#member = #default;
+            }
+        } else {
+            let value_if_none = match field.attrs.default() {
+                attr::Default::Default => quote!(
+                    self.place.#member = _serde::export::Default::default();
+                ),
+                attr::Default::Path(path) => quote!(
+                    self.place.#member = #path();
+                ),
+                attr::Default::None => quote!(
+                    return _serde::export::Err(_serde::de::Error::invalid_length(#index_in_seq, &#expecting));
+                ),
+            };
+            let write = match field.attrs.deserialize_with() {
+                None => {
+                    quote! {
+                        if let _serde::export::None = try!(_serde::de::SeqAccess::next_element_seed(&mut __seq,
+                            _serde::private::de::InPlaceSeed(&mut self.place.#member)))
+                        {
+                            #value_if_none
+                        }
+                    }
+                }
+                Some(path) => {
+                    let (wrapper, wrapper_ty) = wrap_deserialize_field_with(params, field.ty, path);
+                    quote!({
+                        #wrapper
+                        match try!(_serde::de::SeqAccess::next_element::<#wrapper_ty>(&mut __seq)) {
+                            _serde::export::Some(__wrap) => {
+                                self.place.#member = __wrap.value;
+                            }
+                            _serde::export::None => {
+                                #value_if_none
+                            }
+                        }
+                    })
+                }
+            };
+            index_in_seq += 1;
+            write
+        }
+    });
+
+    let this = &params.this;
+    let (_, ty_generics, _) = params.generics.split_for_impl();
+    let let_default = match cattrs.default() {
+        attr::Default::Default => Some(quote!(
+            let __default: #this #ty_generics  = _serde::export::Default::default();
+        )),
+        attr::Default::Path(path) => Some(quote!(
+            let __default: #this #ty_generics  = #path();
+        )),
+        attr::Default::None => {
+            // We don't need the default value, to prevent an unused variable warning
+            // we'll leave the line empty.
+            None
+        }
+    };
+
+    quote_block! {
+        #let_default
+        #(#write_values)*
+        _serde::export::Ok(())
+    }
+}
+
+fn deserialize_newtype_struct(
+    type_path: &TokenStream,
+    params: &Parameters,
+    field: &Field,
+) -> TokenStream {
+    let delife = params.borrowed.de_lifetime();
+    let field_ty = field.ty;
+
+    let value = match field.attrs.deserialize_with() {
+        None => {
+            let span = field.original.span();
+            let func = quote_spanned!(span=> <#field_ty as _serde::Deserialize>::deserialize);
+            quote! {
+                try!(#func(__e))
+            }
+        }
+        Some(path) => {
+            quote! {
+                try!(#path(__e))
+            }
+        }
+    };
+
+    let mut result = quote!(#type_path(__field0));
+    if params.has_getter {
+        let this = &params.this;
+        result = quote! {
+            _serde::export::Into::<#this>::into(#result)
+        };
+    }
+
+    quote! {
+        #[inline]
+        fn visit_newtype_struct<__E>(self, __e: __E) -> _serde::export::Result<Self::Value, __E::Error>
+        where
+            __E: _serde::Deserializer<#delife>,
+        {
+            let __field0: #field_ty = #value;
+            _serde::export::Ok(#result)
+        }
+    }
+}
+
+#[cfg(feature = "deserialize_in_place")]
+fn deserialize_newtype_struct_in_place(params: &Parameters, field: &Field) -> TokenStream {
+    // We do not generate deserialize_in_place if every field has a
+    // deserialize_with.
+    assert!(field.attrs.deserialize_with().is_none());
+
+    let delife = params.borrowed.de_lifetime();
+
+    quote! {
+        #[inline]
+        fn visit_newtype_struct<__E>(self, __e: __E) -> _serde::export::Result<Self::Value, __E::Error>
+        where
+            __E: _serde::Deserializer<#delife>,
+        {
+            _serde::Deserialize::deserialize_in_place(__e, &mut self.place.0)
+        }
+    }
+}
+
+enum Untagged {
+    Yes,
+    No,
+}
+
+fn deserialize_struct(
+    variant_ident: Option<&syn::Ident>,
+    params: &Parameters,
+    fields: &[Field],
+    cattrs: &attr::Container,
+    deserializer: Option<TokenStream>,
+    untagged: &Untagged,
+) -> Fragment {
+    let is_enum = variant_ident.is_some();
+
+    let this = &params.this;
+    let (de_impl_generics, de_ty_generics, ty_generics, where_clause) =
+        split_with_de_lifetime(params);
+    let delife = params.borrowed.de_lifetime();
+
+    // If there are getters (implying private fields), construct the local type
+    // and use an `Into` conversion to get the remote type. If there are no
+    // getters then construct the target type directly.
+    let construct = if params.has_getter {
+        let local = &params.local;
+        quote!(#local)
+    } else {
+        quote!(#this)
+    };
+
+    let type_path = match variant_ident {
+        Some(variant_ident) => quote!(#construct::#variant_ident),
+        None => construct,
+    };
+    let expecting = match variant_ident {
+        Some(variant_ident) => format!("struct variant {}::{}", params.type_name(), variant_ident),
+        None => format!("struct {}", params.type_name()),
+    };
+
+    let visit_seq = Stmts(deserialize_seq(
+        &type_path, params, fields, true, cattrs, &expecting,
+    ));
+
+    let (field_visitor, fields_stmt, visit_map) = if cattrs.has_flatten() {
+        deserialize_struct_as_map_visitor(&type_path, params, fields, cattrs)
+    } else {
+        deserialize_struct_as_struct_visitor(&type_path, params, fields, cattrs)
+    };
+    let field_visitor = Stmts(field_visitor);
+    let fields_stmt = fields_stmt.map(Stmts);
+    let visit_map = Stmts(visit_map);
+
+    let visitor_expr = quote! {
+        __Visitor {
+            marker: _serde::export::PhantomData::<#this #ty_generics>,
+            lifetime: _serde::export::PhantomData,
+        }
+    };
+    let dispatch = if let Some(deserializer) = deserializer {
+        quote! {
+            _serde::Deserializer::deserialize_any(#deserializer, #visitor_expr)
+        }
+    } else if is_enum && cattrs.has_flatten() {
+        quote! {
+            _serde::de::VariantAccess::newtype_variant_seed(__variant, #visitor_expr)
+        }
+    } else if is_enum {
+        quote! {
+            _serde::de::VariantAccess::struct_variant(__variant, FIELDS, #visitor_expr)
+        }
+    } else if cattrs.has_flatten() {
+        quote! {
+            _serde::Deserializer::deserialize_map(__deserializer, #visitor_expr)
+        }
+    } else {
+        let type_name = cattrs.name().deserialize_name();
+        quote! {
+            _serde::Deserializer::deserialize_struct(__deserializer, #type_name, FIELDS, #visitor_expr)
+        }
+    };
+
+    let all_skipped = fields.iter().all(|field| field.attrs.skip_deserializing());
+    let visitor_var = if all_skipped {
+        quote!(_)
+    } else {
+        quote!(mut __seq)
+    };
+
+    // untagged struct variants do not get a visit_seq method. The same applies to
+    // structs that only have a map representation.
+    let visit_seq = match *untagged {
+        Untagged::No if !cattrs.has_flatten() => Some(quote! {
+            #[inline]
+            fn visit_seq<__A>(self, #visitor_var: __A) -> _serde::export::Result<Self::Value, __A::Error>
+            where
+                __A: _serde::de::SeqAccess<#delife>,
+            {
+                #visit_seq
+            }
+        }),
+        _ => None,
+    };
+
+    let visitor_seed = if is_enum && cattrs.has_flatten() {
+        Some(quote! {
+            impl #de_impl_generics _serde::de::DeserializeSeed<#delife> for __Visitor #de_ty_generics #where_clause {
+                type Value = #this #ty_generics;
+
+                fn deserialize<__D>(self, __deserializer: __D) -> _serde::export::Result<Self::Value, __D::Error>
+                where
+                    __D: _serde::Deserializer<'de>,
+                {
+                    _serde::Deserializer::deserialize_map(__deserializer, self)
+                }
+            }
+        })
+    } else {
+        None
+    };
+
+    quote_block! {
+        #field_visitor
+
+        struct __Visitor #de_impl_generics #where_clause {
+            marker: _serde::export::PhantomData<#this #ty_generics>,
+            lifetime: _serde::export::PhantomData<&#delife ()>,
+        }
+
+        impl #de_impl_generics _serde::de::Visitor<#delife> for __Visitor #de_ty_generics #where_clause {
+            type Value = #this #ty_generics;
+
+            fn expecting(&self, __formatter: &mut _serde::export::Formatter) -> _serde::export::fmt::Result {
+                _serde::export::Formatter::write_str(__formatter, #expecting)
+            }
+
+            #visit_seq
+
+            #[inline]
+            fn visit_map<__A>(self, mut __map: __A) -> _serde::export::Result<Self::Value, __A::Error>
+            where
+                __A: _serde::de::MapAccess<#delife>,
+            {
+                #visit_map
+            }
+        }
+
+        #visitor_seed
+
+        #fields_stmt
+
+        #dispatch
+    }
+}
+
+#[cfg(feature = "deserialize_in_place")]
+fn deserialize_struct_in_place(
+    variant_ident: Option<syn::Ident>,
+    params: &Parameters,
+    fields: &[Field],
+    cattrs: &attr::Container,
+    deserializer: Option<TokenStream>,
+) -> Option<Fragment> {
+    let is_enum = variant_ident.is_some();
+
+    // for now we do not support in_place deserialization for structs that
+    // are represented as map.
+    if cattrs.has_flatten() {
+        return None;
+    }
+
+    let this = &params.this;
+    let (de_impl_generics, de_ty_generics, ty_generics, where_clause) =
+        split_with_de_lifetime(params);
+    let delife = params.borrowed.de_lifetime();
+
+    let expecting = match variant_ident {
+        Some(variant_ident) => format!("struct variant {}::{}", params.type_name(), variant_ident),
+        None => format!("struct {}", params.type_name()),
+    };
+
+    let visit_seq = Stmts(deserialize_seq_in_place(params, fields, cattrs, &expecting));
+
+    let (field_visitor, fields_stmt, visit_map) =
+        deserialize_struct_as_struct_in_place_visitor(params, fields, cattrs);
+
+    let field_visitor = Stmts(field_visitor);
+    let fields_stmt = Stmts(fields_stmt);
+    let visit_map = Stmts(visit_map);
+
+    let visitor_expr = quote! {
+        __Visitor {
+            place: __place,
+            lifetime: _serde::export::PhantomData,
+        }
+    };
+    let dispatch = if let Some(deserializer) = deserializer {
+        quote! {
+            _serde::Deserializer::deserialize_any(#deserializer, #visitor_expr)
+        }
+    } else if is_enum {
+        quote! {
+            _serde::de::VariantAccess::struct_variant(__variant, FIELDS, #visitor_expr)
+        }
+    } else {
+        let type_name = cattrs.name().deserialize_name();
+        quote! {
+            _serde::Deserializer::deserialize_struct(__deserializer, #type_name, FIELDS, #visitor_expr)
+        }
+    };
+
+    let all_skipped = fields.iter().all(|field| field.attrs.skip_deserializing());
+    let visitor_var = if all_skipped {
+        quote!(_)
+    } else {
+        quote!(mut __seq)
+    };
+
+    let visit_seq = quote! {
+        #[inline]
+        fn visit_seq<__A>(self, #visitor_var: __A) -> _serde::export::Result<Self::Value, __A::Error>
+        where
+            __A: _serde::de::SeqAccess<#delife>,
+        {
+            #visit_seq
+        }
+    };
+
+    let in_place_impl_generics = de_impl_generics.in_place();
+    let in_place_ty_generics = de_ty_generics.in_place();
+    let place_life = place_lifetime();
+
+    Some(quote_block! {
+        #field_visitor
+
+        struct __Visitor #in_place_impl_generics #where_clause {
+            place: &#place_life mut #this #ty_generics,
+            lifetime: _serde::export::PhantomData<&#delife ()>,
+        }
+
+        impl #in_place_impl_generics _serde::de::Visitor<#delife> for __Visitor #in_place_ty_generics #where_clause {
+            type Value = ();
+
+            fn expecting(&self, __formatter: &mut _serde::export::Formatter) -> _serde::export::fmt::Result {
+                _serde::export::Formatter::write_str(__formatter, #expecting)
+            }
+
+            #visit_seq
+
+            #[inline]
+            fn visit_map<__A>(self, mut __map: __A) -> _serde::export::Result<Self::Value, __A::Error>
+            where
+                __A: _serde::de::MapAccess<#delife>,
+            {
+                #visit_map
+            }
+        }
+
+        #fields_stmt
+
+        #dispatch
+    })
+}
+
+fn deserialize_enum(
+    params: &Parameters,
+    variants: &[Variant],
+    cattrs: &attr::Container,
+) -> Fragment {
+    match cattrs.tag() {
+        attr::TagType::External => deserialize_externally_tagged_enum(params, variants, cattrs),
+        attr::TagType::Internal { tag } => {
+            deserialize_internally_tagged_enum(params, variants, cattrs, tag)
+        }
+        attr::TagType::Adjacent { tag, content } => {
+            deserialize_adjacently_tagged_enum(params, variants, cattrs, tag, content)
+        }
+        attr::TagType::None => deserialize_untagged_enum(params, variants, cattrs),
+    }
+}
+
+fn prepare_enum_variant_enum(
+    variants: &[Variant],
+    cattrs: &attr::Container,
+) -> (TokenStream, Stmts) {
+    let variant_names_idents: Vec<_> = variants
+        .iter()
+        .enumerate()
+        .filter(|&(_, variant)| !variant.attrs.skip_deserializing())
+        .map(|(i, variant)| {
+            (
+                variant.attrs.name().deserialize_name(),
+                field_i(i),
+                variant.attrs.aliases(),
+            )
+        })
+        .collect();
+
+    let other_idx = variants.iter().position(|variant| variant.attrs.other());
+
+    let variants_stmt = {
+        let variant_names = variant_names_idents.iter().map(|(name, _, _)| name);
+        quote! {
+            const VARIANTS: &'static [&'static str] = &[ #(#variant_names),* ];
+        }
+    };
+
+    let variant_visitor = Stmts(deserialize_generated_identifier(
+        &variant_names_idents,
+        cattrs,
+        true,
+        other_idx,
+    ));
+
+    (variants_stmt, variant_visitor)
+}
+
+fn deserialize_externally_tagged_enum(
+    params: &Parameters,
+    variants: &[Variant],
+    cattrs: &attr::Container,
+) -> Fragment {
+    let this = &params.this;
+    let (de_impl_generics, de_ty_generics, ty_generics, where_clause) =
+        split_with_de_lifetime(params);
+    let delife = params.borrowed.de_lifetime();
+
+    let type_name = cattrs.name().deserialize_name();
+    let expecting = format!("enum {}", params.type_name());
+
+    let (variants_stmt, variant_visitor) = prepare_enum_variant_enum(variants, cattrs);
+
+    // Match arms to extract a variant from a string
+    let variant_arms = variants
+        .iter()
+        .enumerate()
+        .filter(|&(_, variant)| !variant.attrs.skip_deserializing())
+        .map(|(i, variant)| {
+            let variant_name = field_i(i);
+
+            let block = Match(deserialize_externally_tagged_variant(
+                params, variant, cattrs,
+            ));
+
+            quote! {
+                (__Field::#variant_name, __variant) => #block
+            }
+        });
+
+    let all_skipped = variants
+        .iter()
+        .all(|variant| variant.attrs.skip_deserializing());
+    let match_variant = if all_skipped {
+        // This is an empty enum like `enum Impossible {}` or an enum in which
+        // all variants have `#[serde(skip_deserializing)]`.
+        quote! {
+            // FIXME: Once we drop support for Rust 1.15:
+            // let _serde::export::Err(__err) = _serde::de::EnumAccess::variant::<__Field>(__data);
+            // _serde::export::Err(__err)
+            _serde::export::Result::map(
+                _serde::de::EnumAccess::variant::<__Field>(__data),
+                |(__impossible, _)| match __impossible {})
+        }
+    } else {
+        quote! {
+            match try!(_serde::de::EnumAccess::variant(__data)) {
+                #(#variant_arms)*
+            }
+        }
+    };
+
+    quote_block! {
+        #variant_visitor
+
+        struct __Visitor #de_impl_generics #where_clause {
+            marker: _serde::export::PhantomData<#this #ty_generics>,
+            lifetime: _serde::export::PhantomData<&#delife ()>,
+        }
+
+        impl #de_impl_generics _serde::de::Visitor<#delife> for __Visitor #de_ty_generics #where_clause {
+            type Value = #this #ty_generics;
+
+            fn expecting(&self, __formatter: &mut _serde::export::Formatter) -> _serde::export::fmt::Result {
+                _serde::export::Formatter::write_str(__formatter, #expecting)
+            }
+
+            fn visit_enum<__A>(self, __data: __A) -> _serde::export::Result<Self::Value, __A::Error>
+            where
+                __A: _serde::de::EnumAccess<#delife>,
+            {
+                #match_variant
+            }
+        }
+
+        #variants_stmt
+
+        _serde::Deserializer::deserialize_enum(
+            __deserializer,
+            #type_name,
+            VARIANTS,
+            __Visitor {
+                marker: _serde::export::PhantomData::<#this #ty_generics>,
+                lifetime: _serde::export::PhantomData,
+            },
+        )
+    }
+}
+
+fn deserialize_internally_tagged_enum(
+    params: &Parameters,
+    variants: &[Variant],
+    cattrs: &attr::Container,
+    tag: &str,
+) -> Fragment {
+    let (variants_stmt, variant_visitor) = prepare_enum_variant_enum(variants, cattrs);
+
+    // Match arms to extract a variant from a string
+    let variant_arms = variants
+        .iter()
+        .enumerate()
+        .filter(|&(_, variant)| !variant.attrs.skip_deserializing())
+        .map(|(i, variant)| {
+            let variant_name = field_i(i);
+
+            let block = Match(deserialize_internally_tagged_variant(
+                params,
+                variant,
+                cattrs,
+                quote! {
+                    _serde::private::de::ContentDeserializer::<__D::Error>::new(__tagged.content)
+                },
+            ));
+
+            quote! {
+                __Field::#variant_name => #block
+            }
+        });
+
+    quote_block! {
+        #variant_visitor
+
+        #variants_stmt
+
+        let __tagged = try!(_serde::Deserializer::deserialize_any(
+            __deserializer,
+            _serde::private::de::TaggedContentVisitor::<__Field>::new(#tag)));
+
+        match __tagged.tag {
+            #(#variant_arms)*
+        }
+    }
+}
+
+fn deserialize_adjacently_tagged_enum(
+    params: &Parameters,
+    variants: &[Variant],
+    cattrs: &attr::Container,
+    tag: &str,
+    content: &str,
+) -> Fragment {
+    let this = &params.this;
+    let (de_impl_generics, de_ty_generics, ty_generics, where_clause) =
+        split_with_de_lifetime(params);
+    let delife = params.borrowed.de_lifetime();
+
+    let (variants_stmt, variant_visitor) = prepare_enum_variant_enum(variants, cattrs);
+
+    let variant_arms: &Vec<_> = &variants
+        .iter()
+        .enumerate()
+        .filter(|&(_, variant)| !variant.attrs.skip_deserializing())
+        .map(|(i, variant)| {
+            let variant_index = field_i(i);
+
+            let block = Match(deserialize_untagged_variant(
+                params,
+                variant,
+                cattrs,
+                quote!(__deserializer),
+            ));
+
+            quote! {
+                __Field::#variant_index => #block
+            }
+        })
+        .collect();
+
+    let expecting = format!("adjacently tagged enum {}", params.type_name());
+    let type_name = cattrs.name().deserialize_name();
+    let deny_unknown_fields = cattrs.deny_unknown_fields();
+
+    // If unknown fields are allowed, we pick the visitor that can step over
+    // those. Otherwise we pick the visitor that fails on unknown keys.
+    let field_visitor_ty = if deny_unknown_fields {
+        quote! { _serde::private::de::TagOrContentFieldVisitor }
+    } else {
+        quote! { _serde::private::de::TagContentOtherFieldVisitor }
+    };
+
+    let tag_or_content = quote! {
+        #field_visitor_ty {
+            tag: #tag,
+            content: #content,
+        }
+    };
+
+    fn is_unit(variant: &Variant) -> bool {
+        match variant.style {
+            Style::Unit => true,
+            Style::Struct | Style::Tuple | Style::Newtype => false,
+        }
+    }
+
+    let mut missing_content = quote! {
+        _serde::export::Err(<__A::Error as _serde::de::Error>::missing_field(#content))
+    };
+    if variants.iter().any(is_unit) {
+        let fallthrough = if variants.iter().all(is_unit) {
+            None
+        } else {
+            Some(quote! {
+                _ => #missing_content
+            })
+        };
+        let arms = variants
+            .iter()
+            .enumerate()
+            .filter(|&(_, variant)| !variant.attrs.skip_deserializing() && is_unit(variant))
+            .map(|(i, variant)| {
+                let variant_index = field_i(i);
+                let variant_ident = &variant.ident;
+                quote! {
+                    __Field::#variant_index => _serde::export::Ok(#this::#variant_ident),
+                }
+            });
+        missing_content = quote! {
+            match __field {
+                #(#arms)*
+                #fallthrough
+            }
+        };
+    }
+
+    // Advance the map by one key, returning early in case of error.
+    let next_key = quote! {
+        try!(_serde::de::MapAccess::next_key_seed(&mut __map, #tag_or_content))
+    };
+
+    // When allowing unknown fields, we want to transparently step through keys
+    // we don't care about until we find `tag`, `content`, or run out of keys.
+    let next_relevant_key = if deny_unknown_fields {
+        next_key
+    } else {
+        quote!({
+            let mut __rk : _serde::export::Option<_serde::private::de::TagOrContentField> = _serde::export::None;
+            while let _serde::export::Some(__k) = #next_key {
+                match __k {
+                    _serde::private::de::TagContentOtherField::Other => {
+                        try!(_serde::de::MapAccess::next_value::<_serde::de::IgnoredAny>(&mut __map));
+                        continue;
+                    },
+                    _serde::private::de::TagContentOtherField::Tag => {
+                        __rk = _serde::export::Some(_serde::private::de::TagOrContentField::Tag);
+                        break;
+                    }
+                    _serde::private::de::TagContentOtherField::Content => {
+                        __rk = _serde::export::Some(_serde::private::de::TagOrContentField::Content);
+                        break;
+                    }
+                }
+            }
+
+            __rk
+        })
+    };
+
+    // Step through remaining keys, looking for duplicates of previously-seen
+    // keys. When unknown fields are denied, any key that isn't a duplicate will
+    // at this point immediately produce an error.
+    let visit_remaining_keys = quote! {
+        match #next_relevant_key {
+            _serde::export::Some(_serde::private::de::TagOrContentField::Tag) => {
+                _serde::export::Err(<__A::Error as _serde::de::Error>::duplicate_field(#tag))
+            }
+            _serde::export::Some(_serde::private::de::TagOrContentField::Content) => {
+                _serde::export::Err(<__A::Error as _serde::de::Error>::duplicate_field(#content))
+            }
+            _serde::export::None => _serde::export::Ok(__ret),
+        }
+    };
+
+    let finish_content_then_tag = if variant_arms.is_empty() {
+        quote! {
+            match try!(_serde::de::MapAccess::next_value::<__Field>(&mut __map)) {}
+        }
+    } else {
+        quote! {
+            let __ret = try!(match try!(_serde::de::MapAccess::next_value(&mut __map)) {
+                // Deserialize the buffered content now that we know the variant.
+                #(#variant_arms)*
+            });
+            // Visit remaining keys, looking for duplicates.
+            #visit_remaining_keys
+        }
+    };
+
+    quote_block! {
+        #variant_visitor
+
+        #variants_stmt
+
+        struct __Seed #de_impl_generics #where_clause {
+            field: __Field,
+            marker: _serde::export::PhantomData<#this #ty_generics>,
+            lifetime: _serde::export::PhantomData<&#delife ()>,
+        }
+
+        impl #de_impl_generics _serde::de::DeserializeSeed<#delife> for __Seed #de_ty_generics #where_clause {
+            type Value = #this #ty_generics;
+
+            fn deserialize<__D>(self, __deserializer: __D) -> _serde::export::Result<Self::Value, __D::Error>
+            where
+                __D: _serde::Deserializer<#delife>,
+            {
+                match self.field {
+                    #(#variant_arms)*
+                }
+            }
+        }
+
+        struct __Visitor #de_impl_generics #where_clause {
+            marker: _serde::export::PhantomData<#this #ty_generics>,
+            lifetime: _serde::export::PhantomData<&#delife ()>,
+        }
+
+        impl #de_impl_generics _serde::de::Visitor<#delife> for __Visitor #de_ty_generics #where_clause {
+            type Value = #this #ty_generics;
+
+            fn expecting(&self, __formatter: &mut _serde::export::Formatter) -> _serde::export::fmt::Result {
+                _serde::export::Formatter::write_str(__formatter, #expecting)
+            }
+
+            fn visit_map<__A>(self, mut __map: __A) -> _serde::export::Result<Self::Value, __A::Error>
+            where
+                __A: _serde::de::MapAccess<#delife>,
+            {
+                // Visit the first relevant key.
+                match #next_relevant_key {
+                    // First key is the tag.
+                    _serde::export::Some(_serde::private::de::TagOrContentField::Tag) => {
+                        // Parse the tag.
+                        let __field = try!(_serde::de::MapAccess::next_value(&mut __map));
+                        // Visit the second key.
+                        match #next_relevant_key {
+                            // Second key is a duplicate of the tag.
+                            _serde::export::Some(_serde::private::de::TagOrContentField::Tag) => {
+                                _serde::export::Err(<__A::Error as _serde::de::Error>::duplicate_field(#tag))
+                            }
+                            // Second key is the content.
+                            _serde::export::Some(_serde::private::de::TagOrContentField::Content) => {
+                                let __ret = try!(_serde::de::MapAccess::next_value_seed(&mut __map,
+                                    __Seed {
+                                        field: __field,
+                                        marker: _serde::export::PhantomData,
+                                        lifetime: _serde::export::PhantomData,
+                                    }));
+                                // Visit remaining keys, looking for duplicates.
+                                #visit_remaining_keys
+                            }
+                            // There is no second key; might be okay if the we have a unit variant.
+                            _serde::export::None => #missing_content
+                        }
+                    }
+                    // First key is the content.
+                    _serde::export::Some(_serde::private::de::TagOrContentField::Content) => {
+                        // Buffer up the content.
+                        let __content = try!(_serde::de::MapAccess::next_value::<_serde::private::de::Content>(&mut __map));
+                        // Visit the second key.
+                        match #next_relevant_key {
+                            // Second key is the tag.
+                            _serde::export::Some(_serde::private::de::TagOrContentField::Tag) => {
+                                let __deserializer = _serde::private::de::ContentDeserializer::<__A::Error>::new(__content);
+                                #finish_content_then_tag
+                            }
+                            // Second key is a duplicate of the content.
+                            _serde::export::Some(_serde::private::de::TagOrContentField::Content) => {
+                                _serde::export::Err(<__A::Error as _serde::de::Error>::duplicate_field(#content))
+                            }
+                            // There is no second key.
+                            _serde::export::None => {
+                                _serde::export::Err(<__A::Error as _serde::de::Error>::missing_field(#tag))
+                            }
+                        }
+                    }
+                    // There is no first key.
+                    _serde::export::None => {
+                        _serde::export::Err(<__A::Error as _serde::de::Error>::missing_field(#tag))
+                    }
+                }
+            }
+
+            fn visit_seq<__A>(self, mut __seq: __A) -> _serde::export::Result<Self::Value, __A::Error>
+            where
+                __A: _serde::de::SeqAccess<#delife>,
+            {
+                // Visit the first element - the tag.
+                match try!(_serde::de::SeqAccess::next_element(&mut __seq)) {
+                    _serde::export::Some(__field) => {
+                        // Visit the second element - the content.
+                        match try!(_serde::de::SeqAccess::next_element_seed(
+                            &mut __seq,
+                            __Seed {
+                                field: __field,
+                                marker: _serde::export::PhantomData,
+                                lifetime: _serde::export::PhantomData,
+                            },
+                        )) {
+                            _serde::export::Some(__ret) => _serde::export::Ok(__ret),
+                            // There is no second element.
+                            _serde::export::None => {
+                                _serde::export::Err(_serde::de::Error::invalid_length(1, &self))
+                            }
+                        }
+                    }
+                    // There is no first element.
+                    _serde::export::None => {
+                        _serde::export::Err(_serde::de::Error::invalid_length(0, &self))
+                    }
+                }
+            }
+        }
+
+        const FIELDS: &'static [&'static str] = &[#tag, #content];
+        _serde::Deserializer::deserialize_struct(
+            __deserializer,
+            #type_name,
+            FIELDS,
+            __Visitor {
+                marker: _serde::export::PhantomData::<#this #ty_generics>,
+                lifetime: _serde::export::PhantomData,
+            },
+        )
+    }
+}
+
+fn deserialize_untagged_enum(
+    params: &Parameters,
+    variants: &[Variant],
+    cattrs: &attr::Container,
+) -> Fragment {
+    let attempts = variants
+        .iter()
+        .filter(|variant| !variant.attrs.skip_deserializing())
+        .map(|variant| {
+            Expr(deserialize_untagged_variant(
+                params,
+                variant,
+                cattrs,
+                quote!(_serde::private::de::ContentRefDeserializer::<__D::Error>::new(&__content)),
+            ))
+        });
+
+    // TODO this message could be better by saving the errors from the failed
+    // attempts. The heuristic used by TOML was to count the number of fields
+    // processed before an error, and use the error that happened after the
+    // largest number of fields. I'm not sure I like that. Maybe it would be
+    // better to save all the errors and combine them into one message that
+    // explains why none of the variants matched.
+    let fallthrough_msg = format!(
+        "data did not match any variant of untagged enum {}",
+        params.type_name()
+    );
+
+    quote_block! {
+        let __content = try!(<_serde::private::de::Content as _serde::Deserialize>::deserialize(__deserializer));
+
+        #(
+            if let _serde::export::Ok(__ok) = #attempts {
+                return _serde::export::Ok(__ok);
+            }
+        )*
+
+        _serde::export::Err(_serde::de::Error::custom(#fallthrough_msg))
+    }
+}
+
+fn deserialize_externally_tagged_variant(
+    params: &Parameters,
+    variant: &Variant,
+    cattrs: &attr::Container,
+) -> Fragment {
+    if let Some(path) = variant.attrs.deserialize_with() {
+        let (wrapper, wrapper_ty, unwrap_fn) = wrap_deserialize_variant_with(params, variant, path);
+        return quote_block! {
+            #wrapper
+            _serde::export::Result::map(
+                _serde::de::VariantAccess::newtype_variant::<#wrapper_ty>(__variant), #unwrap_fn)
+        };
+    }
+
+    let variant_ident = &variant.ident;
+
+    match variant.style {
+        Style::Unit => {
+            let this = &params.this;
+            quote_block! {
+                try!(_serde::de::VariantAccess::unit_variant(__variant));
+                _serde::export::Ok(#this::#variant_ident)
+            }
+        }
+        Style::Newtype => deserialize_externally_tagged_newtype_variant(
+            variant_ident,
+            params,
+            &variant.fields[0],
+            cattrs,
+        ),
+        Style::Tuple => {
+            deserialize_tuple(Some(variant_ident), params, &variant.fields, cattrs, None)
+        }
+        Style::Struct => deserialize_struct(
+            Some(variant_ident),
+            params,
+            &variant.fields,
+            cattrs,
+            None,
+            &Untagged::No,
+        ),
+    }
+}
+
+fn deserialize_internally_tagged_variant(
+    params: &Parameters,
+    variant: &Variant,
+    cattrs: &attr::Container,
+    deserializer: TokenStream,
+) -> Fragment {
+    if variant.attrs.deserialize_with().is_some() {
+        return deserialize_untagged_variant(params, variant, cattrs, deserializer);
+    }
+
+    let variant_ident = &variant.ident;
+
+    match effective_style(variant) {
+        Style::Unit => {
+            let this = &params.this;
+            let type_name = params.type_name();
+            let variant_name = variant.ident.to_string();
+            let default = variant.fields.get(0).map(|field| {
+                let default = Expr(expr_is_missing(field, cattrs));
+                quote!((#default))
+            });
+            quote_block! {
+                try!(_serde::Deserializer::deserialize_any(#deserializer, _serde::private::de::InternallyTaggedUnitVisitor::new(#type_name, #variant_name)));
+                _serde::export::Ok(#this::#variant_ident #default)
+            }
+        }
+        Style::Newtype => deserialize_untagged_newtype_variant(
+            variant_ident,
+            params,
+            &variant.fields[0],
+            &deserializer,
+        ),
+        Style::Struct => deserialize_struct(
+            Some(variant_ident),
+            params,
+            &variant.fields,
+            cattrs,
+            Some(deserializer),
+            &Untagged::No,
+        ),
+        Style::Tuple => unreachable!("checked in serde_derive_internals"),
+    }
+}
+
+fn deserialize_untagged_variant(
+    params: &Parameters,
+    variant: &Variant,
+    cattrs: &attr::Container,
+    deserializer: TokenStream,
+) -> Fragment {
+    if let Some(path) = variant.attrs.deserialize_with() {
+        let (wrapper, wrapper_ty, unwrap_fn) = wrap_deserialize_variant_with(params, variant, path);
+        return quote_block! {
+            #wrapper
+            _serde::export::Result::map(
+                <#wrapper_ty as _serde::Deserialize>::deserialize(#deserializer), #unwrap_fn)
+        };
+    }
+
+    let variant_ident = &variant.ident;
+
+    match effective_style(variant) {
+        Style::Unit => {
+            let this = &params.this;
+            let type_name = params.type_name();
+            let variant_name = variant.ident.to_string();
+            let default = variant.fields.get(0).map(|field| {
+                let default = Expr(expr_is_missing(field, cattrs));
+                quote!((#default))
+            });
+            quote_expr! {
+                match _serde::Deserializer::deserialize_any(
+                    #deserializer,
+                    _serde::private::de::UntaggedUnitVisitor::new(#type_name, #variant_name)
+                ) {
+                    _serde::export::Ok(()) => _serde::export::Ok(#this::#variant_ident #default),
+                    _serde::export::Err(__err) => _serde::export::Err(__err),
+                }
+            }
+        }
+        Style::Newtype => deserialize_untagged_newtype_variant(
+            variant_ident,
+            params,
+            &variant.fields[0],
+            &deserializer,
+        ),
+        Style::Tuple => deserialize_tuple(
+            Some(variant_ident),
+            params,
+            &variant.fields,
+            cattrs,
+            Some(deserializer),
+        ),
+        Style::Struct => deserialize_struct(
+            Some(variant_ident),
+            params,
+            &variant.fields,
+            cattrs,
+            Some(deserializer),
+            &Untagged::Yes,
+        ),
+    }
+}
+
+fn deserialize_externally_tagged_newtype_variant(
+    variant_ident: &syn::Ident,
+    params: &Parameters,
+    field: &Field,
+    cattrs: &attr::Container,
+) -> Fragment {
+    let this = &params.this;
+
+    if field.attrs.skip_deserializing() {
+        let this = &params.this;
+        let default = Expr(expr_is_missing(field, cattrs));
+        return quote_block! {
+            try!(_serde::de::VariantAccess::unit_variant(__variant));
+            _serde::export::Ok(#this::#variant_ident(#default))
+        };
+    }
+
+    match field.attrs.deserialize_with() {
+        None => {
+            let field_ty = field.ty;
+            let span = field.original.span();
+            let func =
+                quote_spanned!(span=> _serde::de::VariantAccess::newtype_variant::<#field_ty>);
+            quote_expr! {
+                _serde::export::Result::map(#func(__variant), #this::#variant_ident)
+            }
+        }
+        Some(path) => {
+            let (wrapper, wrapper_ty) = wrap_deserialize_field_with(params, field.ty, path);
+            quote_block! {
+                #wrapper
+                _serde::export::Result::map(
+                    _serde::de::VariantAccess::newtype_variant::<#wrapper_ty>(__variant),
+                    |__wrapper| #this::#variant_ident(__wrapper.value))
+            }
+        }
+    }
+}
+
+fn deserialize_untagged_newtype_variant(
+    variant_ident: &syn::Ident,
+    params: &Parameters,
+    field: &Field,
+    deserializer: &TokenStream,
+) -> Fragment {
+    let this = &params.this;
+    let field_ty = field.ty;
+    match field.attrs.deserialize_with() {
+        None => {
+            let span = field.original.span();
+            let func = quote_spanned!(span=> <#field_ty as _serde::Deserialize>::deserialize);
+            quote_expr! {
+                _serde::export::Result::map(#func(#deserializer), #this::#variant_ident)
+            }
+        }
+        Some(path) => {
+            quote_block! {
+                let __value: _serde::export::Result<#field_ty, _> = #path(#deserializer);
+                _serde::export::Result::map(__value, #this::#variant_ident)
+            }
+        }
+    }
+}
+
+fn deserialize_generated_identifier(
+    fields: &[(String, Ident, Vec<String>)],
+    cattrs: &attr::Container,
+    is_variant: bool,
+    other_idx: Option<usize>,
+) -> Fragment {
+    let this = quote!(__Field);
+    let field_idents: &Vec<_> = &fields.iter().map(|(_, ident, _)| ident).collect();
+
+    let (ignore_variant, fallthrough) = if !is_variant && cattrs.has_flatten() {
+        let ignore_variant = quote!(__other(_serde::private::de::Content<'de>),);
+        let fallthrough = quote!(_serde::export::Ok(__Field::__other(__value)));
+        (Some(ignore_variant), Some(fallthrough))
+    } else if let Some(other_idx) = other_idx {
+        let ignore_variant = fields[other_idx].1.clone();
+        let fallthrough = quote!(_serde::export::Ok(__Field::#ignore_variant));
+        (None, Some(fallthrough))
+    } else if is_variant || cattrs.deny_unknown_fields() {
+        (None, None)
+    } else {
+        let ignore_variant = quote!(__ignore,);
+        let fallthrough = quote!(_serde::export::Ok(__Field::__ignore));
+        (Some(ignore_variant), Some(fallthrough))
+    };
+
+    let visitor_impl = Stmts(deserialize_identifier(
+        &this,
+        fields,
+        is_variant,
+        fallthrough,
+        !is_variant && cattrs.has_flatten(),
+    ));
+
+    let lifetime = if !is_variant && cattrs.has_flatten() {
+        Some(quote!(<'de>))
+    } else {
+        None
+    };
+
+    quote_block! {
+        #[allow(non_camel_case_types)]
+        enum __Field #lifetime {
+            #(#field_idents,)*
+            #ignore_variant
+        }
+
+        struct __FieldVisitor;
+
+        impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
+            type Value = __Field #lifetime;
+
+            #visitor_impl
+        }
+
+        impl<'de> _serde::Deserialize<'de> for __Field #lifetime {
+            #[inline]
+            fn deserialize<__D>(__deserializer: __D) -> _serde::export::Result<Self, __D::Error>
+            where
+                __D: _serde::Deserializer<'de>,
+            {
+                _serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor)
+            }
+        }
+    }
+}
+
+fn deserialize_custom_identifier(
+    params: &Parameters,
+    variants: &[Variant],
+    cattrs: &attr::Container,
+) -> Fragment {
+    let is_variant = match cattrs.identifier() {
+        attr::Identifier::Variant => true,
+        attr::Identifier::Field => false,
+        attr::Identifier::No => unreachable!(),
+    };
+
+    let this = &params.this;
+    let this = quote!(#this);
+
+    let (ordinary, fallthrough) = if let Some(last) = variants.last() {
+        let last_ident = &last.ident;
+        if last.attrs.other() {
+            let ordinary = &variants[..variants.len() - 1];
+            let fallthrough = quote!(_serde::export::Ok(#this::#last_ident));
+            (ordinary, Some(fallthrough))
+        } else if let Style::Newtype = last.style {
+            let ordinary = &variants[..variants.len() - 1];
+            let deserializer = quote!(_serde::private::de::IdentifierDeserializer::from(__value));
+            let fallthrough = quote! {
+                _serde::export::Result::map(
+                    _serde::Deserialize::deserialize(#deserializer),
+                    #this::#last_ident)
+            };
+            (ordinary, Some(fallthrough))
+        } else {
+            (variants, None)
+        }
+    } else {
+        (variants, None)
+    };
+
+    let names_idents: Vec<_> = ordinary
+        .iter()
+        .map(|variant| {
+            (
+                variant.attrs.name().deserialize_name(),
+                variant.ident.clone(),
+                variant.attrs.aliases(),
+            )
+        })
+        .collect();
+
+    let names = names_idents.iter().map(|(name, _, _)| name);
+
+    let names_const = if fallthrough.is_some() {
+        None
+    } else if is_variant {
+        let variants = quote! {
+            const VARIANTS: &'static [&'static str] = &[ #(#names),* ];
+        };
+        Some(variants)
+    } else {
+        let fields = quote! {
+            const FIELDS: &'static [&'static str] = &[ #(#names),* ];
+        };
+        Some(fields)
+    };
+
+    let (de_impl_generics, de_ty_generics, ty_generics, where_clause) =
+        split_with_de_lifetime(params);
+    let delife = params.borrowed.de_lifetime();
+    let visitor_impl = Stmts(deserialize_identifier(
+        &this,
+        &names_idents,
+        is_variant,
+        fallthrough,
+        false,
+    ));
+
+    quote_block! {
+        #names_const
+
+        struct __FieldVisitor #de_impl_generics #where_clause {
+            marker: _serde::export::PhantomData<#this #ty_generics>,
+            lifetime: _serde::export::PhantomData<&#delife ()>,
+        }
+
+        impl #de_impl_generics _serde::de::Visitor<#delife> for __FieldVisitor #de_ty_generics #where_clause {
+            type Value = #this #ty_generics;
+
+            #visitor_impl
+        }
+
+        let __visitor = __FieldVisitor {
+            marker: _serde::export::PhantomData::<#this #ty_generics>,
+            lifetime: _serde::export::PhantomData,
+        };
+        _serde::Deserializer::deserialize_identifier(__deserializer, __visitor)
+    }
+}
+
+fn deserialize_identifier(
+    this: &TokenStream,
+    fields: &[(String, Ident, Vec<String>)],
+    is_variant: bool,
+    fallthrough: Option<TokenStream>,
+    collect_other_fields: bool,
+) -> Fragment {
+    let mut flat_fields = Vec::new();
+    for (_, ident, aliases) in fields {
+        flat_fields.extend(aliases.iter().map(|alias| (alias, ident)))
+    }
+
+    let field_strs = flat_fields.iter().map(|(name, _)| name);
+    let field_borrowed_strs = flat_fields.iter().map(|(name, _)| name);
+    let field_bytes = flat_fields
+        .iter()
+        .map(|(name, _)| Literal::byte_string(name.as_bytes()));
+    let field_borrowed_bytes = flat_fields
+        .iter()
+        .map(|(name, _)| Literal::byte_string(name.as_bytes()));
+
+    let constructors: &Vec<_> = &flat_fields
+        .iter()
+        .map(|(_, ident)| quote!(#this::#ident))
+        .collect();
+    let main_constructors: &Vec<_> = &fields
+        .iter()
+        .map(|(_, ident, _)| quote!(#this::#ident))
+        .collect();
+
+    let expecting = if is_variant {
+        "variant identifier"
+    } else {
+        "field identifier"
+    };
+
+    let index_expecting = if is_variant { "variant" } else { "field" };
+
+    let bytes_to_str = if fallthrough.is_some() || collect_other_fields {
+        None
+    } else {
+        Some(quote! {
+            let __value = &_serde::export::from_utf8_lossy(__value);
+        })
+    };
+
+    let (
+        value_as_str_content,
+        value_as_borrowed_str_content,
+        value_as_bytes_content,
+        value_as_borrowed_bytes_content,
+    ) = if collect_other_fields {
+        (
+            Some(quote! {
+                let __value = _serde::private::de::Content::String(_serde::export::ToString::to_string(__value));
+            }),
+            Some(quote! {
+                let __value = _serde::private::de::Content::Str(__value);
+            }),
+            Some(quote! {
+                let __value = _serde::private::de::Content::ByteBuf(__value.to_vec());
+            }),
+            Some(quote! {
+                let __value = _serde::private::de::Content::Bytes(__value);
+            }),
+        )
+    } else {
+        (None, None, None, None)
+    };
+
+    let fallthrough_arm = if let Some(fallthrough) = fallthrough {
+        fallthrough
+    } else if is_variant {
+        quote! {
+            _serde::export::Err(_serde::de::Error::unknown_variant(__value, VARIANTS))
+        }
+    } else {
+        quote! {
+            _serde::export::Err(_serde::de::Error::unknown_field(__value, FIELDS))
+        }
+    };
+
+    let variant_indices = 0_u64..;
+    let fallthrough_msg = format!("{} index 0 <= i < {}", index_expecting, fields.len());
+    let visit_other = if collect_other_fields {
+        quote! {
+            fn visit_bool<__E>(self, __value: bool) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                _serde::export::Ok(__Field::__other(_serde::private::de::Content::Bool(__value)))
+            }
+
+            fn visit_i8<__E>(self, __value: i8) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                _serde::export::Ok(__Field::__other(_serde::private::de::Content::I8(__value)))
+            }
+
+            fn visit_i16<__E>(self, __value: i16) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                _serde::export::Ok(__Field::__other(_serde::private::de::Content::I16(__value)))
+            }
+
+            fn visit_i32<__E>(self, __value: i32) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                _serde::export::Ok(__Field::__other(_serde::private::de::Content::I32(__value)))
+            }
+
+            fn visit_i64<__E>(self, __value: i64) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                _serde::export::Ok(__Field::__other(_serde::private::de::Content::I64(__value)))
+            }
+
+            fn visit_u8<__E>(self, __value: u8) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                _serde::export::Ok(__Field::__other(_serde::private::de::Content::U8(__value)))
+            }
+
+            fn visit_u16<__E>(self, __value: u16) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                _serde::export::Ok(__Field::__other(_serde::private::de::Content::U16(__value)))
+            }
+
+            fn visit_u32<__E>(self, __value: u32) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                _serde::export::Ok(__Field::__other(_serde::private::de::Content::U32(__value)))
+            }
+
+            fn visit_u64<__E>(self, __value: u64) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                _serde::export::Ok(__Field::__other(_serde::private::de::Content::U64(__value)))
+            }
+
+            fn visit_f32<__E>(self, __value: f32) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                _serde::export::Ok(__Field::__other(_serde::private::de::Content::F32(__value)))
+            }
+
+            fn visit_f64<__E>(self, __value: f64) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                _serde::export::Ok(__Field::__other(_serde::private::de::Content::F64(__value)))
+            }
+
+            fn visit_char<__E>(self, __value: char) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                _serde::export::Ok(__Field::__other(_serde::private::de::Content::Char(__value)))
+            }
+
+            fn visit_unit<__E>(self) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                _serde::export::Ok(__Field::__other(_serde::private::de::Content::Unit))
+            }
+
+            fn visit_borrowed_str<__E>(self, __value: &'de str) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                match __value {
+                    #(
+                        #field_borrowed_strs => _serde::export::Ok(#constructors),
+                    )*
+                    _ => {
+                        #value_as_borrowed_str_content
+                        #fallthrough_arm
+                    }
+                }
+            }
+
+            fn visit_borrowed_bytes<__E>(self, __value: &'de [u8]) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                match __value {
+                    #(
+                        #field_borrowed_bytes => _serde::export::Ok(#constructors),
+                    )*
+                    _ => {
+                        #bytes_to_str
+                        #value_as_borrowed_bytes_content
+                        #fallthrough_arm
+                    }
+                }
+            }
+        }
+    } else {
+        quote! {
+            fn visit_u64<__E>(self, __value: u64) -> _serde::export::Result<Self::Value, __E>
+            where
+                __E: _serde::de::Error,
+            {
+                match __value {
+                    #(
+                        #variant_indices => _serde::export::Ok(#main_constructors),
+                    )*
+                    _ => _serde::export::Err(_serde::de::Error::invalid_value(
+                        _serde::de::Unexpected::Unsigned(__value),
+                        &#fallthrough_msg,
+                    ))
+                }
+            }
+        }
+    };
+
+    quote_block! {
+        fn expecting(&self, __formatter: &mut _serde::export::Formatter) -> _serde::export::fmt::Result {
+            _serde::export::Formatter::write_str(__formatter, #expecting)
+        }
+
+        #visit_other
+
+        fn visit_str<__E>(self, __value: &str) -> _serde::export::Result<Self::Value, __E>
+        where
+            __E: _serde::de::Error,
+        {
+            match __value {
+                #(
+                    #field_strs => _serde::export::Ok(#constructors),
+                )*
+                _ => {
+                    #value_as_str_content
+                    #fallthrough_arm
+                }
+            }
+        }
+
+        fn visit_bytes<__E>(self, __value: &[u8]) -> _serde::export::Result<Self::Value, __E>
+        where
+            __E: _serde::de::Error,
+        {
+            match __value {
+                #(
+                    #field_bytes => _serde::export::Ok(#constructors),
+                )*
+                _ => {
+                    #bytes_to_str
+                    #value_as_bytes_content
+                    #fallthrough_arm
+                }
+            }
+        }
+    }
+}
+
+fn deserialize_struct_as_struct_visitor(
+    struct_path: &TokenStream,
+    params: &Parameters,
+    fields: &[Field],
+    cattrs: &attr::Container,
+) -> (Fragment, Option<Fragment>, Fragment) {
+    assert!(!cattrs.has_flatten());
+
+    let field_names_idents: Vec<_> = fields
+        .iter()
+        .enumerate()
+        .filter(|&(_, field)| !field.attrs.skip_deserializing())
+        .map(|(i, field)| {
+            (
+                field.attrs.name().deserialize_name(),
+                field_i(i),
+                field.attrs.aliases(),
+            )
+        })
+        .collect();
+
+    let fields_stmt = {
+        let field_names = field_names_idents.iter().map(|(name, _, _)| name);
+        quote_block! {
+            const FIELDS: &'static [&'static str] = &[ #(#field_names),* ];
+        }
+    };
+
+    let field_visitor = deserialize_generated_identifier(&field_names_idents, cattrs, false, None);
+
+    let visit_map = deserialize_map(struct_path, params, fields, cattrs);
+
+    (field_visitor, Some(fields_stmt), visit_map)
+}
+
+fn deserialize_struct_as_map_visitor(
+    struct_path: &TokenStream,
+    params: &Parameters,
+    fields: &[Field],
+    cattrs: &attr::Container,
+) -> (Fragment, Option<Fragment>, Fragment) {
+    let field_names_idents: Vec<_> = fields
+        .iter()
+        .enumerate()
+        .filter(|&(_, field)| !field.attrs.skip_deserializing() && !field.attrs.flatten())
+        .map(|(i, field)| {
+            (
+                field.attrs.name().deserialize_name(),
+                field_i(i),
+                field.attrs.aliases(),
+            )
+        })
+        .collect();
+
+    let field_visitor = deserialize_generated_identifier(&field_names_idents, cattrs, false, None);
+
+    let visit_map = deserialize_map(struct_path, params, fields, cattrs);
+
+    (field_visitor, None, visit_map)
+}
+
+fn deserialize_map(
+    struct_path: &TokenStream,
+    params: &Parameters,
+    fields: &[Field],
+    cattrs: &attr::Container,
+) -> Fragment {
+    // Create the field names for the fields.
+    let fields_names: Vec<_> = fields
+        .iter()
+        .enumerate()
+        .map(|(i, field)| (field, field_i(i)))
+        .collect();
+
+    // Declare each field that will be deserialized.
+    let let_values = fields_names
+        .iter()
+        .filter(|&&(field, _)| !field.attrs.skip_deserializing() && !field.attrs.flatten())
+        .map(|(field, name)| {
+            let field_ty = field.ty;
+            quote! {
+                let mut #name: _serde::export::Option<#field_ty> = _serde::export::None;
+            }
+        });
+
+    // Collect contents for flatten fields into a buffer
+    let let_collect = if cattrs.has_flatten() {
+        Some(quote! {
+            let mut __collect = _serde::export::Vec::<_serde::export::Option<(
+                _serde::private::de::Content,
+                _serde::private::de::Content
+            )>>::new();
+        })
+    } else {
+        None
+    };
+
+    // Match arms to extract a value for a field.
+    let value_arms = fields_names
+        .iter()
+        .filter(|&&(field, _)| !field.attrs.skip_deserializing() && !field.attrs.flatten())
+        .map(|(field, name)| {
+            let deser_name = field.attrs.name().deserialize_name();
+
+            let visit = match field.attrs.deserialize_with() {
+                None => {
+                    let field_ty = field.ty;
+                    let span = field.original.span();
+                    let func =
+                        quote_spanned!(span=> _serde::de::MapAccess::next_value::<#field_ty>);
+                    quote! {
+                        try!(#func(&mut __map))
+                    }
+                }
+                Some(path) => {
+                    let (wrapper, wrapper_ty) = wrap_deserialize_field_with(params, field.ty, path);
+                    quote!({
+                        #wrapper
+                        match _serde::de::MapAccess::next_value::<#wrapper_ty>(&mut __map) {
+                            _serde::export::Ok(__wrapper) => __wrapper.value,
+                            _serde::export::Err(__err) => {
+                                return _serde::export::Err(__err);
+                            }
+                        }
+                    })
+                }
+            };
+            quote! {
+                __Field::#name => {
+                    if _serde::export::Option::is_some(&#name) {
+                        return _serde::export::Err(<__A::Error as _serde::de::Error>::duplicate_field(#deser_name));
+                    }
+                    #name = _serde::export::Some(#visit);
+                }
+            }
+        });
+
+    // Visit ignored values to consume them
+    let ignored_arm = if cattrs.has_flatten() {
+        Some(quote! {
+            __Field::__other(__name) => {
+                __collect.push(_serde::export::Some((
+                    __name,
+                    try!(_serde::de::MapAccess::next_value(&mut __map)))));
+            }
+        })
+    } else if cattrs.deny_unknown_fields() {
+        None
+    } else {
+        Some(quote! {
+            _ => { let _ = try!(_serde::de::MapAccess::next_value::<_serde::de::IgnoredAny>(&mut __map)); }
+        })
+    };
+
+    let all_skipped = fields.iter().all(|field| field.attrs.skip_deserializing());
+    let match_keys = if cattrs.deny_unknown_fields() && all_skipped {
+        quote! {
+            // FIXME: Once we drop support for Rust 1.15:
+            // let _serde::export::None::<__Field> = try!(_serde::de::MapAccess::next_key(&mut __map));
+            _serde::export::Option::map(
+                try!(_serde::de::MapAccess::next_key::<__Field>(&mut __map)),
+                |__impossible| match __impossible {});
+        }
+    } else {
+        quote! {
+            while let _serde::export::Some(__key) = try!(_serde::de::MapAccess::next_key::<__Field>(&mut __map)) {
+                match __key {
+                    #(#value_arms)*
+                    #ignored_arm
+                }
+            }
+        }
+    };
+
+    let extract_values = fields_names
+        .iter()
+        .filter(|&&(field, _)| !field.attrs.skip_deserializing() && !field.attrs.flatten())
+        .map(|(field, name)| {
+            let missing_expr = Match(expr_is_missing(field, cattrs));
+
+            quote! {
+                let #name = match #name {
+                    _serde::export::Some(#name) => #name,
+                    _serde::export::None => #missing_expr
+                };
+            }
+        });
+
+    let extract_collected = fields_names
+        .iter()
+        .filter(|&&(field, _)| field.attrs.flatten() && !field.attrs.skip_deserializing())
+        .map(|(field, name)| {
+            let field_ty = field.ty;
+            let func = match field.attrs.deserialize_with() {
+                None => {
+                    let span = field.original.span();
+                    quote_spanned!(span=> _serde::de::Deserialize::deserialize)
+                }
+                Some(path) => quote!(#path),
+            };
+            quote! {
+                let #name: #field_ty = try!(#func(
+                    _serde::private::de::FlatMapDeserializer(
+                        &mut __collect,
+                        _serde::export::PhantomData)));
+            }
+        });
+
+    let collected_deny_unknown_fields = if cattrs.has_flatten() && cattrs.deny_unknown_fields() {
+        Some(quote! {
+            if let _serde::export::Some(_serde::export::Some((__key, _))) =
+                __collect.into_iter().filter(_serde::export::Option::is_some).next()
+            {
+                if let _serde::export::Some(__key) = __key.as_str() {
+                    return _serde::export::Err(
+                        _serde::de::Error::custom(format_args!("unknown field `{}`", &__key)));
+                } else {
+                    return _serde::export::Err(
+                        _serde::de::Error::custom(format_args!("unexpected map key")));
+                }
+            }
+        })
+    } else {
+        None
+    };
+
+    let result = fields_names.iter().map(|(field, name)| {
+        let member = &field.member;
+        if field.attrs.skip_deserializing() {
+            let value = Expr(expr_is_missing(field, cattrs));
+            quote!(#member: #value)
+        } else {
+            quote!(#member: #name)
+        }
+    });
+
+    let let_default = match cattrs.default() {
+        attr::Default::Default => Some(quote!(
+            let __default: Self::Value = _serde::export::Default::default();
+        )),
+        attr::Default::Path(path) => Some(quote!(
+            let __default: Self::Value = #path();
+        )),
+        attr::Default::None => {
+            // We don't need the default value, to prevent an unused variable warning
+            // we'll leave the line empty.
+            None
+        }
+    };
+
+    let mut result = quote!(#struct_path { #(#result),* });
+    if params.has_getter {
+        let this = &params.this;
+        result = quote! {
+            _serde::export::Into::<#this>::into(#result)
+        };
+    }
+
+    quote_block! {
+        #(#let_values)*
+
+        #let_collect
+
+        #match_keys
+
+        #let_default
+
+        #(#extract_values)*
+
+        #(#extract_collected)*
+
+        #collected_deny_unknown_fields
+
+        _serde::export::Ok(#result)
+    }
+}
+
+#[cfg(feature = "deserialize_in_place")]
+fn deserialize_struct_as_struct_in_place_visitor(
+    params: &Parameters,
+    fields: &[Field],
+    cattrs: &attr::Container,
+) -> (Fragment, Fragment, Fragment) {
+    assert!(!cattrs.has_flatten());
+
+    let field_names_idents: Vec<_> = fields
+        .iter()
+        .enumerate()
+        .filter(|&(_, field)| !field.attrs.skip_deserializing())
+        .map(|(i, field)| {
+            (
+                field.attrs.name().deserialize_name(),
+                field_i(i),
+                field.attrs.aliases(),
+            )
+        })
+        .collect();
+
+    let fields_stmt = {
+        let field_names = field_names_idents.iter().map(|(name, _, _)| name);
+        quote_block! {
+            const FIELDS: &'static [&'static str] = &[ #(#field_names),* ];
+        }
+    };
+
+    let field_visitor = deserialize_generated_identifier(&field_names_idents, cattrs, false, None);
+
+    let visit_map = deserialize_map_in_place(params, fields, cattrs);
+
+    (field_visitor, fields_stmt, visit_map)
+}
+
+#[cfg(feature = "deserialize_in_place")]
+fn deserialize_map_in_place(
+    params: &Parameters,
+    fields: &[Field],
+    cattrs: &attr::Container,
+) -> Fragment {
+    assert!(!cattrs.has_flatten());
+
+    // Create the field names for the fields.
+    let fields_names: Vec<_> = fields
+        .iter()
+        .enumerate()
+        .map(|(i, field)| (field, field_i(i)))
+        .collect();
+
+    // For deserialize_in_place, declare booleans for each field that will be
+    // deserialized.
+    let let_flags = fields_names
+        .iter()
+        .filter(|&&(field, _)| !field.attrs.skip_deserializing())
+        .map(|(_, name)| {
+            quote! {
+                let mut #name: bool = false;
+            }
+        });
+
+    // Match arms to extract a value for a field.
+    let value_arms_from = fields_names
+        .iter()
+        .filter(|&&(field, _)| !field.attrs.skip_deserializing())
+        .map(|(field, name)| {
+            let deser_name = field.attrs.name().deserialize_name();
+            let member = &field.member;
+
+            let visit = match field.attrs.deserialize_with() {
+                None => {
+                    quote! {
+                        try!(_serde::de::MapAccess::next_value_seed(&mut __map, _serde::private::de::InPlaceSeed(&mut self.place.#member)))
+                    }
+                }
+                Some(path) => {
+                    let (wrapper, wrapper_ty) = wrap_deserialize_field_with(params, field.ty, path);
+                    quote!({
+                        #wrapper
+                        self.place.#member = match _serde::de::MapAccess::next_value::<#wrapper_ty>(&mut __map) {
+                            _serde::export::Ok(__wrapper) => __wrapper.value,
+                            _serde::export::Err(__err) => {
+                                return _serde::export::Err(__err);
+                            }
+                        };
+                    })
+                }
+            };
+            quote! {
+                __Field::#name => {
+                    if #name {
+                        return _serde::export::Err(<__A::Error as _serde::de::Error>::duplicate_field(#deser_name));
+                    }
+                    #visit;
+                    #name = true;
+                }
+            }
+        });
+
+    // Visit ignored values to consume them
+    let ignored_arm = if cattrs.deny_unknown_fields() {
+        None
+    } else {
+        Some(quote! {
+            _ => { let _ = try!(_serde::de::MapAccess::next_value::<_serde::de::IgnoredAny>(&mut __map)); }
+        })
+    };
+
+    let all_skipped = fields.iter().all(|field| field.attrs.skip_deserializing());
+
+    let match_keys = if cattrs.deny_unknown_fields() && all_skipped {
+        quote! {
+            // FIXME: Once we drop support for Rust 1.15:
+            // let _serde::export::None::<__Field> = try!(_serde::de::MapAccess::next_key(&mut __map));
+            _serde::export::Option::map(
+                try!(_serde::de::MapAccess::next_key::<__Field>(&mut __map)),
+                |__impossible| match __impossible {});
+        }
+    } else {
+        quote! {
+            while let _serde::export::Some(__key) = try!(_serde::de::MapAccess::next_key::<__Field>(&mut __map)) {
+                match __key {
+                    #(#value_arms_from)*
+                    #ignored_arm
+                }
+            }
+        }
+    };
+
+    let check_flags = fields_names
+        .iter()
+        .filter(|&&(field, _)| !field.attrs.skip_deserializing())
+        .map(|(field, name)| {
+            let missing_expr = expr_is_missing(field, cattrs);
+            // If missing_expr unconditionally returns an error, don't try
+            // to assign its value to self.place.
+            if field.attrs.default().is_none()
+                && cattrs.default().is_none()
+                && field.attrs.deserialize_with().is_some()
+            {
+                let missing_expr = Stmts(missing_expr);
+                quote! {
+                    if !#name {
+                        #missing_expr;
+                    }
+                }
+            } else {
+                let member = &field.member;
+                let missing_expr = Expr(missing_expr);
+                quote! {
+                    if !#name {
+                        self.place.#member = #missing_expr;
+                    };
+                }
+            }
+        });
+
+    let this = &params.this;
+    let (_, _, ty_generics, _) = split_with_de_lifetime(params);
+
+    let let_default = match cattrs.default() {
+        attr::Default::Default => Some(quote!(
+            let __default: #this #ty_generics = _serde::export::Default::default();
+        )),
+        attr::Default::Path(path) => Some(quote!(
+            let __default: #this #ty_generics = #path();
+        )),
+        attr::Default::None => {
+            // We don't need the default value, to prevent an unused variable warning
+            // we'll leave the line empty.
+            None
+        }
+    };
+
+    quote_block! {
+        #(#let_flags)*
+
+        #match_keys
+
+        #let_default
+
+        #(#check_flags)*
+
+        _serde::export::Ok(())
+    }
+}
+
+fn field_i(i: usize) -> Ident {
+    Ident::new(&format!("__field{}", i), Span::call_site())
+}
+
+/// This function wraps the expression in `#[serde(deserialize_with = "...")]`
+/// in a trait to prevent it from accessing the internal `Deserialize` state.
+fn wrap_deserialize_with(
+    params: &Parameters,
+    value_ty: &TokenStream,
+    deserialize_with: &syn::ExprPath,
+) -> (TokenStream, TokenStream) {
+    let this = &params.this;
+    let (de_impl_generics, de_ty_generics, ty_generics, where_clause) =
+        split_with_de_lifetime(params);
+    let delife = params.borrowed.de_lifetime();
+
+    let wrapper = quote! {
+        struct __DeserializeWith #de_impl_generics #where_clause {
+            value: #value_ty,
+            phantom: _serde::export::PhantomData<#this #ty_generics>,
+            lifetime: _serde::export::PhantomData<&#delife ()>,
+        }
+
+        impl #de_impl_generics _serde::Deserialize<#delife> for __DeserializeWith #de_ty_generics #where_clause {
+            fn deserialize<__D>(__deserializer: __D) -> _serde::export::Result<Self, __D::Error>
+            where
+                __D: _serde::Deserializer<#delife>,
+            {
+                _serde::export::Ok(__DeserializeWith {
+                    value: try!(#deserialize_with(__deserializer)),
+                    phantom: _serde::export::PhantomData,
+                    lifetime: _serde::export::PhantomData,
+                })
+            }
+        }
+    };
+
+    let wrapper_ty = quote!(__DeserializeWith #de_ty_generics);
+
+    (wrapper, wrapper_ty)
+}
+
+fn wrap_deserialize_field_with(
+    params: &Parameters,
+    field_ty: &syn::Type,
+    deserialize_with: &syn::ExprPath,
+) -> (TokenStream, TokenStream) {
+    wrap_deserialize_with(params, &quote!(#field_ty), deserialize_with)
+}
+
+fn wrap_deserialize_variant_with(
+    params: &Parameters,
+    variant: &Variant,
+    deserialize_with: &syn::ExprPath,
+) -> (TokenStream, TokenStream, TokenStream) {
+    let this = &params.this;
+    let variant_ident = &variant.ident;
+
+    let field_tys = variant.fields.iter().map(|field| field.ty);
+    let (wrapper, wrapper_ty) =
+        wrap_deserialize_with(params, &quote!((#(#field_tys),*)), deserialize_with);
+
+    let field_access = (0..variant.fields.len()).map(|n| {
+        Member::Unnamed(Index {
+            index: n as u32,
+            span: Span::call_site(),
+        })
+    });
+    let unwrap_fn = match variant.style {
+        Style::Struct if variant.fields.len() == 1 => {
+            let member = &variant.fields[0].member;
+            quote! {
+                |__wrap| #this::#variant_ident { #member: __wrap.value }
+            }
+        }
+        Style::Struct => {
+            let members = variant.fields.iter().map(|field| &field.member);
+            quote! {
+                |__wrap| #this::#variant_ident { #(#members: __wrap.value.#field_access),* }
+            }
+        }
+        Style::Tuple => quote! {
+            |__wrap| #this::#variant_ident(#(__wrap.value.#field_access),*)
+        },
+        Style::Newtype => quote! {
+            |__wrap| #this::#variant_ident(__wrap.value)
+        },
+        Style::Unit => quote! {
+            |__wrap| #this::#variant_ident
+        },
+    };
+
+    (wrapper, wrapper_ty, unwrap_fn)
+}
+
+fn expr_is_missing(field: &Field, cattrs: &attr::Container) -> Fragment {
+    match field.attrs.default() {
+        attr::Default::Default => {
+            let span = field.original.span();
+            let func = quote_spanned!(span=> _serde::export::Default::default);
+            return quote_expr!(#func());
+        }
+        attr::Default::Path(path) => {
+            return quote_expr!(#path());
+        }
+        attr::Default::None => { /* below */ }
+    }
+
+    match *cattrs.default() {
+        attr::Default::Default | attr::Default::Path(_) => {
+            let member = &field.member;
+            return quote_expr!(__default.#member);
+        }
+        attr::Default::None => { /* below */ }
+    }
+
+    let name = field.attrs.name().deserialize_name();
+    match field.attrs.deserialize_with() {
+        None => {
+            let span = field.original.span();
+            let func = quote_spanned!(span=> _serde::private::de::missing_field);
+            quote_expr! {
+                try!(#func(#name))
+            }
+        }
+        Some(_) => {
+            quote_expr! {
+                return _serde::export::Err(<__A::Error as _serde::de::Error>::missing_field(#name))
+            }
+        }
+    }
+}
+
+fn effective_style(variant: &Variant) -> Style {
+    match variant.style {
+        Style::Newtype if variant.fields[0].attrs.skip_deserializing() => Style::Unit,
+        other => other,
+    }
+}
+
+struct DeImplGenerics<'a>(&'a Parameters);
+#[cfg(feature = "deserialize_in_place")]
+struct InPlaceImplGenerics<'a>(&'a Parameters);
+
+impl<'a> ToTokens for DeImplGenerics<'a> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        let mut generics = self.0.generics.clone();
+        if let Some(de_lifetime) = self.0.borrowed.de_lifetime_def() {
+            generics.params = Some(syn::GenericParam::Lifetime(de_lifetime))
+                .into_iter()
+                .chain(generics.params)
+                .collect();
+        }
+        let (impl_generics, _, _) = generics.split_for_impl();
+        impl_generics.to_tokens(tokens);
+    }
+}
+
+#[cfg(feature = "deserialize_in_place")]
+impl<'a> ToTokens for InPlaceImplGenerics<'a> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        let place_lifetime = place_lifetime();
+        let mut generics = self.0.generics.clone();
+
+        // Add lifetime for `&'place mut Self, and `'a: 'place`
+        for param in &mut generics.params {
+            match param {
+                syn::GenericParam::Lifetime(param) => {
+                    param.bounds.push(place_lifetime.lifetime.clone());
+                }
+                syn::GenericParam::Type(param) => {
+                    param.bounds.push(syn::TypeParamBound::Lifetime(
+                        place_lifetime.lifetime.clone(),
+                    ));
+                }
+                syn::GenericParam::Const(_) => {}
+            }
+        }
+        generics.params = Some(syn::GenericParam::Lifetime(place_lifetime))
+            .into_iter()
+            .chain(generics.params)
+            .collect();
+        if let Some(de_lifetime) = self.0.borrowed.de_lifetime_def() {
+            generics.params = Some(syn::GenericParam::Lifetime(de_lifetime))
+                .into_iter()
+                .chain(generics.params)
+                .collect();
+        }
+        let (impl_generics, _, _) = generics.split_for_impl();
+        impl_generics.to_tokens(tokens);
+    }
+}
+
+#[cfg(feature = "deserialize_in_place")]
+impl<'a> DeImplGenerics<'a> {
+    fn in_place(self) -> InPlaceImplGenerics<'a> {
+        InPlaceImplGenerics(self.0)
+    }
+}
+
+struct DeTypeGenerics<'a>(&'a Parameters);
+#[cfg(feature = "deserialize_in_place")]
+struct InPlaceTypeGenerics<'a>(&'a Parameters);
+
+impl<'a> ToTokens for DeTypeGenerics<'a> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        let mut generics = self.0.generics.clone();
+        if self.0.borrowed.de_lifetime_def().is_some() {
+            let def = syn::LifetimeDef {
+                attrs: Vec::new(),
+                lifetime: syn::Lifetime::new("'de", Span::call_site()),
+                colon_token: None,
+                bounds: Punctuated::new(),
+            };
+            generics.params = Some(syn::GenericParam::Lifetime(def))
+                .into_iter()
+                .chain(generics.params)
+                .collect();
+        }
+        let (_, ty_generics, _) = generics.split_for_impl();
+        ty_generics.to_tokens(tokens);
+    }
+}
+
+#[cfg(feature = "deserialize_in_place")]
+impl<'a> ToTokens for InPlaceTypeGenerics<'a> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        let mut generics = self.0.generics.clone();
+        generics.params = Some(syn::GenericParam::Lifetime(place_lifetime()))
+            .into_iter()
+            .chain(generics.params)
+            .collect();
+
+        if self.0.borrowed.de_lifetime_def().is_some() {
+            let def = syn::LifetimeDef {
+                attrs: Vec::new(),
+                lifetime: syn::Lifetime::new("'de", Span::call_site()),
+                colon_token: None,
+                bounds: Punctuated::new(),
+            };
+            generics.params = Some(syn::GenericParam::Lifetime(def))
+                .into_iter()
+                .chain(generics.params)
+                .collect();
+        }
+        let (_, ty_generics, _) = generics.split_for_impl();
+        ty_generics.to_tokens(tokens);
+    }
+}
+
+#[cfg(feature = "deserialize_in_place")]
+impl<'a> DeTypeGenerics<'a> {
+    fn in_place(self) -> InPlaceTypeGenerics<'a> {
+        InPlaceTypeGenerics(self.0)
+    }
+}
+
+#[cfg(feature = "deserialize_in_place")]
+fn place_lifetime() -> syn::LifetimeDef {
+    syn::LifetimeDef {
+        attrs: Vec::new(),
+        lifetime: syn::Lifetime::new("'place", Span::call_site()),
+        colon_token: None,
+        bounds: Punctuated::new(),
+    }
+}
+
+fn split_with_de_lifetime(
+    params: &Parameters,
+) -> (
+    DeImplGenerics,
+    DeTypeGenerics,
+    syn::TypeGenerics,
+    Option<&syn::WhereClause>,
+) {
+    let de_impl_generics = DeImplGenerics(params);
+    let de_ty_generics = DeTypeGenerics(params);
+    let (_, ty_generics, where_clause) = params.generics.split_for_impl();
+    (de_impl_generics, de_ty_generics, ty_generics, where_clause)
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/dummy.rs.html b/src/serde_derive/dummy.rs.html new file mode 100644 index 0000000..8c23519 --- /dev/null +++ b/src/serde_derive/dummy.rs.html @@ -0,0 +1,97 @@ +dummy.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
+use proc_macro2::{Ident, Span, TokenStream};
+
+use syn;
+use try;
+
+pub fn wrap_in_const(
+    serde_path: Option<&syn::Path>,
+    trait_: &str,
+    ty: &Ident,
+    code: TokenStream,
+) -> TokenStream {
+    let try_replacement = try::replacement();
+
+    let dummy_const = Ident::new(
+        &format!("_IMPL_{}_FOR_{}", trait_, unraw(ty)),
+        Span::call_site(),
+    );
+
+    let use_serde = match serde_path {
+        Some(path) => quote! {
+            use #path as _serde;
+        },
+        None => quote! {
+            #[allow(unknown_lints)]
+            #[cfg_attr(feature = "cargo-clippy", allow(useless_attribute))]
+            #[allow(rust_2018_idioms)]
+            extern crate serde as _serde;
+        },
+    };
+
+    quote! {
+        #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
+        const #dummy_const: () = {
+            #use_serde
+            #try_replacement
+            #code
+        };
+    }
+}
+
+#[allow(deprecated)]
+fn unraw(ident: &Ident) -> String {
+    // str::trim_start_matches was added in 1.30, trim_left_matches deprecated
+    // in 1.33. We currently support rustc back to 1.15 so we need to continue
+    // to use the deprecated one.
+    ident.to_string().trim_left_matches("r#").to_owned()
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/fragment.rs.html b/src/serde_derive/fragment.rs.html new file mode 100644 index 0000000..5bb9ae6 --- /dev/null +++ b/src/serde_derive/fragment.rs.html @@ -0,0 +1,151 @@ +fragment.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+
+use proc_macro2::TokenStream;
+use quote::ToTokens;
+use syn::token;
+
+pub enum Fragment {
+    /// Tokens that can be used as an expression.
+    Expr(TokenStream),
+    /// Tokens that can be used inside a block. The surrounding curly braces are
+    /// not part of these tokens.
+    Block(TokenStream),
+}
+
+macro_rules! quote_expr {
+    ($($tt:tt)*) => {
+        $crate::fragment::Fragment::Expr(quote!($($tt)*))
+    }
+}
+
+macro_rules! quote_block {
+    ($($tt:tt)*) => {
+        $crate::fragment::Fragment::Block(quote!($($tt)*))
+    }
+}
+
+/// Interpolate a fragment in place of an expression. This involves surrounding
+/// Block fragments in curly braces.
+pub struct Expr(pub Fragment);
+impl ToTokens for Expr {
+    fn to_tokens(&self, out: &mut TokenStream) {
+        match &self.0 {
+            Fragment::Expr(expr) => expr.to_tokens(out),
+            Fragment::Block(block) => {
+                token::Brace::default().surround(out, |out| block.to_tokens(out));
+            }
+        }
+    }
+}
+
+/// Interpolate a fragment as the statements of a block.
+pub struct Stmts(pub Fragment);
+impl ToTokens for Stmts {
+    fn to_tokens(&self, out: &mut TokenStream) {
+        match &self.0 {
+            Fragment::Expr(expr) => expr.to_tokens(out),
+            Fragment::Block(block) => block.to_tokens(out),
+        }
+    }
+}
+
+/// Interpolate a fragment as the value part of a `match` expression. This
+/// involves putting a comma after expressions and curly braces around blocks.
+pub struct Match(pub Fragment);
+impl ToTokens for Match {
+    fn to_tokens(&self, out: &mut TokenStream) {
+        match &self.0 {
+            Fragment::Expr(expr) => {
+                expr.to_tokens(out);
+                <Token![,]>::default().to_tokens(out);
+            }
+            Fragment::Block(block) => {
+                token::Brace::default().surround(out, |out| block.to_tokens(out));
+            }
+        }
+    }
+}
+
+impl AsRef<TokenStream> for Fragment {
+    fn as_ref(&self) -> &TokenStream {
+        match self {
+            Fragment::Expr(expr) => expr,
+            Fragment::Block(block) => block,
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/internals/ast.rs.html b/src/serde_derive/internals/ast.rs.html new file mode 100644 index 0000000..d2d7d2a --- /dev/null +++ b/src/serde_derive/internals/ast.rs.html @@ -0,0 +1,407 @@ +ast.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+
+//! A Serde ast, parsed from the Syn ast and ready to generate Rust code.
+
+use internals::attr;
+use internals::check;
+use internals::{Ctxt, Derive};
+use syn;
+use syn::punctuated::Punctuated;
+
+/// A source data structure annotated with `#[derive(Serialize)]` and/or `#[derive(Deserialize)]`,
+/// parsed into an internal representation.
+pub struct Container<'a> {
+    /// The struct or enum name (without generics).
+    pub ident: syn::Ident,
+    /// Attributes on the structure, parsed for Serde.
+    pub attrs: attr::Container,
+    /// The contents of the struct or enum.
+    pub data: Data<'a>,
+    /// Any generics on the struct or enum.
+    pub generics: &'a syn::Generics,
+    /// Original input.
+    pub original: &'a syn::DeriveInput,
+}
+
+/// The fields of a struct or enum.
+///
+/// Analagous to `syn::Data`.
+pub enum Data<'a> {
+    Enum(Vec<Variant<'a>>),
+    Struct(Style, Vec<Field<'a>>),
+}
+
+/// A variant of an enum.
+pub struct Variant<'a> {
+    pub ident: syn::Ident,
+    pub attrs: attr::Variant,
+    pub style: Style,
+    pub fields: Vec<Field<'a>>,
+    pub original: &'a syn::Variant,
+}
+
+/// A field of a struct.
+pub struct Field<'a> {
+    pub member: syn::Member,
+    pub attrs: attr::Field,
+    pub ty: &'a syn::Type,
+    pub original: &'a syn::Field,
+}
+
+#[derive(Copy, Clone)]
+pub enum Style {
+    /// Named fields.
+    Struct,
+    /// Many unnamed fields.
+    Tuple,
+    /// One unnamed field.
+    Newtype,
+    /// No fields.
+    Unit,
+}
+
+impl<'a> Container<'a> {
+    /// Convert the raw Syn ast into a parsed container object, collecting errors in `cx`.
+    pub fn from_ast(
+        cx: &Ctxt,
+        item: &'a syn::DeriveInput,
+        derive: Derive,
+    ) -> Option<Container<'a>> {
+        let mut attrs = attr::Container::from_ast(cx, item);
+
+        let mut data = match &item.data {
+            syn::Data::Enum(data) => Data::Enum(enum_from_ast(cx, &data.variants, attrs.default())),
+            syn::Data::Struct(data) => {
+                let (style, fields) = struct_from_ast(cx, &data.fields, None, attrs.default());
+                Data::Struct(style, fields)
+            }
+            syn::Data::Union(_) => {
+                cx.error_spanned_by(item, "Serde does not support derive for unions");
+                return None;
+            }
+        };
+
+        let mut has_flatten = false;
+        match &mut data {
+            Data::Enum(variants) => {
+                for variant in variants {
+                    variant.attrs.rename_by_rules(attrs.rename_all_rules());
+                    for field in &mut variant.fields {
+                        if field.attrs.flatten() {
+                            has_flatten = true;
+                        }
+                        field
+                            .attrs
+                            .rename_by_rules(variant.attrs.rename_all_rules());
+                    }
+                }
+            }
+            Data::Struct(_, fields) => {
+                for field in fields {
+                    if field.attrs.flatten() {
+                        has_flatten = true;
+                    }
+                    field.attrs.rename_by_rules(attrs.rename_all_rules());
+                }
+            }
+        }
+
+        if has_flatten {
+            attrs.mark_has_flatten();
+        }
+
+        let mut item = Container {
+            ident: item.ident.clone(),
+            attrs: attrs,
+            data: data,
+            generics: &item.generics,
+            original: item,
+        };
+        check::check(cx, &mut item, derive);
+        Some(item)
+    }
+}
+
+impl<'a> Data<'a> {
+    pub fn all_fields(&'a self) -> Box<Iterator<Item = &'a Field<'a>> + 'a> {
+        match self {
+            Data::Enum(variants) => {
+                Box::new(variants.iter().flat_map(|variant| variant.fields.iter()))
+            }
+            Data::Struct(_, fields) => Box::new(fields.iter()),
+        }
+    }
+
+    pub fn has_getter(&self) -> bool {
+        self.all_fields().any(|f| f.attrs.getter().is_some())
+    }
+}
+
+fn enum_from_ast<'a>(
+    cx: &Ctxt,
+    variants: &'a Punctuated<syn::Variant, Token![,]>,
+    container_default: &attr::Default,
+) -> Vec<Variant<'a>> {
+    variants
+        .iter()
+        .map(|variant| {
+            let attrs = attr::Variant::from_ast(cx, variant);
+            let (style, fields) =
+                struct_from_ast(cx, &variant.fields, Some(&attrs), container_default);
+            Variant {
+                ident: variant.ident.clone(),
+                attrs: attrs,
+                style: style,
+                fields: fields,
+                original: variant,
+            }
+        })
+        .collect()
+}
+
+fn struct_from_ast<'a>(
+    cx: &Ctxt,
+    fields: &'a syn::Fields,
+    attrs: Option<&attr::Variant>,
+    container_default: &attr::Default,
+) -> (Style, Vec<Field<'a>>) {
+    match fields {
+        syn::Fields::Named(fields) => (
+            Style::Struct,
+            fields_from_ast(cx, &fields.named, attrs, container_default),
+        ),
+        syn::Fields::Unnamed(fields) if fields.unnamed.len() == 1 => (
+            Style::Newtype,
+            fields_from_ast(cx, &fields.unnamed, attrs, container_default),
+        ),
+        syn::Fields::Unnamed(fields) => (
+            Style::Tuple,
+            fields_from_ast(cx, &fields.unnamed, attrs, container_default),
+        ),
+        syn::Fields::Unit => (Style::Unit, Vec::new()),
+    }
+}
+
+fn fields_from_ast<'a>(
+    cx: &Ctxt,
+    fields: &'a Punctuated<syn::Field, Token![,]>,
+    attrs: Option<&attr::Variant>,
+    container_default: &attr::Default,
+) -> Vec<Field<'a>> {
+    fields
+        .iter()
+        .enumerate()
+        .map(|(i, field)| Field {
+            member: match &field.ident {
+                Some(ident) => syn::Member::Named(ident.clone()),
+                None => syn::Member::Unnamed(i.into()),
+            },
+            attrs: attr::Field::from_ast(cx, i, field, attrs, container_default),
+            ty: &field.ty,
+            original: field,
+        })
+        .collect()
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/internals/attr.rs.html b/src/serde_derive/internals/attr.rs.html new file mode 100644 index 0000000..f98cfcd --- /dev/null +++ b/src/serde_derive/internals/attr.rs.html @@ -0,0 +1,3891 @@ +attr.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+
+use internals::symbol::*;
+use internals::Ctxt;
+use proc_macro2::{Group, Span, TokenStream, TokenTree};
+use quote::ToTokens;
+use std::borrow::Cow;
+use std::collections::BTreeSet;
+use std::str::FromStr;
+use syn;
+use syn::parse::{self, Parse, ParseStream};
+use syn::punctuated::Punctuated;
+use syn::Ident;
+use syn::Meta::{List, NameValue, Path};
+use syn::NestedMeta::{Lit, Meta};
+
+// This module handles parsing of `#[serde(...)]` attributes. The entrypoints
+// are `attr::Container::from_ast`, `attr::Variant::from_ast`, and
+// `attr::Field::from_ast`. Each returns an instance of the corresponding
+// struct. Note that none of them return a Result. Unrecognized, malformed, or
+// duplicated attributes result in a span_err but otherwise are ignored. The
+// user will see errors simultaneously for all bad attributes in the crate
+// rather than just the first.
+
+pub use internals::case::RenameRule;
+
+struct Attr<'c, T> {
+    cx: &'c Ctxt,
+    name: Symbol,
+    tokens: TokenStream,
+    value: Option<T>,
+}
+
+impl<'c, T> Attr<'c, T> {
+    fn none(cx: &'c Ctxt, name: Symbol) -> Self {
+        Attr {
+            cx: cx,
+            name: name,
+            tokens: TokenStream::new(),
+            value: None,
+        }
+    }
+
+    fn set<A: ToTokens>(&mut self, obj: A, value: T) {
+        let tokens = obj.into_token_stream();
+
+        if self.value.is_some() {
+            self.cx
+                .error_spanned_by(tokens, format!("duplicate serde attribute `{}`", self.name));
+        } else {
+            self.tokens = tokens;
+            self.value = Some(value);
+        }
+    }
+
+    fn set_opt<A: ToTokens>(&mut self, obj: A, value: Option<T>) {
+        if let Some(value) = value {
+            self.set(obj, value);
+        }
+    }
+
+    fn set_if_none(&mut self, value: T) {
+        if self.value.is_none() {
+            self.value = Some(value);
+        }
+    }
+
+    fn get(self) -> Option<T> {
+        self.value
+    }
+
+    fn get_with_tokens(self) -> Option<(TokenStream, T)> {
+        match self.value {
+            Some(v) => Some((self.tokens, v)),
+            None => None,
+        }
+    }
+}
+
+struct BoolAttr<'c>(Attr<'c, ()>);
+
+impl<'c> BoolAttr<'c> {
+    fn none(cx: &'c Ctxt, name: Symbol) -> Self {
+        BoolAttr(Attr::none(cx, name))
+    }
+
+    fn set_true<A: ToTokens>(&mut self, obj: A) {
+        self.0.set(obj, ());
+    }
+
+    fn get(&self) -> bool {
+        self.0.value.is_some()
+    }
+}
+
+struct VecAttr<'c, T> {
+    cx: &'c Ctxt,
+    name: Symbol,
+    first_dup_tokens: TokenStream,
+    values: Vec<T>,
+}
+
+impl<'c, T> VecAttr<'c, T> {
+    fn none(cx: &'c Ctxt, name: Symbol) -> Self {
+        VecAttr {
+            cx: cx,
+            name: name,
+            first_dup_tokens: TokenStream::new(),
+            values: Vec::new(),
+        }
+    }
+
+    fn insert<A: ToTokens>(&mut self, obj: A, value: T) {
+        if self.values.len() == 1 {
+            self.first_dup_tokens = obj.into_token_stream();
+        }
+        self.values.push(value);
+    }
+
+    fn at_most_one(mut self) -> Result<Option<T>, ()> {
+        if self.values.len() > 1 {
+            let dup_token = self.first_dup_tokens;
+            self.cx.error_spanned_by(
+                dup_token,
+                format!("duplicate serde attribute `{}`", self.name),
+            );
+            Err(())
+        } else {
+            Ok(self.values.pop())
+        }
+    }
+
+    fn get(self) -> Vec<T> {
+        self.values
+    }
+}
+
+pub struct Name {
+    serialize: String,
+    serialize_renamed: bool,
+    deserialize: String,
+    deserialize_renamed: bool,
+    deserialize_aliases: Vec<String>,
+}
+
+#[allow(deprecated)]
+fn unraw(ident: &Ident) -> String {
+    // str::trim_start_matches was added in 1.30, trim_left_matches deprecated
+    // in 1.33. We currently support rustc back to 1.15 so we need to continue
+    // to use the deprecated one.
+    ident.to_string().trim_left_matches("r#").to_owned()
+}
+
+impl Name {
+    fn from_attrs(
+        source_name: String,
+        ser_name: Attr<String>,
+        de_name: Attr<String>,
+        de_aliases: Option<VecAttr<String>>,
+    ) -> Name {
+        let deserialize_aliases = match de_aliases {
+            Some(de_aliases) => {
+                let mut alias_list = BTreeSet::new();
+                for alias_name in de_aliases.get() {
+                    alias_list.insert(alias_name);
+                }
+                alias_list.into_iter().collect()
+            }
+            None => Vec::new(),
+        };
+
+        let ser_name = ser_name.get();
+        let ser_renamed = ser_name.is_some();
+        let de_name = de_name.get();
+        let de_renamed = de_name.is_some();
+        Name {
+            serialize: ser_name.unwrap_or_else(|| source_name.clone()),
+            serialize_renamed: ser_renamed,
+            deserialize: de_name.unwrap_or(source_name),
+            deserialize_renamed: de_renamed,
+            deserialize_aliases: deserialize_aliases,
+        }
+    }
+
+    /// Return the container name for the container when serializing.
+    pub fn serialize_name(&self) -> String {
+        self.serialize.clone()
+    }
+
+    /// Return the container name for the container when deserializing.
+    pub fn deserialize_name(&self) -> String {
+        self.deserialize.clone()
+    }
+
+    fn deserialize_aliases(&self) -> Vec<String> {
+        let mut aliases = self.deserialize_aliases.clone();
+        let main_name = self.deserialize_name();
+        if !aliases.contains(&main_name) {
+            aliases.push(main_name);
+        }
+        aliases
+    }
+}
+
+pub struct RenameAllRules {
+    serialize: RenameRule,
+    deserialize: RenameRule,
+}
+
+/// Represents struct or enum attribute information.
+pub struct Container {
+    name: Name,
+    transparent: bool,
+    deny_unknown_fields: bool,
+    default: Default,
+    rename_all_rules: RenameAllRules,
+    ser_bound: Option<Vec<syn::WherePredicate>>,
+    de_bound: Option<Vec<syn::WherePredicate>>,
+    tag: TagType,
+    type_from: Option<syn::Type>,
+    type_try_from: Option<syn::Type>,
+    type_into: Option<syn::Type>,
+    remote: Option<syn::Path>,
+    identifier: Identifier,
+    has_flatten: bool,
+    serde_path: Option<syn::Path>,
+}
+
+/// Styles of representing an enum.
+pub enum TagType {
+    /// The default.
+    ///
+    /// ```json
+    /// {"variant1": {"key1": "value1", "key2": "value2"}}
+    /// ```
+    External,
+
+    /// `#[serde(tag = "type")]`
+    ///
+    /// ```json
+    /// {"type": "variant1", "key1": "value1", "key2": "value2"}
+    /// ```
+    Internal { tag: String },
+
+    /// `#[serde(tag = "t", content = "c")]`
+    ///
+    /// ```json
+    /// {"t": "variant1", "c": {"key1": "value1", "key2": "value2"}}
+    /// ```
+    Adjacent { tag: String, content: String },
+
+    /// `#[serde(untagged)]`
+    ///
+    /// ```json
+    /// {"key1": "value1", "key2": "value2"}
+    /// ```
+    None,
+}
+
+/// Whether this enum represents the fields of a struct or the variants of an
+/// enum.
+#[derive(Copy, Clone)]
+pub enum Identifier {
+    /// It does not.
+    No,
+
+    /// This enum represents the fields of a struct. All of the variants must be
+    /// unit variants, except possibly one which is annotated with
+    /// `#[serde(other)]` and is a newtype variant.
+    Field,
+
+    /// This enum represents the variants of an enum. All of the variants must
+    /// be unit variants.
+    Variant,
+}
+
+impl Identifier {
+    #[cfg(feature = "deserialize_in_place")]
+    pub fn is_some(self) -> bool {
+        match self {
+            Identifier::No => false,
+            Identifier::Field | Identifier::Variant => true,
+        }
+    }
+}
+
+impl Container {
+    /// Extract out the `#[serde(...)]` attributes from an item.
+    pub fn from_ast(cx: &Ctxt, item: &syn::DeriveInput) -> Self {
+        let mut ser_name = Attr::none(cx, RENAME);
+        let mut de_name = Attr::none(cx, RENAME);
+        let mut transparent = BoolAttr::none(cx, TRANSPARENT);
+        let mut deny_unknown_fields = BoolAttr::none(cx, DENY_UNKNOWN_FIELDS);
+        let mut default = Attr::none(cx, DEFAULT);
+        let mut rename_all_ser_rule = Attr::none(cx, RENAME_ALL);
+        let mut rename_all_de_rule = Attr::none(cx, RENAME_ALL);
+        let mut ser_bound = Attr::none(cx, BOUND);
+        let mut de_bound = Attr::none(cx, BOUND);
+        let mut untagged = BoolAttr::none(cx, UNTAGGED);
+        let mut internal_tag = Attr::none(cx, TAG);
+        let mut content = Attr::none(cx, CONTENT);
+        let mut type_from = Attr::none(cx, FROM);
+        let mut type_try_from = Attr::none(cx, TRY_FROM);
+        let mut type_into = Attr::none(cx, INTO);
+        let mut remote = Attr::none(cx, REMOTE);
+        let mut field_identifier = BoolAttr::none(cx, FIELD_IDENTIFIER);
+        let mut variant_identifier = BoolAttr::none(cx, VARIANT_IDENTIFIER);
+        let mut serde_path = Attr::none(cx, CRATE);
+
+        for meta_item in item
+            .attrs
+            .iter()
+            .flat_map(|attr| get_serde_meta_items(cx, attr))
+            .flatten()
+        {
+            match &meta_item {
+                // Parse `#[serde(rename = "foo")]`
+                Meta(NameValue(m)) if m.path == RENAME => {
+                    if let Ok(s) = get_lit_str(cx, RENAME, &m.lit) {
+                        ser_name.set(&m.path, s.value());
+                        de_name.set(&m.path, s.value());
+                    }
+                }
+
+                // Parse `#[serde(rename(serialize = "foo", deserialize = "bar"))]`
+                Meta(List(m)) if m.path == RENAME => {
+                    if let Ok((ser, de)) = get_renames(cx, &m.nested) {
+                        ser_name.set_opt(&m.path, ser.map(syn::LitStr::value));
+                        de_name.set_opt(&m.path, de.map(syn::LitStr::value));
+                    }
+                }
+
+                // Parse `#[serde(rename_all = "foo")]`
+                Meta(NameValue(m)) if m.path == RENAME_ALL => {
+                    if let Ok(s) = get_lit_str(cx, RENAME_ALL, &m.lit) {
+                        match RenameRule::from_str(&s.value()) {
+                            Ok(rename_rule) => {
+                                rename_all_ser_rule.set(&m.path, rename_rule);
+                                rename_all_de_rule.set(&m.path, rename_rule);
+                            }
+                            Err(()) => cx.error_spanned_by(
+                                s,
+                                format!(
+                                    "unknown rename rule for #[serde(rename_all = {:?})]",
+                                    s.value(),
+                                ),
+                            ),
+                        }
+                    }
+                }
+
+                // Parse `#[serde(rename_all(serialize = "foo", deserialize = "bar"))]`
+                Meta(List(m)) if m.path == RENAME_ALL => {
+                    if let Ok((ser, de)) = get_renames(cx, &m.nested) {
+                        if let Some(ser) = ser {
+                            match RenameRule::from_str(&ser.value()) {
+                                Ok(rename_rule) => rename_all_ser_rule.set(&m.path, rename_rule),
+                                Err(()) => cx.error_spanned_by(
+                                    ser,
+                                    format!(
+                                        "unknown rename rule for #[serde(rename_all = {:?})]",
+                                        ser.value(),
+                                    ),
+                                ),
+                            }
+                        }
+                        if let Some(de) = de {
+                            match RenameRule::from_str(&de.value()) {
+                                Ok(rename_rule) => rename_all_de_rule.set(&m.path, rename_rule),
+                                Err(()) => cx.error_spanned_by(
+                                    de,
+                                    format!(
+                                        "unknown rename rule for #[serde(rename_all = {:?})]",
+                                        de.value(),
+                                    ),
+                                ),
+                            }
+                        }
+                    }
+                }
+
+                // Parse `#[serde(transparent)]`
+                Meta(Path(word)) if word == TRANSPARENT => {
+                    transparent.set_true(word);
+                }
+
+                // Parse `#[serde(deny_unknown_fields)]`
+                Meta(Path(word)) if word == DENY_UNKNOWN_FIELDS => {
+                    deny_unknown_fields.set_true(word);
+                }
+
+                // Parse `#[serde(default)]`
+                Meta(Path(word)) if word == DEFAULT => match &item.data {
+                    syn::Data::Struct(syn::DataStruct { fields, .. }) => match fields {
+                        syn::Fields::Named(_) => {
+                            default.set(word, Default::Default);
+                        }
+                        syn::Fields::Unnamed(_) | syn::Fields::Unit => cx.error_spanned_by(
+                            fields,
+                            "#[serde(default)] can only be used on structs with named fields",
+                        ),
+                    },
+                    syn::Data::Enum(syn::DataEnum { enum_token, .. }) => cx.error_spanned_by(
+                        enum_token,
+                        "#[serde(default)] can only be used on structs with named fields",
+                    ),
+                    syn::Data::Union(syn::DataUnion { union_token, .. }) => cx.error_spanned_by(
+                        union_token,
+                        "#[serde(default)] can only be used on structs with named fields",
+                    ),
+                },
+
+                // Parse `#[serde(default = "...")]`
+                Meta(NameValue(m)) if m.path == DEFAULT => {
+                    if let Ok(path) = parse_lit_into_expr_path(cx, DEFAULT, &m.lit) {
+                        match &item.data {
+                            syn::Data::Struct(syn::DataStruct { fields, .. }) => {
+                                match fields {
+                                    syn::Fields::Named(_) => {
+                                        default.set(&m.path, Default::Path(path));
+                                    }
+                                    syn::Fields::Unnamed(_) | syn::Fields::Unit => cx
+                                        .error_spanned_by(
+                                            fields,
+                                            "#[serde(default = \"...\")] can only be used on structs with named fields",
+                                        ),
+                                }
+                            }
+                            syn::Data::Enum(syn::DataEnum { enum_token, .. }) => cx
+                                .error_spanned_by(
+                                    enum_token,
+                                    "#[serde(default = \"...\")] can only be used on structs with named fields",
+                                ),
+                            syn::Data::Union(syn::DataUnion {
+                                union_token, ..
+                            }) => cx.error_spanned_by(
+                                union_token,
+                                "#[serde(default = \"...\")] can only be used on structs with named fields",
+                            ),
+                        }
+                    }
+                }
+
+                // Parse `#[serde(bound = "T: SomeBound")]`
+                Meta(NameValue(m)) if m.path == BOUND => {
+                    if let Ok(where_predicates) = parse_lit_into_where(cx, BOUND, BOUND, &m.lit) {
+                        ser_bound.set(&m.path, where_predicates.clone());
+                        de_bound.set(&m.path, where_predicates);
+                    }
+                }
+
+                // Parse `#[serde(bound(serialize = "...", deserialize = "..."))]`
+                Meta(List(m)) if m.path == BOUND => {
+                    if let Ok((ser, de)) = get_where_predicates(cx, &m.nested) {
+                        ser_bound.set_opt(&m.path, ser);
+                        de_bound.set_opt(&m.path, de);
+                    }
+                }
+
+                // Parse `#[serde(untagged)]`
+                Meta(Path(word)) if word == UNTAGGED => match item.data {
+                    syn::Data::Enum(_) => {
+                        untagged.set_true(word);
+                    }
+                    syn::Data::Struct(syn::DataStruct { struct_token, .. }) => {
+                        cx.error_spanned_by(
+                            struct_token,
+                            "#[serde(untagged)] can only be used on enums",
+                        );
+                    }
+                    syn::Data::Union(syn::DataUnion { union_token, .. }) => {
+                        cx.error_spanned_by(
+                            union_token,
+                            "#[serde(untagged)] can only be used on enums",
+                        );
+                    }
+                },
+
+                // Parse `#[serde(tag = "type")]`
+                Meta(NameValue(m)) if m.path == TAG => {
+                    if let Ok(s) = get_lit_str(cx, TAG, &m.lit) {
+                        match &item.data {
+                            syn::Data::Enum(_) => {
+                                internal_tag.set(&m.path, s.value());
+                            }
+                            syn::Data::Struct(syn::DataStruct { fields, .. }) => match fields {
+                                syn::Fields::Named(_) => {
+                                    internal_tag.set(&m.path, s.value());
+                                }
+                                syn::Fields::Unnamed(_) | syn::Fields::Unit => {
+                                    cx.error_spanned_by(
+                                            fields,
+                                            "#[serde(tag = \"...\")] can only be used on enums and structs with named fields",
+                                        );
+                                }
+                            },
+                            syn::Data::Union(syn::DataUnion { union_token, .. }) => {
+                                cx.error_spanned_by(
+                                    union_token,
+                                    "#[serde(tag = \"...\")] can only be used on enums and structs with named fields",
+                                );
+                            }
+                        }
+                    }
+                }
+
+                // Parse `#[serde(content = "c")]`
+                Meta(NameValue(m)) if m.path == CONTENT => {
+                    if let Ok(s) = get_lit_str(cx, CONTENT, &m.lit) {
+                        match &item.data {
+                            syn::Data::Enum(_) => {
+                                content.set(&m.path, s.value());
+                            }
+                            syn::Data::Struct(syn::DataStruct { struct_token, .. }) => {
+                                cx.error_spanned_by(
+                                    struct_token,
+                                    "#[serde(content = \"...\")] can only be used on enums",
+                                );
+                            }
+                            syn::Data::Union(syn::DataUnion { union_token, .. }) => {
+                                cx.error_spanned_by(
+                                    union_token,
+                                    "#[serde(content = \"...\")] can only be used on enums",
+                                );
+                            }
+                        }
+                    }
+                }
+
+                // Parse `#[serde(from = "Type")]
+                Meta(NameValue(m)) if m.path == FROM => {
+                    if let Ok(from_ty) = parse_lit_into_ty(cx, FROM, &m.lit) {
+                        type_from.set_opt(&m.path, Some(from_ty));
+                    }
+                }
+
+                // Parse `#[serde(try_from = "Type")]
+                Meta(NameValue(m)) if m.path == TRY_FROM => {
+                    if let Ok(try_from_ty) = parse_lit_into_ty(cx, TRY_FROM, &m.lit) {
+                        type_try_from.set_opt(&m.path, Some(try_from_ty));
+                    }
+                }
+
+                // Parse `#[serde(into = "Type")]
+                Meta(NameValue(m)) if m.path == INTO => {
+                    if let Ok(into_ty) = parse_lit_into_ty(cx, INTO, &m.lit) {
+                        type_into.set_opt(&m.path, Some(into_ty));
+                    }
+                }
+
+                // Parse `#[serde(remote = "...")]`
+                Meta(NameValue(m)) if m.path == REMOTE => {
+                    if let Ok(path) = parse_lit_into_path(cx, REMOTE, &m.lit) {
+                        if is_primitive_path(&path, "Self") {
+                            remote.set(&m.path, item.ident.clone().into());
+                        } else {
+                            remote.set(&m.path, path);
+                        }
+                    }
+                }
+
+                // Parse `#[serde(field_identifier)]`
+                Meta(Path(word)) if word == FIELD_IDENTIFIER => {
+                    field_identifier.set_true(word);
+                }
+
+                // Parse `#[serde(variant_identifier)]`
+                Meta(Path(word)) if word == VARIANT_IDENTIFIER => {
+                    variant_identifier.set_true(word);
+                }
+
+                // Parse `#[serde(crate = "foo")]`
+                Meta(NameValue(m)) if m.path == CRATE => {
+                    if let Ok(path) = parse_lit_into_path(cx, CRATE, &m.lit) {
+                        serde_path.set(&m.path, path)
+                    }
+                }
+
+                Meta(meta_item) => {
+                    let path = meta_item
+                        .path()
+                        .into_token_stream()
+                        .to_string()
+                        .replace(' ', "");
+                    cx.error_spanned_by(
+                        meta_item.path(),
+                        format!("unknown serde container attribute `{}`", path),
+                    );
+                }
+
+                Lit(lit) => {
+                    cx.error_spanned_by(lit, "unexpected literal in serde container attribute");
+                }
+            }
+        }
+
+        Container {
+            name: Name::from_attrs(unraw(&item.ident), ser_name, de_name, None),
+            transparent: transparent.get(),
+            deny_unknown_fields: deny_unknown_fields.get(),
+            default: default.get().unwrap_or(Default::None),
+            rename_all_rules: RenameAllRules {
+                serialize: rename_all_ser_rule.get().unwrap_or(RenameRule::None),
+                deserialize: rename_all_de_rule.get().unwrap_or(RenameRule::None),
+            },
+            ser_bound: ser_bound.get(),
+            de_bound: de_bound.get(),
+            tag: decide_tag(cx, item, untagged, internal_tag, content),
+            type_from: type_from.get(),
+            type_try_from: type_try_from.get(),
+            type_into: type_into.get(),
+            remote: remote.get(),
+            identifier: decide_identifier(cx, item, field_identifier, variant_identifier),
+            has_flatten: false,
+            serde_path: serde_path.get(),
+        }
+    }
+
+    pub fn name(&self) -> &Name {
+        &self.name
+    }
+
+    pub fn rename_all_rules(&self) -> &RenameAllRules {
+        &self.rename_all_rules
+    }
+
+    pub fn transparent(&self) -> bool {
+        self.transparent
+    }
+
+    pub fn deny_unknown_fields(&self) -> bool {
+        self.deny_unknown_fields
+    }
+
+    pub fn default(&self) -> &Default {
+        &self.default
+    }
+
+    pub fn ser_bound(&self) -> Option<&[syn::WherePredicate]> {
+        self.ser_bound.as_ref().map(|vec| &vec[..])
+    }
+
+    pub fn de_bound(&self) -> Option<&[syn::WherePredicate]> {
+        self.de_bound.as_ref().map(|vec| &vec[..])
+    }
+
+    pub fn tag(&self) -> &TagType {
+        &self.tag
+    }
+
+    pub fn type_from(&self) -> Option<&syn::Type> {
+        self.type_from.as_ref()
+    }
+
+    pub fn type_try_from(&self) -> Option<&syn::Type> {
+        self.type_try_from.as_ref()
+    }
+
+    pub fn type_into(&self) -> Option<&syn::Type> {
+        self.type_into.as_ref()
+    }
+
+    pub fn remote(&self) -> Option<&syn::Path> {
+        self.remote.as_ref()
+    }
+
+    pub fn identifier(&self) -> Identifier {
+        self.identifier
+    }
+
+    pub fn has_flatten(&self) -> bool {
+        self.has_flatten
+    }
+
+    pub fn mark_has_flatten(&mut self) {
+        self.has_flatten = true;
+    }
+
+    pub fn custom_serde_path(&self) -> Option<&syn::Path> {
+        self.serde_path.as_ref()
+    }
+
+    pub fn serde_path(&self) -> Cow<syn::Path> {
+        self.custom_serde_path()
+            .map_or_else(|| Cow::Owned(parse_quote!(_serde)), Cow::Borrowed)
+    }
+}
+
+fn decide_tag(
+    cx: &Ctxt,
+    item: &syn::DeriveInput,
+    untagged: BoolAttr,
+    internal_tag: Attr<String>,
+    content: Attr<String>,
+) -> TagType {
+    match (
+        untagged.0.get_with_tokens(),
+        internal_tag.get_with_tokens(),
+        content.get_with_tokens(),
+    ) {
+        (None, None, None) => TagType::External,
+        (Some(_), None, None) => TagType::None,
+        (None, Some((_, tag)), None) => {
+            // Check that there are no tuple variants.
+            if let syn::Data::Enum(data) = &item.data {
+                for variant in &data.variants {
+                    match &variant.fields {
+                        syn::Fields::Named(_) | syn::Fields::Unit => {}
+                        syn::Fields::Unnamed(fields) => {
+                            if fields.unnamed.len() != 1 {
+                                cx.error_spanned_by(
+                                    variant,
+                                    "#[serde(tag = \"...\")] cannot be used with tuple variants",
+                                );
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+            TagType::Internal { tag: tag }
+        }
+        (Some((untagged_tokens, _)), Some((tag_tokens, _)), None) => {
+            cx.error_spanned_by(
+                untagged_tokens,
+                "enum cannot be both untagged and internally tagged",
+            );
+            cx.error_spanned_by(
+                tag_tokens,
+                "enum cannot be both untagged and internally tagged",
+            );
+            TagType::External // doesn't matter, will error
+        }
+        (None, None, Some((content_tokens, _))) => {
+            cx.error_spanned_by(
+                content_tokens,
+                "#[serde(tag = \"...\", content = \"...\")] must be used together",
+            );
+            TagType::External
+        }
+        (Some((untagged_tokens, _)), None, Some((content_tokens, _))) => {
+            cx.error_spanned_by(
+                untagged_tokens,
+                "untagged enum cannot have #[serde(content = \"...\")]",
+            );
+            cx.error_spanned_by(
+                content_tokens,
+                "untagged enum cannot have #[serde(content = \"...\")]",
+            );
+            TagType::External
+        }
+        (None, Some((_, tag)), Some((_, content))) => TagType::Adjacent {
+            tag: tag,
+            content: content,
+        },
+        (Some((untagged_tokens, _)), Some((tag_tokens, _)), Some((content_tokens, _))) => {
+            cx.error_spanned_by(
+                untagged_tokens,
+                "untagged enum cannot have #[serde(tag = \"...\", content = \"...\")]",
+            );
+            cx.error_spanned_by(
+                tag_tokens,
+                "untagged enum cannot have #[serde(tag = \"...\", content = \"...\")]",
+            );
+            cx.error_spanned_by(
+                content_tokens,
+                "untagged enum cannot have #[serde(tag = \"...\", content = \"...\")]",
+            );
+            TagType::External
+        }
+    }
+}
+
+fn decide_identifier(
+    cx: &Ctxt,
+    item: &syn::DeriveInput,
+    field_identifier: BoolAttr,
+    variant_identifier: BoolAttr,
+) -> Identifier {
+    match (
+        &item.data,
+        field_identifier.0.get_with_tokens(),
+        variant_identifier.0.get_with_tokens(),
+    ) {
+        (_, None, None) => Identifier::No,
+        (_, Some((field_identifier_tokens, _)), Some((variant_identifier_tokens, _))) => {
+            cx.error_spanned_by(
+                field_identifier_tokens,
+                "#[serde(field_identifier)] and #[serde(variant_identifier)] cannot both be set",
+            );
+            cx.error_spanned_by(
+                variant_identifier_tokens,
+                "#[serde(field_identifier)] and #[serde(variant_identifier)] cannot both be set",
+            );
+            Identifier::No
+        }
+        (syn::Data::Enum(_), Some(_), None) => Identifier::Field,
+        (syn::Data::Enum(_), None, Some(_)) => Identifier::Variant,
+        (syn::Data::Struct(syn::DataStruct { struct_token, .. }), Some(_), None) => {
+            cx.error_spanned_by(
+                struct_token,
+                "#[serde(field_identifier)] can only be used on an enum",
+            );
+            Identifier::No
+        }
+        (syn::Data::Union(syn::DataUnion { union_token, .. }), Some(_), None) => {
+            cx.error_spanned_by(
+                union_token,
+                "#[serde(field_identifier)] can only be used on an enum",
+            );
+            Identifier::No
+        }
+        (syn::Data::Struct(syn::DataStruct { struct_token, .. }), None, Some(_)) => {
+            cx.error_spanned_by(
+                struct_token,
+                "#[serde(variant_identifier)] can only be used on an enum",
+            );
+            Identifier::No
+        }
+        (syn::Data::Union(syn::DataUnion { union_token, .. }), None, Some(_)) => {
+            cx.error_spanned_by(
+                union_token,
+                "#[serde(variant_identifier)] can only be used on an enum",
+            );
+            Identifier::No
+        }
+    }
+}
+
+/// Represents variant attribute information
+pub struct Variant {
+    name: Name,
+    rename_all_rules: RenameAllRules,
+    ser_bound: Option<Vec<syn::WherePredicate>>,
+    de_bound: Option<Vec<syn::WherePredicate>>,
+    skip_deserializing: bool,
+    skip_serializing: bool,
+    other: bool,
+    serialize_with: Option<syn::ExprPath>,
+    deserialize_with: Option<syn::ExprPath>,
+    borrow: Option<syn::Meta>,
+}
+
+impl Variant {
+    pub fn from_ast(cx: &Ctxt, variant: &syn::Variant) -> Self {
+        let mut ser_name = Attr::none(cx, RENAME);
+        let mut de_name = Attr::none(cx, RENAME);
+        let mut de_aliases = VecAttr::none(cx, RENAME);
+        let mut skip_deserializing = BoolAttr::none(cx, SKIP_DESERIALIZING);
+        let mut skip_serializing = BoolAttr::none(cx, SKIP_SERIALIZING);
+        let mut rename_all_ser_rule = Attr::none(cx, RENAME_ALL);
+        let mut rename_all_de_rule = Attr::none(cx, RENAME_ALL);
+        let mut ser_bound = Attr::none(cx, BOUND);
+        let mut de_bound = Attr::none(cx, BOUND);
+        let mut other = BoolAttr::none(cx, OTHER);
+        let mut serialize_with = Attr::none(cx, SERIALIZE_WITH);
+        let mut deserialize_with = Attr::none(cx, DESERIALIZE_WITH);
+        let mut borrow = Attr::none(cx, BORROW);
+
+        for meta_item in variant
+            .attrs
+            .iter()
+            .flat_map(|attr| get_serde_meta_items(cx, attr))
+            .flatten()
+        {
+            match &meta_item {
+                // Parse `#[serde(rename = "foo")]`
+                Meta(NameValue(m)) if m.path == RENAME => {
+                    if let Ok(s) = get_lit_str(cx, RENAME, &m.lit) {
+                        ser_name.set(&m.path, s.value());
+                        de_name.set_if_none(s.value());
+                        de_aliases.insert(&m.path, s.value());
+                    }
+                }
+
+                // Parse `#[serde(rename(serialize = "foo", deserialize = "bar"))]`
+                Meta(List(m)) if m.path == RENAME => {
+                    if let Ok((ser, de)) = get_multiple_renames(cx, &m.nested) {
+                        ser_name.set_opt(&m.path, ser.map(syn::LitStr::value));
+                        for de_value in de {
+                            de_name.set_if_none(de_value.value());
+                            de_aliases.insert(&m.path, de_value.value());
+                        }
+                    }
+                }
+
+                // Parse `#[serde(alias = "foo")]`
+                Meta(NameValue(m)) if m.path == ALIAS => {
+                    if let Ok(s) = get_lit_str(cx, ALIAS, &m.lit) {
+                        de_aliases.insert(&m.path, s.value());
+                    }
+                }
+
+                // Parse `#[serde(rename_all = "foo")]`
+                Meta(NameValue(m)) if m.path == RENAME_ALL => {
+                    if let Ok(s) = get_lit_str(cx, RENAME_ALL, &m.lit) {
+                        match RenameRule::from_str(&s.value()) {
+                            Ok(rename_rule) => {
+                                rename_all_ser_rule.set(&m.path, rename_rule);
+                                rename_all_de_rule.set(&m.path, rename_rule);
+                            }
+                            Err(()) => cx.error_spanned_by(
+                                s,
+                                format!(
+                                    "unknown rename rule for #[serde(rename_all = {:?})]",
+                                    s.value()
+                                ),
+                            ),
+                        }
+                    }
+                }
+
+                // Parse `#[serde(rename_all(serialize = "foo", deserialize = "bar"))]`
+                Meta(List(m)) if m.path == RENAME_ALL => {
+                    if let Ok((ser, de)) = get_renames(cx, &m.nested) {
+                        if let Some(ser) = ser {
+                            match RenameRule::from_str(&ser.value()) {
+                                Ok(rename_rule) => rename_all_ser_rule.set(&m.path, rename_rule),
+                                Err(()) => cx.error_spanned_by(
+                                    ser,
+                                    format!(
+                                        "unknown rename rule for #[serde(rename_all = {:?})]",
+                                        ser.value(),
+                                    ),
+                                ),
+                            }
+                        }
+                        if let Some(de) = de {
+                            match RenameRule::from_str(&de.value()) {
+                                Ok(rename_rule) => rename_all_de_rule.set(&m.path, rename_rule),
+                                Err(()) => cx.error_spanned_by(
+                                    de,
+                                    format!(
+                                        "unknown rename rule for #[serde(rename_all = {:?})]",
+                                        de.value(),
+                                    ),
+                                ),
+                            }
+                        }
+                    }
+                }
+
+                // Parse `#[serde(skip)]`
+                Meta(Path(word)) if word == SKIP => {
+                    skip_serializing.set_true(word);
+                    skip_deserializing.set_true(word);
+                }
+
+                // Parse `#[serde(skip_deserializing)]`
+                Meta(Path(word)) if word == SKIP_DESERIALIZING => {
+                    skip_deserializing.set_true(word);
+                }
+
+                // Parse `#[serde(skip_serializing)]`
+                Meta(Path(word)) if word == SKIP_SERIALIZING => {
+                    skip_serializing.set_true(word);
+                }
+
+                // Parse `#[serde(other)]`
+                Meta(Path(word)) if word == OTHER => {
+                    other.set_true(word);
+                }
+
+                // Parse `#[serde(bound = "T: SomeBound")]`
+                Meta(NameValue(m)) if m.path == BOUND => {
+                    if let Ok(where_predicates) = parse_lit_into_where(cx, BOUND, BOUND, &m.lit) {
+                        ser_bound.set(&m.path, where_predicates.clone());
+                        de_bound.set(&m.path, where_predicates);
+                    }
+                }
+
+                // Parse `#[serde(bound(serialize = "...", deserialize = "..."))]`
+                Meta(List(m)) if m.path == BOUND => {
+                    if let Ok((ser, de)) = get_where_predicates(cx, &m.nested) {
+                        ser_bound.set_opt(&m.path, ser);
+                        de_bound.set_opt(&m.path, de);
+                    }
+                }
+
+                // Parse `#[serde(with = "...")]`
+                Meta(NameValue(m)) if m.path == WITH => {
+                    if let Ok(path) = parse_lit_into_expr_path(cx, WITH, &m.lit) {
+                        let mut ser_path = path.clone();
+                        ser_path
+                            .path
+                            .segments
+                            .push(Ident::new("serialize", Span::call_site()).into());
+                        serialize_with.set(&m.path, ser_path);
+                        let mut de_path = path;
+                        de_path
+                            .path
+                            .segments
+                            .push(Ident::new("deserialize", Span::call_site()).into());
+                        deserialize_with.set(&m.path, de_path);
+                    }
+                }
+
+                // Parse `#[serde(serialize_with = "...")]`
+                Meta(NameValue(m)) if m.path == SERIALIZE_WITH => {
+                    if let Ok(path) = parse_lit_into_expr_path(cx, SERIALIZE_WITH, &m.lit) {
+                        serialize_with.set(&m.path, path);
+                    }
+                }
+
+                // Parse `#[serde(deserialize_with = "...")]`
+                Meta(NameValue(m)) if m.path == DESERIALIZE_WITH => {
+                    if let Ok(path) = parse_lit_into_expr_path(cx, DESERIALIZE_WITH, &m.lit) {
+                        deserialize_with.set(&m.path, path);
+                    }
+                }
+
+                // Defer `#[serde(borrow)]` and `#[serde(borrow = "'a + 'b")]`
+                Meta(m) if m.path() == BORROW => match &variant.fields {
+                    syn::Fields::Unnamed(fields) if fields.unnamed.len() == 1 => {
+                        borrow.set(m.path(), m.clone());
+                    }
+                    _ => {
+                        cx.error_spanned_by(
+                            variant,
+                            "#[serde(borrow)] may only be used on newtype variants",
+                        );
+                    }
+                },
+
+                Meta(meta_item) => {
+                    let path = meta_item
+                        .path()
+                        .into_token_stream()
+                        .to_string()
+                        .replace(' ', "");
+                    cx.error_spanned_by(
+                        meta_item.path(),
+                        format!("unknown serde variant attribute `{}`", path),
+                    );
+                }
+
+                Lit(lit) => {
+                    cx.error_spanned_by(lit, "unexpected literal in serde variant attribute");
+                }
+            }
+        }
+
+        Variant {
+            name: Name::from_attrs(unraw(&variant.ident), ser_name, de_name, Some(de_aliases)),
+            rename_all_rules: RenameAllRules {
+                serialize: rename_all_ser_rule.get().unwrap_or(RenameRule::None),
+                deserialize: rename_all_de_rule.get().unwrap_or(RenameRule::None),
+            },
+            ser_bound: ser_bound.get(),
+            de_bound: de_bound.get(),
+            skip_deserializing: skip_deserializing.get(),
+            skip_serializing: skip_serializing.get(),
+            other: other.get(),
+            serialize_with: serialize_with.get(),
+            deserialize_with: deserialize_with.get(),
+            borrow: borrow.get(),
+        }
+    }
+
+    pub fn name(&self) -> &Name {
+        &self.name
+    }
+
+    pub fn aliases(&self) -> Vec<String> {
+        self.name.deserialize_aliases()
+    }
+
+    pub fn rename_by_rules(&mut self, rules: &RenameAllRules) {
+        if !self.name.serialize_renamed {
+            self.name.serialize = rules.serialize.apply_to_variant(&self.name.serialize);
+        }
+        if !self.name.deserialize_renamed {
+            self.name.deserialize = rules.deserialize.apply_to_variant(&self.name.deserialize);
+        }
+    }
+
+    pub fn rename_all_rules(&self) -> &RenameAllRules {
+        &self.rename_all_rules
+    }
+
+    pub fn ser_bound(&self) -> Option<&[syn::WherePredicate]> {
+        self.ser_bound.as_ref().map(|vec| &vec[..])
+    }
+
+    pub fn de_bound(&self) -> Option<&[syn::WherePredicate]> {
+        self.de_bound.as_ref().map(|vec| &vec[..])
+    }
+
+    pub fn skip_deserializing(&self) -> bool {
+        self.skip_deserializing
+    }
+
+    pub fn skip_serializing(&self) -> bool {
+        self.skip_serializing
+    }
+
+    pub fn other(&self) -> bool {
+        self.other
+    }
+
+    pub fn serialize_with(&self) -> Option<&syn::ExprPath> {
+        self.serialize_with.as_ref()
+    }
+
+    pub fn deserialize_with(&self) -> Option<&syn::ExprPath> {
+        self.deserialize_with.as_ref()
+    }
+}
+
+/// Represents field attribute information
+pub struct Field {
+    name: Name,
+    skip_serializing: bool,
+    skip_deserializing: bool,
+    skip_serializing_if: Option<syn::ExprPath>,
+    default: Default,
+    serialize_with: Option<syn::ExprPath>,
+    deserialize_with: Option<syn::ExprPath>,
+    ser_bound: Option<Vec<syn::WherePredicate>>,
+    de_bound: Option<Vec<syn::WherePredicate>>,
+    borrowed_lifetimes: BTreeSet<syn::Lifetime>,
+    getter: Option<syn::ExprPath>,
+    flatten: bool,
+    transparent: bool,
+}
+
+/// Represents the default to use for a field when deserializing.
+pub enum Default {
+    /// Field must always be specified because it does not have a default.
+    None,
+    /// The default is given by `std::default::Default::default()`.
+    Default,
+    /// The default is given by this function.
+    Path(syn::ExprPath),
+}
+
+impl Default {
+    pub fn is_none(&self) -> bool {
+        match self {
+            Default::None => true,
+            Default::Default | Default::Path(_) => false,
+        }
+    }
+}
+
+impl Field {
+    /// Extract out the `#[serde(...)]` attributes from a struct field.
+    pub fn from_ast(
+        cx: &Ctxt,
+        index: usize,
+        field: &syn::Field,
+        attrs: Option<&Variant>,
+        container_default: &Default,
+    ) -> Self {
+        let mut ser_name = Attr::none(cx, RENAME);
+        let mut de_name = Attr::none(cx, RENAME);
+        let mut de_aliases = VecAttr::none(cx, RENAME);
+        let mut skip_serializing = BoolAttr::none(cx, SKIP_SERIALIZING);
+        let mut skip_deserializing = BoolAttr::none(cx, SKIP_DESERIALIZING);
+        let mut skip_serializing_if = Attr::none(cx, SKIP_SERIALIZING_IF);
+        let mut default = Attr::none(cx, DEFAULT);
+        let mut serialize_with = Attr::none(cx, SERIALIZE_WITH);
+        let mut deserialize_with = Attr::none(cx, DESERIALIZE_WITH);
+        let mut ser_bound = Attr::none(cx, BOUND);
+        let mut de_bound = Attr::none(cx, BOUND);
+        let mut borrowed_lifetimes = Attr::none(cx, BORROW);
+        let mut getter = Attr::none(cx, GETTER);
+        let mut flatten = BoolAttr::none(cx, FLATTEN);
+
+        let ident = match &field.ident {
+            Some(ident) => unraw(ident),
+            None => index.to_string(),
+        };
+
+        let variant_borrow = attrs
+            .and_then(|variant| variant.borrow.as_ref())
+            .map(|borrow| Meta(borrow.clone()));
+
+        for meta_item in field
+            .attrs
+            .iter()
+            .flat_map(|attr| get_serde_meta_items(cx, attr))
+            .flatten()
+            .chain(variant_borrow)
+        {
+            match &meta_item {
+                // Parse `#[serde(rename = "foo")]`
+                Meta(NameValue(m)) if m.path == RENAME => {
+                    if let Ok(s) = get_lit_str(cx, RENAME, &m.lit) {
+                        ser_name.set(&m.path, s.value());
+                        de_name.set_if_none(s.value());
+                        de_aliases.insert(&m.path, s.value());
+                    }
+                }
+
+                // Parse `#[serde(rename(serialize = "foo", deserialize = "bar"))]`
+                Meta(List(m)) if m.path == RENAME => {
+                    if let Ok((ser, de)) = get_multiple_renames(cx, &m.nested) {
+                        ser_name.set_opt(&m.path, ser.map(syn::LitStr::value));
+                        for de_value in de {
+                            de_name.set_if_none(de_value.value());
+                            de_aliases.insert(&m.path, de_value.value());
+                        }
+                    }
+                }
+
+                // Parse `#[serde(alias = "foo")]`
+                Meta(NameValue(m)) if m.path == ALIAS => {
+                    if let Ok(s) = get_lit_str(cx, ALIAS, &m.lit) {
+                        de_aliases.insert(&m.path, s.value());
+                    }
+                }
+
+                // Parse `#[serde(default)]`
+                Meta(Path(word)) if word == DEFAULT => {
+                    default.set(word, Default::Default);
+                }
+
+                // Parse `#[serde(default = "...")]`
+                Meta(NameValue(m)) if m.path == DEFAULT => {
+                    if let Ok(path) = parse_lit_into_expr_path(cx, DEFAULT, &m.lit) {
+                        default.set(&m.path, Default::Path(path));
+                    }
+                }
+
+                // Parse `#[serde(skip_serializing)]`
+                Meta(Path(word)) if word == SKIP_SERIALIZING => {
+                    skip_serializing.set_true(word);
+                }
+
+                // Parse `#[serde(skip_deserializing)]`
+                Meta(Path(word)) if word == SKIP_DESERIALIZING => {
+                    skip_deserializing.set_true(word);
+                }
+
+                // Parse `#[serde(skip)]`
+                Meta(Path(word)) if word == SKIP => {
+                    skip_serializing.set_true(word);
+                    skip_deserializing.set_true(word);
+                }
+
+                // Parse `#[serde(skip_serializing_if = "...")]`
+                Meta(NameValue(m)) if m.path == SKIP_SERIALIZING_IF => {
+                    if let Ok(path) = parse_lit_into_expr_path(cx, SKIP_SERIALIZING_IF, &m.lit) {
+                        skip_serializing_if.set(&m.path, path);
+                    }
+                }
+
+                // Parse `#[serde(serialize_with = "...")]`
+                Meta(NameValue(m)) if m.path == SERIALIZE_WITH => {
+                    if let Ok(path) = parse_lit_into_expr_path(cx, SERIALIZE_WITH, &m.lit) {
+                        serialize_with.set(&m.path, path);
+                    }
+                }
+
+                // Parse `#[serde(deserialize_with = "...")]`
+                Meta(NameValue(m)) if m.path == DESERIALIZE_WITH => {
+                    if let Ok(path) = parse_lit_into_expr_path(cx, DESERIALIZE_WITH, &m.lit) {
+                        deserialize_with.set(&m.path, path);
+                    }
+                }
+
+                // Parse `#[serde(with = "...")]`
+                Meta(NameValue(m)) if m.path == WITH => {
+                    if let Ok(path) = parse_lit_into_expr_path(cx, WITH, &m.lit) {
+                        let mut ser_path = path.clone();
+                        ser_path
+                            .path
+                            .segments
+                            .push(Ident::new("serialize", Span::call_site()).into());
+                        serialize_with.set(&m.path, ser_path);
+                        let mut de_path = path;
+                        de_path
+                            .path
+                            .segments
+                            .push(Ident::new("deserialize", Span::call_site()).into());
+                        deserialize_with.set(&m.path, de_path);
+                    }
+                }
+
+                // Parse `#[serde(bound = "T: SomeBound")]`
+                Meta(NameValue(m)) if m.path == BOUND => {
+                    if let Ok(where_predicates) = parse_lit_into_where(cx, BOUND, BOUND, &m.lit) {
+                        ser_bound.set(&m.path, where_predicates.clone());
+                        de_bound.set(&m.path, where_predicates);
+                    }
+                }
+
+                // Parse `#[serde(bound(serialize = "...", deserialize = "..."))]`
+                Meta(List(m)) if m.path == BOUND => {
+                    if let Ok((ser, de)) = get_where_predicates(cx, &m.nested) {
+                        ser_bound.set_opt(&m.path, ser);
+                        de_bound.set_opt(&m.path, de);
+                    }
+                }
+
+                // Parse `#[serde(borrow)]`
+                Meta(Path(word)) if word == BORROW => {
+                    if let Ok(borrowable) = borrowable_lifetimes(cx, &ident, field) {
+                        borrowed_lifetimes.set(word, borrowable);
+                    }
+                }
+
+                // Parse `#[serde(borrow = "'a + 'b")]`
+                Meta(NameValue(m)) if m.path == BORROW => {
+                    if let Ok(lifetimes) = parse_lit_into_lifetimes(cx, BORROW, &m.lit) {
+                        if let Ok(borrowable) = borrowable_lifetimes(cx, &ident, field) {
+                            for lifetime in &lifetimes {
+                                if !borrowable.contains(lifetime) {
+                                    cx.error_spanned_by(
+                                        field,
+                                        format!(
+                                            "field `{}` does not have lifetime {}",
+                                            ident, lifetime
+                                        ),
+                                    );
+                                }
+                            }
+                            borrowed_lifetimes.set(&m.path, lifetimes);
+                        }
+                    }
+                }
+
+                // Parse `#[serde(getter = "...")]`
+                Meta(NameValue(m)) if m.path == GETTER => {
+                    if let Ok(path) = parse_lit_into_expr_path(cx, GETTER, &m.lit) {
+                        getter.set(&m.path, path);
+                    }
+                }
+
+                // Parse `#[serde(flatten)]`
+                Meta(Path(word)) if word == FLATTEN => {
+                    flatten.set_true(word);
+                }
+
+                Meta(meta_item) => {
+                    let path = meta_item
+                        .path()
+                        .into_token_stream()
+                        .to_string()
+                        .replace(' ', "");
+                    cx.error_spanned_by(
+                        meta_item.path(),
+                        format!("unknown serde field attribute `{}`", path),
+                    );
+                }
+
+                Lit(lit) => {
+                    cx.error_spanned_by(lit, "unexpected literal in serde field attribute");
+                }
+            }
+        }
+
+        // Is skip_deserializing, initialize the field to Default::default() unless a
+        // different default is specified by `#[serde(default = "...")]` on
+        // ourselves or our container (e.g. the struct we are in).
+        if let Default::None = *container_default {
+            if skip_deserializing.0.value.is_some() {
+                default.set_if_none(Default::Default);
+            }
+        }
+
+        let mut borrowed_lifetimes = borrowed_lifetimes.get().unwrap_or_default();
+        if !borrowed_lifetimes.is_empty() {
+            // Cow<str> and Cow<[u8]> never borrow by default:
+            //
+            //     impl<'de, 'a, T: ?Sized> Deserialize<'de> for Cow<'a, T>
+            //
+            // A #[serde(borrow)] attribute enables borrowing that corresponds
+            // roughly to these impls:
+            //
+            //     impl<'de: 'a, 'a> Deserialize<'de> for Cow<'a, str>
+            //     impl<'de: 'a, 'a> Deserialize<'de> for Cow<'a, [u8]>
+            if is_cow(&field.ty, is_str) {
+                let mut path = syn::Path {
+                    leading_colon: None,
+                    segments: Punctuated::new(),
+                };
+                let span = Span::call_site();
+                path.segments.push(Ident::new("_serde", span).into());
+                path.segments.push(Ident::new("private", span).into());
+                path.segments.push(Ident::new("de", span).into());
+                path.segments
+                    .push(Ident::new("borrow_cow_str", span).into());
+                let expr = syn::ExprPath {
+                    attrs: Vec::new(),
+                    qself: None,
+                    path: path,
+                };
+                deserialize_with.set_if_none(expr);
+            } else if is_cow(&field.ty, is_slice_u8) {
+                let mut path = syn::Path {
+                    leading_colon: None,
+                    segments: Punctuated::new(),
+                };
+                let span = Span::call_site();
+                path.segments.push(Ident::new("_serde", span).into());
+                path.segments.push(Ident::new("private", span).into());
+                path.segments.push(Ident::new("de", span).into());
+                path.segments
+                    .push(Ident::new("borrow_cow_bytes", span).into());
+                let expr = syn::ExprPath {
+                    attrs: Vec::new(),
+                    qself: None,
+                    path: path,
+                };
+                deserialize_with.set_if_none(expr);
+            }
+        } else if is_implicitly_borrowed(&field.ty) {
+            // Types &str and &[u8] are always implicitly borrowed. No need for
+            // a #[serde(borrow)].
+            collect_lifetimes(&field.ty, &mut borrowed_lifetimes);
+        }
+
+        Field {
+            name: Name::from_attrs(ident, ser_name, de_name, Some(de_aliases)),
+            skip_serializing: skip_serializing.get(),
+            skip_deserializing: skip_deserializing.get(),
+            skip_serializing_if: skip_serializing_if.get(),
+            default: default.get().unwrap_or(Default::None),
+            serialize_with: serialize_with.get(),
+            deserialize_with: deserialize_with.get(),
+            ser_bound: ser_bound.get(),
+            de_bound: de_bound.get(),
+            borrowed_lifetimes: borrowed_lifetimes,
+            getter: getter.get(),
+            flatten: flatten.get(),
+            transparent: false,
+        }
+    }
+
+    pub fn name(&self) -> &Name {
+        &self.name
+    }
+
+    pub fn aliases(&self) -> Vec<String> {
+        self.name.deserialize_aliases()
+    }
+
+    pub fn rename_by_rules(&mut self, rules: &RenameAllRules) {
+        if !self.name.serialize_renamed {
+            self.name.serialize = rules.serialize.apply_to_field(&self.name.serialize);
+        }
+        if !self.name.deserialize_renamed {
+            self.name.deserialize = rules.deserialize.apply_to_field(&self.name.deserialize);
+        }
+    }
+
+    pub fn skip_serializing(&self) -> bool {
+        self.skip_serializing
+    }
+
+    pub fn skip_deserializing(&self) -> bool {
+        self.skip_deserializing
+    }
+
+    pub fn skip_serializing_if(&self) -> Option<&syn::ExprPath> {
+        self.skip_serializing_if.as_ref()
+    }
+
+    pub fn default(&self) -> &Default {
+        &self.default
+    }
+
+    pub fn serialize_with(&self) -> Option<&syn::ExprPath> {
+        self.serialize_with.as_ref()
+    }
+
+    pub fn deserialize_with(&self) -> Option<&syn::ExprPath> {
+        self.deserialize_with.as_ref()
+    }
+
+    pub fn ser_bound(&self) -> Option<&[syn::WherePredicate]> {
+        self.ser_bound.as_ref().map(|vec| &vec[..])
+    }
+
+    pub fn de_bound(&self) -> Option<&[syn::WherePredicate]> {
+        self.de_bound.as_ref().map(|vec| &vec[..])
+    }
+
+    pub fn borrowed_lifetimes(&self) -> &BTreeSet<syn::Lifetime> {
+        &self.borrowed_lifetimes
+    }
+
+    pub fn getter(&self) -> Option<&syn::ExprPath> {
+        self.getter.as_ref()
+    }
+
+    pub fn flatten(&self) -> bool {
+        self.flatten
+    }
+
+    pub fn transparent(&self) -> bool {
+        self.transparent
+    }
+
+    pub fn mark_transparent(&mut self) {
+        self.transparent = true;
+    }
+}
+
+type SerAndDe<T> = (Option<T>, Option<T>);
+
+fn get_ser_and_de<'a, 'b, T, F>(
+    cx: &'b Ctxt,
+    attr_name: Symbol,
+    metas: &'a Punctuated<syn::NestedMeta, Token![,]>,
+    f: F,
+) -> Result<(VecAttr<'b, T>, VecAttr<'b, T>), ()>
+where
+    T: 'a,
+    F: Fn(&Ctxt, Symbol, Symbol, &'a syn::Lit) -> Result<T, ()>,
+{
+    let mut ser_meta = VecAttr::none(cx, attr_name);
+    let mut de_meta = VecAttr::none(cx, attr_name);
+
+    for meta in metas {
+        match meta {
+            Meta(NameValue(meta)) if meta.path == SERIALIZE => {
+                if let Ok(v) = f(cx, attr_name, SERIALIZE, &meta.lit) {
+                    ser_meta.insert(&meta.path, v);
+                }
+            }
+
+            Meta(NameValue(meta)) if meta.path == DESERIALIZE => {
+                if let Ok(v) = f(cx, attr_name, DESERIALIZE, &meta.lit) {
+                    de_meta.insert(&meta.path, v);
+                }
+            }
+
+            _ => {
+                cx.error_spanned_by(
+                    meta,
+                    format!(
+                        "malformed {0} attribute, expected `{0}(serialize = ..., deserialize = ...)`",
+                        attr_name
+                    ),
+                );
+                return Err(());
+            }
+        }
+    }
+
+    Ok((ser_meta, de_meta))
+}
+
+fn get_renames<'a>(
+    cx: &Ctxt,
+    items: &'a Punctuated<syn::NestedMeta, Token![,]>,
+) -> Result<SerAndDe<&'a syn::LitStr>, ()> {
+    let (ser, de) = get_ser_and_de(cx, RENAME, items, get_lit_str2)?;
+    Ok((ser.at_most_one()?, de.at_most_one()?))
+}
+
+fn get_multiple_renames<'a>(
+    cx: &Ctxt,
+    items: &'a Punctuated<syn::NestedMeta, Token![,]>,
+) -> Result<(Option<&'a syn::LitStr>, Vec<&'a syn::LitStr>), ()> {
+    let (ser, de) = get_ser_and_de(cx, RENAME, items, get_lit_str2)?;
+    Ok((ser.at_most_one()?, de.get()))
+}
+
+fn get_where_predicates(
+    cx: &Ctxt,
+    items: &Punctuated<syn::NestedMeta, Token![,]>,
+) -> Result<SerAndDe<Vec<syn::WherePredicate>>, ()> {
+    let (ser, de) = get_ser_and_de(cx, BOUND, items, parse_lit_into_where)?;
+    Ok((ser.at_most_one()?, de.at_most_one()?))
+}
+
+pub fn get_serde_meta_items(cx: &Ctxt, attr: &syn::Attribute) -> Result<Vec<syn::NestedMeta>, ()> {
+    if attr.path != SERDE {
+        return Ok(Vec::new());
+    }
+
+    match attr.parse_meta() {
+        Ok(List(meta)) => Ok(meta.nested.into_iter().collect()),
+        Ok(other) => {
+            cx.error_spanned_by(other, "expected #[serde(...)]");
+            Err(())
+        }
+        Err(err) => {
+            cx.syn_error(err);
+            Err(())
+        }
+    }
+}
+
+fn get_lit_str<'a>(cx: &Ctxt, attr_name: Symbol, lit: &'a syn::Lit) -> Result<&'a syn::LitStr, ()> {
+    get_lit_str2(cx, attr_name, attr_name, lit)
+}
+
+fn get_lit_str2<'a>(
+    cx: &Ctxt,
+    attr_name: Symbol,
+    meta_item_name: Symbol,
+    lit: &'a syn::Lit,
+) -> Result<&'a syn::LitStr, ()> {
+    if let syn::Lit::Str(lit) = lit {
+        Ok(lit)
+    } else {
+        cx.error_spanned_by(
+            lit,
+            format!(
+                "expected serde {} attribute to be a string: `{} = \"...\"`",
+                attr_name, meta_item_name
+            ),
+        );
+        Err(())
+    }
+}
+
+fn parse_lit_into_path(cx: &Ctxt, attr_name: Symbol, lit: &syn::Lit) -> Result<syn::Path, ()> {
+    let string = get_lit_str(cx, attr_name, lit)?;
+    parse_lit_str(string).map_err(|_| {
+        cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()))
+    })
+}
+
+fn parse_lit_into_expr_path(
+    cx: &Ctxt,
+    attr_name: Symbol,
+    lit: &syn::Lit,
+) -> Result<syn::ExprPath, ()> {
+    let string = get_lit_str(cx, attr_name, lit)?;
+    parse_lit_str(string).map_err(|_| {
+        cx.error_spanned_by(lit, format!("failed to parse path: {:?}", string.value()))
+    })
+}
+
+fn parse_lit_into_where(
+    cx: &Ctxt,
+    attr_name: Symbol,
+    meta_item_name: Symbol,
+    lit: &syn::Lit,
+) -> Result<Vec<syn::WherePredicate>, ()> {
+    let string = get_lit_str2(cx, attr_name, meta_item_name, lit)?;
+    if string.value().is_empty() {
+        return Ok(Vec::new());
+    }
+
+    let where_string = syn::LitStr::new(&format!("where {}", string.value()), string.span());
+
+    parse_lit_str::<syn::WhereClause>(&where_string)
+        .map(|wh| wh.predicates.into_iter().collect())
+        .map_err(|err| cx.error_spanned_by(lit, err))
+}
+
+fn parse_lit_into_ty(cx: &Ctxt, attr_name: Symbol, lit: &syn::Lit) -> Result<syn::Type, ()> {
+    let string = get_lit_str(cx, attr_name, lit)?;
+
+    parse_lit_str(string).map_err(|_| {
+        cx.error_spanned_by(
+            lit,
+            format!("failed to parse type: {} = {:?}", attr_name, string.value()),
+        )
+    })
+}
+
+// Parses a string literal like "'a + 'b + 'c" containing a nonempty list of
+// lifetimes separated by `+`.
+fn parse_lit_into_lifetimes(
+    cx: &Ctxt,
+    attr_name: Symbol,
+    lit: &syn::Lit,
+) -> Result<BTreeSet<syn::Lifetime>, ()> {
+    let string = get_lit_str(cx, attr_name, lit)?;
+    if string.value().is_empty() {
+        cx.error_spanned_by(lit, "at least one lifetime must be borrowed");
+        return Err(());
+    }
+
+    struct BorrowedLifetimes(Punctuated<syn::Lifetime, Token![+]>);
+
+    impl Parse for BorrowedLifetimes {
+        fn parse(input: ParseStream) -> parse::Result<Self> {
+            Punctuated::parse_separated_nonempty(input).map(BorrowedLifetimes)
+        }
+    }
+
+    if let Ok(BorrowedLifetimes(lifetimes)) = parse_lit_str(string) {
+        let mut set = BTreeSet::new();
+        for lifetime in lifetimes {
+            if !set.insert(lifetime.clone()) {
+                cx.error_spanned_by(lit, format!("duplicate borrowed lifetime `{}`", lifetime));
+            }
+        }
+        return Ok(set);
+    }
+
+    cx.error_spanned_by(
+        lit,
+        format!("failed to parse borrowed lifetimes: {:?}", string.value()),
+    );
+    Err(())
+}
+
+fn is_implicitly_borrowed(ty: &syn::Type) -> bool {
+    is_implicitly_borrowed_reference(ty) || is_option(ty, is_implicitly_borrowed_reference)
+}
+
+fn is_implicitly_borrowed_reference(ty: &syn::Type) -> bool {
+    is_reference(ty, is_str) || is_reference(ty, is_slice_u8)
+}
+
+// Whether the type looks like it might be `std::borrow::Cow<T>` where elem="T".
+// This can have false negatives and false positives.
+//
+// False negative:
+//
+//     use std::borrow::Cow as Pig;
+//
+//     #[derive(Deserialize)]
+//     struct S<'a> {
+//         #[serde(borrow)]
+//         pig: Pig<'a, str>,
+//     }
+//
+// False positive:
+//
+//     type str = [i16];
+//
+//     #[derive(Deserialize)]
+//     struct S<'a> {
+//         #[serde(borrow)]
+//         cow: Cow<'a, str>,
+//     }
+fn is_cow(ty: &syn::Type, elem: fn(&syn::Type) -> bool) -> bool {
+    let path = match ty {
+        syn::Type::Path(ty) => &ty.path,
+        _ => {
+            return false;
+        }
+    };
+    let seg = match path.segments.last() {
+        Some(seg) => seg,
+        None => {
+            return false;
+        }
+    };
+    let args = match &seg.arguments {
+        syn::PathArguments::AngleBracketed(bracketed) => &bracketed.args,
+        _ => {
+            return false;
+        }
+    };
+    seg.ident == "Cow"
+        && args.len() == 2
+        && match (&args[0], &args[1]) {
+            (syn::GenericArgument::Lifetime(_), syn::GenericArgument::Type(arg)) => elem(arg),
+            _ => false,
+        }
+}
+
+fn is_option(ty: &syn::Type, elem: fn(&syn::Type) -> bool) -> bool {
+    let path = match ty {
+        syn::Type::Path(ty) => &ty.path,
+        _ => {
+            return false;
+        }
+    };
+    let seg = match path.segments.last() {
+        Some(seg) => seg,
+        None => {
+            return false;
+        }
+    };
+    let args = match &seg.arguments {
+        syn::PathArguments::AngleBracketed(bracketed) => &bracketed.args,
+        _ => {
+            return false;
+        }
+    };
+    seg.ident == "Option"
+        && args.len() == 1
+        && match &args[0] {
+            syn::GenericArgument::Type(arg) => elem(arg),
+            _ => false,
+        }
+}
+
+// Whether the type looks like it might be `&T` where elem="T". This can have
+// false negatives and false positives.
+//
+// False negative:
+//
+//     type Yarn = str;
+//
+//     #[derive(Deserialize)]
+//     struct S<'a> {
+//         r: &'a Yarn,
+//     }
+//
+// False positive:
+//
+//     type str = [i16];
+//
+//     #[derive(Deserialize)]
+//     struct S<'a> {
+//         r: &'a str,
+//     }
+fn is_reference(ty: &syn::Type, elem: fn(&syn::Type) -> bool) -> bool {
+    match ty {
+        syn::Type::Reference(ty) => ty.mutability.is_none() && elem(&ty.elem),
+        _ => false,
+    }
+}
+
+fn is_str(ty: &syn::Type) -> bool {
+    is_primitive_type(ty, "str")
+}
+
+fn is_slice_u8(ty: &syn::Type) -> bool {
+    match ty {
+        syn::Type::Slice(ty) => is_primitive_type(&ty.elem, "u8"),
+        _ => false,
+    }
+}
+
+fn is_primitive_type(ty: &syn::Type, primitive: &str) -> bool {
+    match ty {
+        syn::Type::Path(ty) => ty.qself.is_none() && is_primitive_path(&ty.path, primitive),
+        _ => false,
+    }
+}
+
+fn is_primitive_path(path: &syn::Path, primitive: &str) -> bool {
+    path.leading_colon.is_none()
+        && path.segments.len() == 1
+        && path.segments[0].ident == primitive
+        && path.segments[0].arguments.is_empty()
+}
+
+// All lifetimes that this type could borrow from a Deserializer.
+//
+// For example a type `S<'a, 'b>` could borrow `'a` and `'b`. On the other hand
+// a type `for<'a> fn(&'a str)` could not borrow `'a` from the Deserializer.
+//
+// This is used when there is an explicit or implicit `#[serde(borrow)]`
+// attribute on the field so there must be at least one borrowable lifetime.
+fn borrowable_lifetimes(
+    cx: &Ctxt,
+    name: &str,
+    field: &syn::Field,
+) -> Result<BTreeSet<syn::Lifetime>, ()> {
+    let mut lifetimes = BTreeSet::new();
+    collect_lifetimes(&field.ty, &mut lifetimes);
+    if lifetimes.is_empty() {
+        cx.error_spanned_by(
+            field,
+            format!("field `{}` has no lifetimes to borrow", name),
+        );
+        Err(())
+    } else {
+        Ok(lifetimes)
+    }
+}
+
+fn collect_lifetimes(ty: &syn::Type, out: &mut BTreeSet<syn::Lifetime>) {
+    match ty {
+        syn::Type::Slice(ty) => {
+            collect_lifetimes(&ty.elem, out);
+        }
+        syn::Type::Array(ty) => {
+            collect_lifetimes(&ty.elem, out);
+        }
+        syn::Type::Ptr(ty) => {
+            collect_lifetimes(&ty.elem, out);
+        }
+        syn::Type::Reference(ty) => {
+            out.extend(ty.lifetime.iter().cloned());
+            collect_lifetimes(&ty.elem, out);
+        }
+        syn::Type::Tuple(ty) => {
+            for elem in &ty.elems {
+                collect_lifetimes(elem, out);
+            }
+        }
+        syn::Type::Path(ty) => {
+            if let Some(qself) = &ty.qself {
+                collect_lifetimes(&qself.ty, out);
+            }
+            for seg in &ty.path.segments {
+                if let syn::PathArguments::AngleBracketed(bracketed) = &seg.arguments {
+                    for arg in &bracketed.args {
+                        match arg {
+                            syn::GenericArgument::Lifetime(lifetime) => {
+                                out.insert(lifetime.clone());
+                            }
+                            syn::GenericArgument::Type(ty) => {
+                                collect_lifetimes(ty, out);
+                            }
+                            syn::GenericArgument::Binding(binding) => {
+                                collect_lifetimes(&binding.ty, out);
+                            }
+                            syn::GenericArgument::Constraint(_)
+                            | syn::GenericArgument::Const(_) => {}
+                        }
+                    }
+                }
+            }
+        }
+        syn::Type::Paren(ty) => {
+            collect_lifetimes(&ty.elem, out);
+        }
+        syn::Type::Group(ty) => {
+            collect_lifetimes(&ty.elem, out);
+        }
+        syn::Type::BareFn(_)
+        | syn::Type::Never(_)
+        | syn::Type::TraitObject(_)
+        | syn::Type::ImplTrait(_)
+        | syn::Type::Infer(_)
+        | syn::Type::Macro(_)
+        | syn::Type::Verbatim(_)
+        | _ => {}
+    }
+}
+
+fn parse_lit_str<T>(s: &syn::LitStr) -> parse::Result<T>
+where
+    T: Parse,
+{
+    let tokens = spanned_tokens(s)?;
+    syn::parse2(tokens)
+}
+
+fn spanned_tokens(s: &syn::LitStr) -> parse::Result<TokenStream> {
+    let stream = syn::parse_str(&s.value())?;
+    Ok(respan_token_stream(stream, s.span()))
+}
+
+fn respan_token_stream(stream: TokenStream, span: Span) -> TokenStream {
+    stream
+        .into_iter()
+        .map(|token| respan_token_tree(token, span))
+        .collect()
+}
+
+fn respan_token_tree(mut token: TokenTree, span: Span) -> TokenTree {
+    if let TokenTree::Group(g) = &mut token {
+        *g = Group::new(g.delimiter(), respan_token_stream(g.stream(), span));
+    }
+    token.set_span(span);
+    token
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/internals/case.rs.html b/src/serde_derive/internals/case.rs.html new file mode 100644 index 0000000..d8509f4 --- /dev/null +++ b/src/serde_derive/internals/case.rs.html @@ -0,0 +1,351 @@ +case.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+
+//! Code to convert the Rust-styled field/variant (e.g. `my_field`, `MyType`) to the
+//! case of the source (e.g. `my-field`, `MY_FIELD`).
+
+// See https://users.rust-lang.org/t/psa-dealing-with-warning-unused-import-std-ascii-asciiext-in-today-s-nightly/13726
+#[allow(deprecated, unused_imports)]
+use std::ascii::AsciiExt;
+
+use std::str::FromStr;
+
+use self::RenameRule::*;
+
+/// The different possible ways to change case of fields in a struct, or variants in an enum.
+#[derive(Copy, Clone, PartialEq)]
+pub enum RenameRule {
+    /// Don't apply a default rename rule.
+    None,
+    /// Rename direct children to "lowercase" style.
+    LowerCase,
+    /// Rename direct children to "UPPERCASE" style.
+    UPPERCASE,
+    /// Rename direct children to "PascalCase" style, as typically used for
+    /// enum variants.
+    PascalCase,
+    /// Rename direct children to "camelCase" style.
+    CamelCase,
+    /// Rename direct children to "snake_case" style, as commonly used for
+    /// fields.
+    SnakeCase,
+    /// Rename direct children to "SCREAMING_SNAKE_CASE" style, as commonly
+    /// used for constants.
+    ScreamingSnakeCase,
+    /// Rename direct children to "kebab-case" style.
+    KebabCase,
+    /// Rename direct children to "SCREAMING-KEBAB-CASE" style.
+    ScreamingKebabCase,
+}
+
+impl RenameRule {
+    /// Apply a renaming rule to an enum variant, returning the version expected in the source.
+    pub fn apply_to_variant(&self, variant: &str) -> String {
+        match *self {
+            None | PascalCase => variant.to_owned(),
+            LowerCase => variant.to_ascii_lowercase(),
+            UPPERCASE => variant.to_ascii_uppercase(),
+            CamelCase => variant[..1].to_ascii_lowercase() + &variant[1..],
+            SnakeCase => {
+                let mut snake = String::new();
+                for (i, ch) in variant.char_indices() {
+                    if i > 0 && ch.is_uppercase() {
+                        snake.push('_');
+                    }
+                    snake.push(ch.to_ascii_lowercase());
+                }
+                snake
+            }
+            ScreamingSnakeCase => SnakeCase.apply_to_variant(variant).to_ascii_uppercase(),
+            KebabCase => SnakeCase.apply_to_variant(variant).replace('_', "-"),
+            ScreamingKebabCase => ScreamingSnakeCase
+                .apply_to_variant(variant)
+                .replace('_', "-"),
+        }
+    }
+
+    /// Apply a renaming rule to a struct field, returning the version expected in the source.
+    pub fn apply_to_field(&self, field: &str) -> String {
+        match *self {
+            None | LowerCase | SnakeCase => field.to_owned(),
+            UPPERCASE => field.to_ascii_uppercase(),
+            PascalCase => {
+                let mut pascal = String::new();
+                let mut capitalize = true;
+                for ch in field.chars() {
+                    if ch == '_' {
+                        capitalize = true;
+                    } else if capitalize {
+                        pascal.push(ch.to_ascii_uppercase());
+                        capitalize = false;
+                    } else {
+                        pascal.push(ch);
+                    }
+                }
+                pascal
+            }
+            CamelCase => {
+                let pascal = PascalCase.apply_to_field(field);
+                pascal[..1].to_ascii_lowercase() + &pascal[1..]
+            }
+            ScreamingSnakeCase => field.to_ascii_uppercase(),
+            KebabCase => field.replace('_', "-"),
+            ScreamingKebabCase => ScreamingSnakeCase.apply_to_field(field).replace('_', "-"),
+        }
+    }
+}
+
+impl FromStr for RenameRule {
+    type Err = ();
+
+    fn from_str(rename_all_str: &str) -> Result<Self, Self::Err> {
+        match rename_all_str {
+            "lowercase" => Ok(LowerCase),
+            "UPPERCASE" => Ok(UPPERCASE),
+            "PascalCase" => Ok(PascalCase),
+            "camelCase" => Ok(CamelCase),
+            "snake_case" => Ok(SnakeCase),
+            "SCREAMING_SNAKE_CASE" => Ok(ScreamingSnakeCase),
+            "kebab-case" => Ok(KebabCase),
+            "SCREAMING-KEBAB-CASE" => Ok(ScreamingKebabCase),
+            _ => Err(()),
+        }
+    }
+}
+
+#[test]
+fn rename_variants() {
+    for &(original, lower, upper, camel, snake, screaming, kebab, screaming_kebab) in &[
+        (
+            "Outcome", "outcome", "OUTCOME", "outcome", "outcome", "OUTCOME", "outcome", "OUTCOME",
+        ),
+        (
+            "VeryTasty",
+            "verytasty",
+            "VERYTASTY",
+            "veryTasty",
+            "very_tasty",
+            "VERY_TASTY",
+            "very-tasty",
+            "VERY-TASTY",
+        ),
+        ("A", "a", "A", "a", "a", "A", "a", "A"),
+        ("Z42", "z42", "Z42", "z42", "z42", "Z42", "z42", "Z42"),
+    ] {
+        assert_eq!(None.apply_to_variant(original), original);
+        assert_eq!(LowerCase.apply_to_variant(original), lower);
+        assert_eq!(UPPERCASE.apply_to_variant(original), upper);
+        assert_eq!(PascalCase.apply_to_variant(original), original);
+        assert_eq!(CamelCase.apply_to_variant(original), camel);
+        assert_eq!(SnakeCase.apply_to_variant(original), snake);
+        assert_eq!(ScreamingSnakeCase.apply_to_variant(original), screaming);
+        assert_eq!(KebabCase.apply_to_variant(original), kebab);
+        assert_eq!(
+            ScreamingKebabCase.apply_to_variant(original),
+            screaming_kebab
+        );
+    }
+}
+
+#[test]
+fn rename_fields() {
+    for &(original, upper, pascal, camel, screaming, kebab, screaming_kebab) in &[
+        (
+            "outcome", "OUTCOME", "Outcome", "outcome", "OUTCOME", "outcome", "OUTCOME",
+        ),
+        (
+            "very_tasty",
+            "VERY_TASTY",
+            "VeryTasty",
+            "veryTasty",
+            "VERY_TASTY",
+            "very-tasty",
+            "VERY-TASTY",
+        ),
+        ("a", "A", "A", "a", "A", "a", "A"),
+        ("z42", "Z42", "Z42", "z42", "Z42", "z42", "Z42"),
+    ] {
+        assert_eq!(None.apply_to_field(original), original);
+        assert_eq!(UPPERCASE.apply_to_field(original), upper);
+        assert_eq!(PascalCase.apply_to_field(original), pascal);
+        assert_eq!(CamelCase.apply_to_field(original), camel);
+        assert_eq!(SnakeCase.apply_to_field(original), original);
+        assert_eq!(ScreamingSnakeCase.apply_to_field(original), screaming);
+        assert_eq!(KebabCase.apply_to_field(original), kebab);
+        assert_eq!(ScreamingKebabCase.apply_to_field(original), screaming_kebab);
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/internals/check.rs.html b/src/serde_derive/internals/check.rs.html new file mode 100644 index 0000000..e95bd1a --- /dev/null +++ b/src/serde_derive/internals/check.rs.html @@ -0,0 +1,843 @@ +check.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+
+use internals::ast::{Container, Data, Field, Style};
+use internals::attr::{Identifier, TagType};
+use internals::{Ctxt, Derive};
+use syn::{Member, Type};
+
+/// Cross-cutting checks that require looking at more than a single attrs
+/// object. Simpler checks should happen when parsing and building the attrs.
+pub fn check(cx: &Ctxt, cont: &mut Container, derive: Derive) {
+    check_getter(cx, cont);
+    check_flatten(cx, cont);
+    check_identifier(cx, cont);
+    check_variant_skip_attrs(cx, cont);
+    check_internal_tag_field_name_conflict(cx, cont);
+    check_adjacent_tag_conflict(cx, cont);
+    check_transparent(cx, cont, derive);
+    check_from_and_try_from(cx, cont);
+}
+
+/// Getters are only allowed inside structs (not enums) with the `remote`
+/// attribute.
+fn check_getter(cx: &Ctxt, cont: &Container) {
+    match cont.data {
+        Data::Enum(_) => {
+            if cont.data.has_getter() {
+                cx.error_spanned_by(
+                    cont.original,
+                    "#[serde(getter = \"...\")] is not allowed in an enum",
+                );
+            }
+        }
+        Data::Struct(_, _) => {
+            if cont.data.has_getter() && cont.attrs.remote().is_none() {
+                cx.error_spanned_by(
+                    cont.original,
+                    "#[serde(getter = \"...\")] can only be used in structs that have #[serde(remote = \"...\")]",
+                );
+            }
+        }
+    }
+}
+
+/// Flattening has some restrictions we can test.
+fn check_flatten(cx: &Ctxt, cont: &Container) {
+    match &cont.data {
+        Data::Enum(variants) => {
+            for variant in variants {
+                for field in &variant.fields {
+                    check_flatten_field(cx, variant.style, field);
+                }
+            }
+        }
+        Data::Struct(style, fields) => {
+            for field in fields {
+                check_flatten_field(cx, *style, field);
+            }
+        }
+    }
+}
+
+fn check_flatten_field(cx: &Ctxt, style: Style, field: &Field) {
+    if !field.attrs.flatten() {
+        return;
+    }
+    match style {
+        Style::Tuple => {
+            cx.error_spanned_by(
+                field.original,
+                "#[serde(flatten)] cannot be used on tuple structs",
+            );
+        }
+        Style::Newtype => {
+            cx.error_spanned_by(
+                field.original,
+                "#[serde(flatten)] cannot be used on newtype structs",
+            );
+        }
+        _ => {}
+    }
+}
+
+/// The `other` attribute must be used at most once and it must be the last
+/// variant of an enum.
+///
+/// Inside a `variant_identifier` all variants must be unit variants. Inside a
+/// `field_identifier` all but possibly one variant must be unit variants. The
+/// last variant may be a newtype variant which is an implicit "other" case.
+fn check_identifier(cx: &Ctxt, cont: &Container) {
+    let variants = match &cont.data {
+        Data::Enum(variants) => variants,
+        Data::Struct(_, _) => {
+            return;
+        }
+    };
+
+    for (i, variant) in variants.iter().enumerate() {
+        match (
+            variant.style,
+            cont.attrs.identifier(),
+            variant.attrs.other(),
+            cont.attrs.tag(),
+        ) {
+            // The `other` attribute may not be used in a variant_identifier.
+            (_, Identifier::Variant, true, _) => {
+                cx.error_spanned_by(
+                    variant.original,
+                    "#[serde(other)] may not be used on a variant identifier",
+                );
+            }
+
+            // Variant with `other` attribute cannot appear in untagged enum
+            (_, Identifier::No, true, &TagType::None) => {
+                cx.error_spanned_by(
+                    variant.original,
+                    "#[serde(other)] cannot appear on untagged enum",
+                );
+            }
+
+            // Variant with `other` attribute must be the last one.
+            (Style::Unit, Identifier::Field, true, _) | (Style::Unit, Identifier::No, true, _) => {
+                if i < variants.len() - 1 {
+                    cx.error_spanned_by(
+                        variant.original,
+                        "#[serde(other)] must be on the last variant",
+                    );
+                }
+            }
+
+            // Variant with `other` attribute must be a unit variant.
+            (_, Identifier::Field, true, _) | (_, Identifier::No, true, _) => {
+                cx.error_spanned_by(
+                    variant.original,
+                    "#[serde(other)] must be on a unit variant",
+                );
+            }
+
+            // Any sort of variant is allowed if this is not an identifier.
+            (_, Identifier::No, false, _) => {}
+
+            // Unit variant without `other` attribute is always fine.
+            (Style::Unit, _, false, _) => {}
+
+            // The last field is allowed to be a newtype catch-all.
+            (Style::Newtype, Identifier::Field, false, _) => {
+                if i < variants.len() - 1 {
+                    cx.error_spanned_by(
+                        variant.original,
+                        format!("`{}` must be the last variant", variant.ident),
+                    );
+                }
+            }
+
+            (_, Identifier::Field, false, _) => {
+                cx.error_spanned_by(
+                    variant.original,
+                    "#[serde(field_identifier)] may only contain unit variants",
+                );
+            }
+
+            (_, Identifier::Variant, false, _) => {
+                cx.error_spanned_by(
+                    variant.original,
+                    "#[serde(variant_identifier)] may only contain unit variants",
+                );
+            }
+        }
+    }
+}
+
+/// Skip-(de)serializing attributes are not allowed on variants marked
+/// (de)serialize_with.
+fn check_variant_skip_attrs(cx: &Ctxt, cont: &Container) {
+    let variants = match &cont.data {
+        Data::Enum(variants) => variants,
+        Data::Struct(_, _) => {
+            return;
+        }
+    };
+
+    for variant in variants.iter() {
+        if variant.attrs.serialize_with().is_some() {
+            if variant.attrs.skip_serializing() {
+                cx.error_spanned_by(
+                    variant.original,
+                    format!(
+                        "variant `{}` cannot have both #[serde(serialize_with)] and #[serde(skip_serializing)]",
+                        variant.ident
+                    ),
+                );
+            }
+
+            for field in &variant.fields {
+                let member = member_message(&field.member);
+
+                if field.attrs.skip_serializing() {
+                    cx.error_spanned_by(
+                        variant.original,
+                        format!(
+                            "variant `{}` cannot have both #[serde(serialize_with)] and a field {} marked with #[serde(skip_serializing)]",
+                            variant.ident, member
+                        ),
+                    );
+                }
+
+                if field.attrs.skip_serializing_if().is_some() {
+                    cx.error_spanned_by(
+                        variant.original,
+                        format!(
+                            "variant `{}` cannot have both #[serde(serialize_with)] and a field {} marked with #[serde(skip_serializing_if)]",
+                            variant.ident, member
+                        ),
+                    );
+                }
+            }
+        }
+
+        if variant.attrs.deserialize_with().is_some() {
+            if variant.attrs.skip_deserializing() {
+                cx.error_spanned_by(
+                    variant.original,
+                    format!(
+                        "variant `{}` cannot have both #[serde(deserialize_with)] and #[serde(skip_deserializing)]",
+                        variant.ident
+                    ),
+                );
+            }
+
+            for field in &variant.fields {
+                if field.attrs.skip_deserializing() {
+                    let member = member_message(&field.member);
+
+                    cx.error_spanned_by(
+                        variant.original,
+                        format!(
+                            "variant `{}` cannot have both #[serde(deserialize_with)] and a field {} marked with #[serde(skip_deserializing)]",
+                            variant.ident, member
+                        ),
+                    );
+                }
+            }
+        }
+    }
+}
+
+/// The tag of an internally-tagged struct variant must not be
+/// the same as either one of its fields, as this would result in
+/// duplicate keys in the serialized output and/or ambiguity in
+/// the to-be-deserialized input.
+fn check_internal_tag_field_name_conflict(cx: &Ctxt, cont: &Container) {
+    let variants = match &cont.data {
+        Data::Enum(variants) => variants,
+        Data::Struct(_, _) => return,
+    };
+
+    let tag = match cont.attrs.tag() {
+        TagType::Internal { tag } => tag.as_str(),
+        TagType::External | TagType::Adjacent { .. } | TagType::None => return,
+    };
+
+    let diagnose_conflict = || {
+        cx.error_spanned_by(
+            cont.original,
+            format!("variant field name `{}` conflicts with internal tag", tag),
+        )
+    };
+
+    for variant in variants {
+        match variant.style {
+            Style::Struct => {
+                for field in &variant.fields {
+                    let check_ser = !field.attrs.skip_serializing();
+                    let check_de = !field.attrs.skip_deserializing();
+                    let name = field.attrs.name();
+                    let ser_name = name.serialize_name();
+
+                    if check_ser && ser_name == tag {
+                        diagnose_conflict();
+                        return;
+                    }
+
+                    for de_name in field.attrs.aliases() {
+                        if check_de && de_name == tag {
+                            diagnose_conflict();
+                            return;
+                        }
+                    }
+                }
+            }
+            Style::Unit | Style::Newtype | Style::Tuple => {}
+        }
+    }
+}
+
+/// In the case of adjacently-tagged enums, the type and the
+/// contents tag must differ, for the same reason.
+fn check_adjacent_tag_conflict(cx: &Ctxt, cont: &Container) {
+    let (type_tag, content_tag) = match cont.attrs.tag() {
+        TagType::Adjacent { tag, content } => (tag, content),
+        TagType::Internal { .. } | TagType::External | TagType::None => return,
+    };
+
+    if type_tag == content_tag {
+        cx.error_spanned_by(
+            cont.original,
+            format!(
+                "enum tags `{}` for type and content conflict with each other",
+                type_tag
+            ),
+        );
+    }
+}
+
+/// Enums and unit structs cannot be transparent.
+fn check_transparent(cx: &Ctxt, cont: &mut Container, derive: Derive) {
+    if !cont.attrs.transparent() {
+        return;
+    }
+
+    if cont.attrs.type_from().is_some() {
+        cx.error_spanned_by(
+            cont.original,
+            "#[serde(transparent)] is not allowed with #[serde(from = \"...\")]",
+        );
+    }
+
+    if cont.attrs.type_try_from().is_some() {
+        cx.error_spanned_by(
+            cont.original,
+            "#[serde(transparent)] is not allowed with #[serde(try_from = \"...\")]",
+        );
+    }
+
+    if cont.attrs.type_into().is_some() {
+        cx.error_spanned_by(
+            cont.original,
+            "#[serde(transparent)] is not allowed with #[serde(into = \"...\")]",
+        );
+    }
+
+    let fields = match &mut cont.data {
+        Data::Enum(_) => {
+            cx.error_spanned_by(
+                cont.original,
+                "#[serde(transparent)] is not allowed on an enum",
+            );
+            return;
+        }
+        Data::Struct(Style::Unit, _) => {
+            cx.error_spanned_by(
+                cont.original,
+                "#[serde(transparent)] is not allowed on a unit struct",
+            );
+            return;
+        }
+        Data::Struct(_, fields) => fields,
+    };
+
+    let mut transparent_field = None;
+
+    for field in fields {
+        if allow_transparent(field, derive) {
+            if transparent_field.is_some() {
+                cx.error_spanned_by(
+                    cont.original,
+                    "#[serde(transparent)] requires struct to have at most one transparent field",
+                );
+                return;
+            }
+            transparent_field = Some(field);
+        }
+    }
+
+    match transparent_field {
+        Some(transparent_field) => transparent_field.attrs.mark_transparent(),
+        None => match derive {
+            Derive::Serialize => {
+                cx.error_spanned_by(
+                    cont.original,
+                    "#[serde(transparent)] requires at least one field that is not skipped",
+                );
+            }
+            Derive::Deserialize => {
+                cx.error_spanned_by(
+                    cont.original,
+                    "#[serde(transparent)] requires at least one field that is neither skipped nor has a default",
+                );
+            }
+        },
+    }
+}
+
+fn member_message(member: &Member) -> String {
+    match member {
+        Member::Named(ident) => format!("`{}`", ident),
+        Member::Unnamed(i) => format!("#{}", i.index),
+    }
+}
+
+fn allow_transparent(field: &Field, derive: Derive) -> bool {
+    if let Type::Path(ty) = field.ty {
+        if let Some(seg) = ty.path.segments.last() {
+            if seg.ident == "PhantomData" {
+                return false;
+            }
+        }
+    }
+
+    match derive {
+        Derive::Serialize => !field.attrs.skip_serializing(),
+        Derive::Deserialize => !field.attrs.skip_deserializing() && field.attrs.default().is_none(),
+    }
+}
+
+fn check_from_and_try_from(cx: &Ctxt, cont: &mut Container) {
+    if cont.attrs.type_from().is_some() && cont.attrs.type_try_from().is_some() {
+        cx.error_spanned_by(
+            cont.original,
+            "#[serde(from = \"...\")] and #[serde(try_from = \"...\")] conflict with each other",
+        );
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/internals/ctxt.rs.html b/src/serde_derive/internals/ctxt.rs.html new file mode 100644 index 0000000..03e2b8e --- /dev/null +++ b/src/serde_derive/internals/ctxt.rs.html @@ -0,0 +1,127 @@ +ctxt.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+
+use quote::ToTokens;
+use std::cell::RefCell;
+use std::fmt::Display;
+use std::thread;
+use syn;
+
+/// A type to collect errors together and format them.
+///
+/// Dropping this object will cause a panic. It must be consumed using `check`.
+///
+/// References can be shared since this type uses run-time exclusive mut checking.
+#[derive(Default)]
+pub struct Ctxt {
+    // The contents will be set to `None` during checking. This is so that checking can be
+    // enforced.
+    errors: RefCell<Option<Vec<syn::Error>>>,
+}
+
+impl Ctxt {
+    /// Create a new context object.
+    ///
+    /// This object contains no errors, but will still trigger a panic if it is not `check`ed.
+    pub fn new() -> Self {
+        Ctxt {
+            errors: RefCell::new(Some(Vec::new())),
+        }
+    }
+
+    /// Add an error to the context object with a tokenenizable object.
+    ///
+    /// The object is used for spanning in error messages.
+    pub fn error_spanned_by<A: ToTokens, T: Display>(&self, obj: A, msg: T) {
+        self.errors
+            .borrow_mut()
+            .as_mut()
+            .unwrap()
+            // Curb monomorphization from generating too many identical methods.
+            .push(syn::Error::new_spanned(obj.into_token_stream(), msg));
+    }
+
+    /// Add one of Syn's parse errors.
+    pub fn syn_error(&self, err: syn::Error) {
+        self.errors.borrow_mut().as_mut().unwrap().push(err);
+    }
+
+    /// Consume this object, producing a formatted error string if there are errors.
+    pub fn check(self) -> Result<(), Vec<syn::Error>> {
+        let errors = self.errors.borrow_mut().take().unwrap();
+        match errors.len() {
+            0 => Ok(()),
+            _ => Err(errors),
+        }
+    }
+}
+
+impl Drop for Ctxt {
+    fn drop(&mut self) {
+        if !thread::panicking() && self.errors.borrow().is_some() {
+            panic!("forgot to check for errors");
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/internals/mod.rs.html b/src/serde_derive/internals/mod.rs.html new file mode 100644 index 0000000..542afe2 --- /dev/null +++ b/src/serde_derive/internals/mod.rs.html @@ -0,0 +1,33 @@ +mod.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+
+pub mod ast;
+pub mod attr;
+
+mod ctxt;
+pub use self::ctxt::Ctxt;
+
+mod case;
+mod check;
+mod symbol;
+
+#[derive(Copy, Clone)]
+pub enum Derive {
+    Serialize,
+    Deserialize,
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/internals/symbol.rs.html b/src/serde_derive/internals/symbol.rs.html new file mode 100644 index 0000000..caec3d6 --- /dev/null +++ b/src/serde_derive/internals/symbol.rs.html @@ -0,0 +1,137 @@ +symbol.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+
+use std::fmt::{self, Display};
+use syn::{Ident, Path};
+
+#[derive(Copy, Clone)]
+pub struct Symbol(&'static str);
+
+pub const ALIAS: Symbol = Symbol("alias");
+pub const BORROW: Symbol = Symbol("borrow");
+pub const BOUND: Symbol = Symbol("bound");
+pub const CONTENT: Symbol = Symbol("content");
+pub const CRATE: Symbol = Symbol("crate");
+pub const DEFAULT: Symbol = Symbol("default");
+pub const DENY_UNKNOWN_FIELDS: Symbol = Symbol("deny_unknown_fields");
+pub const DESERIALIZE: Symbol = Symbol("deserialize");
+pub const DESERIALIZE_WITH: Symbol = Symbol("deserialize_with");
+pub const FIELD_IDENTIFIER: Symbol = Symbol("field_identifier");
+pub const FLATTEN: Symbol = Symbol("flatten");
+pub const FROM: Symbol = Symbol("from");
+pub const GETTER: Symbol = Symbol("getter");
+pub const INTO: Symbol = Symbol("into");
+pub const OTHER: Symbol = Symbol("other");
+pub const REMOTE: Symbol = Symbol("remote");
+pub const RENAME: Symbol = Symbol("rename");
+pub const RENAME_ALL: Symbol = Symbol("rename_all");
+pub const SERDE: Symbol = Symbol("serde");
+pub const SERIALIZE: Symbol = Symbol("serialize");
+pub const SERIALIZE_WITH: Symbol = Symbol("serialize_with");
+pub const SKIP: Symbol = Symbol("skip");
+pub const SKIP_DESERIALIZING: Symbol = Symbol("skip_deserializing");
+pub const SKIP_SERIALIZING: Symbol = Symbol("skip_serializing");
+pub const SKIP_SERIALIZING_IF: Symbol = Symbol("skip_serializing_if");
+pub const TAG: Symbol = Symbol("tag");
+pub const TRANSPARENT: Symbol = Symbol("transparent");
+pub const TRY_FROM: Symbol = Symbol("try_from");
+pub const UNTAGGED: Symbol = Symbol("untagged");
+pub const VARIANT_IDENTIFIER: Symbol = Symbol("variant_identifier");
+pub const WITH: Symbol = Symbol("with");
+
+impl PartialEq<Symbol> for Ident {
+    fn eq(&self, word: &Symbol) -> bool {
+        self == word.0
+    }
+}
+
+impl<'a> PartialEq<Symbol> for &'a Ident {
+    fn eq(&self, word: &Symbol) -> bool {
+        *self == word.0
+    }
+}
+
+impl PartialEq<Symbol> for Path {
+    fn eq(&self, word: &Symbol) -> bool {
+        self.is_ident(word.0)
+    }
+}
+
+impl<'a> PartialEq<Symbol> for &'a Path {
+    fn eq(&self, word: &Symbol) -> bool {
+        self.is_ident(word.0)
+    }
+}
+
+impl Display for Symbol {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str(self.0)
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/lib.rs.html b/src/serde_derive/lib.rs.html new file mode 100644 index 0000000..5c015c0 --- /dev/null +++ b/src/serde_derive/lib.rs.html @@ -0,0 +1,203 @@ +lib.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+
+//! This crate provides Serde's two derive macros.
+//!
+//! ```edition2018
+//! # use serde_derive::{Serialize, Deserialize};
+//! #
+//! #[derive(Serialize, Deserialize)]
+//! # struct S;
+//! #
+//! # fn main() {}
+//! ```
+//!
+//! Please refer to [https://serde.rs/derive.html] for how to set this up.
+//!
+//! [https://serde.rs/derive.html]: https://serde.rs/derive.html
+
+#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.104")]
+#![allow(unknown_lints, bare_trait_objects)]
+#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
+#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
+// Ignored clippy lints
+#![cfg_attr(
+    feature = "cargo-clippy",
+    allow(
+        cognitive_complexity,
+        enum_variant_names,
+        needless_pass_by_value,
+        redundant_field_names,
+        too_many_arguments,
+        trivially_copy_pass_by_ref,
+        used_underscore_binding,
+    )
+)]
+// Ignored clippy_pedantic lints
+#![cfg_attr(
+    feature = "cargo-clippy",
+    allow(
+        cast_possible_truncation,
+        checked_conversions,
+        doc_markdown,
+        enum_glob_use,
+        filter_map,
+        indexing_slicing,
+        items_after_statements,
+        match_same_arms,
+        module_name_repetitions,
+        must_use_candidate,
+        similar_names,
+        single_match_else,
+        too_many_lines,
+        unseparated_literal_suffix,
+        use_self,
+    )
+)]
+// The `quote!` macro requires deep recursion.
+#![recursion_limit = "512"]
+
+#[macro_use]
+extern crate quote;
+#[macro_use]
+extern crate syn;
+
+extern crate proc_macro;
+extern crate proc_macro2;
+
+mod internals;
+
+use proc_macro::TokenStream;
+use syn::DeriveInput;
+
+#[macro_use]
+mod bound;
+#[macro_use]
+mod fragment;
+
+mod de;
+mod dummy;
+mod pretend;
+mod ser;
+mod try;
+
+#[proc_macro_derive(Serialize, attributes(serde))]
+pub fn derive_serialize(input: TokenStream) -> TokenStream {
+    let input = parse_macro_input!(input as DeriveInput);
+    ser::expand_derive_serialize(&input)
+        .unwrap_or_else(to_compile_errors)
+        .into()
+}
+
+#[proc_macro_derive(Deserialize, attributes(serde))]
+pub fn derive_deserialize(input: TokenStream) -> TokenStream {
+    let input = parse_macro_input!(input as DeriveInput);
+    de::expand_derive_deserialize(&input)
+        .unwrap_or_else(to_compile_errors)
+        .into()
+}
+
+fn to_compile_errors(errors: Vec<syn::Error>) -> proc_macro2::TokenStream {
+    let compile_errors = errors.iter().map(syn::Error::to_compile_error);
+    quote!(#(#compile_errors)*)
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/pretend.rs.html b/src/serde_derive/pretend.rs.html new file mode 100644 index 0000000..9b122b8 --- /dev/null +++ b/src/serde_derive/pretend.rs.html @@ -0,0 +1,283 @@ +pretend.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+
+use proc_macro2::{Span, TokenStream};
+use syn::Ident;
+
+use internals::ast::{Container, Data, Field, Style};
+
+// Suppress dead_code warnings that would otherwise appear when using a remote
+// derive. Other than this pretend code, a struct annotated with remote derive
+// never has its fields referenced and an enum annotated with remote derive
+// never has its variants constructed.
+//
+//     warning: field is never used: `i`
+//      --> src/main.rs:4:20
+//       |
+//     4 | struct StructDef { i: i32 }
+//       |                    ^^^^^^
+//
+//     warning: variant is never constructed: `V`
+//      --> src/main.rs:8:16
+//       |
+//     8 | enum EnumDef { V }
+//       |                ^
+//
+pub fn pretend_used(cont: &Container) -> TokenStream {
+    let pretend_fields = pretend_fields_used(cont);
+    let pretend_variants = pretend_variants_used(cont);
+
+    quote! {
+        #pretend_fields
+        #pretend_variants
+    }
+}
+
+// For structs with named fields, expands to:
+//
+//     match None::<T> {
+//         Some(T { a: ref __v0, b: ref __v1 }) => {}
+//         _ => {}
+//     }
+//
+// For enums, expands to the following but only including struct variants:
+//
+//     match None::<T> {
+//         Some(T::A { a: ref __v0 }) => {}
+//         Some(T::B { b: ref __v0 }) => {}
+//         _ => {}
+//     }
+//
+// The `ref` is important in case the user has written a Drop impl on their
+// type. Rust does not allow destructuring a struct or enum that has a Drop
+// impl.
+fn pretend_fields_used(cont: &Container) -> TokenStream {
+    let type_ident = &cont.ident;
+    let (_, ty_generics, _) = cont.generics.split_for_impl();
+
+    let patterns = match &cont.data {
+        Data::Enum(variants) => variants
+            .iter()
+            .filter_map(|variant| match variant.style {
+                Style::Struct => {
+                    let variant_ident = &variant.ident;
+                    let pat = struct_pattern(&variant.fields);
+                    Some(quote!(#type_ident::#variant_ident #pat))
+                }
+                _ => None,
+            })
+            .collect::<Vec<_>>(),
+        Data::Struct(Style::Struct, fields) => {
+            let pat = struct_pattern(fields);
+            vec![quote!(#type_ident #pat)]
+        }
+        Data::Struct(_, _) => {
+            return quote!();
+        }
+    };
+
+    quote! {
+        match _serde::export::None::<#type_ident #ty_generics> {
+            #(
+                _serde::export::Some(#patterns) => {}
+            )*
+            _ => {}
+        }
+    }
+}
+
+// Expands to one of these per enum variant:
+//
+//     match None {
+//         Some((__v0, __v1,)) => {
+//             let _ = E::V { a: __v0, b: __v1 };
+//         }
+//         _ => {}
+//     }
+//
+fn pretend_variants_used(cont: &Container) -> TokenStream {
+    let variants = match &cont.data {
+        Data::Enum(variants) => variants,
+        Data::Struct(_, _) => {
+            return quote!();
+        }
+    };
+
+    let type_ident = &cont.ident;
+    let (_, ty_generics, _) = cont.generics.split_for_impl();
+    let turbofish = ty_generics.as_turbofish();
+
+    let cases = variants.iter().map(|variant| {
+        let variant_ident = &variant.ident;
+        let placeholders = &(0..variant.fields.len())
+            .map(|i| Ident::new(&format!("__v{}", i), Span::call_site()))
+            .collect::<Vec<_>>();
+
+        let pat = match variant.style {
+            Style::Struct => {
+                let members = variant.fields.iter().map(|field| &field.member);
+                quote!({ #(#members: #placeholders),* })
+            }
+            Style::Tuple | Style::Newtype => quote!(( #(#placeholders),* )),
+            Style::Unit => quote!(),
+        };
+
+        quote! {
+            match _serde::export::None {
+                _serde::export::Some((#(#placeholders,)*)) => {
+                    let _ = #type_ident::#variant_ident #turbofish #pat;
+                }
+                _ => {}
+            }
+        }
+    });
+
+    quote!(#(#cases)*)
+}
+
+fn struct_pattern(fields: &[Field]) -> TokenStream {
+    let members = fields.iter().map(|field| &field.member);
+    let placeholders =
+        (0..fields.len()).map(|i| Ident::new(&format!("__v{}", i), Span::call_site()));
+    quote!({ #(#members: ref #placeholders),* })
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/ser.rs.html b/src/serde_derive/ser.rs.html new file mode 100644 index 0000000..ddd61a0 --- /dev/null +++ b/src/serde_derive/ser.rs.html @@ -0,0 +1,2645 @@ +ser.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+
+use proc_macro2::{Span, TokenStream};
+use syn::spanned::Spanned;
+use syn::{self, Ident, Index, Member};
+
+use bound;
+use dummy;
+use fragment::{Fragment, Match, Stmts};
+use internals::ast::{Container, Data, Field, Style, Variant};
+use internals::{attr, Ctxt, Derive};
+use pretend;
+
+pub fn expand_derive_serialize(input: &syn::DeriveInput) -> Result<TokenStream, Vec<syn::Error>> {
+    let ctxt = Ctxt::new();
+    let cont = match Container::from_ast(&ctxt, input, Derive::Serialize) {
+        Some(cont) => cont,
+        None => return Err(ctxt.check().unwrap_err()),
+    };
+    precondition(&ctxt, &cont);
+    ctxt.check()?;
+
+    let ident = &cont.ident;
+    let params = Parameters::new(&cont);
+    let (impl_generics, ty_generics, where_clause) = params.generics.split_for_impl();
+    let body = Stmts(serialize_body(&cont, &params));
+    let serde = cont.attrs.serde_path();
+
+    let impl_block = if let Some(remote) = cont.attrs.remote() {
+        let vis = &input.vis;
+        let used = pretend::pretend_used(&cont);
+        quote! {
+            impl #impl_generics #ident #ty_generics #where_clause {
+                #vis fn serialize<__S>(__self: &#remote #ty_generics, __serializer: __S) -> #serde::export::Result<__S::Ok, __S::Error>
+                where
+                    __S: #serde::Serializer,
+                {
+                    #used
+                    #body
+                }
+            }
+        }
+    } else {
+        quote! {
+            #[automatically_derived]
+            impl #impl_generics #serde::Serialize for #ident #ty_generics #where_clause {
+                fn serialize<__S>(&self, __serializer: __S) -> #serde::export::Result<__S::Ok, __S::Error>
+                where
+                    __S: #serde::Serializer,
+                {
+                    #body
+                }
+            }
+        }
+    };
+
+    Ok(dummy::wrap_in_const(
+        cont.attrs.custom_serde_path(),
+        "SERIALIZE",
+        ident,
+        impl_block,
+    ))
+}
+
+fn precondition(cx: &Ctxt, cont: &Container) {
+    match cont.attrs.identifier() {
+        attr::Identifier::No => {}
+        attr::Identifier::Field => {
+            cx.error_spanned_by(cont.original, "field identifiers cannot be serialized");
+        }
+        attr::Identifier::Variant => {
+            cx.error_spanned_by(cont.original, "variant identifiers cannot be serialized");
+        }
+    }
+}
+
+struct Parameters {
+    /// Variable holding the value being serialized. Either `self` for local
+    /// types or `__self` for remote types.
+    self_var: Ident,
+
+    /// Path to the type the impl is for. Either a single `Ident` for local
+    /// types or `some::remote::Ident` for remote types. Does not include
+    /// generic parameters.
+    this: syn::Path,
+
+    /// Generics including any explicit and inferred bounds for the impl.
+    generics: syn::Generics,
+
+    /// Type has a `serde(remote = "...")` attribute.
+    is_remote: bool,
+}
+
+impl Parameters {
+    fn new(cont: &Container) -> Self {
+        let is_remote = cont.attrs.remote().is_some();
+        let self_var = if is_remote {
+            Ident::new("__self", Span::call_site())
+        } else {
+            Ident::new("self", Span::call_site())
+        };
+
+        let this = match cont.attrs.remote() {
+            Some(remote) => remote.clone(),
+            None => cont.ident.clone().into(),
+        };
+
+        let generics = build_generics(cont);
+
+        Parameters {
+            self_var: self_var,
+            this: this,
+            generics: generics,
+            is_remote: is_remote,
+        }
+    }
+
+    /// Type name to use in error messages and `&'static str` arguments to
+    /// various Serializer methods.
+    fn type_name(&self) -> String {
+        self.this.segments.last().unwrap().ident.to_string()
+    }
+}
+
+// All the generics in the input, plus a bound `T: Serialize` for each generic
+// field type that will be serialized by us.
+fn build_generics(cont: &Container) -> syn::Generics {
+    let generics = bound::without_defaults(cont.generics);
+
+    let generics =
+        bound::with_where_predicates_from_fields(cont, &generics, attr::Field::ser_bound);
+
+    let generics =
+        bound::with_where_predicates_from_variants(cont, &generics, attr::Variant::ser_bound);
+
+    match cont.attrs.ser_bound() {
+        Some(predicates) => bound::with_where_predicates(&generics, predicates),
+        None => bound::with_bound(
+            cont,
+            &generics,
+            needs_serialize_bound,
+            &parse_quote!(_serde::Serialize),
+        ),
+    }
+}
+
+// Fields with a `skip_serializing` or `serialize_with` attribute, or which
+// belong to a variant with a 'skip_serializing` or `serialize_with` attribute,
+// are not serialized by us so we do not generate a bound. Fields with a `bound`
+// attribute specify their own bound so we do not generate one. All other fields
+// may need a `T: Serialize` bound where T is the type of the field.
+fn needs_serialize_bound(field: &attr::Field, variant: Option<&attr::Variant>) -> bool {
+    !field.skip_serializing()
+        && field.serialize_with().is_none()
+        && field.ser_bound().is_none()
+        && variant.map_or(true, |variant| {
+            !variant.skip_serializing()
+                && variant.serialize_with().is_none()
+                && variant.ser_bound().is_none()
+        })
+}
+
+fn serialize_body(cont: &Container, params: &Parameters) -> Fragment {
+    if cont.attrs.transparent() {
+        serialize_transparent(cont, params)
+    } else if let Some(type_into) = cont.attrs.type_into() {
+        serialize_into(params, type_into)
+    } else {
+        match &cont.data {
+            Data::Enum(variants) => serialize_enum(params, variants, &cont.attrs),
+            Data::Struct(Style::Struct, fields) => serialize_struct(params, fields, &cont.attrs),
+            Data::Struct(Style::Tuple, fields) => {
+                serialize_tuple_struct(params, fields, &cont.attrs)
+            }
+            Data::Struct(Style::Newtype, fields) => {
+                serialize_newtype_struct(params, &fields[0], &cont.attrs)
+            }
+            Data::Struct(Style::Unit, _) => serialize_unit_struct(&cont.attrs),
+        }
+    }
+}
+
+fn serialize_transparent(cont: &Container, params: &Parameters) -> Fragment {
+    let fields = match &cont.data {
+        Data::Struct(_, fields) => fields,
+        Data::Enum(_) => unreachable!(),
+    };
+
+    let self_var = &params.self_var;
+    let transparent_field = fields.iter().find(|f| f.attrs.transparent()).unwrap();
+    let member = &transparent_field.member;
+
+    let path = match transparent_field.attrs.serialize_with() {
+        Some(path) => quote!(#path),
+        None => {
+            let span = transparent_field.original.span();
+            quote_spanned!(span=> _serde::Serialize::serialize)
+        }
+    };
+
+    quote_block! {
+        #path(&#self_var.#member, __serializer)
+    }
+}
+
+fn serialize_into(params: &Parameters, type_into: &syn::Type) -> Fragment {
+    let self_var = &params.self_var;
+    quote_block! {
+        _serde::Serialize::serialize(
+            &_serde::export::Into::<#type_into>::into(_serde::export::Clone::clone(#self_var)),
+            __serializer)
+    }
+}
+
+fn serialize_unit_struct(cattrs: &attr::Container) -> Fragment {
+    let type_name = cattrs.name().serialize_name();
+
+    quote_expr! {
+        _serde::Serializer::serialize_unit_struct(__serializer, #type_name)
+    }
+}
+
+fn serialize_newtype_struct(
+    params: &Parameters,
+    field: &Field,
+    cattrs: &attr::Container,
+) -> Fragment {
+    let type_name = cattrs.name().serialize_name();
+
+    let mut field_expr = get_member(
+        params,
+        field,
+        &Member::Unnamed(Index {
+            index: 0,
+            span: Span::call_site(),
+        }),
+    );
+    if let Some(path) = field.attrs.serialize_with() {
+        field_expr = wrap_serialize_field_with(params, field.ty, path, &field_expr);
+    }
+
+    let span = field.original.span();
+    let func = quote_spanned!(span=> _serde::Serializer::serialize_newtype_struct);
+    quote_expr! {
+        #func(__serializer, #type_name, #field_expr)
+    }
+}
+
+fn serialize_tuple_struct(
+    params: &Parameters,
+    fields: &[Field],
+    cattrs: &attr::Container,
+) -> Fragment {
+    let serialize_stmts =
+        serialize_tuple_struct_visitor(fields, params, false, &TupleTrait::SerializeTupleStruct);
+
+    let type_name = cattrs.name().serialize_name();
+
+    let mut serialized_fields = fields
+        .iter()
+        .enumerate()
+        .filter(|(_, field)| !field.attrs.skip_serializing())
+        .peekable();
+
+    let let_mut = mut_if(serialized_fields.peek().is_some());
+
+    let len = serialized_fields
+        .map(|(i, field)| match field.attrs.skip_serializing_if() {
+            None => quote!(1),
+            Some(path) => {
+                let index = syn::Index {
+                    index: i as u32,
+                    span: Span::call_site(),
+                };
+                let field_expr = get_member(params, field, &Member::Unnamed(index));
+                quote!(if #path(#field_expr) { 0 } else { 1 })
+            }
+        })
+        .fold(quote!(0), |sum, expr| quote!(#sum + #expr));
+
+    quote_block! {
+        let #let_mut __serde_state = try!(_serde::Serializer::serialize_tuple_struct(__serializer, #type_name, #len));
+        #(#serialize_stmts)*
+        _serde::ser::SerializeTupleStruct::end(__serde_state)
+    }
+}
+
+fn serialize_struct(params: &Parameters, fields: &[Field], cattrs: &attr::Container) -> Fragment {
+    assert!(fields.len() as u64 <= u64::from(u32::max_value()));
+
+    if cattrs.has_flatten() {
+        serialize_struct_as_map(params, fields, cattrs)
+    } else {
+        serialize_struct_as_struct(params, fields, cattrs)
+    }
+}
+
+fn serialize_struct_tag_field(cattrs: &attr::Container, struct_trait: &StructTrait) -> TokenStream {
+    match cattrs.tag() {
+        attr::TagType::Internal { tag } => {
+            let type_name = cattrs.name().serialize_name();
+            let func = struct_trait.serialize_field(Span::call_site());
+            quote! {
+                try!(#func(&mut __serde_state, #tag, #type_name));
+            }
+        }
+        _ => quote! {},
+    }
+}
+
+fn serialize_struct_as_struct(
+    params: &Parameters,
+    fields: &[Field],
+    cattrs: &attr::Container,
+) -> Fragment {
+    let serialize_fields =
+        serialize_struct_visitor(fields, params, false, &StructTrait::SerializeStruct);
+
+    let type_name = cattrs.name().serialize_name();
+
+    let tag_field = serialize_struct_tag_field(cattrs, &StructTrait::SerializeStruct);
+    let tag_field_exists = !tag_field.is_empty();
+
+    let mut serialized_fields = fields
+        .iter()
+        .filter(|&field| !field.attrs.skip_serializing())
+        .peekable();
+
+    let let_mut = mut_if(serialized_fields.peek().is_some() || tag_field_exists);
+
+    let len = serialized_fields
+        .map(|field| match field.attrs.skip_serializing_if() {
+            None => quote!(1),
+            Some(path) => {
+                let field_expr = get_member(params, field, &field.member);
+                quote!(if #path(#field_expr) { 0 } else { 1 })
+            }
+        })
+        .fold(
+            quote!(#tag_field_exists as usize),
+            |sum, expr| quote!(#sum + #expr),
+        );
+
+    quote_block! {
+        let #let_mut __serde_state = try!(_serde::Serializer::serialize_struct(__serializer, #type_name, #len));
+        #tag_field
+        #(#serialize_fields)*
+        _serde::ser::SerializeStruct::end(__serde_state)
+    }
+}
+
+fn serialize_struct_as_map(
+    params: &Parameters,
+    fields: &[Field],
+    cattrs: &attr::Container,
+) -> Fragment {
+    let serialize_fields =
+        serialize_struct_visitor(fields, params, false, &StructTrait::SerializeMap);
+
+    let tag_field = serialize_struct_tag_field(cattrs, &StructTrait::SerializeMap);
+    let tag_field_exists = !tag_field.is_empty();
+
+    let mut serialized_fields = fields
+        .iter()
+        .filter(|&field| !field.attrs.skip_serializing())
+        .peekable();
+
+    let let_mut = mut_if(serialized_fields.peek().is_some() || tag_field_exists);
+
+    let len = if cattrs.has_flatten() {
+        quote!(_serde::export::None)
+    } else {
+        let len = serialized_fields
+            .map(|field| match field.attrs.skip_serializing_if() {
+                None => quote!(1),
+                Some(path) => {
+                    let field_expr = get_member(params, field, &field.member);
+                    quote!(if #path(#field_expr) { 0 } else { 1 })
+                }
+            })
+            .fold(
+                quote!(#tag_field_exists as usize),
+                |sum, expr| quote!(#sum + #expr),
+            );
+        quote!(_serde::export::Some(#len))
+    };
+
+    quote_block! {
+        let #let_mut __serde_state = try!(_serde::Serializer::serialize_map(__serializer, #len));
+        #tag_field
+        #(#serialize_fields)*
+        _serde::ser::SerializeMap::end(__serde_state)
+    }
+}
+
+fn serialize_enum(params: &Parameters, variants: &[Variant], cattrs: &attr::Container) -> Fragment {
+    assert!(variants.len() as u64 <= u64::from(u32::max_value()));
+
+    let self_var = &params.self_var;
+
+    let arms: Vec<_> = variants
+        .iter()
+        .enumerate()
+        .map(|(variant_index, variant)| {
+            serialize_variant(params, variant, variant_index as u32, cattrs)
+        })
+        .collect();
+
+    quote_expr! {
+        match *#self_var {
+            #(#arms)*
+        }
+    }
+}
+
+fn serialize_variant(
+    params: &Parameters,
+    variant: &Variant,
+    variant_index: u32,
+    cattrs: &attr::Container,
+) -> TokenStream {
+    let this = &params.this;
+    let variant_ident = &variant.ident;
+
+    if variant.attrs.skip_serializing() {
+        let skipped_msg = format!(
+            "the enum variant {}::{} cannot be serialized",
+            params.type_name(),
+            variant_ident
+        );
+        let skipped_err = quote! {
+            _serde::export::Err(_serde::ser::Error::custom(#skipped_msg))
+        };
+        let fields_pat = match variant.style {
+            Style::Unit => quote!(),
+            Style::Newtype | Style::Tuple => quote!((..)),
+            Style::Struct => quote!({ .. }),
+        };
+        quote! {
+            #this::#variant_ident #fields_pat => #skipped_err,
+        }
+    } else {
+        // variant wasn't skipped
+        let case = match variant.style {
+            Style::Unit => {
+                quote! {
+                    #this::#variant_ident
+                }
+            }
+            Style::Newtype => {
+                quote! {
+                    #this::#variant_ident(ref __field0)
+                }
+            }
+            Style::Tuple => {
+                let field_names = (0..variant.fields.len())
+                    .map(|i| Ident::new(&format!("__field{}", i), Span::call_site()));
+                quote! {
+                    #this::#variant_ident(#(ref #field_names),*)
+                }
+            }
+            Style::Struct => {
+                let members = variant.fields.iter().map(|f| &f.member);
+                quote! {
+                    #this::#variant_ident { #(ref #members),* }
+                }
+            }
+        };
+
+        let body = Match(match cattrs.tag() {
+            attr::TagType::External => {
+                serialize_externally_tagged_variant(params, variant, variant_index, cattrs)
+            }
+            attr::TagType::Internal { tag } => {
+                serialize_internally_tagged_variant(params, variant, cattrs, tag)
+            }
+            attr::TagType::Adjacent { tag, content } => {
+                serialize_adjacently_tagged_variant(params, variant, cattrs, tag, content)
+            }
+            attr::TagType::None => serialize_untagged_variant(params, variant, cattrs),
+        });
+
+        quote! {
+            #case => #body
+        }
+    }
+}
+
+fn serialize_externally_tagged_variant(
+    params: &Parameters,
+    variant: &Variant,
+    variant_index: u32,
+    cattrs: &attr::Container,
+) -> Fragment {
+    let type_name = cattrs.name().serialize_name();
+    let variant_name = variant.attrs.name().serialize_name();
+
+    if let Some(path) = variant.attrs.serialize_with() {
+        let ser = wrap_serialize_variant_with(params, path, variant);
+        return quote_expr! {
+            _serde::Serializer::serialize_newtype_variant(
+                __serializer,
+                #type_name,
+                #variant_index,
+                #variant_name,
+                #ser,
+            )
+        };
+    }
+
+    match effective_style(variant) {
+        Style::Unit => {
+            quote_expr! {
+                _serde::Serializer::serialize_unit_variant(
+                    __serializer,
+                    #type_name,
+                    #variant_index,
+                    #variant_name,
+                )
+            }
+        }
+        Style::Newtype => {
+            let field = &variant.fields[0];
+            let mut field_expr = quote!(__field0);
+            if let Some(path) = field.attrs.serialize_with() {
+                field_expr = wrap_serialize_field_with(params, field.ty, path, &field_expr);
+            }
+
+            let span = field.original.span();
+            let func = quote_spanned!(span=> _serde::Serializer::serialize_newtype_variant);
+            quote_expr! {
+                #func(
+                    __serializer,
+                    #type_name,
+                    #variant_index,
+                    #variant_name,
+                    #field_expr,
+                )
+            }
+        }
+        Style::Tuple => serialize_tuple_variant(
+            TupleVariant::ExternallyTagged {
+                type_name: type_name,
+                variant_index: variant_index,
+                variant_name: variant_name,
+            },
+            params,
+            &variant.fields,
+        ),
+        Style::Struct => serialize_struct_variant(
+            StructVariant::ExternallyTagged {
+                variant_index: variant_index,
+                variant_name: variant_name,
+            },
+            params,
+            &variant.fields,
+            &type_name,
+        ),
+    }
+}
+
+fn serialize_internally_tagged_variant(
+    params: &Parameters,
+    variant: &Variant,
+    cattrs: &attr::Container,
+    tag: &str,
+) -> Fragment {
+    let type_name = cattrs.name().serialize_name();
+    let variant_name = variant.attrs.name().serialize_name();
+
+    let enum_ident_str = params.type_name();
+    let variant_ident_str = variant.ident.to_string();
+
+    if let Some(path) = variant.attrs.serialize_with() {
+        let ser = wrap_serialize_variant_with(params, path, variant);
+        return quote_expr! {
+            _serde::private::ser::serialize_tagged_newtype(
+                __serializer,
+                #enum_ident_str,
+                #variant_ident_str,
+                #tag,
+                #variant_name,
+                #ser,
+            )
+        };
+    }
+
+    match effective_style(variant) {
+        Style::Unit => {
+            quote_block! {
+                let mut __struct = try!(_serde::Serializer::serialize_struct(
+                    __serializer, #type_name, 1));
+                try!(_serde::ser::SerializeStruct::serialize_field(
+                    &mut __struct, #tag, #variant_name));
+                _serde::ser::SerializeStruct::end(__struct)
+            }
+        }
+        Style::Newtype => {
+            let field = &variant.fields[0];
+            let mut field_expr = quote!(__field0);
+            if let Some(path) = field.attrs.serialize_with() {
+                field_expr = wrap_serialize_field_with(params, field.ty, path, &field_expr);
+            }
+
+            let span = field.original.span();
+            let func = quote_spanned!(span=> _serde::private::ser::serialize_tagged_newtype);
+            quote_expr! {
+                #func(
+                    __serializer,
+                    #enum_ident_str,
+                    #variant_ident_str,
+                    #tag,
+                    #variant_name,
+                    #field_expr,
+                )
+            }
+        }
+        Style::Struct => serialize_struct_variant(
+            StructVariant::InternallyTagged {
+                tag: tag,
+                variant_name: variant_name,
+            },
+            params,
+            &variant.fields,
+            &type_name,
+        ),
+        Style::Tuple => unreachable!("checked in serde_derive_internals"),
+    }
+}
+
+fn serialize_adjacently_tagged_variant(
+    params: &Parameters,
+    variant: &Variant,
+    cattrs: &attr::Container,
+    tag: &str,
+    content: &str,
+) -> Fragment {
+    let this = &params.this;
+    let type_name = cattrs.name().serialize_name();
+    let variant_name = variant.attrs.name().serialize_name();
+
+    let inner = Stmts(if let Some(path) = variant.attrs.serialize_with() {
+        let ser = wrap_serialize_variant_with(params, path, variant);
+        quote_expr! {
+            _serde::Serialize::serialize(#ser, __serializer)
+        }
+    } else {
+        match effective_style(variant) {
+            Style::Unit => {
+                return quote_block! {
+                    let mut __struct = try!(_serde::Serializer::serialize_struct(
+                        __serializer, #type_name, 1));
+                    try!(_serde::ser::SerializeStruct::serialize_field(
+                        &mut __struct, #tag, #variant_name));
+                    _serde::ser::SerializeStruct::end(__struct)
+                };
+            }
+            Style::Newtype => {
+                let field = &variant.fields[0];
+                let mut field_expr = quote!(__field0);
+                if let Some(path) = field.attrs.serialize_with() {
+                    field_expr = wrap_serialize_field_with(params, field.ty, path, &field_expr);
+                }
+
+                let span = field.original.span();
+                let func = quote_spanned!(span=> _serde::ser::SerializeStruct::serialize_field);
+                return quote_block! {
+                    let mut __struct = try!(_serde::Serializer::serialize_struct(
+                        __serializer, #type_name, 2));
+                    try!(_serde::ser::SerializeStruct::serialize_field(
+                        &mut __struct, #tag, #variant_name));
+                    try!(#func(
+                        &mut __struct, #content, #field_expr));
+                    _serde::ser::SerializeStruct::end(__struct)
+                };
+            }
+            Style::Tuple => {
+                serialize_tuple_variant(TupleVariant::Untagged, params, &variant.fields)
+            }
+            Style::Struct => serialize_struct_variant(
+                StructVariant::Untagged,
+                params,
+                &variant.fields,
+                &variant_name,
+            ),
+        }
+    });
+
+    let fields_ty = variant.fields.iter().map(|f| &f.ty);
+    let fields_ident: &Vec<_> = &match variant.style {
+        Style::Unit => {
+            if variant.attrs.serialize_with().is_some() {
+                vec![]
+            } else {
+                unreachable!()
+            }
+        }
+        Style::Newtype => vec![Member::Named(Ident::new("__field0", Span::call_site()))],
+        Style::Tuple => (0..variant.fields.len())
+            .map(|i| Member::Named(Ident::new(&format!("__field{}", i), Span::call_site())))
+            .collect(),
+        Style::Struct => variant.fields.iter().map(|f| f.member.clone()).collect(),
+    };
+
+    let (_, ty_generics, where_clause) = params.generics.split_for_impl();
+
+    let wrapper_generics = if fields_ident.is_empty() {
+        params.generics.clone()
+    } else {
+        bound::with_lifetime_bound(&params.generics, "'__a")
+    };
+    let (wrapper_impl_generics, wrapper_ty_generics, _) = wrapper_generics.split_for_impl();
+
+    quote_block! {
+        struct __AdjacentlyTagged #wrapper_generics #where_clause {
+            data: (#(&'__a #fields_ty,)*),
+            phantom: _serde::export::PhantomData<#this #ty_generics>,
+        }
+
+        impl #wrapper_impl_generics _serde::Serialize for __AdjacentlyTagged #wrapper_ty_generics #where_clause {
+            fn serialize<__S>(&self, __serializer: __S) -> _serde::export::Result<__S::Ok, __S::Error>
+            where
+                __S: _serde::Serializer,
+            {
+                // Elements that have skip_serializing will be unused.
+                #[allow(unused_variables)]
+                let (#(#fields_ident,)*) = self.data;
+                #inner
+            }
+        }
+
+        let mut __struct = try!(_serde::Serializer::serialize_struct(
+            __serializer, #type_name, 2));
+        try!(_serde::ser::SerializeStruct::serialize_field(
+            &mut __struct, #tag, #variant_name));
+        try!(_serde::ser::SerializeStruct::serialize_field(
+            &mut __struct, #content, &__AdjacentlyTagged {
+                data: (#(#fields_ident,)*),
+                phantom: _serde::export::PhantomData::<#this #ty_generics>,
+            }));
+        _serde::ser::SerializeStruct::end(__struct)
+    }
+}
+
+fn serialize_untagged_variant(
+    params: &Parameters,
+    variant: &Variant,
+    cattrs: &attr::Container,
+) -> Fragment {
+    if let Some(path) = variant.attrs.serialize_with() {
+        let ser = wrap_serialize_variant_with(params, path, variant);
+        return quote_expr! {
+            _serde::Serialize::serialize(#ser, __serializer)
+        };
+    }
+
+    match effective_style(variant) {
+        Style::Unit => {
+            quote_expr! {
+                _serde::Serializer::serialize_unit(__serializer)
+            }
+        }
+        Style::Newtype => {
+            let field = &variant.fields[0];
+            let mut field_expr = quote!(__field0);
+            if let Some(path) = field.attrs.serialize_with() {
+                field_expr = wrap_serialize_field_with(params, field.ty, path, &field_expr);
+            }
+
+            let span = field.original.span();
+            let func = quote_spanned!(span=> _serde::Serialize::serialize);
+            quote_expr! {
+                #func(#field_expr, __serializer)
+            }
+        }
+        Style::Tuple => serialize_tuple_variant(TupleVariant::Untagged, params, &variant.fields),
+        Style::Struct => {
+            let type_name = cattrs.name().serialize_name();
+            serialize_struct_variant(StructVariant::Untagged, params, &variant.fields, &type_name)
+        }
+    }
+}
+
+enum TupleVariant {
+    ExternallyTagged {
+        type_name: String,
+        variant_index: u32,
+        variant_name: String,
+    },
+    Untagged,
+}
+
+fn serialize_tuple_variant(
+    context: TupleVariant,
+    params: &Parameters,
+    fields: &[Field],
+) -> Fragment {
+    let tuple_trait = match context {
+        TupleVariant::ExternallyTagged { .. } => TupleTrait::SerializeTupleVariant,
+        TupleVariant::Untagged => TupleTrait::SerializeTuple,
+    };
+
+    let serialize_stmts = serialize_tuple_struct_visitor(fields, params, true, &tuple_trait);
+
+    let mut serialized_fields = fields
+        .iter()
+        .enumerate()
+        .filter(|(_, field)| !field.attrs.skip_serializing())
+        .peekable();
+
+    let let_mut = mut_if(serialized_fields.peek().is_some());
+
+    let len = serialized_fields
+        .map(|(i, field)| match field.attrs.skip_serializing_if() {
+            None => quote!(1),
+            Some(path) => {
+                let field_expr = Ident::new(&format!("__field{}", i), Span::call_site());
+                quote!(if #path(#field_expr) { 0 } else { 1 })
+            }
+        })
+        .fold(quote!(0), |sum, expr| quote!(#sum + #expr));
+
+    match context {
+        TupleVariant::ExternallyTagged {
+            type_name,
+            variant_index,
+            variant_name,
+        } => {
+            quote_block! {
+                let #let_mut __serde_state = try!(_serde::Serializer::serialize_tuple_variant(
+                    __serializer,
+                    #type_name,
+                    #variant_index,
+                    #variant_name,
+                    #len));
+                #(#serialize_stmts)*
+                _serde::ser::SerializeTupleVariant::end(__serde_state)
+            }
+        }
+        TupleVariant::Untagged => {
+            quote_block! {
+                let #let_mut __serde_state = try!(_serde::Serializer::serialize_tuple(
+                    __serializer,
+                    #len));
+                #(#serialize_stmts)*
+                _serde::ser::SerializeTuple::end(__serde_state)
+            }
+        }
+    }
+}
+
+enum StructVariant<'a> {
+    ExternallyTagged {
+        variant_index: u32,
+        variant_name: String,
+    },
+    InternallyTagged {
+        tag: &'a str,
+        variant_name: String,
+    },
+    Untagged,
+}
+
+fn serialize_struct_variant<'a>(
+    context: StructVariant<'a>,
+    params: &Parameters,
+    fields: &[Field],
+    name: &str,
+) -> Fragment {
+    if fields.iter().any(|field| field.attrs.flatten()) {
+        return serialize_struct_variant_with_flatten(context, params, fields, name);
+    }
+
+    let struct_trait = match context {
+        StructVariant::ExternallyTagged { .. } => (StructTrait::SerializeStructVariant),
+        StructVariant::InternallyTagged { .. } | StructVariant::Untagged => {
+            (StructTrait::SerializeStruct)
+        }
+    };
+
+    let serialize_fields = serialize_struct_visitor(fields, params, true, &struct_trait);
+
+    let mut serialized_fields = fields
+        .iter()
+        .filter(|&field| !field.attrs.skip_serializing())
+        .peekable();
+
+    let let_mut = mut_if(serialized_fields.peek().is_some());
+
+    let len = serialized_fields
+        .map(|field| {
+            let member = &field.member;
+
+            match field.attrs.skip_serializing_if() {
+                Some(path) => quote!(if #path(#member) { 0 } else { 1 }),
+                None => quote!(1),
+            }
+        })
+        .fold(quote!(0), |sum, expr| quote!(#sum + #expr));
+
+    match context {
+        StructVariant::ExternallyTagged {
+            variant_index,
+            variant_name,
+        } => {
+            quote_block! {
+                let #let_mut __serde_state = try!(_serde::Serializer::serialize_struct_variant(
+                    __serializer,
+                    #name,
+                    #variant_index,
+                    #variant_name,
+                    #len,
+                ));
+                #(#serialize_fields)*
+                _serde::ser::SerializeStructVariant::end(__serde_state)
+            }
+        }
+        StructVariant::InternallyTagged { tag, variant_name } => {
+            quote_block! {
+                let mut __serde_state = try!(_serde::Serializer::serialize_struct(
+                    __serializer,
+                    #name,
+                    #len + 1,
+                ));
+                try!(_serde::ser::SerializeStruct::serialize_field(
+                    &mut __serde_state,
+                    #tag,
+                    #variant_name,
+                ));
+                #(#serialize_fields)*
+                _serde::ser::SerializeStruct::end(__serde_state)
+            }
+        }
+        StructVariant::Untagged => {
+            quote_block! {
+                let #let_mut __serde_state = try!(_serde::Serializer::serialize_struct(
+                    __serializer,
+                    #name,
+                    #len,
+                ));
+                #(#serialize_fields)*
+                _serde::ser::SerializeStruct::end(__serde_state)
+            }
+        }
+    }
+}
+
+fn serialize_struct_variant_with_flatten<'a>(
+    context: StructVariant<'a>,
+    params: &Parameters,
+    fields: &[Field],
+    name: &str,
+) -> Fragment {
+    let struct_trait = StructTrait::SerializeMap;
+    let serialize_fields = serialize_struct_visitor(fields, params, true, &struct_trait);
+
+    let mut serialized_fields = fields
+        .iter()
+        .filter(|&field| !field.attrs.skip_serializing())
+        .peekable();
+
+    let let_mut = mut_if(serialized_fields.peek().is_some());
+
+    match context {
+        StructVariant::ExternallyTagged {
+            variant_index,
+            variant_name,
+        } => {
+            let this = &params.this;
+            let fields_ty = fields.iter().map(|f| &f.ty);
+            let members = &fields.iter().map(|f| &f.member).collect::<Vec<_>>();
+
+            let (_, ty_generics, where_clause) = params.generics.split_for_impl();
+            let wrapper_generics = bound::with_lifetime_bound(&params.generics, "'__a");
+            let (wrapper_impl_generics, wrapper_ty_generics, _) = wrapper_generics.split_for_impl();
+
+            quote_block! {
+                struct __EnumFlatten #wrapper_generics #where_clause {
+                    data: (#(&'__a #fields_ty,)*),
+                    phantom: _serde::export::PhantomData<#this #ty_generics>,
+                }
+
+                impl #wrapper_impl_generics _serde::Serialize for __EnumFlatten #wrapper_ty_generics #where_clause {
+                    fn serialize<__S>(&self, __serializer: __S) -> _serde::export::Result<__S::Ok, __S::Error>
+                    where
+                        __S: _serde::Serializer,
+                    {
+                        let (#(#members,)*) = self.data;
+                        let #let_mut __serde_state = try!(_serde::Serializer::serialize_map(
+                            __serializer,
+                            _serde::export::None));
+                        #(#serialize_fields)*
+                        _serde::ser::SerializeMap::end(__serde_state)
+                    }
+                }
+
+                _serde::Serializer::serialize_newtype_variant(
+                    __serializer,
+                    #name,
+                    #variant_index,
+                    #variant_name,
+                    &__EnumFlatten {
+                        data: (#(#members,)*),
+                        phantom: _serde::export::PhantomData::<#this #ty_generics>,
+                    })
+            }
+        }
+        StructVariant::InternallyTagged { tag, variant_name } => {
+            quote_block! {
+                let #let_mut __serde_state = try!(_serde::Serializer::serialize_map(
+                    __serializer,
+                    _serde::export::None));
+                try!(_serde::ser::SerializeMap::serialize_entry(
+                    &mut __serde_state,
+                    #tag,
+                    #variant_name,
+                ));
+                #(#serialize_fields)*
+                _serde::ser::SerializeMap::end(__serde_state)
+            }
+        }
+        StructVariant::Untagged => {
+            quote_block! {
+                let #let_mut __serde_state = try!(_serde::Serializer::serialize_map(
+                    __serializer,
+                    _serde::export::None));
+                #(#serialize_fields)*
+                _serde::ser::SerializeMap::end(__serde_state)
+            }
+        }
+    }
+}
+
+fn serialize_tuple_struct_visitor(
+    fields: &[Field],
+    params: &Parameters,
+    is_enum: bool,
+    tuple_trait: &TupleTrait,
+) -> Vec<TokenStream> {
+    fields
+        .iter()
+        .enumerate()
+        .filter(|(_, field)| !field.attrs.skip_serializing())
+        .map(|(i, field)| {
+            let mut field_expr = if is_enum {
+                let id = Ident::new(&format!("__field{}", i), Span::call_site());
+                quote!(#id)
+            } else {
+                get_member(
+                    params,
+                    field,
+                    &Member::Unnamed(Index {
+                        index: i as u32,
+                        span: Span::call_site(),
+                    }),
+                )
+            };
+
+            let skip = field
+                .attrs
+                .skip_serializing_if()
+                .map(|path| quote!(#path(#field_expr)));
+
+            if let Some(path) = field.attrs.serialize_with() {
+                field_expr = wrap_serialize_field_with(params, field.ty, path, &field_expr);
+            }
+
+            let span = field.original.span();
+            let func = tuple_trait.serialize_element(span);
+            let ser = quote! {
+                try!(#func(&mut __serde_state, #field_expr));
+            };
+
+            match skip {
+                None => ser,
+                Some(skip) => quote!(if !#skip { #ser }),
+            }
+        })
+        .collect()
+}
+
+fn serialize_struct_visitor(
+    fields: &[Field],
+    params: &Parameters,
+    is_enum: bool,
+    struct_trait: &StructTrait,
+) -> Vec<TokenStream> {
+    fields
+        .iter()
+        .filter(|&field| !field.attrs.skip_serializing())
+        .map(|field| {
+            let member = &field.member;
+
+            let mut field_expr = if is_enum {
+                quote!(#member)
+            } else {
+                get_member(params, field, &member)
+            };
+
+            let key_expr = field.attrs.name().serialize_name();
+
+            let skip = field
+                .attrs
+                .skip_serializing_if()
+                .map(|path| quote!(#path(#field_expr)));
+
+            if let Some(path) = field.attrs.serialize_with() {
+                field_expr = wrap_serialize_field_with(params, field.ty, path, &field_expr);
+            }
+
+            let span = field.original.span();
+            let ser = if field.attrs.flatten() {
+                let func = quote_spanned!(span=> _serde::Serialize::serialize);
+                quote! {
+                    try!(#func(&#field_expr, _serde::private::ser::FlatMapSerializer(&mut __serde_state)));
+                }
+            } else {
+                let func = struct_trait.serialize_field(span);
+                quote! {
+                    try!(#func(&mut __serde_state, #key_expr, #field_expr));
+                }
+            };
+
+            match skip {
+                None => ser,
+                Some(skip) => {
+                    if let Some(skip_func) = struct_trait.skip_field(span) {
+                        quote! {
+                            if !#skip {
+                                #ser
+                            } else {
+                                try!(#skip_func(&mut __serde_state, #key_expr));
+                            }
+                        }
+                    } else {
+                        quote! {
+                            if !#skip {
+                                #ser
+                            }
+                        }
+                    }
+                }
+            }
+        })
+        .collect()
+}
+
+fn wrap_serialize_field_with(
+    params: &Parameters,
+    field_ty: &syn::Type,
+    serialize_with: &syn::ExprPath,
+    field_expr: &TokenStream,
+) -> TokenStream {
+    wrap_serialize_with(params, serialize_with, &[field_ty], &[quote!(#field_expr)])
+}
+
+fn wrap_serialize_variant_with(
+    params: &Parameters,
+    serialize_with: &syn::ExprPath,
+    variant: &Variant,
+) -> TokenStream {
+    let field_tys: Vec<_> = variant.fields.iter().map(|field| field.ty).collect();
+    let field_exprs: Vec<_> = variant
+        .fields
+        .iter()
+        .map(|field| {
+            let id = match &field.member {
+                Member::Named(ident) => ident.clone(),
+                Member::Unnamed(member) => {
+                    Ident::new(&format!("__field{}", member.index), Span::call_site())
+                }
+            };
+            quote!(#id)
+        })
+        .collect();
+    wrap_serialize_with(
+        params,
+        serialize_with,
+        field_tys.as_slice(),
+        field_exprs.as_slice(),
+    )
+}
+
+fn wrap_serialize_with(
+    params: &Parameters,
+    serialize_with: &syn::ExprPath,
+    field_tys: &[&syn::Type],
+    field_exprs: &[TokenStream],
+) -> TokenStream {
+    let this = &params.this;
+    let (_, ty_generics, where_clause) = params.generics.split_for_impl();
+
+    let wrapper_generics = if field_exprs.is_empty() {
+        params.generics.clone()
+    } else {
+        bound::with_lifetime_bound(&params.generics, "'__a")
+    };
+    let (wrapper_impl_generics, wrapper_ty_generics, _) = wrapper_generics.split_for_impl();
+
+    let field_access = (0..field_exprs.len()).map(|n| {
+        Member::Unnamed(Index {
+            index: n as u32,
+            span: Span::call_site(),
+        })
+    });
+
+    quote!({
+        struct __SerializeWith #wrapper_impl_generics #where_clause {
+            values: (#(&'__a #field_tys, )*),
+            phantom: _serde::export::PhantomData<#this #ty_generics>,
+        }
+
+        impl #wrapper_impl_generics _serde::Serialize for __SerializeWith #wrapper_ty_generics #where_clause {
+            fn serialize<__S>(&self, __s: __S) -> _serde::export::Result<__S::Ok, __S::Error>
+            where
+                __S: _serde::Serializer,
+            {
+                #serialize_with(#(self.values.#field_access, )* __s)
+            }
+        }
+
+        &__SerializeWith {
+            values: (#(#field_exprs, )*),
+            phantom: _serde::export::PhantomData::<#this #ty_generics>,
+        }
+    })
+}
+
+// Serialization of an empty struct results in code like:
+//
+//     let mut __serde_state = try!(serializer.serialize_struct("S", 0));
+//     _serde::ser::SerializeStruct::end(__serde_state)
+//
+// where we want to omit the `mut` to avoid a warning.
+fn mut_if(is_mut: bool) -> Option<TokenStream> {
+    if is_mut {
+        Some(quote!(mut))
+    } else {
+        None
+    }
+}
+
+fn get_member(params: &Parameters, field: &Field, member: &Member) -> TokenStream {
+    let self_var = &params.self_var;
+    match (params.is_remote, field.attrs.getter()) {
+        (false, None) => quote!(&#self_var.#member),
+        (true, None) => {
+            let inner = quote!(&#self_var.#member);
+            let ty = field.ty;
+            quote!(_serde::private::ser::constrain::<#ty>(#inner))
+        }
+        (true, Some(getter)) => {
+            let ty = field.ty;
+            quote!(_serde::private::ser::constrain::<#ty>(&#getter(#self_var)))
+        }
+        (false, Some(_)) => {
+            unreachable!("getter is only allowed for remote impls");
+        }
+    }
+}
+
+fn effective_style(variant: &Variant) -> Style {
+    match variant.style {
+        Style::Newtype if variant.fields[0].attrs.skip_serializing() => Style::Unit,
+        other => other,
+    }
+}
+
+enum StructTrait {
+    SerializeMap,
+    SerializeStruct,
+    SerializeStructVariant,
+}
+
+impl StructTrait {
+    fn serialize_field(&self, span: Span) -> TokenStream {
+        match *self {
+            StructTrait::SerializeMap => {
+                quote_spanned!(span=> _serde::ser::SerializeMap::serialize_entry)
+            }
+            StructTrait::SerializeStruct => {
+                quote_spanned!(span=> _serde::ser::SerializeStruct::serialize_field)
+            }
+            StructTrait::SerializeStructVariant => {
+                quote_spanned!(span=> _serde::ser::SerializeStructVariant::serialize_field)
+            }
+        }
+    }
+
+    fn skip_field(&self, span: Span) -> Option<TokenStream> {
+        match *self {
+            StructTrait::SerializeMap => None,
+            StructTrait::SerializeStruct => {
+                Some(quote_spanned!(span=> _serde::ser::SerializeStruct::skip_field))
+            }
+            StructTrait::SerializeStructVariant => {
+                Some(quote_spanned!(span=> _serde::ser::SerializeStructVariant::skip_field))
+            }
+        }
+    }
+}
+
+enum TupleTrait {
+    SerializeTuple,
+    SerializeTupleStruct,
+    SerializeTupleVariant,
+}
+
+impl TupleTrait {
+    fn serialize_element(&self, span: Span) -> TokenStream {
+        match *self {
+            TupleTrait::SerializeTuple => {
+                quote_spanned!(span=> _serde::ser::SerializeTuple::serialize_element)
+            }
+            TupleTrait::SerializeTupleStruct => {
+                quote_spanned!(span=> _serde::ser::SerializeTupleStruct::serialize_field)
+            }
+            TupleTrait::SerializeTupleVariant => {
+                quote_spanned!(span=> _serde::ser::SerializeTupleVariant::serialize_field)
+            }
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/serde_derive/try.rs.html b/src/serde_derive/try.rs.html new file mode 100644 index 0000000..48fd17d --- /dev/null +++ b/src/serde_derive/try.rs.html @@ -0,0 +1,51 @@ +try.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
+use proc_macro2::{Punct, Spacing, TokenStream};
+
+// None of our generated code requires the `From::from` error conversion
+// performed by the standard library's `try!` macro. With this simplified macro
+// we see a significant improvement in type checking and borrow checking time of
+// the generated code and a slight improvement in binary size.
+pub fn replacement() -> TokenStream {
+    // Cannot pass `$expr` to `quote!` prior to Rust 1.17.0 so interpolate it.
+    let dollar = Punct::new('$', Spacing::Alone);
+
+    quote! {
+        #[allow(unused_macros)]
+        macro_rules! try {
+            (#dollar __expr:expr) => {
+                match #dollar __expr {
+                    _serde::export::Ok(__val) => __val,
+                    _serde::export::Err(__err) => {
+                        return _serde::export::Err(__err);
+                    }
+                }
+            }
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/attr.rs.html b/src/syn/attr.rs.html new file mode 100644 index 0000000..291c81d --- /dev/null +++ b/src/syn/attr.rs.html @@ -0,0 +1,1375 @@ +attr.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+
+use super::*;
+use crate::punctuated::Punctuated;
+
+use std::iter;
+
+use proc_macro2::TokenStream;
+
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, ParseBuffer, ParseStream, Parser, Result};
+#[cfg(feature = "parsing")]
+use crate::punctuated::Pair;
+#[cfg(feature = "extra-traits")]
+use crate::tt::TokenStreamHelper;
+#[cfg(feature = "extra-traits")]
+use std::hash::{Hash, Hasher};
+
+ast_struct! {
+    /// An attribute like `#[repr(transparent)]`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    ///
+    /// <br>
+    ///
+    /// # Syntax
+    ///
+    /// Rust has six types of attributes.
+    ///
+    /// - Outer attributes like `#[repr(transparent)]`. These appear outside or
+    ///   in front of the item they describe.
+    /// - Inner attributes like `#![feature(proc_macro)]`. These appear inside
+    ///   of the item they describe, usually a module.
+    /// - Outer doc comments like `/// # Example`.
+    /// - Inner doc comments like `//! Please file an issue`.
+    /// - Outer block comments `/** # Example */`.
+    /// - Inner block comments `/*! Please file an issue */`.
+    ///
+    /// The `style` field of type `AttrStyle` distinguishes whether an attribute
+    /// is outer or inner. Doc comments and block comments are promoted to
+    /// attributes, as this is how they are processed by the compiler and by
+    /// `macro_rules!` macros.
+    ///
+    /// The `path` field gives the possibly colon-delimited path against which
+    /// the attribute is resolved. It is equal to `"doc"` for desugared doc
+    /// comments. The `tokens` field contains the rest of the attribute body as
+    /// tokens.
+    ///
+    /// ```text
+    /// #[derive(Copy)]      #[crate::precondition x < 5]
+    ///   ^^^^^^~~~~~~         ^^^^^^^^^^^^^^^^^^^ ~~~~~
+    ///   path  tokens                 path        tokens
+    /// ```
+    ///
+    /// <br>
+    ///
+    /// # Parsing from tokens to Attribute
+    ///
+    /// This type does not implement the [`Parse`] trait and thus cannot be
+    /// parsed directly by [`ParseStream::parse`]. Instead use
+    /// [`ParseStream::call`] with one of the two parser functions
+    /// [`Attribute::parse_outer`] or [`Attribute::parse_inner`] depending on
+    /// which you intend to parse.
+    ///
+    /// [`Parse`]: parse::Parse
+    /// [`ParseStream::parse`]: parse::ParseBuffer::parse
+    /// [`ParseStream::call`]: parse::ParseBuffer::call
+    ///
+    /// ```
+    /// use syn::{Attribute, Ident, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Parses a unit struct with attributes.
+    /// //
+    /// //     #[path = "s.tmpl"]
+    /// //     struct S;
+    /// struct UnitStruct {
+    ///     attrs: Vec<Attribute>,
+    ///     struct_token: Token![struct],
+    ///     name: Ident,
+    ///     semi_token: Token![;],
+    /// }
+    ///
+    /// impl Parse for UnitStruct {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         Ok(UnitStruct {
+    ///             attrs: input.call(Attribute::parse_outer)?,
+    ///             struct_token: input.parse()?,
+    ///             name: input.parse()?,
+    ///             semi_token: input.parse()?,
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    ///
+    /// <p><br></p>
+    ///
+    /// # Parsing from Attribute to structured arguments
+    ///
+    /// The grammar of attributes in Rust is very flexible, which makes the
+    /// syntax tree not that useful on its own. In particular, arguments of the
+    /// attribute are held in an arbitrary `tokens: TokenStream`. Macros are
+    /// expected to check the `path` of the attribute, decide whether they
+    /// recognize it, and then parse the remaining tokens according to whatever
+    /// grammar they wish to require for that kind of attribute.
+    ///
+    /// If the attribute you are parsing is expected to conform to the
+    /// conventional structured form of attribute, use [`parse_meta()`] to
+    /// obtain that structured representation. If the attribute follows some
+    /// other grammar of its own, use [`parse_args()`] to parse that into the
+    /// expected data structure.
+    ///
+    /// [`parse_meta()`]: Attribute::parse_meta
+    /// [`parse_args()`]: Attribute::parse_args
+    ///
+    /// <p><br></p>
+    ///
+    /// # Doc comments
+    ///
+    /// The compiler transforms doc comments, such as `/// comment` and `/*!
+    /// comment */`, into attributes before macros are expanded. Each comment is
+    /// expanded into an attribute of the form `#[doc = r"comment"]`.
+    ///
+    /// As an example, the following `mod` items are expanded identically:
+    ///
+    /// ```
+    /// # use syn::{ItemMod, parse_quote};
+    /// let doc: ItemMod = parse_quote! {
+    ///     /// Single line doc comments
+    ///     /// We write so many!
+    ///     /**
+    ///      * Multi-line comments...
+    ///      * May span many lines
+    ///      */
+    ///     mod example {
+    ///         //! Of course, they can be inner too
+    ///         /*! And fit in a single line */
+    ///     }
+    /// };
+    /// let attr: ItemMod = parse_quote! {
+    ///     #[doc = r" Single line doc comments"]
+    ///     #[doc = r" We write so many!"]
+    ///     #[doc = r" Multi-line comments...
+    ///  May span many lines"]
+    ///     mod example {
+    ///         #![doc = r" Of course, they can be inner too"]
+    ///         #![doc = r" And fit in a single line "]
+    ///     }
+    /// };
+    /// assert_eq!(doc, attr);
+    /// ```
+    pub struct Attribute #manual_extra_traits {
+        pub pound_token: Token![#],
+        pub style: AttrStyle,
+        pub bracket_token: token::Bracket,
+        pub path: Path,
+        pub tokens: TokenStream,
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+impl Eq for Attribute {}
+
+#[cfg(feature = "extra-traits")]
+impl PartialEq for Attribute {
+    fn eq(&self, other: &Self) -> bool {
+        self.style == other.style
+            && self.pound_token == other.pound_token
+            && self.bracket_token == other.bracket_token
+            && self.path == other.path
+            && TokenStreamHelper(&self.tokens) == TokenStreamHelper(&other.tokens)
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+impl Hash for Attribute {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.style.hash(state);
+        self.pound_token.hash(state);
+        self.bracket_token.hash(state);
+        self.path.hash(state);
+        TokenStreamHelper(&self.tokens).hash(state);
+    }
+}
+
+impl Attribute {
+    /// Parses the content of the attribute, consisting of the path and tokens,
+    /// as a [`Meta`] if possible.
+    ///
+    /// *This function is available if Syn is built with the `"parsing"`
+    /// feature.*
+    #[cfg(feature = "parsing")]
+    pub fn parse_meta(&self) -> Result<Meta> {
+        fn clone_ident_segment(segment: &PathSegment) -> PathSegment {
+            PathSegment {
+                ident: segment.ident.clone(),
+                arguments: PathArguments::None,
+            }
+        }
+
+        let path = Path {
+            leading_colon: self
+                .path
+                .leading_colon
+                .as_ref()
+                .map(|colon| Token![::](colon.spans)),
+            segments: self
+                .path
+                .segments
+                .pairs()
+                .map(|pair| match pair {
+                    Pair::Punctuated(seg, punct) => {
+                        Pair::Punctuated(clone_ident_segment(seg), Token![::](punct.spans))
+                    }
+                    Pair::End(seg) => Pair::End(clone_ident_segment(seg)),
+                })
+                .collect(),
+        };
+
+        let parser = |input: ParseStream| parsing::parse_meta_after_path(path, input);
+        parse::Parser::parse2(parser, self.tokens.clone())
+    }
+
+    /// Parse the arguments to the attribute as a syntax tree.
+    ///
+    /// This is similar to `syn::parse2::<T>(attr.tokens)` except that:
+    ///
+    /// - the surrounding delimiters are *not* included in the input to the
+    ///   parser; and
+    /// - the error message has a more useful span when `tokens` is empty.
+    ///
+    /// ```text
+    /// #[my_attr(value < 5)]
+    ///           ^^^^^^^^^ what gets parsed
+    /// ```
+    ///
+    /// *This function is available if Syn is built with the `"parsing"`
+    /// feature.*
+    #[cfg(feature = "parsing")]
+    pub fn parse_args<T: Parse>(&self) -> Result<T> {
+        self.parse_args_with(T::parse)
+    }
+
+    /// Parse the arguments to the attribute using the given parser.
+    ///
+    /// *This function is available if Syn is built with the `"parsing"`
+    /// feature.*
+    #[cfg(feature = "parsing")]
+    pub fn parse_args_with<F: Parser>(&self, parser: F) -> Result<F::Output> {
+        let parser = |input: ParseStream| {
+            let args = enter_args(self, input)?;
+            parse::parse_stream(parser, &args)
+        };
+        parser.parse2(self.tokens.clone())
+    }
+
+    /// Parses zero or more outer attributes from the stream.
+    ///
+    /// *This function is available if Syn is built with the `"parsing"`
+    /// feature.*
+    #[cfg(feature = "parsing")]
+    pub fn parse_outer(input: ParseStream) -> Result<Vec<Self>> {
+        let mut attrs = Vec::new();
+        while input.peek(Token![#]) {
+            attrs.push(input.call(parsing::single_parse_outer)?);
+        }
+        Ok(attrs)
+    }
+
+    /// Parses zero or more inner attributes from the stream.
+    ///
+    /// *This function is available if Syn is built with the `"parsing"`
+    /// feature.*
+    #[cfg(feature = "parsing")]
+    pub fn parse_inner(input: ParseStream) -> Result<Vec<Self>> {
+        let mut attrs = Vec::new();
+        while input.peek(Token![#]) && input.peek2(Token![!]) {
+            attrs.push(input.call(parsing::single_parse_inner)?);
+        }
+        Ok(attrs)
+    }
+}
+
+#[cfg(feature = "parsing")]
+fn expected_parentheses(attr: &Attribute) -> String {
+    let style = match attr.style {
+        AttrStyle::Outer => "#",
+        AttrStyle::Inner(_) => "#!",
+    };
+
+    let mut path = String::new();
+    for segment in &attr.path.segments {
+        if !path.is_empty() || attr.path.leading_colon.is_some() {
+            path += "::";
+        }
+        path += &segment.ident.to_string();
+    }
+
+    format!("{}[{}(...)]", style, path)
+}
+
+#[cfg(feature = "parsing")]
+fn enter_args<'a>(attr: &Attribute, input: ParseStream<'a>) -> Result<ParseBuffer<'a>> {
+    if input.is_empty() {
+        let expected = expected_parentheses(attr);
+        let msg = format!("expected attribute arguments in parentheses: {}", expected);
+        return Err(crate::error::new2(
+            attr.pound_token.span,
+            attr.bracket_token.span,
+            msg,
+        ));
+    } else if input.peek(Token![=]) {
+        let expected = expected_parentheses(attr);
+        let msg = format!("expected parentheses: {}", expected);
+        return Err(input.error(msg));
+    };
+
+    let content;
+    if input.peek(token::Paren) {
+        parenthesized!(content in input);
+    } else if input.peek(token::Bracket) {
+        bracketed!(content in input);
+    } else if input.peek(token::Brace) {
+        braced!(content in input);
+    } else {
+        return Err(input.error("unexpected token in attribute arguments"));
+    }
+
+    if input.is_empty() {
+        Ok(content)
+    } else {
+        Err(input.error("unexpected token in attribute arguments"))
+    }
+}
+
+ast_enum! {
+    /// Distinguishes between attributes that decorate an item and attributes
+    /// that are contained within an item.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    ///
+    /// # Outer attributes
+    ///
+    /// - `#[repr(transparent)]`
+    /// - `/// # Example`
+    /// - `/** Please file an issue */`
+    ///
+    /// # Inner attributes
+    ///
+    /// - `#![feature(proc_macro)]`
+    /// - `//! # Example`
+    /// - `/*! Please file an issue */`
+    #[cfg_attr(feature = "clone-impls", derive(Copy))]
+    pub enum AttrStyle {
+        Outer,
+        Inner(Token![!]),
+    }
+}
+
+ast_enum_of_structs! {
+    /// Content of a compile-time structured attribute.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    ///
+    /// ## Path
+    ///
+    /// A meta path is like the `test` in `#[test]`.
+    ///
+    /// ## List
+    ///
+    /// A meta list is like the `derive(Copy)` in `#[derive(Copy)]`.
+    ///
+    /// ## NameValue
+    ///
+    /// A name-value meta is like the `path = "..."` in `#[path =
+    /// "sys/windows.rs"]`.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums
+    //
+    // TODO: change syntax-tree-enum link to an intra rustdoc link, currently
+    // blocked on https://github.com/rust-lang/rust/issues/62833
+    pub enum Meta {
+        Path(Path),
+
+        /// A structured list within an attribute, like `derive(Copy, Clone)`.
+        List(MetaList),
+
+        /// A name-value pair within an attribute, like `feature = "nightly"`.
+        NameValue(MetaNameValue),
+    }
+}
+
+ast_struct! {
+    /// A structured list within an attribute, like `derive(Copy, Clone)`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct MetaList {
+        pub path: Path,
+        pub paren_token: token::Paren,
+        pub nested: Punctuated<NestedMeta, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A name-value pair within an attribute, like `feature = "nightly"`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct MetaNameValue {
+        pub path: Path,
+        pub eq_token: Token![=],
+        pub lit: Lit,
+    }
+}
+
+impl Meta {
+    /// Returns the identifier that begins this structured meta item.
+    ///
+    /// For example this would return the `test` in `#[test]`, the `derive` in
+    /// `#[derive(Copy)]`, and the `path` in `#[path = "sys/windows.rs"]`.
+    pub fn path(&self) -> &Path {
+        match self {
+            Meta::Path(path) => path,
+            Meta::List(meta) => &meta.path,
+            Meta::NameValue(meta) => &meta.path,
+        }
+    }
+}
+
+ast_enum_of_structs! {
+    /// Element of a compile-time attribute list.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub enum NestedMeta {
+        /// A structured meta item, like the `Copy` in `#[derive(Copy)]` which
+        /// would be a nested `Meta::Path`.
+        Meta(Meta),
+
+        /// A Rust literal, like the `"new_name"` in `#[rename("new_name")]`.
+        Lit(Lit),
+    }
+}
+
+/// Conventional argument type associated with an invocation of an attribute
+/// macro.
+///
+/// For example if we are developing an attribute macro that is intended to be
+/// invoked on function items as follows:
+///
+/// ```
+/// # const IGNORE: &str = stringify! {
+/// #[my_attribute(path = "/v1/refresh")]
+/// # };
+/// pub fn refresh() {
+///     /* ... */
+/// }
+/// ```
+///
+/// The implementation of this macro would want to parse its attribute arguments
+/// as type `AttributeArgs`.
+///
+/// ```
+/// extern crate proc_macro;
+///
+/// use proc_macro::TokenStream;
+/// use syn::{parse_macro_input, AttributeArgs, ItemFn};
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro_attribute]
+/// # };
+/// pub fn my_attribute(args: TokenStream, input: TokenStream) -> TokenStream {
+///     let args = parse_macro_input!(args as AttributeArgs);
+///     let input = parse_macro_input!(input as ItemFn);
+///
+///     /* ... */
+/// #   "".parse().unwrap()
+/// }
+/// ```
+pub type AttributeArgs = Vec<NestedMeta>;
+
+pub trait FilterAttrs<'a> {
+    type Ret: Iterator<Item = &'a Attribute>;
+
+    fn outer(self) -> Self::Ret;
+    fn inner(self) -> Self::Ret;
+}
+
+impl<'a, T> FilterAttrs<'a> for T
+where
+    T: IntoIterator<Item = &'a Attribute>,
+{
+    type Ret = iter::Filter<T::IntoIter, fn(&&Attribute) -> bool>;
+
+    fn outer(self) -> Self::Ret {
+        fn is_outer(attr: &&Attribute) -> bool {
+            match attr.style {
+                AttrStyle::Outer => true,
+                _ => false,
+            }
+        }
+        self.into_iter().filter(is_outer)
+    }
+
+    fn inner(self) -> Self::Ret {
+        fn is_inner(attr: &&Attribute) -> bool {
+            match attr.style {
+                AttrStyle::Inner(_) => true,
+                _ => false,
+            }
+        }
+        self.into_iter().filter(is_inner)
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub mod parsing {
+    use super::*;
+
+    use crate::ext::IdentExt;
+    use crate::parse::{Parse, ParseStream, Result};
+    #[cfg(feature = "full")]
+    use crate::private;
+
+    pub fn single_parse_inner(input: ParseStream) -> Result<Attribute> {
+        let content;
+        Ok(Attribute {
+            pound_token: input.parse()?,
+            style: AttrStyle::Inner(input.parse()?),
+            bracket_token: bracketed!(content in input),
+            path: content.call(Path::parse_mod_style)?,
+            tokens: content.parse()?,
+        })
+    }
+
+    pub fn single_parse_outer(input: ParseStream) -> Result<Attribute> {
+        let content;
+        Ok(Attribute {
+            pound_token: input.parse()?,
+            style: AttrStyle::Outer,
+            bracket_token: bracketed!(content in input),
+            path: content.call(Path::parse_mod_style)?,
+            tokens: content.parse()?,
+        })
+    }
+
+    #[cfg(feature = "full")]
+    impl private {
+        pub fn attrs(outer: Vec<Attribute>, inner: Vec<Attribute>) -> Vec<Attribute> {
+            let mut attrs = outer;
+            attrs.extend(inner);
+            attrs
+        }
+    }
+
+    // Like Path::parse_mod_style but accepts keywords in the path.
+    fn parse_meta_path(input: ParseStream) -> Result<Path> {
+        Ok(Path {
+            leading_colon: input.parse()?,
+            segments: {
+                let mut segments = Punctuated::new();
+                while input.peek(Ident::peek_any) {
+                    let ident = Ident::parse_any(input)?;
+                    segments.push_value(PathSegment::from(ident));
+                    if !input.peek(Token![::]) {
+                        break;
+                    }
+                    let punct = input.parse()?;
+                    segments.push_punct(punct);
+                }
+                if segments.is_empty() {
+                    return Err(input.error("expected path"));
+                } else if segments.trailing_punct() {
+                    return Err(input.error("expected path segment"));
+                }
+                segments
+            },
+        })
+    }
+
+    impl Parse for Meta {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let path = input.call(parse_meta_path)?;
+            parse_meta_after_path(path, input)
+        }
+    }
+
+    impl Parse for MetaList {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let path = input.call(parse_meta_path)?;
+            parse_meta_list_after_path(path, input)
+        }
+    }
+
+    impl Parse for MetaNameValue {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let path = input.call(parse_meta_path)?;
+            parse_meta_name_value_after_path(path, input)
+        }
+    }
+
+    impl Parse for NestedMeta {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Lit) && !(input.peek(LitBool) && input.peek2(Token![=])) {
+                input.parse().map(NestedMeta::Lit)
+            } else if input.peek(Ident::peek_any) {
+                input.parse().map(NestedMeta::Meta)
+            } else {
+                Err(input.error("expected identifier or literal"))
+            }
+        }
+    }
+
+    pub fn parse_meta_after_path(path: Path, input: ParseStream) -> Result<Meta> {
+        if input.peek(token::Paren) {
+            parse_meta_list_after_path(path, input).map(Meta::List)
+        } else if input.peek(Token![=]) {
+            parse_meta_name_value_after_path(path, input).map(Meta::NameValue)
+        } else {
+            Ok(Meta::Path(path))
+        }
+    }
+
+    fn parse_meta_list_after_path(path: Path, input: ParseStream) -> Result<MetaList> {
+        let content;
+        Ok(MetaList {
+            path,
+            paren_token: parenthesized!(content in input),
+            nested: content.parse_terminated(NestedMeta::parse)?,
+        })
+    }
+
+    fn parse_meta_name_value_after_path(path: Path, input: ParseStream) -> Result<MetaNameValue> {
+        Ok(MetaNameValue {
+            path,
+            eq_token: input.parse()?,
+            lit: input.parse()?,
+        })
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use super::*;
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+
+    impl ToTokens for Attribute {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.pound_token.to_tokens(tokens);
+            if let AttrStyle::Inner(b) = &self.style {
+                b.to_tokens(tokens);
+            }
+            self.bracket_token.surround(tokens, |tokens| {
+                self.path.to_tokens(tokens);
+                self.tokens.to_tokens(tokens);
+            });
+        }
+    }
+
+    impl ToTokens for MetaList {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.path.to_tokens(tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                self.nested.to_tokens(tokens);
+            })
+        }
+    }
+
+    impl ToTokens for MetaNameValue {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.path.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.lit.to_tokens(tokens);
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/bigint.rs.html b/src/syn/bigint.rs.html new file mode 100644 index 0000000..0c35cc5 --- /dev/null +++ b/src/syn/bigint.rs.html @@ -0,0 +1,135 @@ +bigint.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
+use std::ops::{AddAssign, MulAssign};
+
+// For implementing base10_digits() accessor on LitInt.
+pub struct BigInt {
+    digits: Vec<u8>,
+}
+
+impl BigInt {
+    pub fn new() -> Self {
+        BigInt { digits: Vec::new() }
+    }
+
+    pub fn to_string(&self) -> String {
+        let mut repr = String::with_capacity(self.digits.len());
+
+        let mut has_nonzero = false;
+        for digit in self.digits.iter().rev() {
+            has_nonzero |= *digit != 0;
+            if has_nonzero {
+                repr.push((*digit + b'0') as char);
+            }
+        }
+
+        if repr.is_empty() {
+            repr.push('0');
+        }
+
+        repr
+    }
+
+    fn reserve_two_digits(&mut self) {
+        let len = self.digits.len();
+        let desired =
+            len + !self.digits.ends_with(&[0, 0]) as usize + !self.digits.ends_with(&[0]) as usize;
+        self.digits.resize(desired, 0);
+    }
+}
+
+impl AddAssign<u8> for BigInt {
+    // Assumes increment <16.
+    fn add_assign(&mut self, mut increment: u8) {
+        self.reserve_two_digits();
+
+        let mut i = 0;
+        while increment > 0 {
+            let sum = self.digits[i] + increment;
+            self.digits[i] = sum % 10;
+            increment = sum / 10;
+            i += 1;
+        }
+    }
+}
+
+impl MulAssign<u8> for BigInt {
+    // Assumes base <=16.
+    fn mul_assign(&mut self, base: u8) {
+        self.reserve_two_digits();
+
+        let mut carry = 0;
+        for digit in &mut self.digits {
+            let prod = *digit * base + carry;
+            *digit = prod % 10;
+            carry = prod / 10;
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/buffer.rs.html b/src/syn/buffer.rs.html new file mode 100644 index 0000000..a9e8d2b --- /dev/null +++ b/src/syn/buffer.rs.html @@ -0,0 +1,767 @@ +buffer.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+
+//! A stably addressed token buffer supporting efficient traversal based on a
+//! cheaply copyable cursor.
+//!
+//! *This module is available if Syn is built with the `"parsing"` feature.*
+
+// This module is heavily commented as it contains most of the unsafe code in
+// Syn, and caution should be used when editing it. The public-facing interface
+// is 100% safe but the implementation is fragile internally.
+
+#[cfg(all(
+    not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
+    feature = "proc-macro"
+))]
+use crate::proc_macro as pm;
+use proc_macro2::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
+
+use std::marker::PhantomData;
+use std::ptr;
+
+use crate::Lifetime;
+
+/// Internal type which is used instead of `TokenTree` to represent a token tree
+/// within a `TokenBuffer`.
+enum Entry {
+    // Mimicking types from proc-macro.
+    Group(Group, TokenBuffer),
+    Ident(Ident),
+    Punct(Punct),
+    Literal(Literal),
+    // End entries contain a raw pointer to the entry from the containing
+    // token tree, or null if this is the outermost level.
+    End(*const Entry),
+}
+
+/// A buffer that can be efficiently traversed multiple times, unlike
+/// `TokenStream` which requires a deep copy in order to traverse more than
+/// once.
+///
+/// *This type is available if Syn is built with the `"parsing"` feature.*
+pub struct TokenBuffer {
+    // NOTE: Do not derive clone on this - there are raw pointers inside which
+    // will be messed up. Moving the `TokenBuffer` itself is safe as the actual
+    // backing slices won't be moved.
+    data: Box<[Entry]>,
+}
+
+impl TokenBuffer {
+    // NOTE: DO NOT MUTATE THE `Vec` RETURNED FROM THIS FUNCTION ONCE IT
+    // RETURNS, THE ADDRESS OF ITS BACKING MEMORY MUST REMAIN STABLE.
+    fn inner_new(stream: TokenStream, up: *const Entry) -> TokenBuffer {
+        // Build up the entries list, recording the locations of any Groups
+        // in the list to be processed later.
+        let mut entries = Vec::new();
+        let mut seqs = Vec::new();
+        for tt in stream {
+            match tt {
+                TokenTree::Ident(sym) => {
+                    entries.push(Entry::Ident(sym));
+                }
+                TokenTree::Punct(op) => {
+                    entries.push(Entry::Punct(op));
+                }
+                TokenTree::Literal(l) => {
+                    entries.push(Entry::Literal(l));
+                }
+                TokenTree::Group(g) => {
+                    // Record the index of the interesting entry, and store an
+                    // `End(null)` there temporarially.
+                    seqs.push((entries.len(), g));
+                    entries.push(Entry::End(ptr::null()));
+                }
+            }
+        }
+        // Add an `End` entry to the end with a reference to the enclosing token
+        // stream which was passed in.
+        entries.push(Entry::End(up));
+
+        // NOTE: This is done to ensure that we don't accidentally modify the
+        // length of the backing buffer. The backing buffer must remain at a
+        // constant address after this point, as we are going to store a raw
+        // pointer into it.
+        let mut entries = entries.into_boxed_slice();
+        for (idx, group) in seqs {
+            // We know that this index refers to one of the temporary
+            // `End(null)` entries, and we know that the last entry is
+            // `End(up)`, so the next index is also valid.
+            let seq_up = &entries[idx + 1] as *const Entry;
+
+            // The end entry stored at the end of this Entry::Group should
+            // point to the Entry which follows the Group in the list.
+            let inner = Self::inner_new(group.stream(), seq_up);
+            entries[idx] = Entry::Group(group, inner);
+        }
+
+        TokenBuffer { data: entries }
+    }
+
+    /// Creates a `TokenBuffer` containing all the tokens from the input
+    /// `TokenStream`.
+    ///
+    /// *This method is available if Syn is built with both the `"parsing"` and
+    /// `"proc-macro"` features.*
+    #[cfg(all(
+        not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
+        feature = "proc-macro"
+    ))]
+    pub fn new(stream: pm::TokenStream) -> TokenBuffer {
+        Self::new2(stream.into())
+    }
+
+    /// Creates a `TokenBuffer` containing all the tokens from the input
+    /// `TokenStream`.
+    pub fn new2(stream: TokenStream) -> TokenBuffer {
+        Self::inner_new(stream, ptr::null())
+    }
+
+    /// Creates a cursor referencing the first token in the buffer and able to
+    /// traverse until the end of the buffer.
+    pub fn begin(&self) -> Cursor {
+        unsafe { Cursor::create(&self.data[0], &self.data[self.data.len() - 1]) }
+    }
+}
+
+/// A cheaply copyable cursor into a `TokenBuffer`.
+///
+/// This cursor holds a shared reference into the immutable data which is used
+/// internally to represent a `TokenStream`, and can be efficiently manipulated
+/// and copied around.
+///
+/// An empty `Cursor` can be created directly, or one may create a `TokenBuffer`
+/// object and get a cursor to its first token with `begin()`.
+///
+/// Two cursors are equal if they have the same location in the same input
+/// stream, and have the same scope.
+///
+/// *This type is available if Syn is built with the `"parsing"` feature.*
+#[derive(Copy, Clone, Eq, PartialEq)]
+pub struct Cursor<'a> {
+    // The current entry which the `Cursor` is pointing at.
+    ptr: *const Entry,
+    // This is the only `Entry::End(..)` object which this cursor is allowed to
+    // point at. All other `End` objects are skipped over in `Cursor::create`.
+    scope: *const Entry,
+    // Cursor is covariant in 'a. This field ensures that our pointers are still
+    // valid.
+    marker: PhantomData<&'a Entry>,
+}
+
+impl<'a> Cursor<'a> {
+    /// Creates a cursor referencing a static empty TokenStream.
+    pub fn empty() -> Self {
+        // It's safe in this situation for us to put an `Entry` object in global
+        // storage, despite it not actually being safe to send across threads
+        // (`Ident` is a reference into a thread-local table). This is because
+        // this entry never includes a `Ident` object.
+        //
+        // This wrapper struct allows us to break the rules and put a `Sync`
+        // object in global storage.
+        struct UnsafeSyncEntry(Entry);
+        unsafe impl Sync for UnsafeSyncEntry {}
+        static EMPTY_ENTRY: UnsafeSyncEntry = UnsafeSyncEntry(Entry::End(0 as *const Entry));
+
+        Cursor {
+            ptr: &EMPTY_ENTRY.0,
+            scope: &EMPTY_ENTRY.0,
+            marker: PhantomData,
+        }
+    }
+
+    /// This create method intelligently exits non-explicitly-entered
+    /// `None`-delimited scopes when the cursor reaches the end of them,
+    /// allowing for them to be treated transparently.
+    unsafe fn create(mut ptr: *const Entry, scope: *const Entry) -> Self {
+        // NOTE: If we're looking at a `End(..)`, we want to advance the cursor
+        // past it, unless `ptr == scope`, which means that we're at the edge of
+        // our cursor's scope. We should only have `ptr != scope` at the exit
+        // from None-delimited groups entered with `ignore_none`.
+        while let Entry::End(exit) = *ptr {
+            if ptr == scope {
+                break;
+            }
+            ptr = exit;
+        }
+
+        Cursor {
+            ptr,
+            scope,
+            marker: PhantomData,
+        }
+    }
+
+    /// Get the current entry.
+    fn entry(self) -> &'a Entry {
+        unsafe { &*self.ptr }
+    }
+
+    /// Bump the cursor to point at the next token after the current one. This
+    /// is undefined behavior if the cursor is currently looking at an
+    /// `Entry::End`.
+    unsafe fn bump(self) -> Cursor<'a> {
+        Cursor::create(self.ptr.offset(1), self.scope)
+    }
+
+    /// If the cursor is looking at a `None`-delimited group, move it to look at
+    /// the first token inside instead. If the group is empty, this will move
+    /// the cursor past the `None`-delimited group.
+    ///
+    /// WARNING: This mutates its argument.
+    fn ignore_none(&mut self) {
+        if let Entry::Group(group, buf) = self.entry() {
+            if group.delimiter() == Delimiter::None {
+                // NOTE: We call `Cursor::create` here to make sure that
+                // situations where we should immediately exit the span after
+                // entering it are handled correctly.
+                unsafe {
+                    *self = Cursor::create(&buf.data[0], self.scope);
+                }
+            }
+        }
+    }
+
+    /// Checks whether the cursor is currently pointing at the end of its valid
+    /// scope.
+    pub fn eof(self) -> bool {
+        // We're at eof if we're at the end of our scope.
+        self.ptr == self.scope
+    }
+
+    /// If the cursor is pointing at a `Group` with the given delimiter, returns
+    /// a cursor into that group and one pointing to the next `TokenTree`.
+    pub fn group(mut self, delim: Delimiter) -> Option<(Cursor<'a>, Span, Cursor<'a>)> {
+        // If we're not trying to enter a none-delimited group, we want to
+        // ignore them. We have to make sure to _not_ ignore them when we want
+        // to enter them, of course. For obvious reasons.
+        if delim != Delimiter::None {
+            self.ignore_none();
+        }
+
+        if let Entry::Group(group, buf) = self.entry() {
+            if group.delimiter() == delim {
+                return Some((buf.begin(), group.span(), unsafe { self.bump() }));
+            }
+        }
+
+        None
+    }
+
+    /// If the cursor is pointing at a `Ident`, returns it along with a cursor
+    /// pointing at the next `TokenTree`.
+    pub fn ident(mut self) -> Option<(Ident, Cursor<'a>)> {
+        self.ignore_none();
+        match self.entry() {
+            Entry::Ident(ident) => Some((ident.clone(), unsafe { self.bump() })),
+            _ => None,
+        }
+    }
+
+    /// If the cursor is pointing at an `Punct`, returns it along with a cursor
+    /// pointing at the next `TokenTree`.
+    pub fn punct(mut self) -> Option<(Punct, Cursor<'a>)> {
+        self.ignore_none();
+        match self.entry() {
+            Entry::Punct(op) if op.as_char() != '\'' => Some((op.clone(), unsafe { self.bump() })),
+            _ => None,
+        }
+    }
+
+    /// If the cursor is pointing at a `Literal`, return it along with a cursor
+    /// pointing at the next `TokenTree`.
+    pub fn literal(mut self) -> Option<(Literal, Cursor<'a>)> {
+        self.ignore_none();
+        match self.entry() {
+            Entry::Literal(lit) => Some((lit.clone(), unsafe { self.bump() })),
+            _ => None,
+        }
+    }
+
+    /// If the cursor is pointing at a `Lifetime`, returns it along with a
+    /// cursor pointing at the next `TokenTree`.
+    pub fn lifetime(mut self) -> Option<(Lifetime, Cursor<'a>)> {
+        self.ignore_none();
+        match self.entry() {
+            Entry::Punct(op) if op.as_char() == '\'' && op.spacing() == Spacing::Joint => {
+                let next = unsafe { self.bump() };
+                match next.ident() {
+                    Some((ident, rest)) => {
+                        let lifetime = Lifetime {
+                            apostrophe: op.span(),
+                            ident,
+                        };
+                        Some((lifetime, rest))
+                    }
+                    None => None,
+                }
+            }
+            _ => None,
+        }
+    }
+
+    /// Copies all remaining tokens visible from this cursor into a
+    /// `TokenStream`.
+    pub fn token_stream(self) -> TokenStream {
+        let mut tts = Vec::new();
+        let mut cursor = self;
+        while let Some((tt, rest)) = cursor.token_tree() {
+            tts.push(tt);
+            cursor = rest;
+        }
+        tts.into_iter().collect()
+    }
+
+    /// If the cursor is pointing at a `TokenTree`, returns it along with a
+    /// cursor pointing at the next `TokenTree`.
+    ///
+    /// Returns `None` if the cursor has reached the end of its stream.
+    ///
+    /// This method does not treat `None`-delimited groups as transparent, and
+    /// will return a `Group(None, ..)` if the cursor is looking at one.
+    pub fn token_tree(self) -> Option<(TokenTree, Cursor<'a>)> {
+        let tree = match self.entry() {
+            Entry::Group(group, _) => group.clone().into(),
+            Entry::Literal(lit) => lit.clone().into(),
+            Entry::Ident(ident) => ident.clone().into(),
+            Entry::Punct(op) => op.clone().into(),
+            Entry::End(..) => {
+                return None;
+            }
+        };
+
+        Some((tree, unsafe { self.bump() }))
+    }
+
+    /// Returns the `Span` of the current token, or `Span::call_site()` if this
+    /// cursor points to eof.
+    pub fn span(self) -> Span {
+        match self.entry() {
+            Entry::Group(group, _) => group.span(),
+            Entry::Literal(l) => l.span(),
+            Entry::Ident(t) => t.span(),
+            Entry::Punct(o) => o.span(),
+            Entry::End(..) => Span::call_site(),
+        }
+    }
+
+    /// Skip over the next token without cloning it. Returns `None` if this
+    /// cursor points to eof.
+    ///
+    /// This method treats `'lifetimes` as a single token.
+    pub(crate) fn skip(self) -> Option<Cursor<'a>> {
+        match self.entry() {
+            Entry::End(..) => None,
+
+            // Treat lifetimes as a single tt for the purposes of 'skip'.
+            Entry::Punct(op) if op.as_char() == '\'' && op.spacing() == Spacing::Joint => {
+                let next = unsafe { self.bump() };
+                match next.entry() {
+                    Entry::Ident(_) => Some(unsafe { next.bump() }),
+                    _ => Some(next),
+                }
+            }
+            _ => Some(unsafe { self.bump() }),
+        }
+    }
+}
+
+pub(crate) fn same_scope(a: Cursor, b: Cursor) -> bool {
+    a.scope == b.scope
+}
+
+pub(crate) fn open_span_of_group(cursor: Cursor) -> Span {
+    match cursor.entry() {
+        Entry::Group(group, _) => group.span_open(),
+        _ => cursor.span(),
+    }
+}
+
+pub(crate) fn close_span_of_group(cursor: Cursor) -> Span {
+    match cursor.entry() {
+        Entry::Group(group, _) => group.span_close(),
+        _ => cursor.span(),
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/custom_keyword.rs.html b/src/syn/custom_keyword.rs.html new file mode 100644 index 0000000..3a7f9ab --- /dev/null +++ b/src/syn/custom_keyword.rs.html @@ -0,0 +1,507 @@ +custom_keyword.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+
+/// Define a type that supports parsing and printing a given identifier as if it
+/// were a keyword.
+///
+/// # Usage
+///
+/// As a convention, it is recommended that this macro be invoked within a
+/// module called `kw` or `keyword` and that the resulting parser be invoked
+/// with a `kw::` or `keyword::` prefix.
+///
+/// ```
+/// mod kw {
+///     syn::custom_keyword!(whatever);
+/// }
+/// ```
+///
+/// The generated syntax tree node supports the following operations just like
+/// any built-in keyword token.
+///
+/// - [Peeking] — `input.peek(kw::whatever)`
+///
+/// - [Parsing] — `input.parse::<kw::whatever>()?`
+///
+/// - [Printing] — `quote!( ... #whatever_token ... )`
+///
+/// - Construction from a [`Span`] — `let whatever_token = kw::whatever(sp)`
+///
+/// - Field access to its span — `let sp = whatever_token.span`
+///
+/// [Peeking]: parse::ParseBuffer::peek
+/// [Parsing]: parse::ParseBuffer::parse
+/// [Printing]: quote::ToTokens
+/// [`Span`]: proc_macro2::Span
+///
+/// # Example
+///
+/// This example parses input that looks like `bool = true` or `str = "value"`.
+/// The key must be either the identifier `bool` or the identifier `str`. If
+/// `bool`, the value may be either `true` or `false`. If `str`, the value may
+/// be any string literal.
+///
+/// The symbols `bool` and `str` are not reserved keywords in Rust so these are
+/// not considered keywords in the `syn::token` module. Like any other
+/// identifier that is not a keyword, these can be declared as custom keywords
+/// by crates that need to use them as such.
+///
+/// ```
+/// use syn::{LitBool, LitStr, Result, Token};
+/// use syn::parse::{Parse, ParseStream};
+///
+/// mod kw {
+///     syn::custom_keyword!(bool);
+///     syn::custom_keyword!(str);
+/// }
+///
+/// enum Argument {
+///     Bool {
+///         bool_token: kw::bool,
+///         eq_token: Token![=],
+///         value: LitBool,
+///     },
+///     Str {
+///         str_token: kw::str,
+///         eq_token: Token![=],
+///         value: LitStr,
+///     },
+/// }
+///
+/// impl Parse for Argument {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let lookahead = input.lookahead1();
+///         if lookahead.peek(kw::bool) {
+///             Ok(Argument::Bool {
+///                 bool_token: input.parse::<kw::bool>()?,
+///                 eq_token: input.parse()?,
+///                 value: input.parse()?,
+///             })
+///         } else if lookahead.peek(kw::str) {
+///             Ok(Argument::Str {
+///                 str_token: input.parse::<kw::str>()?,
+///                 eq_token: input.parse()?,
+///                 value: input.parse()?,
+///             })
+///         } else {
+///             Err(lookahead.error())
+///         }
+///     }
+/// }
+/// ```
+#[macro_export(local_inner_macros)]
+macro_rules! custom_keyword {
+    ($ident:ident) => {
+        #[allow(non_camel_case_types)]
+        pub struct $ident {
+            pub span: $crate::export::Span,
+        }
+
+        #[doc(hidden)]
+        #[allow(non_snake_case)]
+        pub fn $ident<__S: $crate::export::IntoSpans<[$crate::export::Span; 1]>>(
+            span: __S,
+        ) -> $ident {
+            $ident {
+                span: $crate::export::IntoSpans::into_spans(span)[0],
+            }
+        }
+
+        impl $crate::export::Default for $ident {
+            fn default() -> Self {
+                $ident {
+                    span: $crate::export::Span::call_site(),
+                }
+            }
+        }
+
+        impl_parse_for_custom_keyword!($ident);
+        impl_to_tokens_for_custom_keyword!($ident);
+        impl_clone_for_custom_keyword!($ident);
+        impl_extra_traits_for_custom_keyword!($ident);
+    };
+}
+
+// Not public API.
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_parse_for_custom_keyword {
+    ($ident:ident) => {
+        // For peek.
+        impl $crate::token::CustomToken for $ident {
+            fn peek(cursor: $crate::buffer::Cursor) -> $crate::export::bool {
+                if let Some((ident, _rest)) = cursor.ident() {
+                    ident == stringify!($ident)
+                } else {
+                    false
+                }
+            }
+
+            fn display() -> &'static $crate::export::str {
+                concat!("`", stringify!($ident), "`")
+            }
+        }
+
+        impl $crate::parse::Parse for $ident {
+            fn parse(input: $crate::parse::ParseStream) -> $crate::parse::Result<$ident> {
+                input.step(|cursor| {
+                    if let $crate::export::Some((ident, rest)) = cursor.ident() {
+                        if ident == stringify!($ident) {
+                            return $crate::export::Ok(($ident { span: ident.span() }, rest));
+                        }
+                    }
+                    $crate::export::Err(cursor.error(concat!(
+                        "expected `",
+                        stringify!($ident),
+                        "`"
+                    )))
+                })
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "parsing"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_parse_for_custom_keyword {
+    ($ident:ident) => {};
+}
+
+// Not public API.
+#[cfg(feature = "printing")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_to_tokens_for_custom_keyword {
+    ($ident:ident) => {
+        impl $crate::export::ToTokens for $ident {
+            fn to_tokens(&self, tokens: &mut $crate::export::TokenStream2) {
+                let ident = $crate::Ident::new(stringify!($ident), self.span);
+                $crate::export::TokenStreamExt::append(tokens, ident);
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "printing"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_to_tokens_for_custom_keyword {
+    ($ident:ident) => {};
+}
+
+// Not public API.
+#[cfg(feature = "clone-impls")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_clone_for_custom_keyword {
+    ($ident:ident) => {
+        impl $crate::export::Copy for $ident {}
+
+        impl $crate::export::Clone for $ident {
+            fn clone(&self) -> Self {
+                *self
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "clone-impls"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_clone_for_custom_keyword {
+    ($ident:ident) => {};
+}
+
+// Not public API.
+#[cfg(feature = "extra-traits")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_extra_traits_for_custom_keyword {
+    ($ident:ident) => {
+        impl $crate::export::Debug for $ident {
+            fn fmt(&self, f: &mut $crate::export::Formatter) -> $crate::export::fmt::Result {
+                $crate::export::Formatter::write_str(
+                    f,
+                    concat!("Keyword [", stringify!($ident), "]"),
+                )
+            }
+        }
+
+        impl $crate::export::Eq for $ident {}
+
+        impl $crate::export::PartialEq for $ident {
+            fn eq(&self, _other: &Self) -> $crate::export::bool {
+                true
+            }
+        }
+
+        impl $crate::export::Hash for $ident {
+            fn hash<__H: $crate::export::Hasher>(&self, _state: &mut __H) {}
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "extra-traits"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_extra_traits_for_custom_keyword {
+    ($ident:ident) => {};
+}
+
+
\ No newline at end of file diff --git a/src/syn/custom_punctuation.rs.html b/src/syn/custom_punctuation.rs.html new file mode 100644 index 0000000..c4eefb4 --- /dev/null +++ b/src/syn/custom_punctuation.rs.html @@ -0,0 +1,621 @@ +custom_punctuation.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+
+/// Define a type that supports parsing and printing a multi-character symbol
+/// as if it were a punctuation token.
+///
+/// # Usage
+///
+/// ```
+/// syn::custom_punctuation!(LeftRightArrow, <=>);
+/// ```
+///
+/// The generated syntax tree node supports the following operations just like
+/// any built-in punctuation token.
+///
+/// - [Peeking] — `input.peek(LeftRightArrow)`
+///
+/// - [Parsing] — `input.parse::<LeftRightArrow>()?`
+///
+/// - [Printing] — `quote!( ... #lrarrow ... )`
+///
+/// - Construction from a [`Span`] — `let lrarrow = LeftRightArrow(sp)`
+///
+/// - Construction from multiple [`Span`] — `let lrarrow = LeftRightArrow([sp, sp, sp])`
+///
+/// - Field access to its spans — `let spans = lrarrow.spans`
+///
+/// [Peeking]: parse::ParseBuffer::peek
+/// [Parsing]: parse::ParseBuffer::parse
+/// [Printing]: quote::ToTokens
+/// [`Span`]: proc_macro2::Span
+///
+/// # Example
+///
+/// ```
+/// use proc_macro2::{TokenStream, TokenTree};
+/// use syn::parse::{Parse, ParseStream, Peek, Result};
+/// use syn::punctuated::Punctuated;
+/// use syn::Expr;
+///
+/// syn::custom_punctuation!(PathSeparator, </>);
+///
+/// // expr </> expr </> expr ...
+/// struct PathSegments {
+///     segments: Punctuated<Expr, PathSeparator>,
+/// }
+///
+/// impl Parse for PathSegments {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let mut segments = Punctuated::new();
+///
+///         let first = parse_until(input, PathSeparator)?;
+///         segments.push_value(syn::parse2(first)?);
+///
+///         while input.peek(PathSeparator) {
+///             segments.push_punct(input.parse()?);
+///
+///             let next = parse_until(input, PathSeparator)?;
+///             segments.push_value(syn::parse2(next)?);
+///         }
+///
+///         Ok(PathSegments { segments })
+///     }
+/// }
+///
+/// fn parse_until<E: Peek>(input: ParseStream, end: E) -> Result<TokenStream> {
+///     let mut tokens = TokenStream::new();
+///     while !input.is_empty() && !input.peek(end) {
+///         let next: TokenTree = input.parse()?;
+///         tokens.extend(Some(next));
+///     }
+///     Ok(tokens)
+/// }
+///
+/// fn main() {
+///     let input = r#" a::b </> c::d::e "#;
+///     let _: PathSegments = syn::parse_str(input).unwrap();
+/// }
+/// ```
+#[macro_export(local_inner_macros)]
+macro_rules! custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        pub struct $ident {
+            pub spans: custom_punctuation_repr!($($tt)+),
+        }
+
+        #[doc(hidden)]
+        #[allow(non_snake_case)]
+        pub fn $ident<__S: $crate::export::IntoSpans<custom_punctuation_repr!($($tt)+)>>(
+            spans: __S,
+        ) -> $ident {
+            let _validate_len = 0 $(+ custom_punctuation_len!(strict, $tt))*;
+            $ident {
+                spans: $crate::export::IntoSpans::into_spans(spans)
+            }
+        }
+
+        impl $crate::export::Default for $ident {
+            fn default() -> Self {
+                $ident($crate::export::Span::call_site())
+            }
+        }
+
+        impl_parse_for_custom_punctuation!($ident, $($tt)+);
+        impl_to_tokens_for_custom_punctuation!($ident, $($tt)+);
+        impl_clone_for_custom_punctuation!($ident, $($tt)+);
+        impl_extra_traits_for_custom_punctuation!($ident, $($tt)+);
+    };
+}
+
+// Not public API.
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+#[macro_export(local_inner_macros)]
+macro_rules! impl_parse_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        impl $crate::token::CustomToken for $ident {
+            fn peek(cursor: $crate::buffer::Cursor) -> bool {
+                $crate::token::parsing::peek_punct(cursor, stringify_punct!($($tt)+))
+            }
+
+            fn display() -> &'static $crate::export::str {
+                custom_punctuation_concat!("`", stringify_punct!($($tt)+), "`")
+            }
+        }
+
+        impl $crate::parse::Parse for $ident {
+            fn parse(input: $crate::parse::ParseStream) -> $crate::parse::Result<$ident> {
+                let spans: custom_punctuation_repr!($($tt)+) =
+                    $crate::token::parsing::punct(input, stringify_punct!($($tt)+))?;
+                Ok($ident(spans))
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "parsing"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_parse_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {};
+}
+
+// Not public API.
+#[cfg(feature = "printing")]
+#[doc(hidden)]
+#[macro_export(local_inner_macros)]
+macro_rules! impl_to_tokens_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        impl $crate::export::ToTokens for $ident {
+            fn to_tokens(&self, tokens: &mut $crate::export::TokenStream2) {
+                $crate::token::printing::punct(stringify_punct!($($tt)+), &self.spans, tokens)
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "printing"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_to_tokens_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {};
+}
+
+// Not public API.
+#[cfg(feature = "clone-impls")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_clone_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        impl $crate::export::Copy for $ident {}
+
+        impl $crate::export::Clone for $ident {
+            fn clone(&self) -> Self {
+                *self
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "clone-impls"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_clone_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {};
+}
+
+// Not public API.
+#[cfg(feature = "extra-traits")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_extra_traits_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        impl $crate::export::Debug for $ident {
+            fn fmt(&self, f: &mut $crate::export::Formatter) -> $crate::export::fmt::Result {
+                $crate::export::Formatter::write_str(f, stringify!($ident))
+            }
+        }
+
+        impl $crate::export::Eq for $ident {}
+
+        impl $crate::export::PartialEq for $ident {
+            fn eq(&self, _other: &Self) -> $crate::export::bool {
+                true
+            }
+        }
+
+        impl $crate::export::Hash for $ident {
+            fn hash<__H: $crate::export::Hasher>(&self, _state: &mut __H) {}
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "extra-traits"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_extra_traits_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {};
+}
+
+// Not public API.
+#[doc(hidden)]
+#[macro_export(local_inner_macros)]
+macro_rules! custom_punctuation_repr {
+    ($($tt:tt)+) => {
+        [$crate::export::Span; 0 $(+ custom_punctuation_len!(lenient, $tt))+]
+    };
+}
+
+// Not public API.
+#[doc(hidden)]
+#[macro_export(local_inner_macros)]
+#[rustfmt::skip]
+macro_rules! custom_punctuation_len {
+    ($mode:ident, +)     => { 1 };
+    ($mode:ident, +=)    => { 2 };
+    ($mode:ident, &)     => { 1 };
+    ($mode:ident, &&)    => { 2 };
+    ($mode:ident, &=)    => { 2 };
+    ($mode:ident, @)     => { 1 };
+    ($mode:ident, !)     => { 1 };
+    ($mode:ident, ^)     => { 1 };
+    ($mode:ident, ^=)    => { 2 };
+    ($mode:ident, :)     => { 1 };
+    ($mode:ident, ::)    => { 2 };
+    ($mode:ident, ,)     => { 1 };
+    ($mode:ident, /)     => { 1 };
+    ($mode:ident, /=)    => { 2 };
+    ($mode:ident, .)     => { 1 };
+    ($mode:ident, ..)    => { 2 };
+    ($mode:ident, ...)   => { 3 };
+    ($mode:ident, ..=)   => { 3 };
+    ($mode:ident, =)     => { 1 };
+    ($mode:ident, ==)    => { 2 };
+    ($mode:ident, >=)    => { 2 };
+    ($mode:ident, >)     => { 1 };
+    ($mode:ident, <=)    => { 2 };
+    ($mode:ident, <)     => { 1 };
+    ($mode:ident, *=)    => { 2 };
+    ($mode:ident, !=)    => { 2 };
+    ($mode:ident, |)     => { 1 };
+    ($mode:ident, |=)    => { 2 };
+    ($mode:ident, ||)    => { 2 };
+    ($mode:ident, #)     => { 1 };
+    ($mode:ident, ?)     => { 1 };
+    ($mode:ident, ->)    => { 2 };
+    ($mode:ident, <-)    => { 2 };
+    ($mode:ident, %)     => { 1 };
+    ($mode:ident, %=)    => { 2 };
+    ($mode:ident, =>)    => { 2 };
+    ($mode:ident, ;)     => { 1 };
+    ($mode:ident, <<)    => { 2 };
+    ($mode:ident, <<=)   => { 3 };
+    ($mode:ident, >>)    => { 2 };
+    ($mode:ident, >>=)   => { 3 };
+    ($mode:ident, *)     => { 1 };
+    ($mode:ident, -)     => { 1 };
+    ($mode:ident, -=)    => { 2 };
+    ($mode:ident, ~)     => { 1 };
+    (lenient, $tt:tt)    => { 0 };
+    (strict, $tt:tt)     => {{ custom_punctuation_unexpected!($tt); 0 }};
+}
+
+// Not public API.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! custom_punctuation_unexpected {
+    () => {};
+}
+
+// Not public API.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! stringify_punct {
+    ($($tt:tt)+) => {
+        concat!($(stringify!($tt)),+)
+    };
+}
+
+// Not public API.
+// Without this, local_inner_macros breaks when looking for concat!
+#[doc(hidden)]
+#[macro_export]
+macro_rules! custom_punctuation_concat {
+    ($($tt:tt)*) => {
+        concat!($($tt)*)
+    };
+}
+
+
\ No newline at end of file diff --git a/src/syn/data.rs.html b/src/syn/data.rs.html new file mode 100644 index 0000000..f2884aa --- /dev/null +++ b/src/syn/data.rs.html @@ -0,0 +1,915 @@ +data.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+
+use super::*;
+use crate::punctuated::Punctuated;
+
+ast_struct! {
+    /// An enum variant.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct Variant {
+        /// Attributes tagged on the variant.
+        pub attrs: Vec<Attribute>,
+
+        /// Name of the variant.
+        pub ident: Ident,
+
+        /// Content stored in the variant.
+        pub fields: Fields,
+
+        /// Explicit discriminant: `Variant = 1`
+        pub discriminant: Option<(Token![=], Expr)>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// Data stored within an enum variant or struct.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums
+    //
+    // TODO: change syntax-tree-enum link to an intra rustdoc link, currently
+    // blocked on https://github.com/rust-lang/rust/issues/62833
+    pub enum Fields {
+        /// Named fields of a struct or struct variant such as `Point { x: f64,
+        /// y: f64 }`.
+        Named(FieldsNamed),
+
+        /// Unnamed fields of a tuple struct or tuple variant such as `Some(T)`.
+        Unnamed(FieldsUnnamed),
+
+        /// Unit struct or unit variant such as `None`.
+        Unit,
+    }
+}
+
+ast_struct! {
+    /// Named fields of a struct or struct variant such as `Point { x: f64,
+    /// y: f64 }`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct FieldsNamed {
+        pub brace_token: token::Brace,
+        pub named: Punctuated<Field, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// Unnamed fields of a tuple struct or tuple variant such as `Some(T)`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct FieldsUnnamed {
+        pub paren_token: token::Paren,
+        pub unnamed: Punctuated<Field, Token![,]>,
+    }
+}
+
+impl Fields {
+    /// Get an iterator over the borrowed [`Field`] items in this object. This
+    /// iterator can be used to iterate over a named or unnamed struct or
+    /// variant's fields uniformly.
+    pub fn iter(&self) -> punctuated::Iter<Field> {
+        match self {
+            Fields::Unit => crate::punctuated::empty_punctuated_iter(),
+            Fields::Named(f) => f.named.iter(),
+            Fields::Unnamed(f) => f.unnamed.iter(),
+        }
+    }
+
+    /// Get an iterator over the mutably borrowed [`Field`] items in this
+    /// object. This iterator can be used to iterate over a named or unnamed
+    /// struct or variant's fields uniformly.
+    pub fn iter_mut(&mut self) -> punctuated::IterMut<Field> {
+        match self {
+            Fields::Unit => crate::punctuated::empty_punctuated_iter_mut(),
+            Fields::Named(f) => f.named.iter_mut(),
+            Fields::Unnamed(f) => f.unnamed.iter_mut(),
+        }
+    }
+
+    /// Returns the number of fields.
+    pub fn len(&self) -> usize {
+        match self {
+            Fields::Unit => 0,
+            Fields::Named(f) => f.named.len(),
+            Fields::Unnamed(f) => f.unnamed.len(),
+        }
+    }
+
+    /// Returns `true` if there are zero fields.
+    pub fn is_empty(&self) -> bool {
+        match self {
+            Fields::Unit => true,
+            Fields::Named(f) => f.named.is_empty(),
+            Fields::Unnamed(f) => f.unnamed.is_empty(),
+        }
+    }
+}
+
+impl IntoIterator for Fields {
+    type Item = Field;
+    type IntoIter = punctuated::IntoIter<Field>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        match self {
+            Fields::Unit => Punctuated::<Field, ()>::new().into_iter(),
+            Fields::Named(f) => f.named.into_iter(),
+            Fields::Unnamed(f) => f.unnamed.into_iter(),
+        }
+    }
+}
+
+impl<'a> IntoIterator for &'a Fields {
+    type Item = &'a Field;
+    type IntoIter = punctuated::Iter<'a, Field>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter()
+    }
+}
+
+impl<'a> IntoIterator for &'a mut Fields {
+    type Item = &'a mut Field;
+    type IntoIter = punctuated::IterMut<'a, Field>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter_mut()
+    }
+}
+
+ast_struct! {
+    /// A field of a struct or enum variant.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct Field {
+        /// Attributes tagged on the field.
+        pub attrs: Vec<Attribute>,
+
+        /// Visibility of the field.
+        pub vis: Visibility,
+
+        /// Name of the field, if any.
+        ///
+        /// Fields of tuple structs have no names.
+        pub ident: Option<Ident>,
+
+        pub colon_token: Option<Token![:]>,
+
+        /// Type of the field.
+        pub ty: Type,
+    }
+}
+
+ast_enum_of_structs! {
+    /// The visibility level of an item: inherited or `pub` or
+    /// `pub(restricted)`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums
+    //
+    // TODO: change syntax-tree-enum link to an intra rustdoc link, currently
+    // blocked on https://github.com/rust-lang/rust/issues/62833
+    pub enum Visibility {
+        /// A public visibility level: `pub`.
+        Public(VisPublic),
+
+        /// A crate-level visibility: `crate`.
+        Crate(VisCrate),
+
+        /// A visibility level restricted to some path: `pub(self)` or
+        /// `pub(super)` or `pub(crate)` or `pub(in some::module)`.
+        Restricted(VisRestricted),
+
+        /// An inherited visibility, which usually means private.
+        Inherited,
+    }
+}
+
+ast_struct! {
+    /// A public visibility level: `pub`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct VisPublic {
+        pub pub_token: Token![pub],
+    }
+}
+
+ast_struct! {
+    /// A crate-level visibility: `crate`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct VisCrate {
+        pub crate_token: Token![crate],
+    }
+}
+
+ast_struct! {
+    /// A visibility level restricted to some path: `pub(self)` or
+    /// `pub(super)` or `pub(crate)` or `pub(in some::module)`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct VisRestricted {
+        pub pub_token: Token![pub],
+        pub paren_token: token::Paren,
+        pub in_token: Option<Token![in]>,
+        pub path: Box<Path>,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub mod parsing {
+    use super::*;
+
+    use crate::ext::IdentExt;
+    use crate::parse::discouraged::Speculative;
+    use crate::parse::{Parse, ParseStream, Result};
+
+    impl Parse for Variant {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(Variant {
+                attrs: input.call(Attribute::parse_outer)?,
+                ident: input.parse()?,
+                fields: {
+                    if input.peek(token::Brace) {
+                        Fields::Named(input.parse()?)
+                    } else if input.peek(token::Paren) {
+                        Fields::Unnamed(input.parse()?)
+                    } else {
+                        Fields::Unit
+                    }
+                },
+                discriminant: {
+                    if input.peek(Token![=]) {
+                        let eq_token: Token![=] = input.parse()?;
+                        let discriminant: Expr = input.parse()?;
+                        Some((eq_token, discriminant))
+                    } else {
+                        None
+                    }
+                },
+            })
+        }
+    }
+
+    impl Parse for FieldsNamed {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(FieldsNamed {
+                brace_token: braced!(content in input),
+                named: content.parse_terminated(Field::parse_named)?,
+            })
+        }
+    }
+
+    impl Parse for FieldsUnnamed {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(FieldsUnnamed {
+                paren_token: parenthesized!(content in input),
+                unnamed: content.parse_terminated(Field::parse_unnamed)?,
+            })
+        }
+    }
+
+    impl Field {
+        /// Parses a named (braced struct) field.
+        pub fn parse_named(input: ParseStream) -> Result<Self> {
+            Ok(Field {
+                attrs: input.call(Attribute::parse_outer)?,
+                vis: input.parse()?,
+                ident: Some(input.parse()?),
+                colon_token: Some(input.parse()?),
+                ty: input.parse()?,
+            })
+        }
+
+        /// Parses an unnamed (tuple struct) field.
+        pub fn parse_unnamed(input: ParseStream) -> Result<Self> {
+            Ok(Field {
+                attrs: input.call(Attribute::parse_outer)?,
+                vis: input.parse()?,
+                ident: None,
+                colon_token: None,
+                ty: input.parse()?,
+            })
+        }
+    }
+
+    impl Parse for Visibility {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![pub]) {
+                Self::parse_pub(input)
+            } else if input.peek(Token![crate]) {
+                Self::parse_crate(input)
+            } else {
+                Ok(Visibility::Inherited)
+            }
+        }
+    }
+
+    impl Visibility {
+        fn parse_pub(input: ParseStream) -> Result<Self> {
+            let pub_token = input.parse::<Token![pub]>()?;
+
+            if input.peek(token::Paren) {
+                let ahead = input.fork();
+
+                let content;
+                let paren_token = parenthesized!(content in ahead);
+                if content.peek(Token![crate])
+                    || content.peek(Token![self])
+                    || content.peek(Token![super])
+                {
+                    let path = content.call(Ident::parse_any)?;
+
+                    // Ensure there are no additional tokens within `content`.
+                    // Without explicitly checking, we may misinterpret a tuple
+                    // field as a restricted visibility, causing a parse error.
+                    // e.g. `pub (crate::A, crate::B)` (Issue #720).
+                    if content.is_empty() {
+                        input.advance_to(&ahead);
+                        return Ok(Visibility::Restricted(VisRestricted {
+                            pub_token,
+                            paren_token,
+                            in_token: None,
+                            path: Box::new(Path::from(path)),
+                        }));
+                    }
+                } else if content.peek(Token![in]) {
+                    let in_token: Token![in] = content.parse()?;
+                    let path = content.call(Path::parse_mod_style)?;
+
+                    input.advance_to(&ahead);
+                    return Ok(Visibility::Restricted(VisRestricted {
+                        pub_token,
+                        paren_token,
+                        in_token: Some(in_token),
+                        path: Box::new(path),
+                    }));
+                }
+            }
+
+            Ok(Visibility::Public(VisPublic { pub_token }))
+        }
+
+        fn parse_crate(input: ParseStream) -> Result<Self> {
+            if input.peek2(Token![::]) {
+                Ok(Visibility::Inherited)
+            } else {
+                Ok(Visibility::Crate(VisCrate {
+                    crate_token: input.parse()?,
+                }))
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use super::*;
+
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    use crate::print::TokensOrDefault;
+
+    impl ToTokens for Variant {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(&self.attrs);
+            self.ident.to_tokens(tokens);
+            self.fields.to_tokens(tokens);
+            if let Some((eq_token, disc)) = &self.discriminant {
+                eq_token.to_tokens(tokens);
+                disc.to_tokens(tokens);
+            }
+        }
+    }
+
+    impl ToTokens for FieldsNamed {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.brace_token.surround(tokens, |tokens| {
+                self.named.to_tokens(tokens);
+            });
+        }
+    }
+
+    impl ToTokens for FieldsUnnamed {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.paren_token.surround(tokens, |tokens| {
+                self.unnamed.to_tokens(tokens);
+            });
+        }
+    }
+
+    impl ToTokens for Field {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(&self.attrs);
+            self.vis.to_tokens(tokens);
+            if let Some(ident) = &self.ident {
+                ident.to_tokens(tokens);
+                TokensOrDefault(&self.colon_token).to_tokens(tokens);
+            }
+            self.ty.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for VisPublic {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.pub_token.to_tokens(tokens)
+        }
+    }
+
+    impl ToTokens for VisCrate {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.crate_token.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for VisRestricted {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.pub_token.to_tokens(tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                // TODO: If we have a path which is not "self" or "super" or
+                // "crate", automatically add the "in" token.
+                self.in_token.to_tokens(tokens);
+                self.path.to_tokens(tokens);
+            });
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/derive.rs.html b/src/syn/derive.rs.html new file mode 100644 index 0000000..65b546f --- /dev/null +++ b/src/syn/derive.rs.html @@ -0,0 +1,549 @@ +derive.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+
+use super::*;
+use crate::punctuated::Punctuated;
+
+ast_struct! {
+    /// Data structure sent to a `proc_macro_derive` macro.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` feature.*
+    pub struct DeriveInput {
+        /// Attributes tagged on the whole struct or enum.
+        pub attrs: Vec<Attribute>,
+
+        /// Visibility of the struct or enum.
+        pub vis: Visibility,
+
+        /// Name of the struct or enum.
+        pub ident: Ident,
+
+        /// Generics required to complete the definition.
+        pub generics: Generics,
+
+        /// Data within the struct or enum.
+        pub data: Data,
+    }
+}
+
+ast_enum_of_structs! {
+    /// The storage of a struct, enum or union data structure.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` feature.*
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums
+    //
+    // TODO: change syntax-tree-enum link to an intra rustdoc link, currently
+    // blocked on https://github.com/rust-lang/rust/issues/62833
+    pub enum Data {
+        /// A struct input to a `proc_macro_derive` macro.
+        Struct(DataStruct),
+
+        /// An enum input to a `proc_macro_derive` macro.
+        Enum(DataEnum),
+
+        /// An untagged union input to a `proc_macro_derive` macro.
+        Union(DataUnion),
+    }
+
+    do_not_generate_to_tokens
+}
+
+ast_struct! {
+    /// A struct input to a `proc_macro_derive` macro.
+    ///
+    /// *This type is available if Syn is built with the `"derive"`
+    /// feature.*
+    pub struct DataStruct {
+        pub struct_token: Token![struct],
+        pub fields: Fields,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_struct! {
+    /// An enum input to a `proc_macro_derive` macro.
+    ///
+    /// *This type is available if Syn is built with the `"derive"`
+    /// feature.*
+    pub struct DataEnum {
+        pub enum_token: Token![enum],
+        pub brace_token: token::Brace,
+        pub variants: Punctuated<Variant, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// An untagged union input to a `proc_macro_derive` macro.
+    ///
+    /// *This type is available if Syn is built with the `"derive"`
+    /// feature.*
+    pub struct DataUnion {
+        pub union_token: Token![union],
+        pub fields: FieldsNamed,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub mod parsing {
+    use super::*;
+
+    use crate::parse::{Parse, ParseStream, Result};
+
+    impl Parse for DeriveInput {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis = input.parse::<Visibility>()?;
+
+            let lookahead = input.lookahead1();
+            if lookahead.peek(Token![struct]) {
+                let struct_token = input.parse::<Token![struct]>()?;
+                let ident = input.parse::<Ident>()?;
+                let generics = input.parse::<Generics>()?;
+                let (where_clause, fields, semi) = data_struct(input)?;
+                Ok(DeriveInput {
+                    attrs,
+                    vis,
+                    ident,
+                    generics: Generics {
+                        where_clause,
+                        ..generics
+                    },
+                    data: Data::Struct(DataStruct {
+                        struct_token,
+                        fields,
+                        semi_token: semi,
+                    }),
+                })
+            } else if lookahead.peek(Token![enum]) {
+                let enum_token = input.parse::<Token![enum]>()?;
+                let ident = input.parse::<Ident>()?;
+                let generics = input.parse::<Generics>()?;
+                let (where_clause, brace, variants) = data_enum(input)?;
+                Ok(DeriveInput {
+                    attrs,
+                    vis,
+                    ident,
+                    generics: Generics {
+                        where_clause,
+                        ..generics
+                    },
+                    data: Data::Enum(DataEnum {
+                        enum_token,
+                        brace_token: brace,
+                        variants,
+                    }),
+                })
+            } else if lookahead.peek(Token![union]) {
+                let union_token = input.parse::<Token![union]>()?;
+                let ident = input.parse::<Ident>()?;
+                let generics = input.parse::<Generics>()?;
+                let (where_clause, fields) = data_union(input)?;
+                Ok(DeriveInput {
+                    attrs,
+                    vis,
+                    ident,
+                    generics: Generics {
+                        where_clause,
+                        ..generics
+                    },
+                    data: Data::Union(DataUnion {
+                        union_token,
+                        fields,
+                    }),
+                })
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+
+    pub fn data_struct(
+        input: ParseStream,
+    ) -> Result<(Option<WhereClause>, Fields, Option<Token![;]>)> {
+        let mut lookahead = input.lookahead1();
+        let mut where_clause = None;
+        if lookahead.peek(Token![where]) {
+            where_clause = Some(input.parse()?);
+            lookahead = input.lookahead1();
+        }
+
+        if where_clause.is_none() && lookahead.peek(token::Paren) {
+            let fields = input.parse()?;
+
+            lookahead = input.lookahead1();
+            if lookahead.peek(Token![where]) {
+                where_clause = Some(input.parse()?);
+                lookahead = input.lookahead1();
+            }
+
+            if lookahead.peek(Token![;]) {
+                let semi = input.parse()?;
+                Ok((where_clause, Fields::Unnamed(fields), Some(semi)))
+            } else {
+                Err(lookahead.error())
+            }
+        } else if lookahead.peek(token::Brace) {
+            let fields = input.parse()?;
+            Ok((where_clause, Fields::Named(fields), None))
+        } else if lookahead.peek(Token![;]) {
+            let semi = input.parse()?;
+            Ok((where_clause, Fields::Unit, Some(semi)))
+        } else {
+            Err(lookahead.error())
+        }
+    }
+
+    pub fn data_enum(
+        input: ParseStream,
+    ) -> Result<(
+        Option<WhereClause>,
+        token::Brace,
+        Punctuated<Variant, Token![,]>,
+    )> {
+        let where_clause = input.parse()?;
+
+        let content;
+        let brace = braced!(content in input);
+        let variants = content.parse_terminated(Variant::parse)?;
+
+        Ok((where_clause, brace, variants))
+    }
+
+    pub fn data_union(input: ParseStream) -> Result<(Option<WhereClause>, FieldsNamed)> {
+        let where_clause = input.parse()?;
+        let fields = input.parse()?;
+        Ok((where_clause, fields))
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use super::*;
+
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+
+    use crate::attr::FilterAttrs;
+    use crate::print::TokensOrDefault;
+
+    impl ToTokens for DeriveInput {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            for attr in self.attrs.outer() {
+                attr.to_tokens(tokens);
+            }
+            self.vis.to_tokens(tokens);
+            match &self.data {
+                Data::Struct(d) => d.struct_token.to_tokens(tokens),
+                Data::Enum(d) => d.enum_token.to_tokens(tokens),
+                Data::Union(d) => d.union_token.to_tokens(tokens),
+            }
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            match &self.data {
+                Data::Struct(data) => match &data.fields {
+                    Fields::Named(fields) => {
+                        self.generics.where_clause.to_tokens(tokens);
+                        fields.to_tokens(tokens);
+                    }
+                    Fields::Unnamed(fields) => {
+                        fields.to_tokens(tokens);
+                        self.generics.where_clause.to_tokens(tokens);
+                        TokensOrDefault(&data.semi_token).to_tokens(tokens);
+                    }
+                    Fields::Unit => {
+                        self.generics.where_clause.to_tokens(tokens);
+                        TokensOrDefault(&data.semi_token).to_tokens(tokens);
+                    }
+                },
+                Data::Enum(data) => {
+                    self.generics.where_clause.to_tokens(tokens);
+                    data.brace_token.surround(tokens, |tokens| {
+                        data.variants.to_tokens(tokens);
+                    });
+                }
+                Data::Union(data) => {
+                    self.generics.where_clause.to_tokens(tokens);
+                    data.fields.to_tokens(tokens);
+                }
+            }
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/discouraged.rs.html b/src/syn/discouraged.rs.html new file mode 100644 index 0000000..3721e32 --- /dev/null +++ b/src/syn/discouraged.rs.html @@ -0,0 +1,393 @@ +discouraged.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+
+//! Extensions to the parsing API with niche applicability.
+
+use super::*;
+
+/// Extensions to the `ParseStream` API to support speculative parsing.
+pub trait Speculative {
+    /// Advance this parse stream to the position of a forked parse stream.
+    ///
+    /// This is the opposite operation to [`ParseStream::fork`]. You can fork a
+    /// parse stream, perform some speculative parsing, then join the original
+    /// stream to the fork to "commit" the parsing from the fork to the main
+    /// stream.
+    ///
+    /// If you can avoid doing this, you should, as it limits the ability to
+    /// generate useful errors. That said, it is often the only way to parse
+    /// syntax of the form `A* B*` for arbitrary syntax `A` and `B`. The problem
+    /// is that when the fork fails to parse an `A`, it's impossible to tell
+    /// whether that was because of a syntax error and the user meant to provide
+    /// an `A`, or that the `A`s are finished and its time to start parsing
+    /// `B`s. Use with care.
+    ///
+    /// Also note that if `A` is a subset of `B`, `A* B*` can be parsed by
+    /// parsing `B*` and removing the leading members of `A` from the
+    /// repetition, bypassing the need to involve the downsides associated with
+    /// speculative parsing.
+    ///
+    /// [`ParseStream::fork`]: ParseBuffer::fork
+    ///
+    /// # Example
+    ///
+    /// There has been chatter about the possibility of making the colons in the
+    /// turbofish syntax like `path::to::<T>` no longer required by accepting
+    /// `path::to<T>` in expression position. Specifically, according to [RFC
+    /// 2544], [`PathSegment`] parsing should always try to consume a following
+    /// `<` token as the start of generic arguments, and reset to the `<` if
+    /// that fails (e.g. the token is acting as a less-than operator).
+    ///
+    /// This is the exact kind of parsing behavior which requires the "fork,
+    /// try, commit" behavior that [`ParseStream::fork`] discourages. With
+    /// `advance_to`, we can avoid having to parse the speculatively parsed
+    /// content a second time.
+    ///
+    /// This change in behavior can be implemented in syn by replacing just the
+    /// `Parse` implementation for `PathSegment`:
+    ///
+    /// ```
+    /// # use syn::ext::IdentExt;
+    /// use syn::parse::discouraged::Speculative;
+    /// # use syn::parse::{Parse, ParseStream};
+    /// # use syn::{Ident, PathArguments, Result, Token};
+    ///
+    /// pub struct PathSegment {
+    ///     pub ident: Ident,
+    ///     pub arguments: PathArguments,
+    /// }
+    /// #
+    /// # impl<T> From<T> for PathSegment
+    /// # where
+    /// #     T: Into<Ident>,
+    /// # {
+    /// #     fn from(ident: T) -> Self {
+    /// #         PathSegment {
+    /// #             ident: ident.into(),
+    /// #             arguments: PathArguments::None,
+    /// #         }
+    /// #     }
+    /// # }
+    ///
+    /// impl Parse for PathSegment {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         if input.peek(Token![super])
+    ///             || input.peek(Token![self])
+    ///             || input.peek(Token![Self])
+    ///             || input.peek(Token![crate])
+    ///             || input.peek(Token![extern])
+    ///         {
+    ///             let ident = input.call(Ident::parse_any)?;
+    ///             return Ok(PathSegment::from(ident));
+    ///         }
+    ///
+    ///         let ident = input.parse()?;
+    ///         if input.peek(Token![::]) && input.peek3(Token![<]) {
+    ///             return Ok(PathSegment {
+    ///                 ident,
+    ///                 arguments: PathArguments::AngleBracketed(input.parse()?),
+    ///             });
+    ///         }
+    ///         if input.peek(Token![<]) && !input.peek(Token![<=]) {
+    ///             let fork = input.fork();
+    ///             if let Ok(arguments) = fork.parse() {
+    ///                 input.advance_to(&fork);
+    ///                 return Ok(PathSegment {
+    ///                     ident,
+    ///                     arguments: PathArguments::AngleBracketed(arguments),
+    ///                 });
+    ///             }
+    ///         }
+    ///         Ok(PathSegment::from(ident))
+    ///     }
+    /// }
+    ///
+    /// # syn::parse_str::<PathSegment>("a<b,c>").unwrap();
+    /// ```
+    ///
+    /// # Drawbacks
+    ///
+    /// The main drawback of this style of speculative parsing is in error
+    /// presentation. Even if the lookahead is the "correct" parse, the error
+    /// that is shown is that of the "fallback" parse. To use the same example
+    /// as the turbofish above, take the following unfinished "turbofish":
+    ///
+    /// ```text
+    /// let _ = f<&'a fn(), for<'a> serde::>();
+    /// ```
+    ///
+    /// If this is parsed as generic arguments, we can provide the error message
+    ///
+    /// ```text
+    /// error: expected identifier
+    ///  --> src.rs:L:C
+    ///   |
+    /// L | let _ = f<&'a fn(), for<'a> serde::>();
+    ///   |                                    ^
+    /// ```
+    ///
+    /// but if parsed using the above speculative parsing, it falls back to
+    /// assuming that the `<` is a less-than when it fails to parse the generic
+    /// arguments, and tries to interpret the `&'a` as the start of a labelled
+    /// loop, resulting in the much less helpful error
+    ///
+    /// ```text
+    /// error: expected `:`
+    ///  --> src.rs:L:C
+    ///   |
+    /// L | let _ = f<&'a fn(), for<'a> serde::>();
+    ///   |               ^^
+    /// ```
+    ///
+    /// This can be mitigated with various heuristics (two examples: show both
+    /// forks' parse errors, or show the one that consumed more tokens), but
+    /// when you can control the grammar, sticking to something that can be
+    /// parsed LL(3) and without the LL(*) speculative parsing this makes
+    /// possible, displaying reasonable errors becomes much more simple.
+    ///
+    /// [RFC 2544]: https://github.com/rust-lang/rfcs/pull/2544
+    /// [`PathSegment`]: crate::PathSegment
+    ///
+    /// # Performance
+    ///
+    /// This method performs a cheap fixed amount of work that does not depend
+    /// on how far apart the two streams are positioned.
+    ///
+    /// # Panics
+    ///
+    /// The forked stream in the argument of `advance_to` must have been
+    /// obtained by forking `self`. Attempting to advance to any other stream
+    /// will cause a panic.
+    fn advance_to(&self, fork: &Self);
+}
+
+impl<'a> Speculative for ParseBuffer<'a> {
+    fn advance_to(&self, fork: &Self) {
+        if !crate::buffer::same_scope(self.cursor(), fork.cursor()) {
+            panic!("Fork was not derived from the advancing parse stream");
+        }
+
+        let (self_unexp, self_sp) = inner_unexpected(self);
+        let (fork_unexp, fork_sp) = inner_unexpected(fork);
+        if !Rc::ptr_eq(&self_unexp, &fork_unexp) {
+            match (fork_sp, self_sp) {
+                // Unexpected set on the fork, but not on `self`, copy it over.
+                (Some(span), None) => {
+                    self_unexp.set(Unexpected::Some(span));
+                }
+                // Unexpected unset. Use chain to propagate errors from fork.
+                (None, None) => {
+                    fork_unexp.set(Unexpected::Chain(self_unexp));
+
+                    // Ensure toplevel 'unexpected' tokens from the fork don't
+                    // bubble up the chain by replacing the root `unexpected`
+                    // pointer, only 'unexpected' tokens from existing group
+                    // parsers should bubble.
+                    fork.unexpected
+                        .set(Some(Rc::new(Cell::new(Unexpected::None))));
+                }
+                // Unexpected has been set on `self`. No changes needed.
+                (_, Some(_)) => {}
+            }
+        }
+
+        // See comment on `cell` in the struct definition.
+        self.cell
+            .set(unsafe { mem::transmute::<Cursor, Cursor<'static>>(fork.cursor()) })
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/error.rs.html b/src/syn/error.rs.html new file mode 100644 index 0000000..c55c9d3 --- /dev/null +++ b/src/syn/error.rs.html @@ -0,0 +1,739 @@ +error.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+
+use std;
+use std::fmt::{self, Debug, Display};
+use std::iter::FromIterator;
+use std::slice;
+use std::vec;
+
+use proc_macro2::{
+    Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree,
+};
+#[cfg(feature = "printing")]
+use quote::ToTokens;
+
+#[cfg(feature = "parsing")]
+use crate::buffer::Cursor;
+use crate::thread::ThreadBound;
+
+/// The result of a Syn parser.
+pub type Result<T> = std::result::Result<T, Error>;
+
+/// Error returned when a Syn parser cannot parse the input tokens.
+///
+/// # Error reporting in proc macros
+///
+/// The correct way to report errors back to the compiler from a procedural
+/// macro is by emitting an appropriately spanned invocation of
+/// [`compile_error!`] in the generated code. This produces a better diagnostic
+/// message than simply panicking the macro.
+///
+/// [`compile_error!`]: https://doc.rust-lang.org/std/macro.compile_error.html
+///
+/// When parsing macro input, the [`parse_macro_input!`] macro handles the
+/// conversion to `compile_error!` automatically.
+///
+/// ```
+/// extern crate proc_macro;
+///
+/// use proc_macro::TokenStream;
+/// use syn::{parse_macro_input, AttributeArgs, ItemFn};
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro_attribute]
+/// # };
+/// pub fn my_attr(args: TokenStream, input: TokenStream) -> TokenStream {
+///     let args = parse_macro_input!(args as AttributeArgs);
+///     let input = parse_macro_input!(input as ItemFn);
+///
+///     /* ... */
+///     # TokenStream::new()
+/// }
+/// ```
+///
+/// For errors that arise later than the initial parsing stage, the
+/// [`.to_compile_error()`] method can be used to perform an explicit conversion
+/// to `compile_error!`.
+///
+/// [`.to_compile_error()`]: Error::to_compile_error
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// # use proc_macro::TokenStream;
+/// # use syn::{parse_macro_input, DeriveInput};
+/// #
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro_derive(MyDerive)]
+/// # };
+/// pub fn my_derive(input: TokenStream) -> TokenStream {
+///     let input = parse_macro_input!(input as DeriveInput);
+///
+///     // fn(DeriveInput) -> syn::Result<proc_macro2::TokenStream>
+///     expand::my_derive(input)
+///         .unwrap_or_else(|err| err.to_compile_error())
+///         .into()
+/// }
+/// #
+/// # mod expand {
+/// #     use proc_macro2::TokenStream;
+/// #     use syn::{DeriveInput, Result};
+/// #
+/// #     pub fn my_derive(input: DeriveInput) -> Result<TokenStream> {
+/// #         unimplemented!()
+/// #     }
+/// # }
+/// ```
+#[derive(Clone)]
+pub struct Error {
+    messages: Vec<ErrorMessage>,
+}
+
+struct ErrorMessage {
+    // Span is implemented as an index into a thread-local interner to keep the
+    // size small. It is not safe to access from a different thread. We want
+    // errors to be Send and Sync to play nicely with the Failure crate, so pin
+    // the span we're given to its original thread and assume it is
+    // Span::call_site if accessed from any other thread.
+    start_span: ThreadBound<Span>,
+    end_span: ThreadBound<Span>,
+    message: String,
+}
+
+#[cfg(test)]
+struct _Test
+where
+    Error: Send + Sync;
+
+impl Error {
+    /// Usually the [`ParseStream::error`] method will be used instead, which
+    /// automatically uses the correct span from the current position of the
+    /// parse stream.
+    ///
+    /// Use `Error::new` when the error needs to be triggered on some span other
+    /// than where the parse stream is currently positioned.
+    ///
+    /// [`ParseStream::error`]: crate::parse::ParseBuffer::error
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{Error, Ident, LitStr, Result, Token};
+    /// use syn::parse::ParseStream;
+    ///
+    /// // Parses input that looks like `name = "string"` where the key must be
+    /// // the identifier `name` and the value may be any string literal.
+    /// // Returns the string literal.
+    /// fn parse_name(input: ParseStream) -> Result<LitStr> {
+    ///     let name_token: Ident = input.parse()?;
+    ///     if name_token != "name" {
+    ///         // Trigger an error not on the current position of the stream,
+    ///         // but on the position of the unexpected identifier.
+    ///         return Err(Error::new(name_token.span(), "expected `name`"));
+    ///     }
+    ///     input.parse::<Token![=]>()?;
+    ///     let s: LitStr = input.parse()?;
+    ///     Ok(s)
+    /// }
+    /// ```
+    pub fn new<T: Display>(span: Span, message: T) -> Self {
+        Error {
+            messages: vec![ErrorMessage {
+                start_span: ThreadBound::new(span),
+                end_span: ThreadBound::new(span),
+                message: message.to_string(),
+            }],
+        }
+    }
+
+    /// Creates an error with the specified message spanning the given syntax
+    /// tree node.
+    ///
+    /// Unlike the `Error::new` constructor, this constructor takes an argument
+    /// `tokens` which is a syntax tree node. This allows the resulting `Error`
+    /// to attempt to span all tokens inside of `tokens`. While you would
+    /// typically be able to use the `Spanned` trait with the above `Error::new`
+    /// constructor, implementation limitations today mean that
+    /// `Error::new_spanned` may provide a higher-quality error message on
+    /// stable Rust.
+    ///
+    /// When in doubt it's recommended to stick to `Error::new` (or
+    /// `ParseStream::error`)!
+    #[cfg(feature = "printing")]
+    pub fn new_spanned<T: ToTokens, U: Display>(tokens: T, message: U) -> Self {
+        let mut iter = tokens.into_token_stream().into_iter();
+        let start = iter.next().map_or_else(Span::call_site, |t| t.span());
+        let end = iter.last().map_or(start, |t| t.span());
+        Error {
+            messages: vec![ErrorMessage {
+                start_span: ThreadBound::new(start),
+                end_span: ThreadBound::new(end),
+                message: message.to_string(),
+            }],
+        }
+    }
+
+    /// The source location of the error.
+    ///
+    /// Spans are not thread-safe so this function returns `Span::call_site()`
+    /// if called from a different thread than the one on which the `Error` was
+    /// originally created.
+    pub fn span(&self) -> Span {
+        let start = match self.messages[0].start_span.get() {
+            Some(span) => *span,
+            None => return Span::call_site(),
+        };
+        let end = match self.messages[0].end_span.get() {
+            Some(span) => *span,
+            None => return Span::call_site(),
+        };
+        start.join(end).unwrap_or(start)
+    }
+
+    /// Render the error as an invocation of [`compile_error!`].
+    ///
+    /// The [`parse_macro_input!`] macro provides a convenient way to invoke
+    /// this method correctly in a procedural macro.
+    ///
+    /// [`compile_error!`]: https://doc.rust-lang.org/std/macro.compile_error.html
+    pub fn to_compile_error(&self) -> TokenStream {
+        self.messages
+            .iter()
+            .map(ErrorMessage::to_compile_error)
+            .collect()
+    }
+
+    /// Add another error message to self such that when `to_compile_error()` is
+    /// called, both errors will be emitted together.
+    pub fn combine(&mut self, another: Error) {
+        self.messages.extend(another.messages)
+    }
+}
+
+impl ErrorMessage {
+    fn to_compile_error(&self) -> TokenStream {
+        let start = self
+            .start_span
+            .get()
+            .cloned()
+            .unwrap_or_else(Span::call_site);
+        let end = self.end_span.get().cloned().unwrap_or_else(Span::call_site);
+
+        // compile_error!($message)
+        TokenStream::from_iter(vec![
+            TokenTree::Ident(Ident::new("compile_error", start)),
+            TokenTree::Punct({
+                let mut punct = Punct::new('!', Spacing::Alone);
+                punct.set_span(start);
+                punct
+            }),
+            TokenTree::Group({
+                let mut group = Group::new(Delimiter::Brace, {
+                    TokenStream::from_iter(vec![TokenTree::Literal({
+                        let mut string = Literal::string(&self.message);
+                        string.set_span(end);
+                        string
+                    })])
+                });
+                group.set_span(end);
+                group
+            }),
+        ])
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub fn new_at<T: Display>(scope: Span, cursor: Cursor, message: T) -> Error {
+    if cursor.eof() {
+        Error::new(scope, format!("unexpected end of input, {}", message))
+    } else {
+        let span = crate::buffer::open_span_of_group(cursor);
+        Error::new(span, message)
+    }
+}
+
+#[cfg(all(feature = "parsing", any(feature = "full", feature = "derive")))]
+pub fn new2<T: Display>(start: Span, end: Span, message: T) -> Error {
+    Error {
+        messages: vec![ErrorMessage {
+            start_span: ThreadBound::new(start),
+            end_span: ThreadBound::new(end),
+            message: message.to_string(),
+        }],
+    }
+}
+
+impl Debug for Error {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        if self.messages.len() == 1 {
+            formatter
+                .debug_tuple("Error")
+                .field(&self.messages[0])
+                .finish()
+        } else {
+            formatter
+                .debug_tuple("Error")
+                .field(&self.messages)
+                .finish()
+        }
+    }
+}
+
+impl Debug for ErrorMessage {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.message, formatter)
+    }
+}
+
+impl Display for Error {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str(&self.messages[0].message)
+    }
+}
+
+impl Clone for ErrorMessage {
+    fn clone(&self) -> Self {
+        let start = self
+            .start_span
+            .get()
+            .cloned()
+            .unwrap_or_else(Span::call_site);
+        let end = self.end_span.get().cloned().unwrap_or_else(Span::call_site);
+        ErrorMessage {
+            start_span: ThreadBound::new(start),
+            end_span: ThreadBound::new(end),
+            message: self.message.clone(),
+        }
+    }
+}
+
+impl std::error::Error for Error {
+    fn description(&self) -> &str {
+        "parse error"
+    }
+}
+
+impl From<LexError> for Error {
+    fn from(err: LexError) -> Self {
+        Error::new(Span::call_site(), format!("{:?}", err))
+    }
+}
+
+impl IntoIterator for Error {
+    type Item = Error;
+    type IntoIter = IntoIter;
+
+    fn into_iter(self) -> Self::IntoIter {
+        IntoIter {
+            messages: self.messages.into_iter(),
+        }
+    }
+}
+
+pub struct IntoIter {
+    messages: vec::IntoIter<ErrorMessage>,
+}
+
+impl Iterator for IntoIter {
+    type Item = Error;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        Some(Error {
+            messages: vec![self.messages.next()?],
+        })
+    }
+}
+
+impl<'a> IntoIterator for &'a Error {
+    type Item = Error;
+    type IntoIter = Iter<'a>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        Iter {
+            messages: self.messages.iter(),
+        }
+    }
+}
+
+pub struct Iter<'a> {
+    messages: slice::Iter<'a, ErrorMessage>,
+}
+
+impl<'a> Iterator for Iter<'a> {
+    type Item = Error;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        Some(Error {
+            messages: vec![self.messages.next()?.clone()],
+        })
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/export.rs.html b/src/syn/export.rs.html new file mode 100644 index 0000000..fcacb33 --- /dev/null +++ b/src/syn/export.rs.html @@ -0,0 +1,73 @@ +export.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
+pub use std::clone::Clone;
+pub use std::cmp::{Eq, PartialEq};
+pub use std::convert::From;
+pub use std::default::Default;
+pub use std::fmt::{self, Debug, Formatter};
+pub use std::hash::{Hash, Hasher};
+pub use std::marker::Copy;
+pub use std::option::Option::{None, Some};
+pub use std::result::Result::{Err, Ok};
+
+#[cfg(feature = "printing")]
+pub extern crate quote;
+
+pub use proc_macro2::{Span, TokenStream as TokenStream2};
+
+pub use crate::span::IntoSpans;
+
+#[cfg(all(
+    not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
+    feature = "proc-macro"
+))]
+pub use proc_macro::TokenStream;
+
+#[cfg(feature = "printing")]
+pub use quote::{ToTokens, TokenStreamExt};
+
+#[allow(non_camel_case_types)]
+pub type bool = help::Bool;
+#[allow(non_camel_case_types)]
+pub type str = help::Str;
+
+mod help {
+    pub type Bool = bool;
+    pub type Str = str;
+}
+
+
\ No newline at end of file diff --git a/src/syn/expr.rs.html b/src/syn/expr.rs.html new file mode 100644 index 0000000..f807d4a --- /dev/null +++ b/src/syn/expr.rs.html @@ -0,0 +1,6475 @@ +expr.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+2277
+2278
+2279
+2280
+2281
+2282
+2283
+2284
+2285
+2286
+2287
+2288
+2289
+2290
+2291
+2292
+2293
+2294
+2295
+2296
+2297
+2298
+2299
+2300
+2301
+2302
+2303
+2304
+2305
+2306
+2307
+2308
+2309
+2310
+2311
+2312
+2313
+2314
+2315
+2316
+2317
+2318
+2319
+2320
+2321
+2322
+2323
+2324
+2325
+2326
+2327
+2328
+2329
+2330
+2331
+2332
+2333
+2334
+2335
+2336
+2337
+2338
+2339
+2340
+2341
+2342
+2343
+2344
+2345
+2346
+2347
+2348
+2349
+2350
+2351
+2352
+2353
+2354
+2355
+2356
+2357
+2358
+2359
+2360
+2361
+2362
+2363
+2364
+2365
+2366
+2367
+2368
+2369
+2370
+2371
+2372
+2373
+2374
+2375
+2376
+2377
+2378
+2379
+2380
+2381
+2382
+2383
+2384
+2385
+2386
+2387
+2388
+2389
+2390
+2391
+2392
+2393
+2394
+2395
+2396
+2397
+2398
+2399
+2400
+2401
+2402
+2403
+2404
+2405
+2406
+2407
+2408
+2409
+2410
+2411
+2412
+2413
+2414
+2415
+2416
+2417
+2418
+2419
+2420
+2421
+2422
+2423
+2424
+2425
+2426
+2427
+2428
+2429
+2430
+2431
+2432
+2433
+2434
+2435
+2436
+2437
+2438
+2439
+2440
+2441
+2442
+2443
+2444
+2445
+2446
+2447
+2448
+2449
+2450
+2451
+2452
+2453
+2454
+2455
+2456
+2457
+2458
+2459
+2460
+2461
+2462
+2463
+2464
+2465
+2466
+2467
+2468
+2469
+2470
+2471
+2472
+2473
+2474
+2475
+2476
+2477
+2478
+2479
+2480
+2481
+2482
+2483
+2484
+2485
+2486
+2487
+2488
+2489
+2490
+2491
+2492
+2493
+2494
+2495
+2496
+2497
+2498
+2499
+2500
+2501
+2502
+2503
+2504
+2505
+2506
+2507
+2508
+2509
+2510
+2511
+2512
+2513
+2514
+2515
+2516
+2517
+2518
+2519
+2520
+2521
+2522
+2523
+2524
+2525
+2526
+2527
+2528
+2529
+2530
+2531
+2532
+2533
+2534
+2535
+2536
+2537
+2538
+2539
+2540
+2541
+2542
+2543
+2544
+2545
+2546
+2547
+2548
+2549
+2550
+2551
+2552
+2553
+2554
+2555
+2556
+2557
+2558
+2559
+2560
+2561
+2562
+2563
+2564
+2565
+2566
+2567
+2568
+2569
+2570
+2571
+2572
+2573
+2574
+2575
+2576
+2577
+2578
+2579
+2580
+2581
+2582
+2583
+2584
+2585
+2586
+2587
+2588
+2589
+2590
+2591
+2592
+2593
+2594
+2595
+2596
+2597
+2598
+2599
+2600
+2601
+2602
+2603
+2604
+2605
+2606
+2607
+2608
+2609
+2610
+2611
+2612
+2613
+2614
+2615
+2616
+2617
+2618
+2619
+2620
+2621
+2622
+2623
+2624
+2625
+2626
+2627
+2628
+2629
+2630
+2631
+2632
+2633
+2634
+2635
+2636
+2637
+2638
+2639
+2640
+2641
+2642
+2643
+2644
+2645
+2646
+2647
+2648
+2649
+2650
+2651
+2652
+2653
+2654
+2655
+2656
+2657
+2658
+2659
+2660
+2661
+2662
+2663
+2664
+2665
+2666
+2667
+2668
+2669
+2670
+2671
+2672
+2673
+2674
+2675
+2676
+2677
+2678
+2679
+2680
+2681
+2682
+2683
+2684
+2685
+2686
+2687
+2688
+2689
+2690
+2691
+2692
+2693
+2694
+2695
+2696
+2697
+2698
+2699
+2700
+2701
+2702
+2703
+2704
+2705
+2706
+2707
+2708
+2709
+2710
+2711
+2712
+2713
+2714
+2715
+2716
+2717
+2718
+2719
+2720
+2721
+2722
+2723
+2724
+2725
+2726
+2727
+2728
+2729
+2730
+2731
+2732
+2733
+2734
+2735
+2736
+2737
+2738
+2739
+2740
+2741
+2742
+2743
+2744
+2745
+2746
+2747
+2748
+2749
+2750
+2751
+2752
+2753
+2754
+2755
+2756
+2757
+2758
+2759
+2760
+2761
+2762
+2763
+2764
+2765
+2766
+2767
+2768
+2769
+2770
+2771
+2772
+2773
+2774
+2775
+2776
+2777
+2778
+2779
+2780
+2781
+2782
+2783
+2784
+2785
+2786
+2787
+2788
+2789
+2790
+2791
+2792
+2793
+2794
+2795
+2796
+2797
+2798
+2799
+2800
+2801
+2802
+2803
+2804
+2805
+2806
+2807
+2808
+2809
+2810
+2811
+2812
+2813
+2814
+2815
+2816
+2817
+2818
+2819
+2820
+2821
+2822
+2823
+2824
+2825
+2826
+2827
+2828
+2829
+2830
+2831
+2832
+2833
+2834
+2835
+2836
+2837
+2838
+2839
+2840
+2841
+2842
+2843
+2844
+2845
+2846
+2847
+2848
+2849
+2850
+2851
+2852
+2853
+2854
+2855
+2856
+2857
+2858
+2859
+2860
+2861
+2862
+2863
+2864
+2865
+2866
+2867
+2868
+2869
+2870
+2871
+2872
+2873
+2874
+2875
+2876
+2877
+2878
+2879
+2880
+2881
+2882
+2883
+2884
+2885
+2886
+2887
+2888
+2889
+2890
+2891
+2892
+2893
+2894
+2895
+2896
+2897
+2898
+2899
+2900
+2901
+2902
+2903
+2904
+2905
+2906
+2907
+2908
+2909
+2910
+2911
+2912
+2913
+2914
+2915
+2916
+2917
+2918
+2919
+2920
+2921
+2922
+2923
+2924
+2925
+2926
+2927
+2928
+2929
+2930
+2931
+2932
+2933
+2934
+2935
+2936
+2937
+2938
+2939
+2940
+2941
+2942
+2943
+2944
+2945
+2946
+2947
+2948
+2949
+2950
+2951
+2952
+2953
+2954
+2955
+2956
+2957
+2958
+2959
+2960
+2961
+2962
+2963
+2964
+2965
+2966
+2967
+2968
+2969
+2970
+2971
+2972
+2973
+2974
+2975
+2976
+2977
+2978
+2979
+2980
+2981
+2982
+2983
+2984
+2985
+2986
+2987
+2988
+2989
+2990
+2991
+2992
+2993
+2994
+2995
+2996
+2997
+2998
+2999
+3000
+3001
+3002
+3003
+3004
+3005
+3006
+3007
+3008
+3009
+3010
+3011
+3012
+3013
+3014
+3015
+3016
+3017
+3018
+3019
+3020
+3021
+3022
+3023
+3024
+3025
+3026
+3027
+3028
+3029
+3030
+3031
+3032
+3033
+3034
+3035
+3036
+3037
+3038
+3039
+3040
+3041
+3042
+3043
+3044
+3045
+3046
+3047
+3048
+3049
+3050
+3051
+3052
+3053
+3054
+3055
+3056
+3057
+3058
+3059
+3060
+3061
+3062
+3063
+3064
+3065
+3066
+3067
+3068
+3069
+3070
+3071
+3072
+3073
+3074
+3075
+3076
+3077
+3078
+3079
+3080
+3081
+3082
+3083
+3084
+3085
+3086
+3087
+3088
+3089
+3090
+3091
+3092
+3093
+3094
+3095
+3096
+3097
+3098
+3099
+3100
+3101
+3102
+3103
+3104
+3105
+3106
+3107
+3108
+3109
+3110
+3111
+3112
+3113
+3114
+3115
+3116
+3117
+3118
+3119
+3120
+3121
+3122
+3123
+3124
+3125
+3126
+3127
+3128
+3129
+3130
+3131
+3132
+3133
+3134
+3135
+3136
+3137
+3138
+3139
+3140
+3141
+3142
+3143
+3144
+3145
+3146
+3147
+3148
+3149
+3150
+3151
+3152
+3153
+3154
+3155
+3156
+3157
+3158
+3159
+3160
+3161
+3162
+3163
+3164
+3165
+3166
+3167
+3168
+3169
+3170
+3171
+3172
+3173
+3174
+3175
+3176
+3177
+3178
+3179
+3180
+3181
+3182
+3183
+3184
+3185
+3186
+3187
+3188
+3189
+3190
+3191
+3192
+3193
+3194
+3195
+3196
+3197
+3198
+3199
+3200
+3201
+3202
+3203
+3204
+3205
+3206
+3207
+3208
+3209
+3210
+3211
+3212
+3213
+3214
+3215
+3216
+3217
+3218
+3219
+3220
+3221
+3222
+3223
+3224
+3225
+3226
+3227
+3228
+3229
+3230
+3231
+3232
+3233
+3234
+3235
+3236
+
+use super::*;
+use crate::punctuated::Punctuated;
+#[cfg(feature = "extra-traits")]
+use crate::tt::TokenStreamHelper;
+use proc_macro2::{Span, TokenStream};
+#[cfg(feature = "printing")]
+use quote::IdentFragment;
+#[cfg(feature = "printing")]
+use std::fmt::{self, Display};
+use std::hash::{Hash, Hasher};
+#[cfg(all(feature = "parsing", feature = "full"))]
+use std::mem;
+
+ast_enum_of_structs! {
+    /// A Rust expression.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    ///
+    /// # Syntax tree enums
+    ///
+    /// This type is a syntax tree enum. In Syn this and other syntax tree enums
+    /// are designed to be traversed using the following rebinding idiom.
+    ///
+    /// ```
+    /// # use syn::Expr;
+    /// #
+    /// # fn example(expr: Expr) {
+    /// # const IGNORE: &str = stringify! {
+    /// let expr: Expr = /* ... */;
+    /// # };
+    /// match expr {
+    ///     Expr::MethodCall(expr) => {
+    ///         /* ... */
+    ///     }
+    ///     Expr::Cast(expr) => {
+    ///         /* ... */
+    ///     }
+    ///     Expr::If(expr) => {
+    ///         /* ... */
+    ///     }
+    ///
+    ///     /* ... */
+    ///     # _ => {}
+    /// # }
+    /// # }
+    /// ```
+    ///
+    /// We begin with a variable `expr` of type `Expr` that has no fields
+    /// (because it is an enum), and by matching on it and rebinding a variable
+    /// with the same name `expr` we effectively imbue our variable with all of
+    /// the data fields provided by the variant that it turned out to be. So for
+    /// example above if we ended up in the `MethodCall` case then we get to use
+    /// `expr.receiver`, `expr.args` etc; if we ended up in the `If` case we get
+    /// to use `expr.cond`, `expr.then_branch`, `expr.else_branch`.
+    ///
+    /// This approach avoids repeating the variant names twice on every line.
+    ///
+    /// ```
+    /// # use syn::{Expr, ExprMethodCall};
+    /// #
+    /// # fn example(expr: Expr) {
+    /// // Repetitive; recommend not doing this.
+    /// match expr {
+    ///     Expr::MethodCall(ExprMethodCall { method, args, .. }) => {
+    /// # }
+    /// # _ => {}
+    /// # }
+    /// # }
+    /// ```
+    ///
+    /// In general, the name to which a syntax tree enum variant is bound should
+    /// be a suitable name for the complete syntax tree enum type.
+    ///
+    /// ```
+    /// # use syn::{Expr, ExprField};
+    /// #
+    /// # fn example(discriminant: ExprField) {
+    /// // Binding is called `base` which is the name I would use if I were
+    /// // assigning `*discriminant.base` without an `if let`.
+    /// if let Expr::Tuple(base) = *discriminant.base {
+    /// # }
+    /// # }
+    /// ```
+    ///
+    /// A sign that you may not be choosing the right variable names is if you
+    /// see names getting repeated in your code, like accessing
+    /// `receiver.receiver` or `pat.pat` or `cond.cond`.
+    pub enum Expr #manual_extra_traits {
+        /// A slice literal expression: `[a, b, c, d]`.
+        Array(ExprArray),
+
+        /// An assignment expression: `a = compute()`.
+        Assign(ExprAssign),
+
+        /// A compound assignment expression: `counter += 1`.
+        AssignOp(ExprAssignOp),
+
+        /// An async block: `async { ... }`.
+        Async(ExprAsync),
+
+        /// An await expression: `fut.await`.
+        Await(ExprAwait),
+
+        /// A binary operation: `a + b`, `a * b`.
+        Binary(ExprBinary),
+
+        /// A blocked scope: `{ ... }`.
+        Block(ExprBlock),
+
+        /// A box expression: `box f`.
+        Box(ExprBox),
+
+        /// A `break`, with an optional label to break and an optional
+        /// expression.
+        Break(ExprBreak),
+
+        /// A function call expression: `invoke(a, b)`.
+        Call(ExprCall),
+
+        /// A cast expression: `foo as f64`.
+        Cast(ExprCast),
+
+        /// A closure expression: `|a, b| a + b`.
+        Closure(ExprClosure),
+
+        /// A `continue`, with an optional label.
+        Continue(ExprContinue),
+
+        /// Access of a named struct field (`obj.k`) or unnamed tuple struct
+        /// field (`obj.0`).
+        Field(ExprField),
+
+        /// A for loop: `for pat in expr { ... }`.
+        ForLoop(ExprForLoop),
+
+        /// An expression contained within invisible delimiters.
+        ///
+        /// This variant is important for faithfully representing the precedence
+        /// of expressions and is related to `None`-delimited spans in a
+        /// `TokenStream`.
+        Group(ExprGroup),
+
+        /// An `if` expression with an optional `else` block: `if expr { ... }
+        /// else { ... }`.
+        ///
+        /// The `else` branch expression may only be an `If` or `Block`
+        /// expression, not any of the other types of expression.
+        If(ExprIf),
+
+        /// A square bracketed indexing expression: `vector[2]`.
+        Index(ExprIndex),
+
+        /// A `let` guard: `let Some(x) = opt`.
+        Let(ExprLet),
+
+        /// A literal in place of an expression: `1`, `"foo"`.
+        Lit(ExprLit),
+
+        /// Conditionless loop: `loop { ... }`.
+        Loop(ExprLoop),
+
+        /// A macro invocation expression: `format!("{}", q)`.
+        Macro(ExprMacro),
+
+        /// A `match` expression: `match n { Some(n) => {}, None => {} }`.
+        Match(ExprMatch),
+
+        /// A method call expression: `x.foo::<T>(a, b)`.
+        MethodCall(ExprMethodCall),
+
+        /// A parenthesized expression: `(a + b)`.
+        Paren(ExprParen),
+
+        /// A path like `std::mem::replace` possibly containing generic
+        /// parameters and a qualified self-type.
+        ///
+        /// A plain identifier like `x` is a path of length 1.
+        Path(ExprPath),
+
+        /// A range expression: `1..2`, `1..`, `..2`, `1..=2`, `..=2`.
+        Range(ExprRange),
+
+        /// A referencing operation: `&a` or `&mut a`.
+        Reference(ExprReference),
+
+        /// An array literal constructed from one repeated element: `[0u8; N]`.
+        Repeat(ExprRepeat),
+
+        /// A `return`, with an optional value to be returned.
+        Return(ExprReturn),
+
+        /// A struct literal expression: `Point { x: 1, y: 1 }`.
+        ///
+        /// The `rest` provides the value of the remaining fields as in `S { a:
+        /// 1, b: 1, ..rest }`.
+        Struct(ExprStruct),
+
+        /// A try-expression: `expr?`.
+        Try(ExprTry),
+
+        /// A try block: `try { ... }`.
+        TryBlock(ExprTryBlock),
+
+        /// A tuple expression: `(a, b, c, d)`.
+        Tuple(ExprTuple),
+
+        /// A type ascription expression: `foo: f64`.
+        Type(ExprType),
+
+        /// A unary operation: `!x`, `*x`.
+        Unary(ExprUnary),
+
+        /// An unsafe block: `unsafe { ... }`.
+        Unsafe(ExprUnsafe),
+
+        /// Tokens in expression position not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        /// A while loop: `while expr { ... }`.
+        While(ExprWhile),
+
+        /// A yield expression: `yield expr`.
+        Yield(ExprYield),
+
+        #[doc(hidden)]
+        __Nonexhaustive,
+    }
+}
+
+ast_struct! {
+    /// A slice literal expression: `[a, b, c, d]`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprArray #full {
+        pub attrs: Vec<Attribute>,
+        pub bracket_token: token::Bracket,
+        pub elems: Punctuated<Expr, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// An assignment expression: `a = compute()`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprAssign #full {
+        pub attrs: Vec<Attribute>,
+        pub left: Box<Expr>,
+        pub eq_token: Token![=],
+        pub right: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A compound assignment expression: `counter += 1`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprAssignOp #full {
+        pub attrs: Vec<Attribute>,
+        pub left: Box<Expr>,
+        pub op: BinOp,
+        pub right: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// An async block: `async { ... }`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprAsync #full {
+        pub attrs: Vec<Attribute>,
+        pub async_token: Token![async],
+        pub capture: Option<Token![move]>,
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// An await expression: `fut.await`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprAwait #full {
+        pub attrs: Vec<Attribute>,
+        pub base: Box<Expr>,
+        pub dot_token: Token![.],
+        pub await_token: token::Await,
+    }
+}
+
+ast_struct! {
+    /// A binary operation: `a + b`, `a * b`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct ExprBinary {
+        pub attrs: Vec<Attribute>,
+        pub left: Box<Expr>,
+        pub op: BinOp,
+        pub right: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A blocked scope: `{ ... }`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprBlock #full {
+        pub attrs: Vec<Attribute>,
+        pub label: Option<Label>,
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// A box expression: `box f`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprBox #full {
+        pub attrs: Vec<Attribute>,
+        pub box_token: Token![box],
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A `break`, with an optional label to break and an optional
+    /// expression.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprBreak #full {
+        pub attrs: Vec<Attribute>,
+        pub break_token: Token![break],
+        pub label: Option<Lifetime>,
+        pub expr: Option<Box<Expr>>,
+    }
+}
+
+ast_struct! {
+    /// A function call expression: `invoke(a, b)`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct ExprCall {
+        pub attrs: Vec<Attribute>,
+        pub func: Box<Expr>,
+        pub paren_token: token::Paren,
+        pub args: Punctuated<Expr, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A cast expression: `foo as f64`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct ExprCast {
+        pub attrs: Vec<Attribute>,
+        pub expr: Box<Expr>,
+        pub as_token: Token![as],
+        pub ty: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A closure expression: `|a, b| a + b`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprClosure #full {
+        pub attrs: Vec<Attribute>,
+        pub asyncness: Option<Token![async]>,
+        pub movability: Option<Token![static]>,
+        pub capture: Option<Token![move]>,
+        pub or1_token: Token![|],
+        pub inputs: Punctuated<Pat, Token![,]>,
+        pub or2_token: Token![|],
+        pub output: ReturnType,
+        pub body: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A `continue`, with an optional label.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprContinue #full {
+        pub attrs: Vec<Attribute>,
+        pub continue_token: Token![continue],
+        pub label: Option<Lifetime>,
+    }
+}
+
+ast_struct! {
+    /// Access of a named struct field (`obj.k`) or unnamed tuple struct
+    /// field (`obj.0`).
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprField {
+        pub attrs: Vec<Attribute>,
+        pub base: Box<Expr>,
+        pub dot_token: Token![.],
+        pub member: Member,
+    }
+}
+
+ast_struct! {
+    /// A for loop: `for pat in expr { ... }`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprForLoop #full {
+        pub attrs: Vec<Attribute>,
+        pub label: Option<Label>,
+        pub for_token: Token![for],
+        pub pat: Pat,
+        pub in_token: Token![in],
+        pub expr: Box<Expr>,
+        pub body: Block,
+    }
+}
+
+ast_struct! {
+    /// An expression contained within invisible delimiters.
+    ///
+    /// This variant is important for faithfully representing the precedence
+    /// of expressions and is related to `None`-delimited spans in a
+    /// `TokenStream`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprGroup #full {
+        pub attrs: Vec<Attribute>,
+        pub group_token: token::Group,
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// An `if` expression with an optional `else` block: `if expr { ... }
+    /// else { ... }`.
+    ///
+    /// The `else` branch expression may only be an `If` or `Block`
+    /// expression, not any of the other types of expression.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprIf #full {
+        pub attrs: Vec<Attribute>,
+        pub if_token: Token![if],
+        pub cond: Box<Expr>,
+        pub then_branch: Block,
+        pub else_branch: Option<(Token![else], Box<Expr>)>,
+    }
+}
+
+ast_struct! {
+    /// A square bracketed indexing expression: `vector[2]`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct ExprIndex {
+        pub attrs: Vec<Attribute>,
+        pub expr: Box<Expr>,
+        pub bracket_token: token::Bracket,
+        pub index: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A `let` guard: `let Some(x) = opt`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprLet #full {
+        pub attrs: Vec<Attribute>,
+        pub let_token: Token![let],
+        pub pat: Pat,
+        pub eq_token: Token![=],
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A literal in place of an expression: `1`, `"foo"`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct ExprLit {
+        pub attrs: Vec<Attribute>,
+        pub lit: Lit,
+    }
+}
+
+ast_struct! {
+    /// Conditionless loop: `loop { ... }`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprLoop #full {
+        pub attrs: Vec<Attribute>,
+        pub label: Option<Label>,
+        pub loop_token: Token![loop],
+        pub body: Block,
+    }
+}
+
+ast_struct! {
+    /// A macro invocation expression: `format!("{}", q)`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprMacro #full {
+        pub attrs: Vec<Attribute>,
+        pub mac: Macro,
+    }
+}
+
+ast_struct! {
+    /// A `match` expression: `match n { Some(n) => {}, None => {} }`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprMatch #full {
+        pub attrs: Vec<Attribute>,
+        pub match_token: Token![match],
+        pub expr: Box<Expr>,
+        pub brace_token: token::Brace,
+        pub arms: Vec<Arm>,
+    }
+}
+
+ast_struct! {
+    /// A method call expression: `x.foo::<T>(a, b)`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprMethodCall #full {
+        pub attrs: Vec<Attribute>,
+        pub receiver: Box<Expr>,
+        pub dot_token: Token![.],
+        pub method: Ident,
+        pub turbofish: Option<MethodTurbofish>,
+        pub paren_token: token::Paren,
+        pub args: Punctuated<Expr, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A parenthesized expression: `(a + b)`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprParen {
+        pub attrs: Vec<Attribute>,
+        pub paren_token: token::Paren,
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A path like `std::mem::replace` possibly containing generic
+    /// parameters and a qualified self-type.
+    ///
+    /// A plain identifier like `x` is a path of length 1.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct ExprPath {
+        pub attrs: Vec<Attribute>,
+        pub qself: Option<QSelf>,
+        pub path: Path,
+    }
+}
+
+ast_struct! {
+    /// A range expression: `1..2`, `1..`, `..2`, `1..=2`, `..=2`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprRange #full {
+        pub attrs: Vec<Attribute>,
+        pub from: Option<Box<Expr>>,
+        pub limits: RangeLimits,
+        pub to: Option<Box<Expr>>,
+    }
+}
+
+ast_struct! {
+    /// A referencing operation: `&a` or `&mut a`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprReference #full {
+        pub attrs: Vec<Attribute>,
+        pub and_token: Token![&],
+        pub raw: Reserved,
+        pub mutability: Option<Token![mut]>,
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// An array literal constructed from one repeated element: `[0u8; N]`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprRepeat #full {
+        pub attrs: Vec<Attribute>,
+        pub bracket_token: token::Bracket,
+        pub expr: Box<Expr>,
+        pub semi_token: Token![;],
+        pub len: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A `return`, with an optional value to be returned.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprReturn #full {
+        pub attrs: Vec<Attribute>,
+        pub return_token: Token![return],
+        pub expr: Option<Box<Expr>>,
+    }
+}
+
+ast_struct! {
+    /// A struct literal expression: `Point { x: 1, y: 1 }`.
+    ///
+    /// The `rest` provides the value of the remaining fields as in `S { a:
+    /// 1, b: 1, ..rest }`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprStruct #full {
+        pub attrs: Vec<Attribute>,
+        pub path: Path,
+        pub brace_token: token::Brace,
+        pub fields: Punctuated<FieldValue, Token![,]>,
+        pub dot2_token: Option<Token![..]>,
+        pub rest: Option<Box<Expr>>,
+    }
+}
+
+ast_struct! {
+    /// A try-expression: `expr?`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprTry #full {
+        pub attrs: Vec<Attribute>,
+        pub expr: Box<Expr>,
+        pub question_token: Token![?],
+    }
+}
+
+ast_struct! {
+    /// A try block: `try { ... }`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprTryBlock #full {
+        pub attrs: Vec<Attribute>,
+        pub try_token: Token![try],
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// A tuple expression: `(a, b, c, d)`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprTuple #full {
+        pub attrs: Vec<Attribute>,
+        pub paren_token: token::Paren,
+        pub elems: Punctuated<Expr, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A type ascription expression: `foo: f64`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprType #full {
+        pub attrs: Vec<Attribute>,
+        pub expr: Box<Expr>,
+        pub colon_token: Token![:],
+        pub ty: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A unary operation: `!x`, `*x`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct ExprUnary {
+        pub attrs: Vec<Attribute>,
+        pub op: UnOp,
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// An unsafe block: `unsafe { ... }`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprUnsafe #full {
+        pub attrs: Vec<Attribute>,
+        pub unsafe_token: Token![unsafe],
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// A while loop: `while expr { ... }`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprWhile #full {
+        pub attrs: Vec<Attribute>,
+        pub label: Option<Label>,
+        pub while_token: Token![while],
+        pub cond: Box<Expr>,
+        pub body: Block,
+    }
+}
+
+ast_struct! {
+    /// A yield expression: `yield expr`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct ExprYield #full {
+        pub attrs: Vec<Attribute>,
+        pub yield_token: Token![yield],
+        pub expr: Option<Box<Expr>>,
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+impl Eq for Expr {}
+
+#[cfg(feature = "extra-traits")]
+impl PartialEq for Expr {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (Expr::Array(this), Expr::Array(other)) => this == other,
+            (Expr::Assign(this), Expr::Assign(other)) => this == other,
+            (Expr::AssignOp(this), Expr::AssignOp(other)) => this == other,
+            (Expr::Async(this), Expr::Async(other)) => this == other,
+            (Expr::Await(this), Expr::Await(other)) => this == other,
+            (Expr::Binary(this), Expr::Binary(other)) => this == other,
+            (Expr::Block(this), Expr::Block(other)) => this == other,
+            (Expr::Box(this), Expr::Box(other)) => this == other,
+            (Expr::Break(this), Expr::Break(other)) => this == other,
+            (Expr::Call(this), Expr::Call(other)) => this == other,
+            (Expr::Cast(this), Expr::Cast(other)) => this == other,
+            (Expr::Closure(this), Expr::Closure(other)) => this == other,
+            (Expr::Continue(this), Expr::Continue(other)) => this == other,
+            (Expr::Field(this), Expr::Field(other)) => this == other,
+            (Expr::ForLoop(this), Expr::ForLoop(other)) => this == other,
+            (Expr::Group(this), Expr::Group(other)) => this == other,
+            (Expr::If(this), Expr::If(other)) => this == other,
+            (Expr::Index(this), Expr::Index(other)) => this == other,
+            (Expr::Let(this), Expr::Let(other)) => this == other,
+            (Expr::Lit(this), Expr::Lit(other)) => this == other,
+            (Expr::Loop(this), Expr::Loop(other)) => this == other,
+            (Expr::Macro(this), Expr::Macro(other)) => this == other,
+            (Expr::Match(this), Expr::Match(other)) => this == other,
+            (Expr::MethodCall(this), Expr::MethodCall(other)) => this == other,
+            (Expr::Paren(this), Expr::Paren(other)) => this == other,
+            (Expr::Path(this), Expr::Path(other)) => this == other,
+            (Expr::Range(this), Expr::Range(other)) => this == other,
+            (Expr::Reference(this), Expr::Reference(other)) => this == other,
+            (Expr::Repeat(this), Expr::Repeat(other)) => this == other,
+            (Expr::Return(this), Expr::Return(other)) => this == other,
+            (Expr::Struct(this), Expr::Struct(other)) => this == other,
+            (Expr::Try(this), Expr::Try(other)) => this == other,
+            (Expr::TryBlock(this), Expr::TryBlock(other)) => this == other,
+            (Expr::Tuple(this), Expr::Tuple(other)) => this == other,
+            (Expr::Type(this), Expr::Type(other)) => this == other,
+            (Expr::Unary(this), Expr::Unary(other)) => this == other,
+            (Expr::Unsafe(this), Expr::Unsafe(other)) => this == other,
+            (Expr::Verbatim(this), Expr::Verbatim(other)) => {
+                TokenStreamHelper(this) == TokenStreamHelper(other)
+            }
+            (Expr::While(this), Expr::While(other)) => this == other,
+            (Expr::Yield(this), Expr::Yield(other)) => this == other,
+            _ => false,
+        }
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+impl Hash for Expr {
+    fn hash<H>(&self, hash: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            Expr::Array(expr) => {
+                hash.write_u8(0);
+                expr.hash(hash);
+            }
+            Expr::Assign(expr) => {
+                hash.write_u8(1);
+                expr.hash(hash);
+            }
+            Expr::AssignOp(expr) => {
+                hash.write_u8(2);
+                expr.hash(hash);
+            }
+            Expr::Async(expr) => {
+                hash.write_u8(3);
+                expr.hash(hash);
+            }
+            Expr::Await(expr) => {
+                hash.write_u8(4);
+                expr.hash(hash);
+            }
+            Expr::Binary(expr) => {
+                hash.write_u8(5);
+                expr.hash(hash);
+            }
+            Expr::Block(expr) => {
+                hash.write_u8(6);
+                expr.hash(hash);
+            }
+            Expr::Box(expr) => {
+                hash.write_u8(7);
+                expr.hash(hash);
+            }
+            Expr::Break(expr) => {
+                hash.write_u8(8);
+                expr.hash(hash);
+            }
+            Expr::Call(expr) => {
+                hash.write_u8(9);
+                expr.hash(hash);
+            }
+            Expr::Cast(expr) => {
+                hash.write_u8(10);
+                expr.hash(hash);
+            }
+            Expr::Closure(expr) => {
+                hash.write_u8(11);
+                expr.hash(hash);
+            }
+            Expr::Continue(expr) => {
+                hash.write_u8(12);
+                expr.hash(hash);
+            }
+            Expr::Field(expr) => {
+                hash.write_u8(13);
+                expr.hash(hash);
+            }
+            Expr::ForLoop(expr) => {
+                hash.write_u8(14);
+                expr.hash(hash);
+            }
+            Expr::Group(expr) => {
+                hash.write_u8(15);
+                expr.hash(hash);
+            }
+            Expr::If(expr) => {
+                hash.write_u8(16);
+                expr.hash(hash);
+            }
+            Expr::Index(expr) => {
+                hash.write_u8(17);
+                expr.hash(hash);
+            }
+            Expr::Let(expr) => {
+                hash.write_u8(18);
+                expr.hash(hash);
+            }
+            Expr::Lit(expr) => {
+                hash.write_u8(19);
+                expr.hash(hash);
+            }
+            Expr::Loop(expr) => {
+                hash.write_u8(20);
+                expr.hash(hash);
+            }
+            Expr::Macro(expr) => {
+                hash.write_u8(21);
+                expr.hash(hash);
+            }
+            Expr::Match(expr) => {
+                hash.write_u8(22);
+                expr.hash(hash);
+            }
+            Expr::MethodCall(expr) => {
+                hash.write_u8(23);
+                expr.hash(hash);
+            }
+            Expr::Paren(expr) => {
+                hash.write_u8(24);
+                expr.hash(hash);
+            }
+            Expr::Path(expr) => {
+                hash.write_u8(25);
+                expr.hash(hash);
+            }
+            Expr::Range(expr) => {
+                hash.write_u8(26);
+                expr.hash(hash);
+            }
+            Expr::Reference(expr) => {
+                hash.write_u8(27);
+                expr.hash(hash);
+            }
+            Expr::Repeat(expr) => {
+                hash.write_u8(28);
+                expr.hash(hash);
+            }
+            Expr::Return(expr) => {
+                hash.write_u8(29);
+                expr.hash(hash);
+            }
+            Expr::Struct(expr) => {
+                hash.write_u8(30);
+                expr.hash(hash);
+            }
+            Expr::Try(expr) => {
+                hash.write_u8(31);
+                expr.hash(hash);
+            }
+            Expr::TryBlock(expr) => {
+                hash.write_u8(32);
+                expr.hash(hash);
+            }
+            Expr::Tuple(expr) => {
+                hash.write_u8(33);
+                expr.hash(hash);
+            }
+            Expr::Type(expr) => {
+                hash.write_u8(34);
+                expr.hash(hash);
+            }
+            Expr::Unary(expr) => {
+                hash.write_u8(35);
+                expr.hash(hash);
+            }
+            Expr::Unsafe(expr) => {
+                hash.write_u8(36);
+                expr.hash(hash);
+            }
+            Expr::Verbatim(expr) => {
+                hash.write_u8(37);
+                TokenStreamHelper(expr).hash(hash);
+            }
+            Expr::While(expr) => {
+                hash.write_u8(38);
+                expr.hash(hash);
+            }
+            Expr::Yield(expr) => {
+                hash.write_u8(39);
+                expr.hash(hash);
+            }
+            Expr::__Nonexhaustive => unreachable!(),
+        }
+    }
+}
+
+impl Expr {
+    #[cfg(all(feature = "parsing", feature = "full"))]
+    pub(crate) fn replace_attrs(&mut self, new: Vec<Attribute>) -> Vec<Attribute> {
+        match self {
+            Expr::Box(ExprBox { attrs, .. })
+            | Expr::Array(ExprArray { attrs, .. })
+            | Expr::Call(ExprCall { attrs, .. })
+            | Expr::MethodCall(ExprMethodCall { attrs, .. })
+            | Expr::Tuple(ExprTuple { attrs, .. })
+            | Expr::Binary(ExprBinary { attrs, .. })
+            | Expr::Unary(ExprUnary { attrs, .. })
+            | Expr::Lit(ExprLit { attrs, .. })
+            | Expr::Cast(ExprCast { attrs, .. })
+            | Expr::Type(ExprType { attrs, .. })
+            | Expr::Let(ExprLet { attrs, .. })
+            | Expr::If(ExprIf { attrs, .. })
+            | Expr::While(ExprWhile { attrs, .. })
+            | Expr::ForLoop(ExprForLoop { attrs, .. })
+            | Expr::Loop(ExprLoop { attrs, .. })
+            | Expr::Match(ExprMatch { attrs, .. })
+            | Expr::Closure(ExprClosure { attrs, .. })
+            | Expr::Unsafe(ExprUnsafe { attrs, .. })
+            | Expr::Block(ExprBlock { attrs, .. })
+            | Expr::Assign(ExprAssign { attrs, .. })
+            | Expr::AssignOp(ExprAssignOp { attrs, .. })
+            | Expr::Field(ExprField { attrs, .. })
+            | Expr::Index(ExprIndex { attrs, .. })
+            | Expr::Range(ExprRange { attrs, .. })
+            | Expr::Path(ExprPath { attrs, .. })
+            | Expr::Reference(ExprReference { attrs, .. })
+            | Expr::Break(ExprBreak { attrs, .. })
+            | Expr::Continue(ExprContinue { attrs, .. })
+            | Expr::Return(ExprReturn { attrs, .. })
+            | Expr::Macro(ExprMacro { attrs, .. })
+            | Expr::Struct(ExprStruct { attrs, .. })
+            | Expr::Repeat(ExprRepeat { attrs, .. })
+            | Expr::Paren(ExprParen { attrs, .. })
+            | Expr::Group(ExprGroup { attrs, .. })
+            | Expr::Try(ExprTry { attrs, .. })
+            | Expr::Async(ExprAsync { attrs, .. })
+            | Expr::Await(ExprAwait { attrs, .. })
+            | Expr::TryBlock(ExprTryBlock { attrs, .. })
+            | Expr::Yield(ExprYield { attrs, .. }) => mem::replace(attrs, new),
+            Expr::Verbatim(_) => Vec::new(),
+            Expr::__Nonexhaustive => unreachable!(),
+        }
+    }
+}
+
+ast_enum! {
+    /// A struct or tuple struct field accessed in a struct literal or field
+    /// expression.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    #[derive(Eq, PartialEq, Hash)]
+    pub enum Member #manual_extra_traits {
+        /// A named field like `self.x`.
+        Named(Ident),
+        /// An unnamed field like `self.0`.
+        Unnamed(Index),
+    }
+}
+
+#[cfg(feature = "printing")]
+impl IdentFragment for Member {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Member::Named(m) => Display::fmt(m, formatter),
+            Member::Unnamed(m) => Display::fmt(&m.index, formatter),
+        }
+    }
+
+    fn span(&self) -> Option<Span> {
+        match self {
+            Member::Named(m) => Some(m.span()),
+            Member::Unnamed(m) => Some(m.span),
+        }
+    }
+}
+
+ast_struct! {
+    /// The index of an unnamed tuple struct field.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct Index #manual_extra_traits {
+        pub index: u32,
+        pub span: Span,
+    }
+}
+
+impl From<usize> for Index {
+    fn from(index: usize) -> Index {
+        assert!(index < u32::max_value() as usize);
+        Index {
+            index: index as u32,
+            span: Span::call_site(),
+        }
+    }
+}
+
+impl Eq for Index {}
+
+impl PartialEq for Index {
+    fn eq(&self, other: &Self) -> bool {
+        self.index == other.index
+    }
+}
+
+impl Hash for Index {
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        self.index.hash(state);
+    }
+}
+
+#[cfg(feature = "printing")]
+impl IdentFragment for Index {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.index, formatter)
+    }
+
+    fn span(&self) -> Option<Span> {
+        Some(self.span)
+    }
+}
+
+#[cfg(feature = "full")]
+ast_struct! {
+    #[derive(Default)]
+    pub struct Reserved {
+        _private: (),
+    }
+}
+
+#[cfg(feature = "full")]
+ast_struct! {
+    /// The `::<>` explicit type parameters passed to a method call:
+    /// `parse::<u64>()`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct MethodTurbofish {
+        pub colon2_token: Token![::],
+        pub lt_token: Token![<],
+        pub args: Punctuated<GenericMethodArgument, Token![,]>,
+        pub gt_token: Token![>],
+    }
+}
+
+#[cfg(feature = "full")]
+ast_enum! {
+    /// An individual generic argument to a method, like `T`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub enum GenericMethodArgument {
+        /// A type argument.
+        Type(Type),
+        /// A const expression. Must be inside of a block.
+        ///
+        /// NOTE: Identity expressions are represented as Type arguments, as
+        /// they are indistinguishable syntactically.
+        Const(Expr),
+    }
+}
+
+#[cfg(feature = "full")]
+ast_struct! {
+    /// A field-value pair in a struct literal.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct FieldValue {
+        /// Attributes tagged on the field.
+        pub attrs: Vec<Attribute>,
+
+        /// Name or index of the field.
+        pub member: Member,
+
+        /// The colon in `Struct { x: x }`. If written in shorthand like
+        /// `Struct { x }`, there is no colon.
+        pub colon_token: Option<Token![:]>,
+
+        /// Value of the field.
+        pub expr: Expr,
+    }
+}
+
+#[cfg(feature = "full")]
+ast_struct! {
+    /// A lifetime labeling a `for`, `while`, or `loop`.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct Label {
+        pub name: Lifetime,
+        pub colon_token: Token![:],
+    }
+}
+
+#[cfg(feature = "full")]
+ast_struct! {
+    /// One arm of a `match` expression: `0...10 => { return true; }`.
+    ///
+    /// As in:
+    ///
+    /// ```
+    /// # fn f() -> bool {
+    /// #     let n = 0;
+    /// match n {
+    ///     0...10 => {
+    ///         return true;
+    ///     }
+    ///     // ...
+    ///     # _ => {}
+    /// }
+    /// #   false
+    /// # }
+    /// ```
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    pub struct Arm {
+        pub attrs: Vec<Attribute>,
+        pub pat: Pat,
+        pub guard: Option<(Token![if], Box<Expr>)>,
+        pub fat_arrow_token: Token![=>],
+        pub body: Box<Expr>,
+        pub comma: Option<Token![,]>,
+    }
+}
+
+#[cfg(feature = "full")]
+ast_enum! {
+    /// Limit types of a range, inclusive or exclusive.
+    ///
+    /// *This type is available if Syn is built with the `"full"` feature.*
+    #[cfg_attr(feature = "clone-impls", derive(Copy))]
+    pub enum RangeLimits {
+        /// Inclusive at the beginning, exclusive at the end.
+        HalfOpen(Token![..]),
+        /// Inclusive at the beginning and end.
+        Closed(Token![..=]),
+    }
+}
+
+#[cfg(any(feature = "parsing", feature = "printing"))]
+#[cfg(feature = "full")]
+pub(crate) fn requires_terminator(expr: &Expr) -> bool {
+    // see https://github.com/rust-lang/rust/blob/eb8f2586e/src/libsyntax/parse/classify.rs#L17-L37
+    match *expr {
+        Expr::Unsafe(..)
+        | Expr::Block(..)
+        | Expr::If(..)
+        | Expr::Match(..)
+        | Expr::While(..)
+        | Expr::Loop(..)
+        | Expr::ForLoop(..)
+        | Expr::Async(..)
+        | Expr::TryBlock(..) => false,
+        _ => true,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use super::*;
+
+    use crate::parse::discouraged::Speculative;
+    use crate::parse::{Parse, ParseStream, Result};
+    use crate::path;
+
+    // When we're parsing expressions which occur before blocks, like in an if
+    // statement's condition, we cannot parse a struct literal.
+    //
+    // Struct literals are ambiguous in certain positions
+    // https://github.com/rust-lang/rfcs/pull/92
+    #[derive(Copy, Clone)]
+    pub struct AllowStruct(bool);
+
+    #[derive(Copy, Clone, PartialEq, PartialOrd)]
+    enum Precedence {
+        Any,
+        Assign,
+        Range,
+        Or,
+        And,
+        Compare,
+        BitOr,
+        BitXor,
+        BitAnd,
+        Shift,
+        Arithmetic,
+        Term,
+        Cast,
+    }
+
+    impl Precedence {
+        fn of(op: &BinOp) -> Self {
+            match *op {
+                BinOp::Add(_) | BinOp::Sub(_) => Precedence::Arithmetic,
+                BinOp::Mul(_) | BinOp::Div(_) | BinOp::Rem(_) => Precedence::Term,
+                BinOp::And(_) => Precedence::And,
+                BinOp::Or(_) => Precedence::Or,
+                BinOp::BitXor(_) => Precedence::BitXor,
+                BinOp::BitAnd(_) => Precedence::BitAnd,
+                BinOp::BitOr(_) => Precedence::BitOr,
+                BinOp::Shl(_) | BinOp::Shr(_) => Precedence::Shift,
+                BinOp::Eq(_)
+                | BinOp::Lt(_)
+                | BinOp::Le(_)
+                | BinOp::Ne(_)
+                | BinOp::Ge(_)
+                | BinOp::Gt(_) => Precedence::Compare,
+                BinOp::AddEq(_)
+                | BinOp::SubEq(_)
+                | BinOp::MulEq(_)
+                | BinOp::DivEq(_)
+                | BinOp::RemEq(_)
+                | BinOp::BitXorEq(_)
+                | BinOp::BitAndEq(_)
+                | BinOp::BitOrEq(_)
+                | BinOp::ShlEq(_)
+                | BinOp::ShrEq(_) => Precedence::Assign,
+            }
+        }
+    }
+
+    impl Parse for Expr {
+        fn parse(input: ParseStream) -> Result<Self> {
+            ambiguous_expr(input, AllowStruct(true))
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_no_struct(input: ParseStream) -> Result<Expr> {
+        ambiguous_expr(input, AllowStruct(false))
+    }
+
+    #[cfg(feature = "full")]
+    fn parse_expr(
+        input: ParseStream,
+        mut lhs: Expr,
+        allow_struct: AllowStruct,
+        base: Precedence,
+    ) -> Result<Expr> {
+        loop {
+            if input
+                .fork()
+                .parse::<BinOp>()
+                .ok()
+                .map_or(false, |op| Precedence::of(&op) >= base)
+            {
+                let op: BinOp = input.parse()?;
+                let precedence = Precedence::of(&op);
+                let mut rhs = unary_expr(input, allow_struct)?;
+                loop {
+                    let next = peek_precedence(input);
+                    if next > precedence || next == precedence && precedence == Precedence::Assign {
+                        rhs = parse_expr(input, rhs, allow_struct, next)?;
+                    } else {
+                        break;
+                    }
+                }
+                lhs = if precedence == Precedence::Assign {
+                    Expr::AssignOp(ExprAssignOp {
+                        attrs: Vec::new(),
+                        left: Box::new(lhs),
+                        op,
+                        right: Box::new(rhs),
+                    })
+                } else {
+                    Expr::Binary(ExprBinary {
+                        attrs: Vec::new(),
+                        left: Box::new(lhs),
+                        op,
+                        right: Box::new(rhs),
+                    })
+                };
+            } else if Precedence::Assign >= base
+                && input.peek(Token![=])
+                && !input.peek(Token![==])
+                && !input.peek(Token![=>])
+            {
+                let eq_token: Token![=] = input.parse()?;
+                let mut rhs = unary_expr(input, allow_struct)?;
+                loop {
+                    let next = peek_precedence(input);
+                    if next >= Precedence::Assign {
+                        rhs = parse_expr(input, rhs, allow_struct, next)?;
+                    } else {
+                        break;
+                    }
+                }
+                lhs = Expr::Assign(ExprAssign {
+                    attrs: Vec::new(),
+                    left: Box::new(lhs),
+                    eq_token,
+                    right: Box::new(rhs),
+                });
+            } else if Precedence::Range >= base && input.peek(Token![..]) {
+                let limits: RangeLimits = input.parse()?;
+                let rhs = if input.is_empty()
+                    || input.peek(Token![,])
+                    || input.peek(Token![;])
+                    || !allow_struct.0 && input.peek(token::Brace)
+                {
+                    None
+                } else {
+                    let mut rhs = unary_expr(input, allow_struct)?;
+                    loop {
+                        let next = peek_precedence(input);
+                        if next > Precedence::Range {
+                            rhs = parse_expr(input, rhs, allow_struct, next)?;
+                        } else {
+                            break;
+                        }
+                    }
+                    Some(rhs)
+                };
+                lhs = Expr::Range(ExprRange {
+                    attrs: Vec::new(),
+                    from: Some(Box::new(lhs)),
+                    limits,
+                    to: rhs.map(Box::new),
+                });
+            } else if Precedence::Cast >= base && input.peek(Token![as]) {
+                let as_token: Token![as] = input.parse()?;
+                let ty = input.call(Type::without_plus)?;
+                lhs = Expr::Cast(ExprCast {
+                    attrs: Vec::new(),
+                    expr: Box::new(lhs),
+                    as_token,
+                    ty: Box::new(ty),
+                });
+            } else if Precedence::Cast >= base && input.peek(Token![:]) && !input.peek(Token![::]) {
+                let colon_token: Token![:] = input.parse()?;
+                let ty = input.call(Type::without_plus)?;
+                lhs = Expr::Type(ExprType {
+                    attrs: Vec::new(),
+                    expr: Box::new(lhs),
+                    colon_token,
+                    ty: Box::new(ty),
+                });
+            } else {
+                break;
+            }
+        }
+        Ok(lhs)
+    }
+
+    #[cfg(not(feature = "full"))]
+    fn parse_expr(
+        input: ParseStream,
+        mut lhs: Expr,
+        allow_struct: AllowStruct,
+        base: Precedence,
+    ) -> Result<Expr> {
+        loop {
+            if input
+                .fork()
+                .parse::<BinOp>()
+                .ok()
+                .map_or(false, |op| Precedence::of(&op) >= base)
+            {
+                let op: BinOp = input.parse()?;
+                let precedence = Precedence::of(&op);
+                let mut rhs = unary_expr(input, allow_struct)?;
+                loop {
+                    let next = peek_precedence(input);
+                    if next > precedence || next == precedence && precedence == Precedence::Assign {
+                        rhs = parse_expr(input, rhs, allow_struct, next)?;
+                    } else {
+                        break;
+                    }
+                }
+                lhs = Expr::Binary(ExprBinary {
+                    attrs: Vec::new(),
+                    left: Box::new(lhs),
+                    op,
+                    right: Box::new(rhs),
+                });
+            } else if Precedence::Cast >= base && input.peek(Token![as]) {
+                let as_token: Token![as] = input.parse()?;
+                let ty = input.call(Type::without_plus)?;
+                lhs = Expr::Cast(ExprCast {
+                    attrs: Vec::new(),
+                    expr: Box::new(lhs),
+                    as_token,
+                    ty: Box::new(ty),
+                });
+            } else {
+                break;
+            }
+        }
+        Ok(lhs)
+    }
+
+    fn peek_precedence(input: ParseStream) -> Precedence {
+        if let Ok(op) = input.fork().parse() {
+            Precedence::of(&op)
+        } else if input.peek(Token![=]) && !input.peek(Token![=>]) {
+            Precedence::Assign
+        } else if input.peek(Token![..]) {
+            Precedence::Range
+        } else if input.peek(Token![as]) || input.peek(Token![:]) && !input.peek(Token![::]) {
+            Precedence::Cast
+        } else {
+            Precedence::Any
+        }
+    }
+
+    // Parse an arbitrary expression.
+    fn ambiguous_expr(input: ParseStream, allow_struct: AllowStruct) -> Result<Expr> {
+        let lhs = unary_expr(input, allow_struct)?;
+        parse_expr(input, lhs, allow_struct, Precedence::Any)
+    }
+
+    // <UnOp> <trailer>
+    // & <trailer>
+    // &mut <trailer>
+    // box <trailer>
+    #[cfg(feature = "full")]
+    fn unary_expr(input: ParseStream, allow_struct: AllowStruct) -> Result<Expr> {
+        let ahead = input.fork();
+        let attrs = ahead.call(Attribute::parse_outer)?;
+        if ahead.peek(Token![&])
+            || ahead.peek(Token![box])
+            || ahead.peek(Token![*])
+            || ahead.peek(Token![!])
+            || ahead.peek(Token![-])
+        {
+            input.advance_to(&ahead);
+            if input.peek(Token![&]) {
+                Ok(Expr::Reference(ExprReference {
+                    attrs,
+                    and_token: input.parse()?,
+                    raw: Reserved::default(),
+                    mutability: input.parse()?,
+                    expr: Box::new(unary_expr(input, allow_struct)?),
+                }))
+            } else if input.peek(Token![box]) {
+                Ok(Expr::Box(ExprBox {
+                    attrs,
+                    box_token: input.parse()?,
+                    expr: Box::new(unary_expr(input, allow_struct)?),
+                }))
+            } else {
+                Ok(Expr::Unary(ExprUnary {
+                    attrs,
+                    op: input.parse()?,
+                    expr: Box::new(unary_expr(input, allow_struct)?),
+                }))
+            }
+        } else {
+            trailer_expr(input, allow_struct)
+        }
+    }
+
+    #[cfg(not(feature = "full"))]
+    fn unary_expr(input: ParseStream, allow_struct: AllowStruct) -> Result<Expr> {
+        let ahead = input.fork();
+        let attrs = ahead.call(Attribute::parse_outer)?;
+        if ahead.peek(Token![*]) || ahead.peek(Token![!]) || ahead.peek(Token![-]) {
+            input.advance_to(&ahead);
+            Ok(Expr::Unary(ExprUnary {
+                attrs,
+                op: input.parse()?,
+                expr: Box::new(unary_expr(input, allow_struct)?),
+            }))
+        } else {
+            trailer_expr(input, allow_struct)
+        }
+    }
+
+    // <atom> (..<args>) ...
+    // <atom> . <ident> (..<args>) ...
+    // <atom> . <ident> ...
+    // <atom> . <lit> ...
+    // <atom> [ <expr> ] ...
+    // <atom> ? ...
+    #[cfg(feature = "full")]
+    fn trailer_expr(input: ParseStream, allow_struct: AllowStruct) -> Result<Expr> {
+        if input.peek(token::Group) {
+            return input.call(expr_group).map(Expr::Group);
+        }
+
+        let outer_attrs = input.call(Attribute::parse_outer)?;
+
+        let atom = atom_expr(input, allow_struct)?;
+        let mut e = trailer_helper(input, atom)?;
+
+        let inner_attrs = e.replace_attrs(Vec::new());
+        let attrs = private::attrs(outer_attrs, inner_attrs);
+        e.replace_attrs(attrs);
+        Ok(e)
+    }
+
+    #[cfg(feature = "full")]
+    fn trailer_helper(input: ParseStream, mut e: Expr) -> Result<Expr> {
+        loop {
+            if input.peek(token::Paren) {
+                let content;
+                e = Expr::Call(ExprCall {
+                    attrs: Vec::new(),
+                    func: Box::new(e),
+                    paren_token: parenthesized!(content in input),
+                    args: content.parse_terminated(Expr::parse)?,
+                });
+            } else if input.peek(Token![.]) && !input.peek(Token![..]) {
+                let dot_token: Token![.] = input.parse()?;
+
+                if input.peek(token::Await) {
+                    e = Expr::Await(ExprAwait {
+                        attrs: Vec::new(),
+                        base: Box::new(e),
+                        dot_token,
+                        await_token: input.parse()?,
+                    });
+                    continue;
+                }
+
+                let member: Member = input.parse()?;
+                let turbofish = if member.is_named() && input.peek(Token![::]) {
+                    Some(MethodTurbofish {
+                        colon2_token: input.parse()?,
+                        lt_token: input.parse()?,
+                        args: {
+                            let mut args = Punctuated::new();
+                            loop {
+                                if input.peek(Token![>]) {
+                                    break;
+                                }
+                                let value = input.call(generic_method_argument)?;
+                                args.push_value(value);
+                                if input.peek(Token![>]) {
+                                    break;
+                                }
+                                let punct = input.parse()?;
+                                args.push_punct(punct);
+                            }
+                            args
+                        },
+                        gt_token: input.parse()?,
+                    })
+                } else {
+                    None
+                };
+
+                if turbofish.is_some() || input.peek(token::Paren) {
+                    if let Member::Named(method) = member {
+                        let content;
+                        e = Expr::MethodCall(ExprMethodCall {
+                            attrs: Vec::new(),
+                            receiver: Box::new(e),
+                            dot_token,
+                            method,
+                            turbofish,
+                            paren_token: parenthesized!(content in input),
+                            args: content.parse_terminated(Expr::parse)?,
+                        });
+                        continue;
+                    }
+                }
+
+                e = Expr::Field(ExprField {
+                    attrs: Vec::new(),
+                    base: Box::new(e),
+                    dot_token,
+                    member,
+                });
+            } else if input.peek(token::Bracket) {
+                let content;
+                e = Expr::Index(ExprIndex {
+                    attrs: Vec::new(),
+                    expr: Box::new(e),
+                    bracket_token: bracketed!(content in input),
+                    index: content.parse()?,
+                });
+            } else if input.peek(Token![?]) {
+                e = Expr::Try(ExprTry {
+                    attrs: Vec::new(),
+                    expr: Box::new(e),
+                    question_token: input.parse()?,
+                });
+            } else {
+                break;
+            }
+        }
+        Ok(e)
+    }
+
+    #[cfg(not(feature = "full"))]
+    fn trailer_expr(input: ParseStream, allow_struct: AllowStruct) -> Result<Expr> {
+        let mut e = atom_expr(input, allow_struct)?;
+
+        loop {
+            if input.peek(token::Paren) {
+                let content;
+                e = Expr::Call(ExprCall {
+                    attrs: Vec::new(),
+                    func: Box::new(e),
+                    paren_token: parenthesized!(content in input),
+                    args: content.parse_terminated(Expr::parse)?,
+                });
+            } else if input.peek(Token![.]) && !input.peek(Token![..]) && !input.peek2(token::Await)
+            {
+                e = Expr::Field(ExprField {
+                    attrs: Vec::new(),
+                    base: Box::new(e),
+                    dot_token: input.parse()?,
+                    member: input.parse()?,
+                });
+            } else if input.peek(token::Bracket) {
+                let content;
+                e = Expr::Index(ExprIndex {
+                    attrs: Vec::new(),
+                    expr: Box::new(e),
+                    bracket_token: bracketed!(content in input),
+                    index: content.parse()?,
+                });
+            } else {
+                break;
+            }
+        }
+
+        Ok(e)
+    }
+
+    // Parse all atomic expressions which don't have to worry about precedence
+    // interactions, as they are fully contained.
+    #[cfg(feature = "full")]
+    fn atom_expr(input: ParseStream, allow_struct: AllowStruct) -> Result<Expr> {
+        if input.peek(token::Group) {
+            input.call(expr_group).map(Expr::Group)
+        } else if input.peek(Lit) {
+            input.parse().map(Expr::Lit)
+        } else if input.peek(Token![async])
+            && (input.peek2(token::Brace) || input.peek2(Token![move]) && input.peek3(token::Brace))
+        {
+            input.call(expr_async).map(Expr::Async)
+        } else if input.peek(Token![try]) && input.peek2(token::Brace) {
+            input.call(expr_try_block).map(Expr::TryBlock)
+        } else if input.peek(Token![|])
+            || input.peek(Token![async]) && (input.peek2(Token![|]) || input.peek2(Token![move]))
+            || input.peek(Token![static])
+            || input.peek(Token![move])
+        {
+            expr_closure(input, allow_struct).map(Expr::Closure)
+        } else if input.peek(Ident)
+            || input.peek(Token![::])
+            || input.peek(Token![<])
+            || input.peek(Token![self])
+            || input.peek(Token![Self])
+            || input.peek(Token![super])
+            || input.peek(Token![extern])
+            || input.peek(Token![crate])
+        {
+            path_or_macro_or_struct(input, allow_struct)
+        } else if input.peek(token::Paren) {
+            paren_or_tuple(input)
+        } else if input.peek(Token![break]) {
+            expr_break(input, allow_struct).map(Expr::Break)
+        } else if input.peek(Token![continue]) {
+            input.call(expr_continue).map(Expr::Continue)
+        } else if input.peek(Token![return]) {
+            expr_ret(input, allow_struct).map(Expr::Return)
+        } else if input.peek(token::Bracket) {
+            array_or_repeat(input)
+        } else if input.peek(Token![let]) {
+            input.call(expr_let).map(Expr::Let)
+        } else if input.peek(Token![if]) {
+            input.parse().map(Expr::If)
+        } else if input.peek(Token![while]) {
+            input.parse().map(Expr::While)
+        } else if input.peek(Token![for]) {
+            input.parse().map(Expr::ForLoop)
+        } else if input.peek(Token![loop]) {
+            input.parse().map(Expr::Loop)
+        } else if input.peek(Token![match]) {
+            input.parse().map(Expr::Match)
+        } else if input.peek(Token![yield]) {
+            input.call(expr_yield).map(Expr::Yield)
+        } else if input.peek(Token![unsafe]) {
+            input.call(expr_unsafe).map(Expr::Unsafe)
+        } else if input.peek(token::Brace) {
+            input.call(expr_block).map(Expr::Block)
+        } else if input.peek(Token![..]) {
+            expr_range(input, allow_struct).map(Expr::Range)
+        } else if input.peek(Lifetime) {
+            let the_label: Label = input.parse()?;
+            let mut expr = if input.peek(Token![while]) {
+                Expr::While(input.parse()?)
+            } else if input.peek(Token![for]) {
+                Expr::ForLoop(input.parse()?)
+            } else if input.peek(Token![loop]) {
+                Expr::Loop(input.parse()?)
+            } else if input.peek(token::Brace) {
+                Expr::Block(input.call(expr_block)?)
+            } else {
+                return Err(input.error("expected loop or block expression"));
+            };
+            match &mut expr {
+                Expr::While(ExprWhile { label, .. })
+                | Expr::ForLoop(ExprForLoop { label, .. })
+                | Expr::Loop(ExprLoop { label, .. })
+                | Expr::Block(ExprBlock { label, .. }) => *label = Some(the_label),
+                _ => unreachable!(),
+            }
+            Ok(expr)
+        } else {
+            Err(input.error("expected expression"))
+        }
+    }
+
+    #[cfg(not(feature = "full"))]
+    fn atom_expr(input: ParseStream, _allow_struct: AllowStruct) -> Result<Expr> {
+        if input.peek(Lit) {
+            input.parse().map(Expr::Lit)
+        } else if input.peek(token::Paren) {
+            input.call(expr_paren).map(Expr::Paren)
+        } else if input.peek(Ident)
+            || input.peek(Token![::])
+            || input.peek(Token![<])
+            || input.peek(Token![self])
+            || input.peek(Token![Self])
+            || input.peek(Token![super])
+            || input.peek(Token![extern])
+            || input.peek(Token![crate])
+        {
+            input.parse().map(Expr::Path)
+        } else {
+            Err(input.error("unsupported expression; enable syn's features=[\"full\"]"))
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn path_or_macro_or_struct(input: ParseStream, allow_struct: AllowStruct) -> Result<Expr> {
+        let expr: ExprPath = input.parse()?;
+        if expr.qself.is_some() {
+            return Ok(Expr::Path(expr));
+        }
+
+        if input.peek(Token![!]) && !input.peek(Token![!=]) {
+            let mut contains_arguments = false;
+            for segment in &expr.path.segments {
+                match segment.arguments {
+                    PathArguments::None => {}
+                    PathArguments::AngleBracketed(_) | PathArguments::Parenthesized(_) => {
+                        contains_arguments = true;
+                    }
+                }
+            }
+
+            if !contains_arguments {
+                let bang_token: Token![!] = input.parse()?;
+                let (delimiter, tokens) = mac::parse_delimiter(input)?;
+                return Ok(Expr::Macro(ExprMacro {
+                    attrs: Vec::new(),
+                    mac: Macro {
+                        path: expr.path,
+                        bang_token,
+                        delimiter,
+                        tokens,
+                    },
+                }));
+            }
+        }
+
+        if allow_struct.0 && input.peek(token::Brace) {
+            let outer_attrs = Vec::new();
+            expr_struct_helper(input, outer_attrs, expr.path).map(Expr::Struct)
+        } else {
+            Ok(Expr::Path(expr))
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn paren_or_tuple(input: ParseStream) -> Result<Expr> {
+        let content;
+        let paren_token = parenthesized!(content in input);
+        let inner_attrs = content.call(Attribute::parse_inner)?;
+        if content.is_empty() {
+            return Ok(Expr::Tuple(ExprTuple {
+                attrs: inner_attrs,
+                paren_token,
+                elems: Punctuated::new(),
+            }));
+        }
+
+        let first: Expr = content.parse()?;
+        if content.is_empty() {
+            return Ok(Expr::Paren(ExprParen {
+                attrs: inner_attrs,
+                paren_token,
+                expr: Box::new(first),
+            }));
+        }
+
+        let mut elems = Punctuated::new();
+        elems.push_value(first);
+        while !content.is_empty() {
+            let punct = content.parse()?;
+            elems.push_punct(punct);
+            if content.is_empty() {
+                break;
+            }
+            let value = content.parse()?;
+            elems.push_value(value);
+        }
+        Ok(Expr::Tuple(ExprTuple {
+            attrs: inner_attrs,
+            paren_token,
+            elems,
+        }))
+    }
+
+    #[cfg(feature = "full")]
+    fn array_or_repeat(input: ParseStream) -> Result<Expr> {
+        let content;
+        let bracket_token = bracketed!(content in input);
+        let inner_attrs = content.call(Attribute::parse_inner)?;
+        if content.is_empty() {
+            return Ok(Expr::Array(ExprArray {
+                attrs: inner_attrs,
+                bracket_token,
+                elems: Punctuated::new(),
+            }));
+        }
+
+        let first: Expr = content.parse()?;
+        if content.is_empty() || content.peek(Token![,]) {
+            let mut elems = Punctuated::new();
+            elems.push_value(first);
+            while !content.is_empty() {
+                let punct = content.parse()?;
+                elems.push_punct(punct);
+                if content.is_empty() {
+                    break;
+                }
+                let value = content.parse()?;
+                elems.push_value(value);
+            }
+            Ok(Expr::Array(ExprArray {
+                attrs: inner_attrs,
+                bracket_token,
+                elems,
+            }))
+        } else if content.peek(Token![;]) {
+            let semi_token: Token![;] = content.parse()?;
+            let len: Expr = content.parse()?;
+            Ok(Expr::Repeat(ExprRepeat {
+                attrs: inner_attrs,
+                bracket_token,
+                expr: Box::new(first),
+                semi_token,
+                len: Box::new(len),
+            }))
+        } else {
+            Err(content.error("expected `,` or `;`"))
+        }
+    }
+
+    #[cfg(feature = "full")]
+    pub(crate) fn expr_early(input: ParseStream) -> Result<Expr> {
+        let mut attrs = input.call(Attribute::parse_outer)?;
+        let mut expr = if input.peek(Token![if]) {
+            Expr::If(input.parse()?)
+        } else if input.peek(Token![while]) {
+            Expr::While(input.parse()?)
+        } else if input.peek(Token![for]) {
+            Expr::ForLoop(input.parse()?)
+        } else if input.peek(Token![loop]) {
+            Expr::Loop(input.parse()?)
+        } else if input.peek(Token![match]) {
+            Expr::Match(input.parse()?)
+        } else if input.peek(Token![try]) && input.peek2(token::Brace) {
+            Expr::TryBlock(input.call(expr_try_block)?)
+        } else if input.peek(Token![unsafe]) {
+            Expr::Unsafe(input.call(expr_unsafe)?)
+        } else if input.peek(token::Brace) {
+            Expr::Block(input.call(expr_block)?)
+        } else {
+            let allow_struct = AllowStruct(true);
+            let mut expr = unary_expr(input, allow_struct)?;
+
+            attrs.extend(expr.replace_attrs(Vec::new()));
+            expr.replace_attrs(attrs);
+
+            return parse_expr(input, expr, allow_struct, Precedence::Any);
+        };
+
+        if input.peek(Token![.]) || input.peek(Token![?]) {
+            expr = trailer_helper(input, expr)?;
+
+            attrs.extend(expr.replace_attrs(Vec::new()));
+            expr.replace_attrs(attrs);
+
+            let allow_struct = AllowStruct(true);
+            return parse_expr(input, expr, allow_struct, Precedence::Any);
+        }
+
+        attrs.extend(expr.replace_attrs(Vec::new()));
+        expr.replace_attrs(attrs);
+        Ok(expr)
+    }
+
+    impl Parse for ExprLit {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprLit {
+                attrs: Vec::new(),
+                lit: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_group(input: ParseStream) -> Result<ExprGroup> {
+        let group = crate::group::parse_group(input)?;
+        Ok(ExprGroup {
+            attrs: Vec::new(),
+            group_token: group.token,
+            expr: group.content.parse()?,
+        })
+    }
+
+    #[cfg(not(feature = "full"))]
+    fn expr_paren(input: ParseStream) -> Result<ExprParen> {
+        let content;
+        Ok(ExprParen {
+            attrs: Vec::new(),
+            paren_token: parenthesized!(content in input),
+            expr: content.parse()?,
+        })
+    }
+
+    #[cfg(feature = "full")]
+    fn generic_method_argument(input: ParseStream) -> Result<GenericMethodArgument> {
+        // TODO parse const generics as well
+        input.parse().map(GenericMethodArgument::Type)
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_let(input: ParseStream) -> Result<ExprLet> {
+        Ok(ExprLet {
+            attrs: Vec::new(),
+            let_token: input.parse()?,
+            pat: {
+                let leading_vert: Option<Token![|]> = input.parse()?;
+                let pat: Pat = input.parse()?;
+                if leading_vert.is_some()
+                    || input.peek(Token![|]) && !input.peek(Token![||]) && !input.peek(Token![|=])
+                {
+                    let mut cases = Punctuated::new();
+                    cases.push_value(pat);
+                    while input.peek(Token![|])
+                        && !input.peek(Token![||])
+                        && !input.peek(Token![|=])
+                    {
+                        let punct = input.parse()?;
+                        cases.push_punct(punct);
+                        let pat: Pat = input.parse()?;
+                        cases.push_value(pat);
+                    }
+                    Pat::Or(PatOr {
+                        attrs: Vec::new(),
+                        leading_vert,
+                        cases,
+                    })
+                } else {
+                    pat
+                }
+            },
+            eq_token: input.parse()?,
+            expr: Box::new(input.call(expr_no_struct)?),
+        })
+    }
+
+    #[cfg(feature = "full")]
+    impl Parse for ExprIf {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprIf {
+                attrs: Vec::new(),
+                if_token: input.parse()?,
+                cond: Box::new(input.call(expr_no_struct)?),
+                then_branch: input.parse()?,
+                else_branch: {
+                    if input.peek(Token![else]) {
+                        Some(input.call(else_block)?)
+                    } else {
+                        None
+                    }
+                },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn else_block(input: ParseStream) -> Result<(Token![else], Box<Expr>)> {
+        let else_token: Token![else] = input.parse()?;
+
+        let lookahead = input.lookahead1();
+        let else_branch = if input.peek(Token![if]) {
+            input.parse().map(Expr::If)?
+        } else if input.peek(token::Brace) {
+            Expr::Block(ExprBlock {
+                attrs: Vec::new(),
+                label: None,
+                block: input.parse()?,
+            })
+        } else {
+            return Err(lookahead.error());
+        };
+
+        Ok((else_token, Box::new(else_branch)))
+    }
+
+    #[cfg(feature = "full")]
+    impl Parse for ExprForLoop {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let label: Option<Label> = input.parse()?;
+            let for_token: Token![for] = input.parse()?;
+
+            let leading_vert: Option<Token![|]> = input.parse()?;
+            let mut pat: Pat = input.parse()?;
+            if leading_vert.is_some() || input.peek(Token![|]) {
+                let mut cases = Punctuated::new();
+                cases.push_value(pat);
+                while input.peek(Token![|]) {
+                    let punct = input.parse()?;
+                    cases.push_punct(punct);
+                    let pat: Pat = input.parse()?;
+                    cases.push_value(pat);
+                }
+                pat = Pat::Or(PatOr {
+                    attrs: Vec::new(),
+                    leading_vert,
+                    cases,
+                });
+            }
+
+            let in_token: Token![in] = input.parse()?;
+            let expr: Expr = input.call(expr_no_struct)?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            let inner_attrs = content.call(Attribute::parse_inner)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprForLoop {
+                attrs: inner_attrs,
+                label,
+                for_token,
+                pat,
+                in_token,
+                expr: Box::new(expr),
+                body: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl Parse for ExprLoop {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let label: Option<Label> = input.parse()?;
+            let loop_token: Token![loop] = input.parse()?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            let inner_attrs = content.call(Attribute::parse_inner)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprLoop {
+                attrs: inner_attrs,
+                label,
+                loop_token,
+                body: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl Parse for ExprMatch {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let match_token: Token![match] = input.parse()?;
+            let expr = expr_no_struct(input)?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            let inner_attrs = content.call(Attribute::parse_inner)?;
+
+            let mut arms = Vec::new();
+            while !content.is_empty() {
+                arms.push(content.call(Arm::parse)?);
+            }
+
+            Ok(ExprMatch {
+                attrs: inner_attrs,
+                match_token,
+                expr: Box::new(expr),
+                brace_token,
+                arms,
+            })
+        }
+    }
+
+    macro_rules! impl_by_parsing_expr {
+        (
+            $(
+                $expr_type:ty, $variant:ident, $msg:expr,
+            )*
+        ) => {
+            $(
+                #[cfg(all(feature = "full", feature = "printing"))]
+                impl Parse for $expr_type {
+                    fn parse(input: ParseStream) -> Result<Self> {
+                        let mut expr: Expr = input.parse()?;
+                        loop {
+                            match expr {
+                                Expr::$variant(inner) => return Ok(inner),
+                                Expr::Group(next) => expr = *next.expr,
+                                _ => return Err(Error::new_spanned(expr, $msg)),
+                            }
+                        }
+                    }
+                }
+            )*
+        };
+    }
+
+    impl_by_parsing_expr! {
+        ExprBox, Box, "expected box expression",
+        ExprArray, Array, "expected slice literal expression",
+        ExprCall, Call, "expected function call expression",
+        ExprMethodCall, MethodCall, "expected method call expression",
+        ExprTuple, Tuple, "expected tuple expression",
+        ExprBinary, Binary, "expected binary operation",
+        ExprUnary, Unary, "expected unary operation",
+        ExprCast, Cast, "expected cast expression",
+        ExprType, Type, "expected type ascription expression",
+        ExprLet, Let, "expected let guard",
+        ExprClosure, Closure, "expected closure expression",
+        ExprUnsafe, Unsafe, "expected unsafe block",
+        ExprBlock, Block, "expected blocked scope",
+        ExprAssign, Assign, "expected assignment expression",
+        ExprAssignOp, AssignOp, "expected compound assignment expression",
+        ExprField, Field, "expected struct field access",
+        ExprIndex, Index, "expected indexing expression",
+        ExprRange, Range, "expected range expression",
+        ExprReference, Reference, "expected referencing operation",
+        ExprBreak, Break, "expected break expression",
+        ExprContinue, Continue, "expected continue expression",
+        ExprReturn, Return, "expected return expression",
+        ExprMacro, Macro, "expected macro invocation expression",
+        ExprStruct, Struct, "expected struct literal expression",
+        ExprRepeat, Repeat, "expected array literal constructed from one repeated element",
+        ExprParen, Paren, "expected parenthesized expression",
+        ExprTry, Try, "expected try expression",
+        ExprAsync, Async, "expected async block",
+        ExprTryBlock, TryBlock, "expected try block",
+        ExprYield, Yield, "expected yield expression",
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_try_block(input: ParseStream) -> Result<ExprTryBlock> {
+        Ok(ExprTryBlock {
+            attrs: Vec::new(),
+            try_token: input.parse()?,
+            block: input.parse()?,
+        })
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_yield(input: ParseStream) -> Result<ExprYield> {
+        Ok(ExprYield {
+            attrs: Vec::new(),
+            yield_token: input.parse()?,
+            expr: {
+                if !input.is_empty() && !input.peek(Token![,]) && !input.peek(Token![;]) {
+                    Some(input.parse()?)
+                } else {
+                    None
+                }
+            },
+        })
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_closure(input: ParseStream, allow_struct: AllowStruct) -> Result<ExprClosure> {
+        let asyncness: Option<Token![async]> = input.parse()?;
+        let movability: Option<Token![static]> = if asyncness.is_none() {
+            input.parse()?
+        } else {
+            None
+        };
+        let capture: Option<Token![move]> = input.parse()?;
+        let or1_token: Token![|] = input.parse()?;
+
+        let mut inputs = Punctuated::new();
+        loop {
+            if input.peek(Token![|]) {
+                break;
+            }
+            let value = closure_arg(input)?;
+            inputs.push_value(value);
+            if input.peek(Token![|]) {
+                break;
+            }
+            let punct: Token![,] = input.parse()?;
+            inputs.push_punct(punct);
+        }
+
+        let or2_token: Token![|] = input.parse()?;
+
+        let (output, body) = if input.peek(Token![->]) {
+            let arrow_token: Token![->] = input.parse()?;
+            let ty: Type = input.parse()?;
+            let body: Block = input.parse()?;
+            let output = ReturnType::Type(arrow_token, Box::new(ty));
+            let block = Expr::Block(ExprBlock {
+                attrs: Vec::new(),
+                label: None,
+                block: body,
+            });
+            (output, block)
+        } else {
+            let body = ambiguous_expr(input, allow_struct)?;
+            (ReturnType::Default, body)
+        };
+
+        Ok(ExprClosure {
+            attrs: Vec::new(),
+            asyncness,
+            movability,
+            capture,
+            or1_token,
+            inputs,
+            or2_token,
+            output,
+            body: Box::new(body),
+        })
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_async(input: ParseStream) -> Result<ExprAsync> {
+        Ok(ExprAsync {
+            attrs: Vec::new(),
+            async_token: input.parse()?,
+            capture: input.parse()?,
+            block: input.parse()?,
+        })
+    }
+
+    #[cfg(feature = "full")]
+    fn closure_arg(input: ParseStream) -> Result<Pat> {
+        let attrs = input.call(Attribute::parse_outer)?;
+        let mut pat: Pat = input.parse()?;
+
+        if input.peek(Token![:]) {
+            Ok(Pat::Type(PatType {
+                attrs,
+                pat: Box::new(pat),
+                colon_token: input.parse()?,
+                ty: input.parse()?,
+            }))
+        } else {
+            match &mut pat {
+                Pat::Box(pat) => pat.attrs = attrs,
+                Pat::Ident(pat) => pat.attrs = attrs,
+                Pat::Lit(pat) => pat.attrs = attrs,
+                Pat::Macro(pat) => pat.attrs = attrs,
+                Pat::Or(pat) => pat.attrs = attrs,
+                Pat::Path(pat) => pat.attrs = attrs,
+                Pat::Range(pat) => pat.attrs = attrs,
+                Pat::Reference(pat) => pat.attrs = attrs,
+                Pat::Rest(pat) => pat.attrs = attrs,
+                Pat::Slice(pat) => pat.attrs = attrs,
+                Pat::Struct(pat) => pat.attrs = attrs,
+                Pat::Tuple(pat) => pat.attrs = attrs,
+                Pat::TupleStruct(pat) => pat.attrs = attrs,
+                Pat::Type(_) => unreachable!(),
+                Pat::Verbatim(_) => {}
+                Pat::Wild(pat) => pat.attrs = attrs,
+                Pat::__Nonexhaustive => unreachable!(),
+            }
+            Ok(pat)
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl Parse for ExprWhile {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let label: Option<Label> = input.parse()?;
+            let while_token: Token![while] = input.parse()?;
+            let cond = expr_no_struct(input)?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            let inner_attrs = content.call(Attribute::parse_inner)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprWhile {
+                attrs: inner_attrs,
+                label,
+                while_token,
+                cond: Box::new(cond),
+                body: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl Parse for Label {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(Label {
+                name: input.parse()?,
+                colon_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl Parse for Option<Label> {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Lifetime) {
+                input.parse().map(Some)
+            } else {
+                Ok(None)
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_continue(input: ParseStream) -> Result<ExprContinue> {
+        Ok(ExprContinue {
+            attrs: Vec::new(),
+            continue_token: input.parse()?,
+            label: input.parse()?,
+        })
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_break(input: ParseStream, allow_struct: AllowStruct) -> Result<ExprBreak> {
+        Ok(ExprBreak {
+            attrs: Vec::new(),
+            break_token: input.parse()?,
+            label: input.parse()?,
+            expr: {
+                if input.is_empty()
+                    || input.peek(Token![,])
+                    || input.peek(Token![;])
+                    || !allow_struct.0 && input.peek(token::Brace)
+                {
+                    None
+                } else {
+                    let expr = ambiguous_expr(input, allow_struct)?;
+                    Some(Box::new(expr))
+                }
+            },
+        })
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_ret(input: ParseStream, allow_struct: AllowStruct) -> Result<ExprReturn> {
+        Ok(ExprReturn {
+            attrs: Vec::new(),
+            return_token: input.parse()?,
+            expr: {
+                if input.is_empty() || input.peek(Token![,]) || input.peek(Token![;]) {
+                    None
+                } else {
+                    // NOTE: return is greedy and eats blocks after it even when in a
+                    // position where structs are not allowed, such as in if statement
+                    // conditions. For example:
+                    //
+                    // if return { println!("A") } {} // Prints "A"
+                    let expr = ambiguous_expr(input, allow_struct)?;
+                    Some(Box::new(expr))
+                }
+            },
+        })
+    }
+
+    #[cfg(feature = "full")]
+    impl Parse for FieldValue {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let member: Member = input.parse()?;
+            let (colon_token, value) = if input.peek(Token![:]) || !member.is_named() {
+                let colon_token: Token![:] = input.parse()?;
+                let value: Expr = input.parse()?;
+                (Some(colon_token), value)
+            } else if let Member::Named(ident) = &member {
+                let value = Expr::Path(ExprPath {
+                    attrs: Vec::new(),
+                    qself: None,
+                    path: Path::from(ident.clone()),
+                });
+                (None, value)
+            } else {
+                unreachable!()
+            };
+
+            Ok(FieldValue {
+                attrs,
+                member,
+                colon_token,
+                expr: value,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_struct_helper(
+        input: ParseStream,
+        outer_attrs: Vec<Attribute>,
+        path: Path,
+    ) -> Result<ExprStruct> {
+        let content;
+        let brace_token = braced!(content in input);
+        let inner_attrs = content.call(Attribute::parse_inner)?;
+        let attrs = private::attrs(outer_attrs, inner_attrs);
+
+        let mut fields = Punctuated::new();
+        while !content.is_empty() {
+            if content.peek(Token![..]) {
+                return Ok(ExprStruct {
+                    attrs,
+                    brace_token,
+                    path,
+                    fields,
+                    dot2_token: Some(content.parse()?),
+                    rest: Some(Box::new(content.parse()?)),
+                });
+            }
+
+            fields.push(content.parse()?);
+            if !content.peek(Token![,]) {
+                break;
+            }
+            let punct: Token![,] = content.parse()?;
+            fields.push_punct(punct);
+        }
+
+        Ok(ExprStruct {
+            attrs,
+            brace_token,
+            path,
+            fields,
+            dot2_token: None,
+            rest: None,
+        })
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_unsafe(input: ParseStream) -> Result<ExprUnsafe> {
+        let unsafe_token: Token![unsafe] = input.parse()?;
+
+        let content;
+        let brace_token = braced!(content in input);
+        let inner_attrs = content.call(Attribute::parse_inner)?;
+        let stmts = content.call(Block::parse_within)?;
+
+        Ok(ExprUnsafe {
+            attrs: inner_attrs,
+            unsafe_token,
+            block: Block { brace_token, stmts },
+        })
+    }
+
+    #[cfg(feature = "full")]
+    pub fn expr_block(input: ParseStream) -> Result<ExprBlock> {
+        let label: Option<Label> = input.parse()?;
+
+        let content;
+        let brace_token = braced!(content in input);
+        let inner_attrs = content.call(Attribute::parse_inner)?;
+        let stmts = content.call(Block::parse_within)?;
+
+        Ok(ExprBlock {
+            attrs: inner_attrs,
+            label,
+            block: Block { brace_token, stmts },
+        })
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_range(input: ParseStream, allow_struct: AllowStruct) -> Result<ExprRange> {
+        Ok(ExprRange {
+            attrs: Vec::new(),
+            from: None,
+            limits: input.parse()?,
+            to: {
+                if input.is_empty()
+                    || input.peek(Token![,])
+                    || input.peek(Token![;])
+                    || !allow_struct.0 && input.peek(token::Brace)
+                {
+                    None
+                } else {
+                    let to = ambiguous_expr(input, allow_struct)?;
+                    Some(Box::new(to))
+                }
+            },
+        })
+    }
+
+    #[cfg(feature = "full")]
+    impl Parse for RangeLimits {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let lookahead = input.lookahead1();
+            if lookahead.peek(Token![..=]) {
+                input.parse().map(RangeLimits::Closed)
+            } else if lookahead.peek(Token![...]) {
+                let dot3: Token![...] = input.parse()?;
+                Ok(RangeLimits::Closed(Token![..=](dot3.spans)))
+            } else if lookahead.peek(Token![..]) {
+                input.parse().map(RangeLimits::HalfOpen)
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+
+    impl Parse for ExprPath {
+        fn parse(input: ParseStream) -> Result<Self> {
+            #[cfg(not(feature = "full"))]
+            let attrs = Vec::new();
+            #[cfg(feature = "full")]
+            let attrs = input.call(Attribute::parse_outer)?;
+
+            let (qself, path) = path::parsing::qpath(input, true)?;
+
+            Ok(ExprPath { attrs, qself, path })
+        }
+    }
+
+    impl Parse for Member {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Ident) {
+                input.parse().map(Member::Named)
+            } else if input.peek(LitInt) {
+                input.parse().map(Member::Unnamed)
+            } else {
+                Err(input.error("expected identifier or integer"))
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl Parse for Arm {
+        fn parse(input: ParseStream) -> Result<Arm> {
+            let requires_comma;
+            Ok(Arm {
+                attrs: input.call(Attribute::parse_outer)?,
+                pat: {
+                    let leading_vert: Option<Token![|]> = input.parse()?;
+                    let pat: Pat = input.parse()?;
+                    if leading_vert.is_some() || input.peek(Token![|]) {
+                        let mut cases = Punctuated::new();
+                        cases.push_value(pat);
+                        while input.peek(Token![|]) {
+                            let punct = input.parse()?;
+                            cases.push_punct(punct);
+                            let pat: Pat = input.parse()?;
+                            cases.push_value(pat);
+                        }
+                        Pat::Or(PatOr {
+                            attrs: Vec::new(),
+                            leading_vert,
+                            cases,
+                        })
+                    } else {
+                        pat
+                    }
+                },
+                guard: {
+                    if input.peek(Token![if]) {
+                        let if_token: Token![if] = input.parse()?;
+                        let guard: Expr = input.parse()?;
+                        Some((if_token, Box::new(guard)))
+                    } else {
+                        None
+                    }
+                },
+                fat_arrow_token: input.parse()?,
+                body: {
+                    let body = input.call(expr_early)?;
+                    requires_comma = requires_terminator(&body);
+                    Box::new(body)
+                },
+                comma: {
+                    if requires_comma && !input.is_empty() {
+                        Some(input.parse()?)
+                    } else {
+                        input.parse()?
+                    }
+                },
+            })
+        }
+    }
+
+    impl Parse for Index {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let lit: LitInt = input.parse()?;
+            if lit.suffix().is_empty() {
+                Ok(Index {
+                    index: lit
+                        .base10_digits()
+                        .parse()
+                        .map_err(|err| Error::new(lit.span(), err))?,
+                    span: lit.span(),
+                })
+            } else {
+                Err(Error::new(lit.span(), "expected unsuffixed integer"))
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl Member {
+        fn is_named(&self) -> bool {
+            match *self {
+                Member::Named(_) => true,
+                Member::Unnamed(_) => false,
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+pub(crate) mod printing {
+    use super::*;
+
+    use proc_macro2::{Literal, TokenStream};
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg(feature = "full")]
+    use crate::attr::FilterAttrs;
+    #[cfg(feature = "full")]
+    use crate::print::TokensOrDefault;
+
+    // If the given expression is a bare `ExprStruct`, wraps it in parenthesis
+    // before appending it to `TokenStream`.
+    #[cfg(feature = "full")]
+    fn wrap_bare_struct(tokens: &mut TokenStream, e: &Expr) {
+        if let Expr::Struct(_) = *e {
+            token::Paren::default().surround(tokens, |tokens| {
+                e.to_tokens(tokens);
+            });
+        } else {
+            e.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    pub(crate) fn outer_attrs_to_tokens(attrs: &[Attribute], tokens: &mut TokenStream) {
+        tokens.append_all(attrs.outer());
+    }
+
+    #[cfg(feature = "full")]
+    fn inner_attrs_to_tokens(attrs: &[Attribute], tokens: &mut TokenStream) {
+        tokens.append_all(attrs.inner());
+    }
+
+    #[cfg(not(feature = "full"))]
+    pub(crate) fn outer_attrs_to_tokens(_attrs: &[Attribute], _tokens: &mut TokenStream) {}
+
+    #[cfg(not(feature = "full"))]
+    fn inner_attrs_to_tokens(_attrs: &[Attribute], _tokens: &mut TokenStream) {}
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprBox {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.box_token.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprArray {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.bracket_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                self.elems.to_tokens(tokens);
+            })
+        }
+    }
+
+    impl ToTokens for ExprCall {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.func.to_tokens(tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                self.args.to_tokens(tokens);
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprMethodCall {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.receiver.to_tokens(tokens);
+            self.dot_token.to_tokens(tokens);
+            self.method.to_tokens(tokens);
+            self.turbofish.to_tokens(tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                self.args.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for MethodTurbofish {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.colon2_token.to_tokens(tokens);
+            self.lt_token.to_tokens(tokens);
+            self.args.to_tokens(tokens);
+            self.gt_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for GenericMethodArgument {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                GenericMethodArgument::Type(t) => t.to_tokens(tokens),
+                GenericMethodArgument::Const(c) => c.to_tokens(tokens),
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprTuple {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                self.elems.to_tokens(tokens);
+                // If we only have one argument, we need a trailing comma to
+                // distinguish ExprTuple from ExprParen.
+                if self.elems.len() == 1 && !self.elems.trailing_punct() {
+                    <Token![,]>::default().to_tokens(tokens);
+                }
+            })
+        }
+    }
+
+    impl ToTokens for ExprBinary {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.left.to_tokens(tokens);
+            self.op.to_tokens(tokens);
+            self.right.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for ExprUnary {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.op.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for ExprLit {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.lit.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for ExprCast {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.expr.to_tokens(tokens);
+            self.as_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.expr.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn maybe_wrap_else(tokens: &mut TokenStream, else_: &Option<(Token![else], Box<Expr>)>) {
+        if let Some((else_token, else_)) = else_ {
+            else_token.to_tokens(tokens);
+
+            // If we are not one of the valid expressions to exist in an else
+            // clause, wrap ourselves in a block.
+            match **else_ {
+                Expr::If(_) | Expr::Block(_) => {
+                    else_.to_tokens(tokens);
+                }
+                _ => {
+                    token::Brace::default().surround(tokens, |tokens| {
+                        else_.to_tokens(tokens);
+                    });
+                }
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprLet {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.let_token.to_tokens(tokens);
+            self.pat.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            wrap_bare_struct(tokens, &self.expr);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprIf {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.if_token.to_tokens(tokens);
+            wrap_bare_struct(tokens, &self.cond);
+            self.then_branch.to_tokens(tokens);
+            maybe_wrap_else(tokens, &self.else_branch);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprWhile {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.label.to_tokens(tokens);
+            self.while_token.to_tokens(tokens);
+            wrap_bare_struct(tokens, &self.cond);
+            self.body.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.body.stmts);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprForLoop {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.label.to_tokens(tokens);
+            self.for_token.to_tokens(tokens);
+            self.pat.to_tokens(tokens);
+            self.in_token.to_tokens(tokens);
+            wrap_bare_struct(tokens, &self.expr);
+            self.body.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.body.stmts);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprLoop {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.label.to_tokens(tokens);
+            self.loop_token.to_tokens(tokens);
+            self.body.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.body.stmts);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprMatch {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.match_token.to_tokens(tokens);
+            wrap_bare_struct(tokens, &self.expr);
+            self.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                for (i, arm) in self.arms.iter().enumerate() {
+                    arm.to_tokens(tokens);
+                    // Ensure that we have a comma after a non-block arm, except
+                    // for the last one.
+                    let is_last = i == self.arms.len() - 1;
+                    if !is_last && requires_terminator(&arm.body) && arm.comma.is_none() {
+                        <Token![,]>::default().to_tokens(tokens);
+                    }
+                }
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprAsync {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.async_token.to_tokens(tokens);
+            self.capture.to_tokens(tokens);
+            self.block.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprAwait {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.base.to_tokens(tokens);
+            self.dot_token.to_tokens(tokens);
+            self.await_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprTryBlock {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.try_token.to_tokens(tokens);
+            self.block.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprYield {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.yield_token.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprClosure {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.asyncness.to_tokens(tokens);
+            self.movability.to_tokens(tokens);
+            self.capture.to_tokens(tokens);
+            self.or1_token.to_tokens(tokens);
+            self.inputs.to_tokens(tokens);
+            self.or2_token.to_tokens(tokens);
+            self.output.to_tokens(tokens);
+            self.body.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprUnsafe {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.unsafe_token.to_tokens(tokens);
+            self.block.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.block.stmts);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprBlock {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.label.to_tokens(tokens);
+            self.block.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.block.stmts);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprAssign {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.left.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.right.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprAssignOp {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.left.to_tokens(tokens);
+            self.op.to_tokens(tokens);
+            self.right.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for ExprField {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.base.to_tokens(tokens);
+            self.dot_token.to_tokens(tokens);
+            self.member.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for Member {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                Member::Named(ident) => ident.to_tokens(tokens),
+                Member::Unnamed(index) => index.to_tokens(tokens),
+            }
+        }
+    }
+
+    impl ToTokens for Index {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            let mut lit = Literal::i64_unsuffixed(i64::from(self.index));
+            lit.set_span(self.span);
+            tokens.append(lit);
+        }
+    }
+
+    impl ToTokens for ExprIndex {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.expr.to_tokens(tokens);
+            self.bracket_token.surround(tokens, |tokens| {
+                self.index.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprRange {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.from.to_tokens(tokens);
+            match &self.limits {
+                RangeLimits::HalfOpen(t) => t.to_tokens(tokens),
+                RangeLimits::Closed(t) => t.to_tokens(tokens),
+            }
+            self.to.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for ExprPath {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            private::print_path(tokens, &self.qself, &self.path);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprReference {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.and_token.to_tokens(tokens);
+            self.mutability.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprBreak {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.break_token.to_tokens(tokens);
+            self.label.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprContinue {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.continue_token.to_tokens(tokens);
+            self.label.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprReturn {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.return_token.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.mac.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprStruct {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.path.to_tokens(tokens);
+            self.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                self.fields.to_tokens(tokens);
+                if self.rest.is_some() {
+                    TokensOrDefault(&self.dot2_token).to_tokens(tokens);
+                    self.rest.to_tokens(tokens);
+                }
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprRepeat {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.bracket_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                self.expr.to_tokens(tokens);
+                self.semi_token.to_tokens(tokens);
+                self.len.to_tokens(tokens);
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprGroup {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.group_token.surround(tokens, |tokens| {
+                self.expr.to_tokens(tokens);
+            });
+        }
+    }
+
+    impl ToTokens for ExprParen {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                self.expr.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for ExprTry {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.expr.to_tokens(tokens);
+            self.question_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for Label {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.name.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for FieldValue {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.member.to_tokens(tokens);
+            if let Some(colon_token) = &self.colon_token {
+                colon_token.to_tokens(tokens);
+                self.expr.to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl ToTokens for Arm {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(&self.attrs);
+            self.pat.to_tokens(tokens);
+            if let Some((if_token, guard)) = &self.guard {
+                if_token.to_tokens(tokens);
+                guard.to_tokens(tokens);
+            }
+            self.fat_arrow_token.to_tokens(tokens);
+            self.body.to_tokens(tokens);
+            self.comma.to_tokens(tokens);
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/ext.rs.html b/src/syn/ext.rs.html new file mode 100644 index 0000000..185b37b --- /dev/null +++ b/src/syn/ext.rs.html @@ -0,0 +1,273 @@ +ext.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+
+//! Extension traits to provide parsing methods on foreign types.
+//!
+//! *This module is available if Syn is built with the `"parsing"` feature.*
+
+use proc_macro2::Ident;
+
+use crate::parse::{ParseStream, Result};
+
+use crate::buffer::Cursor;
+use crate::parse::Peek;
+use crate::sealed::lookahead;
+use crate::token::CustomToken;
+
+/// Additional methods for `Ident` not provided by proc-macro2 or libproc_macro.
+///
+/// This trait is sealed and cannot be implemented for types outside of Syn. It
+/// is implemented only for `proc_macro2::Ident`.
+///
+/// *This trait is available if Syn is built with the `"parsing"` feature.*
+pub trait IdentExt: Sized + private::Sealed {
+    /// Parses any identifier including keywords.
+    ///
+    /// This is useful when parsing macro input which allows Rust keywords as
+    /// identifiers.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{Error, Ident, Result, Token};
+    /// use syn::ext::IdentExt;
+    /// use syn::parse::ParseStream;
+    ///
+    /// mod kw {
+    ///     syn::custom_keyword!(name);
+    /// }
+    ///
+    /// // Parses input that looks like `name = NAME` where `NAME` can be
+    /// // any identifier.
+    /// //
+    /// // Examples:
+    /// //
+    /// //     name = anything
+    /// //     name = impl
+    /// fn parse_dsl(input: ParseStream) -> Result<Ident> {
+    ///     input.parse::<kw::name>()?;
+    ///     input.parse::<Token![=]>()?;
+    ///     let name = input.call(Ident::parse_any)?;
+    ///     Ok(name)
+    /// }
+    /// ```
+    fn parse_any(input: ParseStream) -> Result<Self>;
+
+    /// Peeks any identifier including keywords. Usage:
+    /// `input.peek(Ident::peek_any)`
+    ///
+    /// This is different from `input.peek(Ident)` which only returns true in
+    /// the case of an ident which is not a Rust keyword.
+    #[allow(non_upper_case_globals)]
+    const peek_any: private::PeekFn = private::PeekFn;
+
+    /// Strips the raw marker `r#`, if any, from the beginning of an ident.
+    ///
+    ///   - unraw(`x`) = `x`
+    ///   - unraw(`move`) = `move`
+    ///   - unraw(`r#move`) = `move`
+    ///
+    /// # Example
+    ///
+    /// In the case of interop with other languages like Python that have a
+    /// different set of keywords than Rust, we might come across macro input
+    /// that involves raw identifiers to refer to ordinary variables in the
+    /// other language with a name that happens to be a Rust keyword.
+    ///
+    /// The function below appends an identifier from the caller's input onto a
+    /// fixed prefix. Without using `unraw()`, this would tend to produce
+    /// invalid identifiers like `__pyo3_get_r#move`.
+    ///
+    /// ```
+    /// use proc_macro2::Span;
+    /// use syn::Ident;
+    /// use syn::ext::IdentExt;
+    ///
+    /// fn ident_for_getter(variable: &Ident) -> Ident {
+    ///     let getter = format!("__pyo3_get_{}", variable.unraw());
+    ///     Ident::new(&getter, Span::call_site())
+    /// }
+    /// ```
+    fn unraw(&self) -> Ident;
+}
+
+impl IdentExt for Ident {
+    fn parse_any(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| match cursor.ident() {
+            Some((ident, rest)) => Ok((ident, rest)),
+            None => Err(cursor.error("expected ident")),
+        })
+    }
+
+    fn unraw(&self) -> Ident {
+        let string = self.to_string();
+        if string.starts_with("r#") {
+            Ident::new(&string[2..], self.span())
+        } else {
+            self.clone()
+        }
+    }
+}
+
+impl Peek for private::PeekFn {
+    type Token = private::IdentAny;
+}
+
+impl CustomToken for private::IdentAny {
+    fn peek(cursor: Cursor) -> bool {
+        cursor.ident().is_some()
+    }
+
+    fn display() -> &'static str {
+        "identifier"
+    }
+}
+
+impl lookahead::Sealed for private::PeekFn {}
+
+mod private {
+    use proc_macro2::Ident;
+
+    pub trait Sealed {}
+
+    impl Sealed for Ident {}
+
+    #[derive(Copy, Clone)]
+    pub struct PeekFn;
+    pub struct IdentAny;
+}
+
+
\ No newline at end of file diff --git a/src/syn/gen/up/gen_helper.rs.html b/src/syn/gen/up/gen_helper.rs.html new file mode 100644 index 0000000..3d72823 --- /dev/null +++ b/src/syn/gen/up/gen_helper.rs.html @@ -0,0 +1,311 @@ +gen_helper.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+
+#[cfg(feature = "fold")]
+pub mod fold {
+    use crate::fold::Fold;
+    use crate::punctuated::{Pair, Punctuated};
+    use proc_macro2::Span;
+
+    pub trait FoldHelper {
+        type Item;
+        fn lift<F>(self, f: F) -> Self
+        where
+            F: FnMut(Self::Item) -> Self::Item;
+    }
+
+    impl<T> FoldHelper for Vec<T> {
+        type Item = T;
+        fn lift<F>(self, f: F) -> Self
+        where
+            F: FnMut(Self::Item) -> Self::Item,
+        {
+            self.into_iter().map(f).collect()
+        }
+    }
+
+    impl<T, U> FoldHelper for Punctuated<T, U> {
+        type Item = T;
+        fn lift<F>(self, mut f: F) -> Self
+        where
+            F: FnMut(Self::Item) -> Self::Item,
+        {
+            self.into_pairs()
+                .map(Pair::into_tuple)
+                .map(|(t, u)| Pair::new(f(t), u))
+                .collect()
+        }
+    }
+
+    pub fn tokens_helper<F: Fold + ?Sized, S: Spans>(folder: &mut F, spans: &S) -> S {
+        spans.fold(folder)
+    }
+
+    pub trait Spans {
+        fn fold<F: Fold + ?Sized>(&self, folder: &mut F) -> Self;
+    }
+
+    impl Spans for Span {
+        fn fold<F: Fold + ?Sized>(&self, folder: &mut F) -> Self {
+            folder.fold_span(*self)
+        }
+    }
+
+    impl Spans for [Span; 1] {
+        fn fold<F: Fold + ?Sized>(&self, folder: &mut F) -> Self {
+            [folder.fold_span(self[0])]
+        }
+    }
+
+    impl Spans for [Span; 2] {
+        fn fold<F: Fold + ?Sized>(&self, folder: &mut F) -> Self {
+            [folder.fold_span(self[0]), folder.fold_span(self[1])]
+        }
+    }
+
+    impl Spans for [Span; 3] {
+        fn fold<F: Fold + ?Sized>(&self, folder: &mut F) -> Self {
+            [
+                folder.fold_span(self[0]),
+                folder.fold_span(self[1]),
+                folder.fold_span(self[2]),
+            ]
+        }
+    }
+}
+
+#[cfg(feature = "visit")]
+pub mod visit {
+    use crate::visit::Visit;
+    use proc_macro2::Span;
+
+    pub fn tokens_helper<'ast, V: Visit<'ast> + ?Sized, S: Spans>(visitor: &mut V, spans: &S) {
+        spans.visit(visitor);
+    }
+
+    pub trait Spans {
+        fn visit<'ast, V: Visit<'ast> + ?Sized>(&self, visitor: &mut V);
+    }
+
+    impl Spans for Span {
+        fn visit<'ast, V: Visit<'ast> + ?Sized>(&self, visitor: &mut V) {
+            visitor.visit_span(self);
+        }
+    }
+
+    impl Spans for [Span; 1] {
+        fn visit<'ast, V: Visit<'ast> + ?Sized>(&self, visitor: &mut V) {
+            visitor.visit_span(&self[0]);
+        }
+    }
+
+    impl Spans for [Span; 2] {
+        fn visit<'ast, V: Visit<'ast> + ?Sized>(&self, visitor: &mut V) {
+            visitor.visit_span(&self[0]);
+            visitor.visit_span(&self[1]);
+        }
+    }
+
+    impl Spans for [Span; 3] {
+        fn visit<'ast, V: Visit<'ast> + ?Sized>(&self, visitor: &mut V) {
+            visitor.visit_span(&self[0]);
+            visitor.visit_span(&self[1]);
+            visitor.visit_span(&self[2]);
+        }
+    }
+}
+
+#[cfg(feature = "visit-mut")]
+pub mod visit_mut {
+    use crate::visit_mut::VisitMut;
+    use proc_macro2::Span;
+
+    pub fn tokens_helper<V: VisitMut + ?Sized, S: Spans>(visitor: &mut V, spans: &mut S) {
+        spans.visit_mut(visitor);
+    }
+
+    pub trait Spans {
+        fn visit_mut<V: VisitMut + ?Sized>(&mut self, visitor: &mut V);
+    }
+
+    impl Spans for Span {
+        fn visit_mut<V: VisitMut + ?Sized>(&mut self, visitor: &mut V) {
+            visitor.visit_span_mut(self);
+        }
+    }
+
+    impl Spans for [Span; 1] {
+        fn visit_mut<V: VisitMut + ?Sized>(&mut self, visitor: &mut V) {
+            visitor.visit_span_mut(&mut self[0]);
+        }
+    }
+
+    impl Spans for [Span; 2] {
+        fn visit_mut<V: VisitMut + ?Sized>(&mut self, visitor: &mut V) {
+            visitor.visit_span_mut(&mut self[0]);
+            visitor.visit_span_mut(&mut self[1]);
+        }
+    }
+
+    impl Spans for [Span; 3] {
+        fn visit_mut<V: VisitMut + ?Sized>(&mut self, visitor: &mut V) {
+            visitor.visit_span_mut(&mut self[0]);
+            visitor.visit_span_mut(&mut self[1]);
+            visitor.visit_span_mut(&mut self[2]);
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/gen/visit.rs.html b/src/syn/gen/visit.rs.html new file mode 100644 index 0000000..51d2d01 --- /dev/null +++ b/src/syn/gen/visit.rs.html @@ -0,0 +1,7587 @@ +visit.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+2277
+2278
+2279
+2280
+2281
+2282
+2283
+2284
+2285
+2286
+2287
+2288
+2289
+2290
+2291
+2292
+2293
+2294
+2295
+2296
+2297
+2298
+2299
+2300
+2301
+2302
+2303
+2304
+2305
+2306
+2307
+2308
+2309
+2310
+2311
+2312
+2313
+2314
+2315
+2316
+2317
+2318
+2319
+2320
+2321
+2322
+2323
+2324
+2325
+2326
+2327
+2328
+2329
+2330
+2331
+2332
+2333
+2334
+2335
+2336
+2337
+2338
+2339
+2340
+2341
+2342
+2343
+2344
+2345
+2346
+2347
+2348
+2349
+2350
+2351
+2352
+2353
+2354
+2355
+2356
+2357
+2358
+2359
+2360
+2361
+2362
+2363
+2364
+2365
+2366
+2367
+2368
+2369
+2370
+2371
+2372
+2373
+2374
+2375
+2376
+2377
+2378
+2379
+2380
+2381
+2382
+2383
+2384
+2385
+2386
+2387
+2388
+2389
+2390
+2391
+2392
+2393
+2394
+2395
+2396
+2397
+2398
+2399
+2400
+2401
+2402
+2403
+2404
+2405
+2406
+2407
+2408
+2409
+2410
+2411
+2412
+2413
+2414
+2415
+2416
+2417
+2418
+2419
+2420
+2421
+2422
+2423
+2424
+2425
+2426
+2427
+2428
+2429
+2430
+2431
+2432
+2433
+2434
+2435
+2436
+2437
+2438
+2439
+2440
+2441
+2442
+2443
+2444
+2445
+2446
+2447
+2448
+2449
+2450
+2451
+2452
+2453
+2454
+2455
+2456
+2457
+2458
+2459
+2460
+2461
+2462
+2463
+2464
+2465
+2466
+2467
+2468
+2469
+2470
+2471
+2472
+2473
+2474
+2475
+2476
+2477
+2478
+2479
+2480
+2481
+2482
+2483
+2484
+2485
+2486
+2487
+2488
+2489
+2490
+2491
+2492
+2493
+2494
+2495
+2496
+2497
+2498
+2499
+2500
+2501
+2502
+2503
+2504
+2505
+2506
+2507
+2508
+2509
+2510
+2511
+2512
+2513
+2514
+2515
+2516
+2517
+2518
+2519
+2520
+2521
+2522
+2523
+2524
+2525
+2526
+2527
+2528
+2529
+2530
+2531
+2532
+2533
+2534
+2535
+2536
+2537
+2538
+2539
+2540
+2541
+2542
+2543
+2544
+2545
+2546
+2547
+2548
+2549
+2550
+2551
+2552
+2553
+2554
+2555
+2556
+2557
+2558
+2559
+2560
+2561
+2562
+2563
+2564
+2565
+2566
+2567
+2568
+2569
+2570
+2571
+2572
+2573
+2574
+2575
+2576
+2577
+2578
+2579
+2580
+2581
+2582
+2583
+2584
+2585
+2586
+2587
+2588
+2589
+2590
+2591
+2592
+2593
+2594
+2595
+2596
+2597
+2598
+2599
+2600
+2601
+2602
+2603
+2604
+2605
+2606
+2607
+2608
+2609
+2610
+2611
+2612
+2613
+2614
+2615
+2616
+2617
+2618
+2619
+2620
+2621
+2622
+2623
+2624
+2625
+2626
+2627
+2628
+2629
+2630
+2631
+2632
+2633
+2634
+2635
+2636
+2637
+2638
+2639
+2640
+2641
+2642
+2643
+2644
+2645
+2646
+2647
+2648
+2649
+2650
+2651
+2652
+2653
+2654
+2655
+2656
+2657
+2658
+2659
+2660
+2661
+2662
+2663
+2664
+2665
+2666
+2667
+2668
+2669
+2670
+2671
+2672
+2673
+2674
+2675
+2676
+2677
+2678
+2679
+2680
+2681
+2682
+2683
+2684
+2685
+2686
+2687
+2688
+2689
+2690
+2691
+2692
+2693
+2694
+2695
+2696
+2697
+2698
+2699
+2700
+2701
+2702
+2703
+2704
+2705
+2706
+2707
+2708
+2709
+2710
+2711
+2712
+2713
+2714
+2715
+2716
+2717
+2718
+2719
+2720
+2721
+2722
+2723
+2724
+2725
+2726
+2727
+2728
+2729
+2730
+2731
+2732
+2733
+2734
+2735
+2736
+2737
+2738
+2739
+2740
+2741
+2742
+2743
+2744
+2745
+2746
+2747
+2748
+2749
+2750
+2751
+2752
+2753
+2754
+2755
+2756
+2757
+2758
+2759
+2760
+2761
+2762
+2763
+2764
+2765
+2766
+2767
+2768
+2769
+2770
+2771
+2772
+2773
+2774
+2775
+2776
+2777
+2778
+2779
+2780
+2781
+2782
+2783
+2784
+2785
+2786
+2787
+2788
+2789
+2790
+2791
+2792
+2793
+2794
+2795
+2796
+2797
+2798
+2799
+2800
+2801
+2802
+2803
+2804
+2805
+2806
+2807
+2808
+2809
+2810
+2811
+2812
+2813
+2814
+2815
+2816
+2817
+2818
+2819
+2820
+2821
+2822
+2823
+2824
+2825
+2826
+2827
+2828
+2829
+2830
+2831
+2832
+2833
+2834
+2835
+2836
+2837
+2838
+2839
+2840
+2841
+2842
+2843
+2844
+2845
+2846
+2847
+2848
+2849
+2850
+2851
+2852
+2853
+2854
+2855
+2856
+2857
+2858
+2859
+2860
+2861
+2862
+2863
+2864
+2865
+2866
+2867
+2868
+2869
+2870
+2871
+2872
+2873
+2874
+2875
+2876
+2877
+2878
+2879
+2880
+2881
+2882
+2883
+2884
+2885
+2886
+2887
+2888
+2889
+2890
+2891
+2892
+2893
+2894
+2895
+2896
+2897
+2898
+2899
+2900
+2901
+2902
+2903
+2904
+2905
+2906
+2907
+2908
+2909
+2910
+2911
+2912
+2913
+2914
+2915
+2916
+2917
+2918
+2919
+2920
+2921
+2922
+2923
+2924
+2925
+2926
+2927
+2928
+2929
+2930
+2931
+2932
+2933
+2934
+2935
+2936
+2937
+2938
+2939
+2940
+2941
+2942
+2943
+2944
+2945
+2946
+2947
+2948
+2949
+2950
+2951
+2952
+2953
+2954
+2955
+2956
+2957
+2958
+2959
+2960
+2961
+2962
+2963
+2964
+2965
+2966
+2967
+2968
+2969
+2970
+2971
+2972
+2973
+2974
+2975
+2976
+2977
+2978
+2979
+2980
+2981
+2982
+2983
+2984
+2985
+2986
+2987
+2988
+2989
+2990
+2991
+2992
+2993
+2994
+2995
+2996
+2997
+2998
+2999
+3000
+3001
+3002
+3003
+3004
+3005
+3006
+3007
+3008
+3009
+3010
+3011
+3012
+3013
+3014
+3015
+3016
+3017
+3018
+3019
+3020
+3021
+3022
+3023
+3024
+3025
+3026
+3027
+3028
+3029
+3030
+3031
+3032
+3033
+3034
+3035
+3036
+3037
+3038
+3039
+3040
+3041
+3042
+3043
+3044
+3045
+3046
+3047
+3048
+3049
+3050
+3051
+3052
+3053
+3054
+3055
+3056
+3057
+3058
+3059
+3060
+3061
+3062
+3063
+3064
+3065
+3066
+3067
+3068
+3069
+3070
+3071
+3072
+3073
+3074
+3075
+3076
+3077
+3078
+3079
+3080
+3081
+3082
+3083
+3084
+3085
+3086
+3087
+3088
+3089
+3090
+3091
+3092
+3093
+3094
+3095
+3096
+3097
+3098
+3099
+3100
+3101
+3102
+3103
+3104
+3105
+3106
+3107
+3108
+3109
+3110
+3111
+3112
+3113
+3114
+3115
+3116
+3117
+3118
+3119
+3120
+3121
+3122
+3123
+3124
+3125
+3126
+3127
+3128
+3129
+3130
+3131
+3132
+3133
+3134
+3135
+3136
+3137
+3138
+3139
+3140
+3141
+3142
+3143
+3144
+3145
+3146
+3147
+3148
+3149
+3150
+3151
+3152
+3153
+3154
+3155
+3156
+3157
+3158
+3159
+3160
+3161
+3162
+3163
+3164
+3165
+3166
+3167
+3168
+3169
+3170
+3171
+3172
+3173
+3174
+3175
+3176
+3177
+3178
+3179
+3180
+3181
+3182
+3183
+3184
+3185
+3186
+3187
+3188
+3189
+3190
+3191
+3192
+3193
+3194
+3195
+3196
+3197
+3198
+3199
+3200
+3201
+3202
+3203
+3204
+3205
+3206
+3207
+3208
+3209
+3210
+3211
+3212
+3213
+3214
+3215
+3216
+3217
+3218
+3219
+3220
+3221
+3222
+3223
+3224
+3225
+3226
+3227
+3228
+3229
+3230
+3231
+3232
+3233
+3234
+3235
+3236
+3237
+3238
+3239
+3240
+3241
+3242
+3243
+3244
+3245
+3246
+3247
+3248
+3249
+3250
+3251
+3252
+3253
+3254
+3255
+3256
+3257
+3258
+3259
+3260
+3261
+3262
+3263
+3264
+3265
+3266
+3267
+3268
+3269
+3270
+3271
+3272
+3273
+3274
+3275
+3276
+3277
+3278
+3279
+3280
+3281
+3282
+3283
+3284
+3285
+3286
+3287
+3288
+3289
+3290
+3291
+3292
+3293
+3294
+3295
+3296
+3297
+3298
+3299
+3300
+3301
+3302
+3303
+3304
+3305
+3306
+3307
+3308
+3309
+3310
+3311
+3312
+3313
+3314
+3315
+3316
+3317
+3318
+3319
+3320
+3321
+3322
+3323
+3324
+3325
+3326
+3327
+3328
+3329
+3330
+3331
+3332
+3333
+3334
+3335
+3336
+3337
+3338
+3339
+3340
+3341
+3342
+3343
+3344
+3345
+3346
+3347
+3348
+3349
+3350
+3351
+3352
+3353
+3354
+3355
+3356
+3357
+3358
+3359
+3360
+3361
+3362
+3363
+3364
+3365
+3366
+3367
+3368
+3369
+3370
+3371
+3372
+3373
+3374
+3375
+3376
+3377
+3378
+3379
+3380
+3381
+3382
+3383
+3384
+3385
+3386
+3387
+3388
+3389
+3390
+3391
+3392
+3393
+3394
+3395
+3396
+3397
+3398
+3399
+3400
+3401
+3402
+3403
+3404
+3405
+3406
+3407
+3408
+3409
+3410
+3411
+3412
+3413
+3414
+3415
+3416
+3417
+3418
+3419
+3420
+3421
+3422
+3423
+3424
+3425
+3426
+3427
+3428
+3429
+3430
+3431
+3432
+3433
+3434
+3435
+3436
+3437
+3438
+3439
+3440
+3441
+3442
+3443
+3444
+3445
+3446
+3447
+3448
+3449
+3450
+3451
+3452
+3453
+3454
+3455
+3456
+3457
+3458
+3459
+3460
+3461
+3462
+3463
+3464
+3465
+3466
+3467
+3468
+3469
+3470
+3471
+3472
+3473
+3474
+3475
+3476
+3477
+3478
+3479
+3480
+3481
+3482
+3483
+3484
+3485
+3486
+3487
+3488
+3489
+3490
+3491
+3492
+3493
+3494
+3495
+3496
+3497
+3498
+3499
+3500
+3501
+3502
+3503
+3504
+3505
+3506
+3507
+3508
+3509
+3510
+3511
+3512
+3513
+3514
+3515
+3516
+3517
+3518
+3519
+3520
+3521
+3522
+3523
+3524
+3525
+3526
+3527
+3528
+3529
+3530
+3531
+3532
+3533
+3534
+3535
+3536
+3537
+3538
+3539
+3540
+3541
+3542
+3543
+3544
+3545
+3546
+3547
+3548
+3549
+3550
+3551
+3552
+3553
+3554
+3555
+3556
+3557
+3558
+3559
+3560
+3561
+3562
+3563
+3564
+3565
+3566
+3567
+3568
+3569
+3570
+3571
+3572
+3573
+3574
+3575
+3576
+3577
+3578
+3579
+3580
+3581
+3582
+3583
+3584
+3585
+3586
+3587
+3588
+3589
+3590
+3591
+3592
+3593
+3594
+3595
+3596
+3597
+3598
+3599
+3600
+3601
+3602
+3603
+3604
+3605
+3606
+3607
+3608
+3609
+3610
+3611
+3612
+3613
+3614
+3615
+3616
+3617
+3618
+3619
+3620
+3621
+3622
+3623
+3624
+3625
+3626
+3627
+3628
+3629
+3630
+3631
+3632
+3633
+3634
+3635
+3636
+3637
+3638
+3639
+3640
+3641
+3642
+3643
+3644
+3645
+3646
+3647
+3648
+3649
+3650
+3651
+3652
+3653
+3654
+3655
+3656
+3657
+3658
+3659
+3660
+3661
+3662
+3663
+3664
+3665
+3666
+3667
+3668
+3669
+3670
+3671
+3672
+3673
+3674
+3675
+3676
+3677
+3678
+3679
+3680
+3681
+3682
+3683
+3684
+3685
+3686
+3687
+3688
+3689
+3690
+3691
+3692
+3693
+3694
+3695
+3696
+3697
+3698
+3699
+3700
+3701
+3702
+3703
+3704
+3705
+3706
+3707
+3708
+3709
+3710
+3711
+3712
+3713
+3714
+3715
+3716
+3717
+3718
+3719
+3720
+3721
+3722
+3723
+3724
+3725
+3726
+3727
+3728
+3729
+3730
+3731
+3732
+3733
+3734
+3735
+3736
+3737
+3738
+3739
+3740
+3741
+3742
+3743
+3744
+3745
+3746
+3747
+3748
+3749
+3750
+3751
+3752
+3753
+3754
+3755
+3756
+3757
+3758
+3759
+3760
+3761
+3762
+3763
+3764
+3765
+3766
+3767
+3768
+3769
+3770
+3771
+3772
+3773
+3774
+3775
+3776
+3777
+3778
+3779
+3780
+3781
+3782
+3783
+3784
+3785
+3786
+3787
+3788
+3789
+3790
+3791
+3792
+
+// This file is @generated by syn-internal-codegen.
+// It is not intended for manual editing.
+
+#![allow(unused_variables)]
+#[cfg(any(feature = "full", feature = "derive"))]
+use crate::gen::helper::visit::*;
+#[cfg(any(feature = "full", feature = "derive"))]
+use crate::punctuated::Punctuated;
+use crate::*;
+use proc_macro2::Span;
+#[cfg(feature = "full")]
+macro_rules! full {
+    ($e:expr) => {
+        $e
+    };
+}
+#[cfg(all(feature = "derive", not(feature = "full")))]
+macro_rules! full {
+    ($e:expr) => {
+        unreachable!()
+    };
+}
+#[cfg(any(feature = "full", feature = "derive"))]
+macro_rules! skip {
+    ($($tt:tt)*) => {};
+}
+/// Syntax tree traversal to walk a shared borrow of a syntax tree.
+///
+/// See the [module documentation] for details.
+///
+/// [module documentation]: self
+///
+/// *This trait is available if Syn is built with the `"visit"` feature.*
+pub trait Visit<'ast> {
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_abi(&mut self, i: &'ast Abi) {
+        visit_abi(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_angle_bracketed_generic_arguments(&mut self, i: &'ast AngleBracketedGenericArguments) {
+        visit_angle_bracketed_generic_arguments(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_arm(&mut self, i: &'ast Arm) {
+        visit_arm(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_attr_style(&mut self, i: &'ast AttrStyle) {
+        visit_attr_style(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_attribute(&mut self, i: &'ast Attribute) {
+        visit_attribute(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) {
+        visit_bare_fn_arg(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_bin_op(&mut self, i: &'ast BinOp) {
+        visit_bin_op(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_binding(&mut self, i: &'ast Binding) {
+        visit_binding(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_block(&mut self, i: &'ast Block) {
+        visit_block(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) {
+        visit_bound_lifetimes(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_const_param(&mut self, i: &'ast ConstParam) {
+        visit_const_param(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_constraint(&mut self, i: &'ast Constraint) {
+        visit_constraint(self, i)
+    }
+    #[cfg(feature = "derive")]
+    fn visit_data(&mut self, i: &'ast Data) {
+        visit_data(self, i)
+    }
+    #[cfg(feature = "derive")]
+    fn visit_data_enum(&mut self, i: &'ast DataEnum) {
+        visit_data_enum(self, i)
+    }
+    #[cfg(feature = "derive")]
+    fn visit_data_struct(&mut self, i: &'ast DataStruct) {
+        visit_data_struct(self, i)
+    }
+    #[cfg(feature = "derive")]
+    fn visit_data_union(&mut self, i: &'ast DataUnion) {
+        visit_data_union(self, i)
+    }
+    #[cfg(feature = "derive")]
+    fn visit_derive_input(&mut self, i: &'ast DeriveInput) {
+        visit_derive_input(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_expr(&mut self, i: &'ast Expr) {
+        visit_expr(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_array(&mut self, i: &'ast ExprArray) {
+        visit_expr_array(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_assign(&mut self, i: &'ast ExprAssign) {
+        visit_expr_assign(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_assign_op(&mut self, i: &'ast ExprAssignOp) {
+        visit_expr_assign_op(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_async(&mut self, i: &'ast ExprAsync) {
+        visit_expr_async(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_await(&mut self, i: &'ast ExprAwait) {
+        visit_expr_await(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_expr_binary(&mut self, i: &'ast ExprBinary) {
+        visit_expr_binary(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_block(&mut self, i: &'ast ExprBlock) {
+        visit_expr_block(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_box(&mut self, i: &'ast ExprBox) {
+        visit_expr_box(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_break(&mut self, i: &'ast ExprBreak) {
+        visit_expr_break(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_expr_call(&mut self, i: &'ast ExprCall) {
+        visit_expr_call(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_expr_cast(&mut self, i: &'ast ExprCast) {
+        visit_expr_cast(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_closure(&mut self, i: &'ast ExprClosure) {
+        visit_expr_closure(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_continue(&mut self, i: &'ast ExprContinue) {
+        visit_expr_continue(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_expr_field(&mut self, i: &'ast ExprField) {
+        visit_expr_field(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_for_loop(&mut self, i: &'ast ExprForLoop) {
+        visit_expr_for_loop(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_group(&mut self, i: &'ast ExprGroup) {
+        visit_expr_group(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_if(&mut self, i: &'ast ExprIf) {
+        visit_expr_if(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_expr_index(&mut self, i: &'ast ExprIndex) {
+        visit_expr_index(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_let(&mut self, i: &'ast ExprLet) {
+        visit_expr_let(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_expr_lit(&mut self, i: &'ast ExprLit) {
+        visit_expr_lit(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_loop(&mut self, i: &'ast ExprLoop) {
+        visit_expr_loop(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_macro(&mut self, i: &'ast ExprMacro) {
+        visit_expr_macro(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_match(&mut self, i: &'ast ExprMatch) {
+        visit_expr_match(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_method_call(&mut self, i: &'ast ExprMethodCall) {
+        visit_expr_method_call(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_expr_paren(&mut self, i: &'ast ExprParen) {
+        visit_expr_paren(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_expr_path(&mut self, i: &'ast ExprPath) {
+        visit_expr_path(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_range(&mut self, i: &'ast ExprRange) {
+        visit_expr_range(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_reference(&mut self, i: &'ast ExprReference) {
+        visit_expr_reference(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_repeat(&mut self, i: &'ast ExprRepeat) {
+        visit_expr_repeat(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_return(&mut self, i: &'ast ExprReturn) {
+        visit_expr_return(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_struct(&mut self, i: &'ast ExprStruct) {
+        visit_expr_struct(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_try(&mut self, i: &'ast ExprTry) {
+        visit_expr_try(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_try_block(&mut self, i: &'ast ExprTryBlock) {
+        visit_expr_try_block(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_tuple(&mut self, i: &'ast ExprTuple) {
+        visit_expr_tuple(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_type(&mut self, i: &'ast ExprType) {
+        visit_expr_type(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_expr_unary(&mut self, i: &'ast ExprUnary) {
+        visit_expr_unary(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_unsafe(&mut self, i: &'ast ExprUnsafe) {
+        visit_expr_unsafe(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_while(&mut self, i: &'ast ExprWhile) {
+        visit_expr_while(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_expr_yield(&mut self, i: &'ast ExprYield) {
+        visit_expr_yield(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_field(&mut self, i: &'ast Field) {
+        visit_field(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_field_pat(&mut self, i: &'ast FieldPat) {
+        visit_field_pat(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_field_value(&mut self, i: &'ast FieldValue) {
+        visit_field_value(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_fields(&mut self, i: &'ast Fields) {
+        visit_fields(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_fields_named(&mut self, i: &'ast FieldsNamed) {
+        visit_fields_named(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) {
+        visit_fields_unnamed(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_file(&mut self, i: &'ast File) {
+        visit_file(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_fn_arg(&mut self, i: &'ast FnArg) {
+        visit_fn_arg(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
+        visit_foreign_item(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_foreign_item_fn(&mut self, i: &'ast ForeignItemFn) {
+        visit_foreign_item_fn(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_foreign_item_macro(&mut self, i: &'ast ForeignItemMacro) {
+        visit_foreign_item_macro(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_foreign_item_static(&mut self, i: &'ast ForeignItemStatic) {
+        visit_foreign_item_static(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_foreign_item_type(&mut self, i: &'ast ForeignItemType) {
+        visit_foreign_item_type(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_generic_argument(&mut self, i: &'ast GenericArgument) {
+        visit_generic_argument(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_generic_method_argument(&mut self, i: &'ast GenericMethodArgument) {
+        visit_generic_method_argument(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_generic_param(&mut self, i: &'ast GenericParam) {
+        visit_generic_param(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_generics(&mut self, i: &'ast Generics) {
+        visit_generics(self, i)
+    }
+    fn visit_ident(&mut self, i: &'ast Ident) {
+        visit_ident(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_impl_item(&mut self, i: &'ast ImplItem) {
+        visit_impl_item(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_impl_item_const(&mut self, i: &'ast ImplItemConst) {
+        visit_impl_item_const(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_impl_item_macro(&mut self, i: &'ast ImplItemMacro) {
+        visit_impl_item_macro(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_impl_item_method(&mut self, i: &'ast ImplItemMethod) {
+        visit_impl_item_method(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_impl_item_type(&mut self, i: &'ast ImplItemType) {
+        visit_impl_item_type(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_index(&mut self, i: &'ast Index) {
+        visit_index(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item(&mut self, i: &'ast Item) {
+        visit_item(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_const(&mut self, i: &'ast ItemConst) {
+        visit_item_const(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_enum(&mut self, i: &'ast ItemEnum) {
+        visit_item_enum(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_extern_crate(&mut self, i: &'ast ItemExternCrate) {
+        visit_item_extern_crate(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_fn(&mut self, i: &'ast ItemFn) {
+        visit_item_fn(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_foreign_mod(&mut self, i: &'ast ItemForeignMod) {
+        visit_item_foreign_mod(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_impl(&mut self, i: &'ast ItemImpl) {
+        visit_item_impl(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_macro(&mut self, i: &'ast ItemMacro) {
+        visit_item_macro(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_macro2(&mut self, i: &'ast ItemMacro2) {
+        visit_item_macro2(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_mod(&mut self, i: &'ast ItemMod) {
+        visit_item_mod(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_static(&mut self, i: &'ast ItemStatic) {
+        visit_item_static(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_struct(&mut self, i: &'ast ItemStruct) {
+        visit_item_struct(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_trait(&mut self, i: &'ast ItemTrait) {
+        visit_item_trait(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_trait_alias(&mut self, i: &'ast ItemTraitAlias) {
+        visit_item_trait_alias(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_type(&mut self, i: &'ast ItemType) {
+        visit_item_type(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_union(&mut self, i: &'ast ItemUnion) {
+        visit_item_union(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_item_use(&mut self, i: &'ast ItemUse) {
+        visit_item_use(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_label(&mut self, i: &'ast Label) {
+        visit_label(self, i)
+    }
+    fn visit_lifetime(&mut self, i: &'ast Lifetime) {
+        visit_lifetime(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) {
+        visit_lifetime_def(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_lit(&mut self, i: &'ast Lit) {
+        visit_lit(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_lit_bool(&mut self, i: &'ast LitBool) {
+        visit_lit_bool(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_lit_byte(&mut self, i: &'ast LitByte) {
+        visit_lit_byte(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) {
+        visit_lit_byte_str(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_lit_char(&mut self, i: &'ast LitChar) {
+        visit_lit_char(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_lit_float(&mut self, i: &'ast LitFloat) {
+        visit_lit_float(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_lit_int(&mut self, i: &'ast LitInt) {
+        visit_lit_int(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_lit_str(&mut self, i: &'ast LitStr) {
+        visit_lit_str(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_local(&mut self, i: &'ast Local) {
+        visit_local(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_macro(&mut self, i: &'ast Macro) {
+        visit_macro(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) {
+        visit_macro_delimiter(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_member(&mut self, i: &'ast Member) {
+        visit_member(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_meta(&mut self, i: &'ast Meta) {
+        visit_meta(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_meta_list(&mut self, i: &'ast MetaList) {
+        visit_meta_list(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) {
+        visit_meta_name_value(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
+        visit_method_turbofish(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_nested_meta(&mut self, i: &'ast NestedMeta) {
+        visit_nested_meta(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_parenthesized_generic_arguments(&mut self, i: &'ast ParenthesizedGenericArguments) {
+        visit_parenthesized_generic_arguments(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat(&mut self, i: &'ast Pat) {
+        visit_pat(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_box(&mut self, i: &'ast PatBox) {
+        visit_pat_box(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_ident(&mut self, i: &'ast PatIdent) {
+        visit_pat_ident(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_lit(&mut self, i: &'ast PatLit) {
+        visit_pat_lit(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
+        visit_pat_macro(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_or(&mut self, i: &'ast PatOr) {
+        visit_pat_or(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_path(&mut self, i: &'ast PatPath) {
+        visit_pat_path(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_range(&mut self, i: &'ast PatRange) {
+        visit_pat_range(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_reference(&mut self, i: &'ast PatReference) {
+        visit_pat_reference(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_rest(&mut self, i: &'ast PatRest) {
+        visit_pat_rest(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_slice(&mut self, i: &'ast PatSlice) {
+        visit_pat_slice(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_struct(&mut self, i: &'ast PatStruct) {
+        visit_pat_struct(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_tuple(&mut self, i: &'ast PatTuple) {
+        visit_pat_tuple(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_tuple_struct(&mut self, i: &'ast PatTupleStruct) {
+        visit_pat_tuple_struct(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_type(&mut self, i: &'ast PatType) {
+        visit_pat_type(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_pat_wild(&mut self, i: &'ast PatWild) {
+        visit_pat_wild(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_path(&mut self, i: &'ast Path) {
+        visit_path(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_path_arguments(&mut self, i: &'ast PathArguments) {
+        visit_path_arguments(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_path_segment(&mut self, i: &'ast PathSegment) {
+        visit_path_segment(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) {
+        visit_predicate_eq(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) {
+        visit_predicate_lifetime(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_predicate_type(&mut self, i: &'ast PredicateType) {
+        visit_predicate_type(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_qself(&mut self, i: &'ast QSelf) {
+        visit_qself(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_range_limits(&mut self, i: &'ast RangeLimits) {
+        visit_range_limits(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_receiver(&mut self, i: &'ast Receiver) {
+        visit_receiver(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_return_type(&mut self, i: &'ast ReturnType) {
+        visit_return_type(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_signature(&mut self, i: &'ast Signature) {
+        visit_signature(self, i)
+    }
+    fn visit_span(&mut self, i: &Span) {
+        visit_span(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_stmt(&mut self, i: &'ast Stmt) {
+        visit_stmt(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_trait_bound(&mut self, i: &'ast TraitBound) {
+        visit_trait_bound(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) {
+        visit_trait_bound_modifier(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_trait_item(&mut self, i: &'ast TraitItem) {
+        visit_trait_item(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_trait_item_const(&mut self, i: &'ast TraitItemConst) {
+        visit_trait_item_const(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_trait_item_macro(&mut self, i: &'ast TraitItemMacro) {
+        visit_trait_item_macro(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_trait_item_method(&mut self, i: &'ast TraitItemMethod) {
+        visit_trait_item_method(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_trait_item_type(&mut self, i: &'ast TraitItemType) {
+        visit_trait_item_type(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type(&mut self, i: &'ast Type) {
+        visit_type(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_array(&mut self, i: &'ast TypeArray) {
+        visit_type_array(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) {
+        visit_type_bare_fn(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_group(&mut self, i: &'ast TypeGroup) {
+        visit_type_group(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) {
+        visit_type_impl_trait(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_infer(&mut self, i: &'ast TypeInfer) {
+        visit_type_infer(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_macro(&mut self, i: &'ast TypeMacro) {
+        visit_type_macro(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_never(&mut self, i: &'ast TypeNever) {
+        visit_type_never(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_param(&mut self, i: &'ast TypeParam) {
+        visit_type_param(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) {
+        visit_type_param_bound(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_paren(&mut self, i: &'ast TypeParen) {
+        visit_type_paren(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_path(&mut self, i: &'ast TypePath) {
+        visit_type_path(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_ptr(&mut self, i: &'ast TypePtr) {
+        visit_type_ptr(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_reference(&mut self, i: &'ast TypeReference) {
+        visit_type_reference(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_slice(&mut self, i: &'ast TypeSlice) {
+        visit_type_slice(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) {
+        visit_type_trait_object(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_type_tuple(&mut self, i: &'ast TypeTuple) {
+        visit_type_tuple(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_un_op(&mut self, i: &'ast UnOp) {
+        visit_un_op(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_use_glob(&mut self, i: &'ast UseGlob) {
+        visit_use_glob(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_use_group(&mut self, i: &'ast UseGroup) {
+        visit_use_group(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_use_name(&mut self, i: &'ast UseName) {
+        visit_use_name(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_use_path(&mut self, i: &'ast UsePath) {
+        visit_use_path(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_use_rename(&mut self, i: &'ast UseRename) {
+        visit_use_rename(self, i)
+    }
+    #[cfg(feature = "full")]
+    fn visit_use_tree(&mut self, i: &'ast UseTree) {
+        visit_use_tree(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_variadic(&mut self, i: &'ast Variadic) {
+        visit_variadic(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_variant(&mut self, i: &'ast Variant) {
+        visit_variant(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_vis_crate(&mut self, i: &'ast VisCrate) {
+        visit_vis_crate(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_vis_public(&mut self, i: &'ast VisPublic) {
+        visit_vis_public(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) {
+        visit_vis_restricted(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_visibility(&mut self, i: &'ast Visibility) {
+        visit_visibility(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_where_clause(&mut self, i: &'ast WhereClause) {
+        visit_where_clause(self, i)
+    }
+    #[cfg(any(feature = "derive", feature = "full"))]
+    fn visit_where_predicate(&mut self, i: &'ast WherePredicate) {
+        visit_where_predicate(self, i)
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_abi<'ast, V>(v: &mut V, node: &'ast Abi)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.extern_token.span);
+    if let Some(it) = &node.name {
+        v.visit_lit_str(it)
+    };
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_angle_bracketed_generic_arguments<'ast, V>(
+    v: &mut V,
+    node: &'ast AngleBracketedGenericArguments,
+) where
+    V: Visit<'ast> + ?Sized,
+{
+    if let Some(it) = &node.colon2_token {
+        tokens_helper(v, &it.spans)
+    };
+    tokens_helper(v, &node.lt_token.spans);
+    for el in Punctuated::pairs(&node.args) {
+        let (it, p) = el.into_tuple();
+        v.visit_generic_argument(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+    tokens_helper(v, &node.gt_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_arm<'ast, V>(v: &mut V, node: &'ast Arm)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_pat(&node.pat);
+    if let Some(it) = &node.guard {
+        tokens_helper(v, &(it).0.span);
+        v.visit_expr(&*(it).1);
+    };
+    tokens_helper(v, &node.fat_arrow_token.spans);
+    v.visit_expr(&*node.body);
+    if let Some(it) = &node.comma {
+        tokens_helper(v, &it.spans)
+    };
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_attr_style<'ast, V>(v: &mut V, node: &'ast AttrStyle)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        AttrStyle::Outer => {}
+        AttrStyle::Inner(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_attribute<'ast, V>(v: &mut V, node: &'ast Attribute)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.pound_token.spans);
+    v.visit_attr_style(&node.style);
+    tokens_helper(v, &node.bracket_token.span);
+    v.visit_path(&node.path);
+    skip!(node.tokens);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_bare_fn_arg<'ast, V>(v: &mut V, node: &'ast BareFnArg)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    if let Some(it) = &node.name {
+        v.visit_ident(&(it).0);
+        tokens_helper(v, &(it).1.spans);
+    };
+    v.visit_type(&node.ty);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_bin_op<'ast, V>(v: &mut V, node: &'ast BinOp)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        BinOp::Add(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::Sub(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::Mul(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::Div(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::Rem(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::And(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::Or(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::BitXor(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::BitAnd(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::BitOr(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::Shl(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::Shr(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::Eq(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::Lt(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::Le(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::Ne(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::Ge(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::Gt(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::AddEq(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::SubEq(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::MulEq(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::DivEq(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::RemEq(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::BitXorEq(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::BitAndEq(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::BitOrEq(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::ShlEq(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        BinOp::ShrEq(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_binding<'ast, V>(v: &mut V, node: &'ast Binding)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_ident(&node.ident);
+    tokens_helper(v, &node.eq_token.spans);
+    v.visit_type(&node.ty);
+}
+#[cfg(feature = "full")]
+pub fn visit_block<'ast, V>(v: &mut V, node: &'ast Block)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.brace_token.span);
+    for it in &node.stmts {
+        v.visit_stmt(it)
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_bound_lifetimes<'ast, V>(v: &mut V, node: &'ast BoundLifetimes)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.for_token.span);
+    tokens_helper(v, &node.lt_token.spans);
+    for el in Punctuated::pairs(&node.lifetimes) {
+        let (it, p) = el.into_tuple();
+        v.visit_lifetime_def(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+    tokens_helper(v, &node.gt_token.spans);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_const_param<'ast, V>(v: &mut V, node: &'ast ConstParam)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.const_token.span);
+    v.visit_ident(&node.ident);
+    tokens_helper(v, &node.colon_token.spans);
+    v.visit_type(&node.ty);
+    if let Some(it) = &node.eq_token {
+        tokens_helper(v, &it.spans)
+    };
+    if let Some(it) = &node.default {
+        v.visit_expr(it)
+    };
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_constraint<'ast, V>(v: &mut V, node: &'ast Constraint)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_ident(&node.ident);
+    tokens_helper(v, &node.colon_token.spans);
+    for el in Punctuated::pairs(&node.bounds) {
+        let (it, p) = el.into_tuple();
+        v.visit_type_param_bound(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(feature = "derive")]
+pub fn visit_data<'ast, V>(v: &mut V, node: &'ast Data)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        Data::Struct(_binding_0) => {
+            v.visit_data_struct(_binding_0);
+        }
+        Data::Enum(_binding_0) => {
+            v.visit_data_enum(_binding_0);
+        }
+        Data::Union(_binding_0) => {
+            v.visit_data_union(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "derive")]
+pub fn visit_data_enum<'ast, V>(v: &mut V, node: &'ast DataEnum)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.enum_token.span);
+    tokens_helper(v, &node.brace_token.span);
+    for el in Punctuated::pairs(&node.variants) {
+        let (it, p) = el.into_tuple();
+        v.visit_variant(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(feature = "derive")]
+pub fn visit_data_struct<'ast, V>(v: &mut V, node: &'ast DataStruct)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.struct_token.span);
+    v.visit_fields(&node.fields);
+    if let Some(it) = &node.semi_token {
+        tokens_helper(v, &it.spans)
+    };
+}
+#[cfg(feature = "derive")]
+pub fn visit_data_union<'ast, V>(v: &mut V, node: &'ast DataUnion)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.union_token.span);
+    v.visit_fields_named(&node.fields);
+}
+#[cfg(feature = "derive")]
+pub fn visit_derive_input<'ast, V>(v: &mut V, node: &'ast DeriveInput)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    v.visit_data(&node.data);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_expr<'ast, V>(v: &mut V, node: &'ast Expr)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        Expr::Array(_binding_0) => {
+            full!(v.visit_expr_array(_binding_0));
+        }
+        Expr::Assign(_binding_0) => {
+            full!(v.visit_expr_assign(_binding_0));
+        }
+        Expr::AssignOp(_binding_0) => {
+            full!(v.visit_expr_assign_op(_binding_0));
+        }
+        Expr::Async(_binding_0) => {
+            full!(v.visit_expr_async(_binding_0));
+        }
+        Expr::Await(_binding_0) => {
+            full!(v.visit_expr_await(_binding_0));
+        }
+        Expr::Binary(_binding_0) => {
+            v.visit_expr_binary(_binding_0);
+        }
+        Expr::Block(_binding_0) => {
+            full!(v.visit_expr_block(_binding_0));
+        }
+        Expr::Box(_binding_0) => {
+            full!(v.visit_expr_box(_binding_0));
+        }
+        Expr::Break(_binding_0) => {
+            full!(v.visit_expr_break(_binding_0));
+        }
+        Expr::Call(_binding_0) => {
+            v.visit_expr_call(_binding_0);
+        }
+        Expr::Cast(_binding_0) => {
+            v.visit_expr_cast(_binding_0);
+        }
+        Expr::Closure(_binding_0) => {
+            full!(v.visit_expr_closure(_binding_0));
+        }
+        Expr::Continue(_binding_0) => {
+            full!(v.visit_expr_continue(_binding_0));
+        }
+        Expr::Field(_binding_0) => {
+            v.visit_expr_field(_binding_0);
+        }
+        Expr::ForLoop(_binding_0) => {
+            full!(v.visit_expr_for_loop(_binding_0));
+        }
+        Expr::Group(_binding_0) => {
+            full!(v.visit_expr_group(_binding_0));
+        }
+        Expr::If(_binding_0) => {
+            full!(v.visit_expr_if(_binding_0));
+        }
+        Expr::Index(_binding_0) => {
+            v.visit_expr_index(_binding_0);
+        }
+        Expr::Let(_binding_0) => {
+            full!(v.visit_expr_let(_binding_0));
+        }
+        Expr::Lit(_binding_0) => {
+            v.visit_expr_lit(_binding_0);
+        }
+        Expr::Loop(_binding_0) => {
+            full!(v.visit_expr_loop(_binding_0));
+        }
+        Expr::Macro(_binding_0) => {
+            full!(v.visit_expr_macro(_binding_0));
+        }
+        Expr::Match(_binding_0) => {
+            full!(v.visit_expr_match(_binding_0));
+        }
+        Expr::MethodCall(_binding_0) => {
+            full!(v.visit_expr_method_call(_binding_0));
+        }
+        Expr::Paren(_binding_0) => {
+            v.visit_expr_paren(_binding_0);
+        }
+        Expr::Path(_binding_0) => {
+            v.visit_expr_path(_binding_0);
+        }
+        Expr::Range(_binding_0) => {
+            full!(v.visit_expr_range(_binding_0));
+        }
+        Expr::Reference(_binding_0) => {
+            full!(v.visit_expr_reference(_binding_0));
+        }
+        Expr::Repeat(_binding_0) => {
+            full!(v.visit_expr_repeat(_binding_0));
+        }
+        Expr::Return(_binding_0) => {
+            full!(v.visit_expr_return(_binding_0));
+        }
+        Expr::Struct(_binding_0) => {
+            full!(v.visit_expr_struct(_binding_0));
+        }
+        Expr::Try(_binding_0) => {
+            full!(v.visit_expr_try(_binding_0));
+        }
+        Expr::TryBlock(_binding_0) => {
+            full!(v.visit_expr_try_block(_binding_0));
+        }
+        Expr::Tuple(_binding_0) => {
+            full!(v.visit_expr_tuple(_binding_0));
+        }
+        Expr::Type(_binding_0) => {
+            full!(v.visit_expr_type(_binding_0));
+        }
+        Expr::Unary(_binding_0) => {
+            v.visit_expr_unary(_binding_0);
+        }
+        Expr::Unsafe(_binding_0) => {
+            full!(v.visit_expr_unsafe(_binding_0));
+        }
+        Expr::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+        Expr::While(_binding_0) => {
+            full!(v.visit_expr_while(_binding_0));
+        }
+        Expr::Yield(_binding_0) => {
+            full!(v.visit_expr_yield(_binding_0));
+        }
+        _ => unreachable!(),
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_array<'ast, V>(v: &mut V, node: &'ast ExprArray)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.bracket_token.span);
+    for el in Punctuated::pairs(&node.elems) {
+        let (it, p) = el.into_tuple();
+        v.visit_expr(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_assign<'ast, V>(v: &mut V, node: &'ast ExprAssign)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_expr(&*node.left);
+    tokens_helper(v, &node.eq_token.spans);
+    v.visit_expr(&*node.right);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_assign_op<'ast, V>(v: &mut V, node: &'ast ExprAssignOp)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_expr(&*node.left);
+    v.visit_bin_op(&node.op);
+    v.visit_expr(&*node.right);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_async<'ast, V>(v: &mut V, node: &'ast ExprAsync)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.async_token.span);
+    if let Some(it) = &node.capture {
+        tokens_helper(v, &it.span)
+    };
+    v.visit_block(&node.block);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_await<'ast, V>(v: &mut V, node: &'ast ExprAwait)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_expr(&*node.base);
+    tokens_helper(v, &node.dot_token.spans);
+    tokens_helper(v, &node.await_token.span);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_expr_binary<'ast, V>(v: &mut V, node: &'ast ExprBinary)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_expr(&*node.left);
+    v.visit_bin_op(&node.op);
+    v.visit_expr(&*node.right);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_block<'ast, V>(v: &mut V, node: &'ast ExprBlock)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    if let Some(it) = &node.label {
+        v.visit_label(it)
+    };
+    v.visit_block(&node.block);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_box<'ast, V>(v: &mut V, node: &'ast ExprBox)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.box_token.span);
+    v.visit_expr(&*node.expr);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_break<'ast, V>(v: &mut V, node: &'ast ExprBreak)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.break_token.span);
+    if let Some(it) = &node.label {
+        v.visit_lifetime(it)
+    };
+    if let Some(it) = &node.expr {
+        v.visit_expr(&**it)
+    };
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_expr_call<'ast, V>(v: &mut V, node: &'ast ExprCall)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_expr(&*node.func);
+    tokens_helper(v, &node.paren_token.span);
+    for el in Punctuated::pairs(&node.args) {
+        let (it, p) = el.into_tuple();
+        v.visit_expr(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_expr_cast<'ast, V>(v: &mut V, node: &'ast ExprCast)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_expr(&*node.expr);
+    tokens_helper(v, &node.as_token.span);
+    v.visit_type(&*node.ty);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_closure<'ast, V>(v: &mut V, node: &'ast ExprClosure)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    if let Some(it) = &node.asyncness {
+        tokens_helper(v, &it.span)
+    };
+    if let Some(it) = &node.movability {
+        tokens_helper(v, &it.span)
+    };
+    if let Some(it) = &node.capture {
+        tokens_helper(v, &it.span)
+    };
+    tokens_helper(v, &node.or1_token.spans);
+    for el in Punctuated::pairs(&node.inputs) {
+        let (it, p) = el.into_tuple();
+        v.visit_pat(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+    tokens_helper(v, &node.or2_token.spans);
+    v.visit_return_type(&node.output);
+    v.visit_expr(&*node.body);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_continue<'ast, V>(v: &mut V, node: &'ast ExprContinue)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.continue_token.span);
+    if let Some(it) = &node.label {
+        v.visit_lifetime(it)
+    };
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_expr_field<'ast, V>(v: &mut V, node: &'ast ExprField)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_expr(&*node.base);
+    tokens_helper(v, &node.dot_token.spans);
+    v.visit_member(&node.member);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_for_loop<'ast, V>(v: &mut V, node: &'ast ExprForLoop)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    if let Some(it) = &node.label {
+        v.visit_label(it)
+    };
+    tokens_helper(v, &node.for_token.span);
+    v.visit_pat(&node.pat);
+    tokens_helper(v, &node.in_token.span);
+    v.visit_expr(&*node.expr);
+    v.visit_block(&node.body);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_group<'ast, V>(v: &mut V, node: &'ast ExprGroup)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.group_token.span);
+    v.visit_expr(&*node.expr);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_if<'ast, V>(v: &mut V, node: &'ast ExprIf)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.if_token.span);
+    v.visit_expr(&*node.cond);
+    v.visit_block(&node.then_branch);
+    if let Some(it) = &node.else_branch {
+        tokens_helper(v, &(it).0.span);
+        v.visit_expr(&*(it).1);
+    };
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_expr_index<'ast, V>(v: &mut V, node: &'ast ExprIndex)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_expr(&*node.expr);
+    tokens_helper(v, &node.bracket_token.span);
+    v.visit_expr(&*node.index);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_let<'ast, V>(v: &mut V, node: &'ast ExprLet)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.let_token.span);
+    v.visit_pat(&node.pat);
+    tokens_helper(v, &node.eq_token.spans);
+    v.visit_expr(&*node.expr);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_expr_lit<'ast, V>(v: &mut V, node: &'ast ExprLit)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_lit(&node.lit);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_loop<'ast, V>(v: &mut V, node: &'ast ExprLoop)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    if let Some(it) = &node.label {
+        v.visit_label(it)
+    };
+    tokens_helper(v, &node.loop_token.span);
+    v.visit_block(&node.body);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_macro<'ast, V>(v: &mut V, node: &'ast ExprMacro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_macro(&node.mac);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_match<'ast, V>(v: &mut V, node: &'ast ExprMatch)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.match_token.span);
+    v.visit_expr(&*node.expr);
+    tokens_helper(v, &node.brace_token.span);
+    for it in &node.arms {
+        v.visit_arm(it)
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_method_call<'ast, V>(v: &mut V, node: &'ast ExprMethodCall)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_expr(&*node.receiver);
+    tokens_helper(v, &node.dot_token.spans);
+    v.visit_ident(&node.method);
+    if let Some(it) = &node.turbofish {
+        v.visit_method_turbofish(it)
+    };
+    tokens_helper(v, &node.paren_token.span);
+    for el in Punctuated::pairs(&node.args) {
+        let (it, p) = el.into_tuple();
+        v.visit_expr(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_expr_paren<'ast, V>(v: &mut V, node: &'ast ExprParen)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.paren_token.span);
+    v.visit_expr(&*node.expr);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_expr_path<'ast, V>(v: &mut V, node: &'ast ExprPath)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    if let Some(it) = &node.qself {
+        v.visit_qself(it)
+    };
+    v.visit_path(&node.path);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_range<'ast, V>(v: &mut V, node: &'ast ExprRange)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    if let Some(it) = &node.from {
+        v.visit_expr(&**it)
+    };
+    v.visit_range_limits(&node.limits);
+    if let Some(it) = &node.to {
+        v.visit_expr(&**it)
+    };
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_reference<'ast, V>(v: &mut V, node: &'ast ExprReference)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.and_token.spans);
+    if let Some(it) = &node.mutability {
+        tokens_helper(v, &it.span)
+    };
+    v.visit_expr(&*node.expr);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_repeat<'ast, V>(v: &mut V, node: &'ast ExprRepeat)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.bracket_token.span);
+    v.visit_expr(&*node.expr);
+    tokens_helper(v, &node.semi_token.spans);
+    v.visit_expr(&*node.len);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_return<'ast, V>(v: &mut V, node: &'ast ExprReturn)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.return_token.span);
+    if let Some(it) = &node.expr {
+        v.visit_expr(&**it)
+    };
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_struct<'ast, V>(v: &mut V, node: &'ast ExprStruct)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_path(&node.path);
+    tokens_helper(v, &node.brace_token.span);
+    for el in Punctuated::pairs(&node.fields) {
+        let (it, p) = el.into_tuple();
+        v.visit_field_value(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+    if let Some(it) = &node.dot2_token {
+        tokens_helper(v, &it.spans)
+    };
+    if let Some(it) = &node.rest {
+        v.visit_expr(&**it)
+    };
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_try<'ast, V>(v: &mut V, node: &'ast ExprTry)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_expr(&*node.expr);
+    tokens_helper(v, &node.question_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_try_block<'ast, V>(v: &mut V, node: &'ast ExprTryBlock)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.try_token.span);
+    v.visit_block(&node.block);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_tuple<'ast, V>(v: &mut V, node: &'ast ExprTuple)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.paren_token.span);
+    for el in Punctuated::pairs(&node.elems) {
+        let (it, p) = el.into_tuple();
+        v.visit_expr(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_type<'ast, V>(v: &mut V, node: &'ast ExprType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_expr(&*node.expr);
+    tokens_helper(v, &node.colon_token.spans);
+    v.visit_type(&*node.ty);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_expr_unary<'ast, V>(v: &mut V, node: &'ast ExprUnary)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_un_op(&node.op);
+    v.visit_expr(&*node.expr);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_unsafe<'ast, V>(v: &mut V, node: &'ast ExprUnsafe)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.unsafe_token.span);
+    v.visit_block(&node.block);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_while<'ast, V>(v: &mut V, node: &'ast ExprWhile)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    if let Some(it) = &node.label {
+        v.visit_label(it)
+    };
+    tokens_helper(v, &node.while_token.span);
+    v.visit_expr(&*node.cond);
+    v.visit_block(&node.body);
+}
+#[cfg(feature = "full")]
+pub fn visit_expr_yield<'ast, V>(v: &mut V, node: &'ast ExprYield)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.yield_token.span);
+    if let Some(it) = &node.expr {
+        v.visit_expr(&**it)
+    };
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_field<'ast, V>(v: &mut V, node: &'ast Field)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    if let Some(it) = &node.ident {
+        v.visit_ident(it)
+    };
+    if let Some(it) = &node.colon_token {
+        tokens_helper(v, &it.spans)
+    };
+    v.visit_type(&node.ty);
+}
+#[cfg(feature = "full")]
+pub fn visit_field_pat<'ast, V>(v: &mut V, node: &'ast FieldPat)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_member(&node.member);
+    if let Some(it) = &node.colon_token {
+        tokens_helper(v, &it.spans)
+    };
+    v.visit_pat(&*node.pat);
+}
+#[cfg(feature = "full")]
+pub fn visit_field_value<'ast, V>(v: &mut V, node: &'ast FieldValue)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_member(&node.member);
+    if let Some(it) = &node.colon_token {
+        tokens_helper(v, &it.spans)
+    };
+    v.visit_expr(&node.expr);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_fields<'ast, V>(v: &mut V, node: &'ast Fields)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        Fields::Named(_binding_0) => {
+            v.visit_fields_named(_binding_0);
+        }
+        Fields::Unnamed(_binding_0) => {
+            v.visit_fields_unnamed(_binding_0);
+        }
+        Fields::Unit => {}
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_fields_named<'ast, V>(v: &mut V, node: &'ast FieldsNamed)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.brace_token.span);
+    for el in Punctuated::pairs(&node.named) {
+        let (it, p) = el.into_tuple();
+        v.visit_field(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_fields_unnamed<'ast, V>(v: &mut V, node: &'ast FieldsUnnamed)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.paren_token.span);
+    for el in Punctuated::pairs(&node.unnamed) {
+        let (it, p) = el.into_tuple();
+        v.visit_field(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_file<'ast, V>(v: &mut V, node: &'ast File)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.shebang);
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    for it in &node.items {
+        v.visit_item(it)
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_fn_arg<'ast, V>(v: &mut V, node: &'ast FnArg)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        FnArg::Receiver(_binding_0) => {
+            v.visit_receiver(_binding_0);
+        }
+        FnArg::Typed(_binding_0) => {
+            v.visit_pat_type(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_foreign_item<'ast, V>(v: &mut V, node: &'ast ForeignItem)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        ForeignItem::Fn(_binding_0) => {
+            v.visit_foreign_item_fn(_binding_0);
+        }
+        ForeignItem::Static(_binding_0) => {
+            v.visit_foreign_item_static(_binding_0);
+        }
+        ForeignItem::Type(_binding_0) => {
+            v.visit_foreign_item_type(_binding_0);
+        }
+        ForeignItem::Macro(_binding_0) => {
+            v.visit_foreign_item_macro(_binding_0);
+        }
+        ForeignItem::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+        _ => unreachable!(),
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_foreign_item_fn<'ast, V>(v: &mut V, node: &'ast ForeignItemFn)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    v.visit_signature(&node.sig);
+    tokens_helper(v, &node.semi_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_foreign_item_macro<'ast, V>(v: &mut V, node: &'ast ForeignItemMacro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_macro(&node.mac);
+    if let Some(it) = &node.semi_token {
+        tokens_helper(v, &it.spans)
+    };
+}
+#[cfg(feature = "full")]
+pub fn visit_foreign_item_static<'ast, V>(v: &mut V, node: &'ast ForeignItemStatic)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    tokens_helper(v, &node.static_token.span);
+    if let Some(it) = &node.mutability {
+        tokens_helper(v, &it.span)
+    };
+    v.visit_ident(&node.ident);
+    tokens_helper(v, &node.colon_token.spans);
+    v.visit_type(&*node.ty);
+    tokens_helper(v, &node.semi_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_foreign_item_type<'ast, V>(v: &mut V, node: &'ast ForeignItemType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    tokens_helper(v, &node.type_token.span);
+    v.visit_ident(&node.ident);
+    tokens_helper(v, &node.semi_token.spans);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_generic_argument<'ast, V>(v: &mut V, node: &'ast GenericArgument)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        GenericArgument::Lifetime(_binding_0) => {
+            v.visit_lifetime(_binding_0);
+        }
+        GenericArgument::Type(_binding_0) => {
+            v.visit_type(_binding_0);
+        }
+        GenericArgument::Binding(_binding_0) => {
+            v.visit_binding(_binding_0);
+        }
+        GenericArgument::Constraint(_binding_0) => {
+            v.visit_constraint(_binding_0);
+        }
+        GenericArgument::Const(_binding_0) => {
+            v.visit_expr(_binding_0);
+        }
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_generic_method_argument<'ast, V>(v: &mut V, node: &'ast GenericMethodArgument)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        GenericMethodArgument::Type(_binding_0) => {
+            v.visit_type(_binding_0);
+        }
+        GenericMethodArgument::Const(_binding_0) => {
+            v.visit_expr(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_generic_param<'ast, V>(v: &mut V, node: &'ast GenericParam)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        GenericParam::Type(_binding_0) => {
+            v.visit_type_param(_binding_0);
+        }
+        GenericParam::Lifetime(_binding_0) => {
+            v.visit_lifetime_def(_binding_0);
+        }
+        GenericParam::Const(_binding_0) => {
+            v.visit_const_param(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_generics<'ast, V>(v: &mut V, node: &'ast Generics)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    if let Some(it) = &node.lt_token {
+        tokens_helper(v, &it.spans)
+    };
+    for el in Punctuated::pairs(&node.params) {
+        let (it, p) = el.into_tuple();
+        v.visit_generic_param(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+    if let Some(it) = &node.gt_token {
+        tokens_helper(v, &it.spans)
+    };
+    if let Some(it) = &node.where_clause {
+        v.visit_where_clause(it)
+    };
+}
+pub fn visit_ident<'ast, V>(v: &mut V, node: &'ast Ident)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_span(&node.span());
+}
+#[cfg(feature = "full")]
+pub fn visit_impl_item<'ast, V>(v: &mut V, node: &'ast ImplItem)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        ImplItem::Const(_binding_0) => {
+            v.visit_impl_item_const(_binding_0);
+        }
+        ImplItem::Method(_binding_0) => {
+            v.visit_impl_item_method(_binding_0);
+        }
+        ImplItem::Type(_binding_0) => {
+            v.visit_impl_item_type(_binding_0);
+        }
+        ImplItem::Macro(_binding_0) => {
+            v.visit_impl_item_macro(_binding_0);
+        }
+        ImplItem::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+        _ => unreachable!(),
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_impl_item_const<'ast, V>(v: &mut V, node: &'ast ImplItemConst)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    if let Some(it) = &node.defaultness {
+        tokens_helper(v, &it.span)
+    };
+    tokens_helper(v, &node.const_token.span);
+    v.visit_ident(&node.ident);
+    tokens_helper(v, &node.colon_token.spans);
+    v.visit_type(&node.ty);
+    tokens_helper(v, &node.eq_token.spans);
+    v.visit_expr(&node.expr);
+    tokens_helper(v, &node.semi_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_impl_item_macro<'ast, V>(v: &mut V, node: &'ast ImplItemMacro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_macro(&node.mac);
+    if let Some(it) = &node.semi_token {
+        tokens_helper(v, &it.spans)
+    };
+}
+#[cfg(feature = "full")]
+pub fn visit_impl_item_method<'ast, V>(v: &mut V, node: &'ast ImplItemMethod)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    if let Some(it) = &node.defaultness {
+        tokens_helper(v, &it.span)
+    };
+    v.visit_signature(&node.sig);
+    v.visit_block(&node.block);
+}
+#[cfg(feature = "full")]
+pub fn visit_impl_item_type<'ast, V>(v: &mut V, node: &'ast ImplItemType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    if let Some(it) = &node.defaultness {
+        tokens_helper(v, &it.span)
+    };
+    tokens_helper(v, &node.type_token.span);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    tokens_helper(v, &node.eq_token.spans);
+    v.visit_type(&node.ty);
+    tokens_helper(v, &node.semi_token.spans);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_index<'ast, V>(v: &mut V, node: &'ast Index)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.index);
+    v.visit_span(&node.span);
+}
+#[cfg(feature = "full")]
+pub fn visit_item<'ast, V>(v: &mut V, node: &'ast Item)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        Item::Const(_binding_0) => {
+            v.visit_item_const(_binding_0);
+        }
+        Item::Enum(_binding_0) => {
+            v.visit_item_enum(_binding_0);
+        }
+        Item::ExternCrate(_binding_0) => {
+            v.visit_item_extern_crate(_binding_0);
+        }
+        Item::Fn(_binding_0) => {
+            v.visit_item_fn(_binding_0);
+        }
+        Item::ForeignMod(_binding_0) => {
+            v.visit_item_foreign_mod(_binding_0);
+        }
+        Item::Impl(_binding_0) => {
+            v.visit_item_impl(_binding_0);
+        }
+        Item::Macro(_binding_0) => {
+            v.visit_item_macro(_binding_0);
+        }
+        Item::Macro2(_binding_0) => {
+            v.visit_item_macro2(_binding_0);
+        }
+        Item::Mod(_binding_0) => {
+            v.visit_item_mod(_binding_0);
+        }
+        Item::Static(_binding_0) => {
+            v.visit_item_static(_binding_0);
+        }
+        Item::Struct(_binding_0) => {
+            v.visit_item_struct(_binding_0);
+        }
+        Item::Trait(_binding_0) => {
+            v.visit_item_trait(_binding_0);
+        }
+        Item::TraitAlias(_binding_0) => {
+            v.visit_item_trait_alias(_binding_0);
+        }
+        Item::Type(_binding_0) => {
+            v.visit_item_type(_binding_0);
+        }
+        Item::Union(_binding_0) => {
+            v.visit_item_union(_binding_0);
+        }
+        Item::Use(_binding_0) => {
+            v.visit_item_use(_binding_0);
+        }
+        Item::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+        _ => unreachable!(),
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_item_const<'ast, V>(v: &mut V, node: &'ast ItemConst)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    tokens_helper(v, &node.const_token.span);
+    v.visit_ident(&node.ident);
+    tokens_helper(v, &node.colon_token.spans);
+    v.visit_type(&*node.ty);
+    tokens_helper(v, &node.eq_token.spans);
+    v.visit_expr(&*node.expr);
+    tokens_helper(v, &node.semi_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_item_enum<'ast, V>(v: &mut V, node: &'ast ItemEnum)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    tokens_helper(v, &node.enum_token.span);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    tokens_helper(v, &node.brace_token.span);
+    for el in Punctuated::pairs(&node.variants) {
+        let (it, p) = el.into_tuple();
+        v.visit_variant(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_item_extern_crate<'ast, V>(v: &mut V, node: &'ast ItemExternCrate)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    tokens_helper(v, &node.extern_token.span);
+    tokens_helper(v, &node.crate_token.span);
+    v.visit_ident(&node.ident);
+    if let Some(it) = &node.rename {
+        tokens_helper(v, &(it).0.span);
+        v.visit_ident(&(it).1);
+    };
+    tokens_helper(v, &node.semi_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_item_fn<'ast, V>(v: &mut V, node: &'ast ItemFn)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    v.visit_signature(&node.sig);
+    v.visit_block(&*node.block);
+}
+#[cfg(feature = "full")]
+pub fn visit_item_foreign_mod<'ast, V>(v: &mut V, node: &'ast ItemForeignMod)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_abi(&node.abi);
+    tokens_helper(v, &node.brace_token.span);
+    for it in &node.items {
+        v.visit_foreign_item(it)
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_item_impl<'ast, V>(v: &mut V, node: &'ast ItemImpl)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    if let Some(it) = &node.defaultness {
+        tokens_helper(v, &it.span)
+    };
+    if let Some(it) = &node.unsafety {
+        tokens_helper(v, &it.span)
+    };
+    tokens_helper(v, &node.impl_token.span);
+    v.visit_generics(&node.generics);
+    if let Some(it) = &node.trait_ {
+        if let Some(it) = &(it).0 {
+            tokens_helper(v, &it.spans)
+        };
+        v.visit_path(&(it).1);
+        tokens_helper(v, &(it).2.span);
+    };
+    v.visit_type(&*node.self_ty);
+    tokens_helper(v, &node.brace_token.span);
+    for it in &node.items {
+        v.visit_impl_item(it)
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_item_macro<'ast, V>(v: &mut V, node: &'ast ItemMacro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    if let Some(it) = &node.ident {
+        v.visit_ident(it)
+    };
+    v.visit_macro(&node.mac);
+    if let Some(it) = &node.semi_token {
+        tokens_helper(v, &it.spans)
+    };
+}
+#[cfg(feature = "full")]
+pub fn visit_item_macro2<'ast, V>(v: &mut V, node: &'ast ItemMacro2)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    tokens_helper(v, &node.macro_token.span);
+    v.visit_ident(&node.ident);
+    skip!(node.rules);
+}
+#[cfg(feature = "full")]
+pub fn visit_item_mod<'ast, V>(v: &mut V, node: &'ast ItemMod)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    tokens_helper(v, &node.mod_token.span);
+    v.visit_ident(&node.ident);
+    if let Some(it) = &node.content {
+        tokens_helper(v, &(it).0.span);
+        for it in &(it).1 {
+            v.visit_item(it)
+        }
+    };
+    if let Some(it) = &node.semi {
+        tokens_helper(v, &it.spans)
+    };
+}
+#[cfg(feature = "full")]
+pub fn visit_item_static<'ast, V>(v: &mut V, node: &'ast ItemStatic)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    tokens_helper(v, &node.static_token.span);
+    if let Some(it) = &node.mutability {
+        tokens_helper(v, &it.span)
+    };
+    v.visit_ident(&node.ident);
+    tokens_helper(v, &node.colon_token.spans);
+    v.visit_type(&*node.ty);
+    tokens_helper(v, &node.eq_token.spans);
+    v.visit_expr(&*node.expr);
+    tokens_helper(v, &node.semi_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_item_struct<'ast, V>(v: &mut V, node: &'ast ItemStruct)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    tokens_helper(v, &node.struct_token.span);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    v.visit_fields(&node.fields);
+    if let Some(it) = &node.semi_token {
+        tokens_helper(v, &it.spans)
+    };
+}
+#[cfg(feature = "full")]
+pub fn visit_item_trait<'ast, V>(v: &mut V, node: &'ast ItemTrait)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    if let Some(it) = &node.unsafety {
+        tokens_helper(v, &it.span)
+    };
+    if let Some(it) = &node.auto_token {
+        tokens_helper(v, &it.span)
+    };
+    tokens_helper(v, &node.trait_token.span);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    if let Some(it) = &node.colon_token {
+        tokens_helper(v, &it.spans)
+    };
+    for el in Punctuated::pairs(&node.supertraits) {
+        let (it, p) = el.into_tuple();
+        v.visit_type_param_bound(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+    tokens_helper(v, &node.brace_token.span);
+    for it in &node.items {
+        v.visit_trait_item(it)
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_item_trait_alias<'ast, V>(v: &mut V, node: &'ast ItemTraitAlias)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    tokens_helper(v, &node.trait_token.span);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    tokens_helper(v, &node.eq_token.spans);
+    for el in Punctuated::pairs(&node.bounds) {
+        let (it, p) = el.into_tuple();
+        v.visit_type_param_bound(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+    tokens_helper(v, &node.semi_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_item_type<'ast, V>(v: &mut V, node: &'ast ItemType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    tokens_helper(v, &node.type_token.span);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    tokens_helper(v, &node.eq_token.spans);
+    v.visit_type(&*node.ty);
+    tokens_helper(v, &node.semi_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_item_union<'ast, V>(v: &mut V, node: &'ast ItemUnion)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    tokens_helper(v, &node.union_token.span);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    v.visit_fields_named(&node.fields);
+}
+#[cfg(feature = "full")]
+pub fn visit_item_use<'ast, V>(v: &mut V, node: &'ast ItemUse)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_visibility(&node.vis);
+    tokens_helper(v, &node.use_token.span);
+    if let Some(it) = &node.leading_colon {
+        tokens_helper(v, &it.spans)
+    };
+    v.visit_use_tree(&node.tree);
+    tokens_helper(v, &node.semi_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_label<'ast, V>(v: &mut V, node: &'ast Label)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_lifetime(&node.name);
+    tokens_helper(v, &node.colon_token.spans);
+}
+pub fn visit_lifetime<'ast, V>(v: &mut V, node: &'ast Lifetime)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_span(&node.apostrophe);
+    v.visit_ident(&node.ident);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_lifetime_def<'ast, V>(v: &mut V, node: &'ast LifetimeDef)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_lifetime(&node.lifetime);
+    if let Some(it) = &node.colon_token {
+        tokens_helper(v, &it.spans)
+    };
+    for el in Punctuated::pairs(&node.bounds) {
+        let (it, p) = el.into_tuple();
+        v.visit_lifetime(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_lit<'ast, V>(v: &mut V, node: &'ast Lit)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        Lit::Str(_binding_0) => {
+            v.visit_lit_str(_binding_0);
+        }
+        Lit::ByteStr(_binding_0) => {
+            v.visit_lit_byte_str(_binding_0);
+        }
+        Lit::Byte(_binding_0) => {
+            v.visit_lit_byte(_binding_0);
+        }
+        Lit::Char(_binding_0) => {
+            v.visit_lit_char(_binding_0);
+        }
+        Lit::Int(_binding_0) => {
+            v.visit_lit_int(_binding_0);
+        }
+        Lit::Float(_binding_0) => {
+            v.visit_lit_float(_binding_0);
+        }
+        Lit::Bool(_binding_0) => {
+            v.visit_lit_bool(_binding_0);
+        }
+        Lit::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_lit_bool<'ast, V>(v: &mut V, node: &'ast LitBool)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    skip!(node.value);
+    v.visit_span(&node.span);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_lit_byte<'ast, V>(v: &mut V, node: &'ast LitByte)
+where
+    V: Visit<'ast> + ?Sized,
+{
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_lit_byte_str<'ast, V>(v: &mut V, node: &'ast LitByteStr)
+where
+    V: Visit<'ast> + ?Sized,
+{
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_lit_char<'ast, V>(v: &mut V, node: &'ast LitChar)
+where
+    V: Visit<'ast> + ?Sized,
+{
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_lit_float<'ast, V>(v: &mut V, node: &'ast LitFloat)
+where
+    V: Visit<'ast> + ?Sized,
+{
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_lit_int<'ast, V>(v: &mut V, node: &'ast LitInt)
+where
+    V: Visit<'ast> + ?Sized,
+{
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_lit_str<'ast, V>(v: &mut V, node: &'ast LitStr)
+where
+    V: Visit<'ast> + ?Sized,
+{
+}
+#[cfg(feature = "full")]
+pub fn visit_local<'ast, V>(v: &mut V, node: &'ast Local)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.let_token.span);
+    v.visit_pat(&node.pat);
+    if let Some(it) = &node.init {
+        tokens_helper(v, &(it).0.spans);
+        v.visit_expr(&*(it).1);
+    };
+    tokens_helper(v, &node.semi_token.spans);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_macro<'ast, V>(v: &mut V, node: &'ast Macro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_path(&node.path);
+    tokens_helper(v, &node.bang_token.spans);
+    v.visit_macro_delimiter(&node.delimiter);
+    skip!(node.tokens);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_macro_delimiter<'ast, V>(v: &mut V, node: &'ast MacroDelimiter)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        MacroDelimiter::Paren(_binding_0) => {
+            tokens_helper(v, &_binding_0.span);
+        }
+        MacroDelimiter::Brace(_binding_0) => {
+            tokens_helper(v, &_binding_0.span);
+        }
+        MacroDelimiter::Bracket(_binding_0) => {
+            tokens_helper(v, &_binding_0.span);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_member<'ast, V>(v: &mut V, node: &'ast Member)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        Member::Named(_binding_0) => {
+            v.visit_ident(_binding_0);
+        }
+        Member::Unnamed(_binding_0) => {
+            v.visit_index(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_meta<'ast, V>(v: &mut V, node: &'ast Meta)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        Meta::Path(_binding_0) => {
+            v.visit_path(_binding_0);
+        }
+        Meta::List(_binding_0) => {
+            v.visit_meta_list(_binding_0);
+        }
+        Meta::NameValue(_binding_0) => {
+            v.visit_meta_name_value(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_meta_list<'ast, V>(v: &mut V, node: &'ast MetaList)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_path(&node.path);
+    tokens_helper(v, &node.paren_token.span);
+    for el in Punctuated::pairs(&node.nested) {
+        let (it, p) = el.into_tuple();
+        v.visit_nested_meta(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_meta_name_value<'ast, V>(v: &mut V, node: &'ast MetaNameValue)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_path(&node.path);
+    tokens_helper(v, &node.eq_token.spans);
+    v.visit_lit(&node.lit);
+}
+#[cfg(feature = "full")]
+pub fn visit_method_turbofish<'ast, V>(v: &mut V, node: &'ast MethodTurbofish)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.colon2_token.spans);
+    tokens_helper(v, &node.lt_token.spans);
+    for el in Punctuated::pairs(&node.args) {
+        let (it, p) = el.into_tuple();
+        v.visit_generic_method_argument(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+    tokens_helper(v, &node.gt_token.spans);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_nested_meta<'ast, V>(v: &mut V, node: &'ast NestedMeta)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        NestedMeta::Meta(_binding_0) => {
+            v.visit_meta(_binding_0);
+        }
+        NestedMeta::Lit(_binding_0) => {
+            v.visit_lit(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_parenthesized_generic_arguments<'ast, V>(
+    v: &mut V,
+    node: &'ast ParenthesizedGenericArguments,
+) where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.paren_token.span);
+    for el in Punctuated::pairs(&node.inputs) {
+        let (it, p) = el.into_tuple();
+        v.visit_type(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+    v.visit_return_type(&node.output);
+}
+#[cfg(feature = "full")]
+pub fn visit_pat<'ast, V>(v: &mut V, node: &'ast Pat)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        Pat::Box(_binding_0) => {
+            v.visit_pat_box(_binding_0);
+        }
+        Pat::Ident(_binding_0) => {
+            v.visit_pat_ident(_binding_0);
+        }
+        Pat::Lit(_binding_0) => {
+            v.visit_pat_lit(_binding_0);
+        }
+        Pat::Macro(_binding_0) => {
+            v.visit_pat_macro(_binding_0);
+        }
+        Pat::Or(_binding_0) => {
+            v.visit_pat_or(_binding_0);
+        }
+        Pat::Path(_binding_0) => {
+            v.visit_pat_path(_binding_0);
+        }
+        Pat::Range(_binding_0) => {
+            v.visit_pat_range(_binding_0);
+        }
+        Pat::Reference(_binding_0) => {
+            v.visit_pat_reference(_binding_0);
+        }
+        Pat::Rest(_binding_0) => {
+            v.visit_pat_rest(_binding_0);
+        }
+        Pat::Slice(_binding_0) => {
+            v.visit_pat_slice(_binding_0);
+        }
+        Pat::Struct(_binding_0) => {
+            v.visit_pat_struct(_binding_0);
+        }
+        Pat::Tuple(_binding_0) => {
+            v.visit_pat_tuple(_binding_0);
+        }
+        Pat::TupleStruct(_binding_0) => {
+            v.visit_pat_tuple_struct(_binding_0);
+        }
+        Pat::Type(_binding_0) => {
+            v.visit_pat_type(_binding_0);
+        }
+        Pat::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+        Pat::Wild(_binding_0) => {
+            v.visit_pat_wild(_binding_0);
+        }
+        _ => unreachable!(),
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_box<'ast, V>(v: &mut V, node: &'ast PatBox)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.box_token.span);
+    v.visit_pat(&*node.pat);
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_ident<'ast, V>(v: &mut V, node: &'ast PatIdent)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    if let Some(it) = &node.by_ref {
+        tokens_helper(v, &it.span)
+    };
+    if let Some(it) = &node.mutability {
+        tokens_helper(v, &it.span)
+    };
+    v.visit_ident(&node.ident);
+    if let Some(it) = &node.subpat {
+        tokens_helper(v, &(it).0.spans);
+        v.visit_pat(&*(it).1);
+    };
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_lit<'ast, V>(v: &mut V, node: &'ast PatLit)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_expr(&*node.expr);
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_macro<'ast, V>(v: &mut V, node: &'ast PatMacro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_macro(&node.mac);
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_or<'ast, V>(v: &mut V, node: &'ast PatOr)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    if let Some(it) = &node.leading_vert {
+        tokens_helper(v, &it.spans)
+    };
+    for el in Punctuated::pairs(&node.cases) {
+        let (it, p) = el.into_tuple();
+        v.visit_pat(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_path<'ast, V>(v: &mut V, node: &'ast PatPath)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    if let Some(it) = &node.qself {
+        v.visit_qself(it)
+    };
+    v.visit_path(&node.path);
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_range<'ast, V>(v: &mut V, node: &'ast PatRange)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_expr(&*node.lo);
+    v.visit_range_limits(&node.limits);
+    v.visit_expr(&*node.hi);
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_reference<'ast, V>(v: &mut V, node: &'ast PatReference)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.and_token.spans);
+    if let Some(it) = &node.mutability {
+        tokens_helper(v, &it.span)
+    };
+    v.visit_pat(&*node.pat);
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_rest<'ast, V>(v: &mut V, node: &'ast PatRest)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.dot2_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_slice<'ast, V>(v: &mut V, node: &'ast PatSlice)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.bracket_token.span);
+    for el in Punctuated::pairs(&node.elems) {
+        let (it, p) = el.into_tuple();
+        v.visit_pat(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_struct<'ast, V>(v: &mut V, node: &'ast PatStruct)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_path(&node.path);
+    tokens_helper(v, &node.brace_token.span);
+    for el in Punctuated::pairs(&node.fields) {
+        let (it, p) = el.into_tuple();
+        v.visit_field_pat(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+    if let Some(it) = &node.dot2_token {
+        tokens_helper(v, &it.spans)
+    };
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_tuple<'ast, V>(v: &mut V, node: &'ast PatTuple)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.paren_token.span);
+    for el in Punctuated::pairs(&node.elems) {
+        let (it, p) = el.into_tuple();
+        v.visit_pat(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_tuple_struct<'ast, V>(v: &mut V, node: &'ast PatTupleStruct)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_path(&node.path);
+    v.visit_pat_tuple(&node.pat);
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_type<'ast, V>(v: &mut V, node: &'ast PatType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_pat(&*node.pat);
+    tokens_helper(v, &node.colon_token.spans);
+    v.visit_type(&*node.ty);
+}
+#[cfg(feature = "full")]
+pub fn visit_pat_wild<'ast, V>(v: &mut V, node: &'ast PatWild)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.underscore_token.spans);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_path<'ast, V>(v: &mut V, node: &'ast Path)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    if let Some(it) = &node.leading_colon {
+        tokens_helper(v, &it.spans)
+    };
+    for el in Punctuated::pairs(&node.segments) {
+        let (it, p) = el.into_tuple();
+        v.visit_path_segment(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_path_arguments<'ast, V>(v: &mut V, node: &'ast PathArguments)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        PathArguments::None => {}
+        PathArguments::AngleBracketed(_binding_0) => {
+            v.visit_angle_bracketed_generic_arguments(_binding_0);
+        }
+        PathArguments::Parenthesized(_binding_0) => {
+            v.visit_parenthesized_generic_arguments(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_path_segment<'ast, V>(v: &mut V, node: &'ast PathSegment)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_ident(&node.ident);
+    v.visit_path_arguments(&node.arguments);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_predicate_eq<'ast, V>(v: &mut V, node: &'ast PredicateEq)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_type(&node.lhs_ty);
+    tokens_helper(v, &node.eq_token.spans);
+    v.visit_type(&node.rhs_ty);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_predicate_lifetime<'ast, V>(v: &mut V, node: &'ast PredicateLifetime)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_lifetime(&node.lifetime);
+    tokens_helper(v, &node.colon_token.spans);
+    for el in Punctuated::pairs(&node.bounds) {
+        let (it, p) = el.into_tuple();
+        v.visit_lifetime(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_predicate_type<'ast, V>(v: &mut V, node: &'ast PredicateType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    if let Some(it) = &node.lifetimes {
+        v.visit_bound_lifetimes(it)
+    };
+    v.visit_type(&node.bounded_ty);
+    tokens_helper(v, &node.colon_token.spans);
+    for el in Punctuated::pairs(&node.bounds) {
+        let (it, p) = el.into_tuple();
+        v.visit_type_param_bound(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_qself<'ast, V>(v: &mut V, node: &'ast QSelf)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.lt_token.spans);
+    v.visit_type(&*node.ty);
+    skip!(node.position);
+    if let Some(it) = &node.as_token {
+        tokens_helper(v, &it.span)
+    };
+    tokens_helper(v, &node.gt_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_range_limits<'ast, V>(v: &mut V, node: &'ast RangeLimits)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        RangeLimits::HalfOpen(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        RangeLimits::Closed(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_receiver<'ast, V>(v: &mut V, node: &'ast Receiver)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    if let Some(it) = &node.reference {
+        tokens_helper(v, &(it).0.spans);
+        if let Some(it) = &(it).1 {
+            v.visit_lifetime(it)
+        };
+    };
+    if let Some(it) = &node.mutability {
+        tokens_helper(v, &it.span)
+    };
+    tokens_helper(v, &node.self_token.span);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_return_type<'ast, V>(v: &mut V, node: &'ast ReturnType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        ReturnType::Default => {}
+        ReturnType::Type(_binding_0, _binding_1) => {
+            tokens_helper(v, &_binding_0.spans);
+            v.visit_type(&**_binding_1);
+        }
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_signature<'ast, V>(v: &mut V, node: &'ast Signature)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    if let Some(it) = &node.constness {
+        tokens_helper(v, &it.span)
+    };
+    if let Some(it) = &node.asyncness {
+        tokens_helper(v, &it.span)
+    };
+    if let Some(it) = &node.unsafety {
+        tokens_helper(v, &it.span)
+    };
+    if let Some(it) = &node.abi {
+        v.visit_abi(it)
+    };
+    tokens_helper(v, &node.fn_token.span);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    tokens_helper(v, &node.paren_token.span);
+    for el in Punctuated::pairs(&node.inputs) {
+        let (it, p) = el.into_tuple();
+        v.visit_fn_arg(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+    if let Some(it) = &node.variadic {
+        v.visit_variadic(it)
+    };
+    v.visit_return_type(&node.output);
+}
+pub fn visit_span<'ast, V>(v: &mut V, node: &Span)
+where
+    V: Visit<'ast> + ?Sized,
+{
+}
+#[cfg(feature = "full")]
+pub fn visit_stmt<'ast, V>(v: &mut V, node: &'ast Stmt)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        Stmt::Local(_binding_0) => {
+            v.visit_local(_binding_0);
+        }
+        Stmt::Item(_binding_0) => {
+            v.visit_item(_binding_0);
+        }
+        Stmt::Expr(_binding_0) => {
+            v.visit_expr(_binding_0);
+        }
+        Stmt::Semi(_binding_0, _binding_1) => {
+            v.visit_expr(_binding_0);
+            tokens_helper(v, &_binding_1.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_trait_bound<'ast, V>(v: &mut V, node: &'ast TraitBound)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    if let Some(it) = &node.paren_token {
+        tokens_helper(v, &it.span)
+    };
+    v.visit_trait_bound_modifier(&node.modifier);
+    if let Some(it) = &node.lifetimes {
+        v.visit_bound_lifetimes(it)
+    };
+    v.visit_path(&node.path);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_trait_bound_modifier<'ast, V>(v: &mut V, node: &'ast TraitBoundModifier)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        TraitBoundModifier::None => {}
+        TraitBoundModifier::Maybe(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_trait_item<'ast, V>(v: &mut V, node: &'ast TraitItem)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        TraitItem::Const(_binding_0) => {
+            v.visit_trait_item_const(_binding_0);
+        }
+        TraitItem::Method(_binding_0) => {
+            v.visit_trait_item_method(_binding_0);
+        }
+        TraitItem::Type(_binding_0) => {
+            v.visit_trait_item_type(_binding_0);
+        }
+        TraitItem::Macro(_binding_0) => {
+            v.visit_trait_item_macro(_binding_0);
+        }
+        TraitItem::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+        _ => unreachable!(),
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_trait_item_const<'ast, V>(v: &mut V, node: &'ast TraitItemConst)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.const_token.span);
+    v.visit_ident(&node.ident);
+    tokens_helper(v, &node.colon_token.spans);
+    v.visit_type(&node.ty);
+    if let Some(it) = &node.default {
+        tokens_helper(v, &(it).0.spans);
+        v.visit_expr(&(it).1);
+    };
+    tokens_helper(v, &node.semi_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_trait_item_macro<'ast, V>(v: &mut V, node: &'ast TraitItemMacro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_macro(&node.mac);
+    if let Some(it) = &node.semi_token {
+        tokens_helper(v, &it.spans)
+    };
+}
+#[cfg(feature = "full")]
+pub fn visit_trait_item_method<'ast, V>(v: &mut V, node: &'ast TraitItemMethod)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_signature(&node.sig);
+    if let Some(it) = &node.default {
+        v.visit_block(it)
+    };
+    if let Some(it) = &node.semi_token {
+        tokens_helper(v, &it.spans)
+    };
+}
+#[cfg(feature = "full")]
+pub fn visit_trait_item_type<'ast, V>(v: &mut V, node: &'ast TraitItemType)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.type_token.span);
+    v.visit_ident(&node.ident);
+    v.visit_generics(&node.generics);
+    if let Some(it) = &node.colon_token {
+        tokens_helper(v, &it.spans)
+    };
+    for el in Punctuated::pairs(&node.bounds) {
+        let (it, p) = el.into_tuple();
+        v.visit_type_param_bound(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+    if let Some(it) = &node.default {
+        tokens_helper(v, &(it).0.spans);
+        v.visit_type(&(it).1);
+    };
+    tokens_helper(v, &node.semi_token.spans);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type<'ast, V>(v: &mut V, node: &'ast Type)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        Type::Array(_binding_0) => {
+            v.visit_type_array(_binding_0);
+        }
+        Type::BareFn(_binding_0) => {
+            v.visit_type_bare_fn(_binding_0);
+        }
+        Type::Group(_binding_0) => {
+            v.visit_type_group(_binding_0);
+        }
+        Type::ImplTrait(_binding_0) => {
+            v.visit_type_impl_trait(_binding_0);
+        }
+        Type::Infer(_binding_0) => {
+            v.visit_type_infer(_binding_0);
+        }
+        Type::Macro(_binding_0) => {
+            v.visit_type_macro(_binding_0);
+        }
+        Type::Never(_binding_0) => {
+            v.visit_type_never(_binding_0);
+        }
+        Type::Paren(_binding_0) => {
+            v.visit_type_paren(_binding_0);
+        }
+        Type::Path(_binding_0) => {
+            v.visit_type_path(_binding_0);
+        }
+        Type::Ptr(_binding_0) => {
+            v.visit_type_ptr(_binding_0);
+        }
+        Type::Reference(_binding_0) => {
+            v.visit_type_reference(_binding_0);
+        }
+        Type::Slice(_binding_0) => {
+            v.visit_type_slice(_binding_0);
+        }
+        Type::TraitObject(_binding_0) => {
+            v.visit_type_trait_object(_binding_0);
+        }
+        Type::Tuple(_binding_0) => {
+            v.visit_type_tuple(_binding_0);
+        }
+        Type::Verbatim(_binding_0) => {
+            skip!(_binding_0);
+        }
+        _ => unreachable!(),
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_array<'ast, V>(v: &mut V, node: &'ast TypeArray)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.bracket_token.span);
+    v.visit_type(&*node.elem);
+    tokens_helper(v, &node.semi_token.spans);
+    v.visit_expr(&node.len);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_bare_fn<'ast, V>(v: &mut V, node: &'ast TypeBareFn)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    if let Some(it) = &node.lifetimes {
+        v.visit_bound_lifetimes(it)
+    };
+    if let Some(it) = &node.unsafety {
+        tokens_helper(v, &it.span)
+    };
+    if let Some(it) = &node.abi {
+        v.visit_abi(it)
+    };
+    tokens_helper(v, &node.fn_token.span);
+    tokens_helper(v, &node.paren_token.span);
+    for el in Punctuated::pairs(&node.inputs) {
+        let (it, p) = el.into_tuple();
+        v.visit_bare_fn_arg(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+    if let Some(it) = &node.variadic {
+        v.visit_variadic(it)
+    };
+    v.visit_return_type(&node.output);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_group<'ast, V>(v: &mut V, node: &'ast TypeGroup)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.group_token.span);
+    v.visit_type(&*node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_impl_trait<'ast, V>(v: &mut V, node: &'ast TypeImplTrait)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.impl_token.span);
+    for el in Punctuated::pairs(&node.bounds) {
+        let (it, p) = el.into_tuple();
+        v.visit_type_param_bound(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_infer<'ast, V>(v: &mut V, node: &'ast TypeInfer)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.underscore_token.spans);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_macro<'ast, V>(v: &mut V, node: &'ast TypeMacro)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_macro(&node.mac);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_never<'ast, V>(v: &mut V, node: &'ast TypeNever)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.bang_token.spans);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_param<'ast, V>(v: &mut V, node: &'ast TypeParam)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_ident(&node.ident);
+    if let Some(it) = &node.colon_token {
+        tokens_helper(v, &it.spans)
+    };
+    for el in Punctuated::pairs(&node.bounds) {
+        let (it, p) = el.into_tuple();
+        v.visit_type_param_bound(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+    if let Some(it) = &node.eq_token {
+        tokens_helper(v, &it.spans)
+    };
+    if let Some(it) = &node.default {
+        v.visit_type(it)
+    };
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_param_bound<'ast, V>(v: &mut V, node: &'ast TypeParamBound)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        TypeParamBound::Trait(_binding_0) => {
+            v.visit_trait_bound(_binding_0);
+        }
+        TypeParamBound::Lifetime(_binding_0) => {
+            v.visit_lifetime(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_paren<'ast, V>(v: &mut V, node: &'ast TypeParen)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.paren_token.span);
+    v.visit_type(&*node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_path<'ast, V>(v: &mut V, node: &'ast TypePath)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    if let Some(it) = &node.qself {
+        v.visit_qself(it)
+    };
+    v.visit_path(&node.path);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_ptr<'ast, V>(v: &mut V, node: &'ast TypePtr)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.star_token.spans);
+    if let Some(it) = &node.const_token {
+        tokens_helper(v, &it.span)
+    };
+    if let Some(it) = &node.mutability {
+        tokens_helper(v, &it.span)
+    };
+    v.visit_type(&*node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_reference<'ast, V>(v: &mut V, node: &'ast TypeReference)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.and_token.spans);
+    if let Some(it) = &node.lifetime {
+        v.visit_lifetime(it)
+    };
+    if let Some(it) = &node.mutability {
+        tokens_helper(v, &it.span)
+    };
+    v.visit_type(&*node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_slice<'ast, V>(v: &mut V, node: &'ast TypeSlice)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.bracket_token.span);
+    v.visit_type(&*node.elem);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_trait_object<'ast, V>(v: &mut V, node: &'ast TypeTraitObject)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    if let Some(it) = &node.dyn_token {
+        tokens_helper(v, &it.span)
+    };
+    for el in Punctuated::pairs(&node.bounds) {
+        let (it, p) = el.into_tuple();
+        v.visit_type_param_bound(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_type_tuple<'ast, V>(v: &mut V, node: &'ast TypeTuple)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.paren_token.span);
+    for el in Punctuated::pairs(&node.elems) {
+        let (it, p) = el.into_tuple();
+        v.visit_type(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_un_op<'ast, V>(v: &mut V, node: &'ast UnOp)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        UnOp::Deref(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        UnOp::Not(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+        UnOp::Neg(_binding_0) => {
+            tokens_helper(v, &_binding_0.spans);
+        }
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_use_glob<'ast, V>(v: &mut V, node: &'ast UseGlob)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.star_token.spans);
+}
+#[cfg(feature = "full")]
+pub fn visit_use_group<'ast, V>(v: &mut V, node: &'ast UseGroup)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.brace_token.span);
+    for el in Punctuated::pairs(&node.items) {
+        let (it, p) = el.into_tuple();
+        v.visit_use_tree(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(feature = "full")]
+pub fn visit_use_name<'ast, V>(v: &mut V, node: &'ast UseName)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_ident(&node.ident);
+}
+#[cfg(feature = "full")]
+pub fn visit_use_path<'ast, V>(v: &mut V, node: &'ast UsePath)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_ident(&node.ident);
+    tokens_helper(v, &node.colon2_token.spans);
+    v.visit_use_tree(&*node.tree);
+}
+#[cfg(feature = "full")]
+pub fn visit_use_rename<'ast, V>(v: &mut V, node: &'ast UseRename)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    v.visit_ident(&node.ident);
+    tokens_helper(v, &node.as_token.span);
+    v.visit_ident(&node.rename);
+}
+#[cfg(feature = "full")]
+pub fn visit_use_tree<'ast, V>(v: &mut V, node: &'ast UseTree)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        UseTree::Path(_binding_0) => {
+            v.visit_use_path(_binding_0);
+        }
+        UseTree::Name(_binding_0) => {
+            v.visit_use_name(_binding_0);
+        }
+        UseTree::Rename(_binding_0) => {
+            v.visit_use_rename(_binding_0);
+        }
+        UseTree::Glob(_binding_0) => {
+            v.visit_use_glob(_binding_0);
+        }
+        UseTree::Group(_binding_0) => {
+            v.visit_use_group(_binding_0);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_variadic<'ast, V>(v: &mut V, node: &'ast Variadic)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    tokens_helper(v, &node.dots.spans);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_variant<'ast, V>(v: &mut V, node: &'ast Variant)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for it in &node.attrs {
+        v.visit_attribute(it)
+    }
+    v.visit_ident(&node.ident);
+    v.visit_fields(&node.fields);
+    if let Some(it) = &node.discriminant {
+        tokens_helper(v, &(it).0.spans);
+        v.visit_expr(&(it).1);
+    };
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_vis_crate<'ast, V>(v: &mut V, node: &'ast VisCrate)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.crate_token.span);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_vis_public<'ast, V>(v: &mut V, node: &'ast VisPublic)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.pub_token.span);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_vis_restricted<'ast, V>(v: &mut V, node: &'ast VisRestricted)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.pub_token.span);
+    tokens_helper(v, &node.paren_token.span);
+    if let Some(it) = &node.in_token {
+        tokens_helper(v, &it.span)
+    };
+    v.visit_path(&*node.path);
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_visibility<'ast, V>(v: &mut V, node: &'ast Visibility)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        Visibility::Public(_binding_0) => {
+            v.visit_vis_public(_binding_0);
+        }
+        Visibility::Crate(_binding_0) => {
+            v.visit_vis_crate(_binding_0);
+        }
+        Visibility::Restricted(_binding_0) => {
+            v.visit_vis_restricted(_binding_0);
+        }
+        Visibility::Inherited => {}
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_where_clause<'ast, V>(v: &mut V, node: &'ast WhereClause)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    tokens_helper(v, &node.where_token.span);
+    for el in Punctuated::pairs(&node.predicates) {
+        let (it, p) = el.into_tuple();
+        v.visit_where_predicate(it);
+        if let Some(p) = p {
+            tokens_helper(v, &p.spans);
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+pub fn visit_where_predicate<'ast, V>(v: &mut V, node: &'ast WherePredicate)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    match node {
+        WherePredicate::Type(_binding_0) => {
+            v.visit_predicate_type(_binding_0);
+        }
+        WherePredicate::Lifetime(_binding_0) => {
+            v.visit_predicate_lifetime(_binding_0);
+        }
+        WherePredicate::Eq(_binding_0) => {
+            v.visit_predicate_eq(_binding_0);
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/generics.rs.html b/src/syn/generics.rs.html new file mode 100644 index 0000000..28adb51 --- /dev/null +++ b/src/syn/generics.rs.html @@ -0,0 +1,2307 @@ +generics.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+
+use super::*;
+use crate::punctuated::{Iter, IterMut, Punctuated};
+
+ast_struct! {
+    /// Lifetimes and type parameters attached to a declaration of a function,
+    /// enum, trait, etc.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    #[derive(Default)]
+    pub struct Generics {
+        pub lt_token: Option<Token![<]>,
+        pub params: Punctuated<GenericParam, Token![,]>,
+        pub gt_token: Option<Token![>]>,
+        pub where_clause: Option<WhereClause>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// A generic type parameter, lifetime, or const generic: `T: Into<String>`,
+    /// `'a: 'b`, `const LEN: usize`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums
+    pub enum GenericParam {
+        /// A generic type parameter: `T: Into<String>`.
+        Type(TypeParam),
+
+        /// A lifetime definition: `'a: 'b + 'c + 'd`.
+        Lifetime(LifetimeDef),
+
+        /// A const generic parameter: `const LENGTH: usize`.
+        Const(ConstParam),
+    }
+}
+
+ast_struct! {
+    /// A generic type parameter: `T: Into<String>`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypeParam {
+        pub attrs: Vec<Attribute>,
+        pub ident: Ident,
+        pub colon_token: Option<Token![:]>,
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+        pub eq_token: Option<Token![=]>,
+        pub default: Option<Type>,
+    }
+}
+
+ast_struct! {
+    /// A lifetime definition: `'a: 'b + 'c + 'd`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct LifetimeDef {
+        pub attrs: Vec<Attribute>,
+        pub lifetime: Lifetime,
+        pub colon_token: Option<Token![:]>,
+        pub bounds: Punctuated<Lifetime, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// A const generic parameter: `const LENGTH: usize`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct ConstParam {
+        pub attrs: Vec<Attribute>,
+        pub const_token: Token![const],
+        pub ident: Ident,
+        pub colon_token: Token![:],
+        pub ty: Type,
+        pub eq_token: Option<Token![=]>,
+        pub default: Option<Expr>,
+    }
+}
+
+impl Generics {
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;</code><a
+    ///   href="struct.TypeParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">TypeParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the type parameters in `self.params`.
+    pub fn type_params(&self) -> TypeParams {
+        TypeParams(self.params.iter())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;mut </code><a
+    ///   href="struct.TypeParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">TypeParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the type parameters in `self.params`.
+    pub fn type_params_mut(&mut self) -> TypeParamsMut {
+        TypeParamsMut(self.params.iter_mut())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;</code><a
+    ///   href="struct.LifetimeDef.html"><code
+    ///   style="padding-left:0;padding-right:0;">LifetimeDef</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the lifetime parameters in `self.params`.
+    pub fn lifetimes(&self) -> Lifetimes {
+        Lifetimes(self.params.iter())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;mut </code><a
+    ///   href="struct.LifetimeDef.html"><code
+    ///   style="padding-left:0;padding-right:0;">LifetimeDef</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the lifetime parameters in `self.params`.
+    pub fn lifetimes_mut(&mut self) -> LifetimesMut {
+        LifetimesMut(self.params.iter_mut())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;</code><a
+    ///   href="struct.ConstParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">ConstParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the constant parameters in `self.params`.
+    pub fn const_params(&self) -> ConstParams {
+        ConstParams(self.params.iter())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;mut </code><a
+    ///   href="struct.ConstParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">ConstParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the constant parameters in `self.params`.
+    pub fn const_params_mut(&mut self) -> ConstParamsMut {
+        ConstParamsMut(self.params.iter_mut())
+    }
+
+    /// Initializes an empty `where`-clause if there is not one present already.
+    pub fn make_where_clause(&mut self) -> &mut WhereClause {
+        // This is Option::get_or_insert_with in Rust 1.20.
+        if self.where_clause.is_none() {
+            self.where_clause = Some(WhereClause {
+                where_token: <Token![where]>::default(),
+                predicates: Punctuated::new(),
+            });
+        }
+        match &mut self.where_clause {
+            Some(where_clause) => where_clause,
+            None => unreachable!(),
+        }
+    }
+}
+
+pub struct TypeParams<'a>(Iter<'a, GenericParam>);
+
+impl<'a> Iterator for TypeParams<'a> {
+    type Item = &'a TypeParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Type(type_param) = next {
+            Some(type_param)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct TypeParamsMut<'a>(IterMut<'a, GenericParam>);
+
+impl<'a> Iterator for TypeParamsMut<'a> {
+    type Item = &'a mut TypeParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Type(type_param) = next {
+            Some(type_param)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct Lifetimes<'a>(Iter<'a, GenericParam>);
+
+impl<'a> Iterator for Lifetimes<'a> {
+    type Item = &'a LifetimeDef;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Lifetime(lifetime) = next {
+            Some(lifetime)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct LifetimesMut<'a>(IterMut<'a, GenericParam>);
+
+impl<'a> Iterator for LifetimesMut<'a> {
+    type Item = &'a mut LifetimeDef;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Lifetime(lifetime) = next {
+            Some(lifetime)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct ConstParams<'a>(Iter<'a, GenericParam>);
+
+impl<'a> Iterator for ConstParams<'a> {
+    type Item = &'a ConstParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Const(const_param) = next {
+            Some(const_param)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct ConstParamsMut<'a>(IterMut<'a, GenericParam>);
+
+impl<'a> Iterator for ConstParamsMut<'a> {
+    type Item = &'a mut ConstParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Const(const_param) = next {
+            Some(const_param)
+        } else {
+            self.next()
+        }
+    }
+}
+
+/// Returned by `Generics::split_for_impl`.
+///
+/// *This type is available if Syn is built with the `"derive"` or `"full"`
+/// feature and the `"printing"` feature.*
+#[cfg(feature = "printing")]
+#[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))]
+#[cfg_attr(feature = "clone-impls", derive(Clone))]
+pub struct ImplGenerics<'a>(&'a Generics);
+
+/// Returned by `Generics::split_for_impl`.
+///
+/// *This type is available if Syn is built with the `"derive"` or `"full"`
+/// feature and the `"printing"` feature.*
+#[cfg(feature = "printing")]
+#[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))]
+#[cfg_attr(feature = "clone-impls", derive(Clone))]
+pub struct TypeGenerics<'a>(&'a Generics);
+
+/// Returned by `TypeGenerics::as_turbofish`.
+///
+/// *This type is available if Syn is built with the `"derive"` or `"full"`
+/// feature and the `"printing"` feature.*
+#[cfg(feature = "printing")]
+#[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))]
+#[cfg_attr(feature = "clone-impls", derive(Clone))]
+pub struct Turbofish<'a>(&'a Generics);
+
+#[cfg(feature = "printing")]
+impl Generics {
+    /// Split a type's generics into the pieces required for impl'ing a trait
+    /// for that type.
+    ///
+    /// ```
+    /// # use proc_macro2::{Span, Ident};
+    /// # use quote::quote;
+    /// #
+    /// # let generics: syn::Generics = Default::default();
+    /// # let name = Ident::new("MyType", Span::call_site());
+    /// #
+    /// let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
+    /// quote! {
+    ///     impl #impl_generics MyTrait for #name #ty_generics #where_clause {
+    ///         // ...
+    ///     }
+    /// }
+    /// # ;
+    /// ```
+    ///
+    /// *This method is available if Syn is built with the `"derive"` or
+    /// `"full"` feature and the `"printing"` feature.*
+    pub fn split_for_impl(&self) -> (ImplGenerics, TypeGenerics, Option<&WhereClause>) {
+        (
+            ImplGenerics(self),
+            TypeGenerics(self),
+            self.where_clause.as_ref(),
+        )
+    }
+}
+
+#[cfg(feature = "printing")]
+impl<'a> TypeGenerics<'a> {
+    /// Turn a type's generics like `<X, Y>` into a turbofish like `::<X, Y>`.
+    ///
+    /// *This method is available if Syn is built with the `"derive"` or
+    /// `"full"` feature and the `"printing"` feature.*
+    pub fn as_turbofish(&self) -> Turbofish {
+        Turbofish(self.0)
+    }
+}
+
+ast_struct! {
+    /// A set of bound lifetimes: `for<'a, 'b, 'c>`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    #[derive(Default)]
+    pub struct BoundLifetimes {
+        pub for_token: Token![for],
+        pub lt_token: Token![<],
+        pub lifetimes: Punctuated<LifetimeDef, Token![,]>,
+        pub gt_token: Token![>],
+    }
+}
+
+impl LifetimeDef {
+    pub fn new(lifetime: Lifetime) -> Self {
+        LifetimeDef {
+            attrs: Vec::new(),
+            lifetime,
+            colon_token: None,
+            bounds: Punctuated::new(),
+        }
+    }
+}
+
+impl From<Ident> for TypeParam {
+    fn from(ident: Ident) -> Self {
+        TypeParam {
+            attrs: vec![],
+            ident,
+            colon_token: None,
+            bounds: Punctuated::new(),
+            eq_token: None,
+            default: None,
+        }
+    }
+}
+
+ast_enum_of_structs! {
+    /// A trait or lifetime used as a bound on a type parameter.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub enum TypeParamBound {
+        Trait(TraitBound),
+        Lifetime(Lifetime),
+    }
+}
+
+ast_struct! {
+    /// A trait used as a bound on a type parameter.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct TraitBound {
+        pub paren_token: Option<token::Paren>,
+        pub modifier: TraitBoundModifier,
+        /// The `for<'a>` in `for<'a> Foo<&'a T>`
+        pub lifetimes: Option<BoundLifetimes>,
+        /// The `Foo<&'a T>` in `for<'a> Foo<&'a T>`
+        pub path: Path,
+    }
+}
+
+ast_enum! {
+    /// A modifier on a trait bound, currently only used for the `?` in
+    /// `?Sized`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    #[cfg_attr(feature = "clone-impls", derive(Copy))]
+    pub enum TraitBoundModifier {
+        None,
+        Maybe(Token![?]),
+    }
+}
+
+ast_struct! {
+    /// A `where` clause in a definition: `where T: Deserialize<'de>, D:
+    /// 'static`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct WhereClause {
+        pub where_token: Token![where],
+        pub predicates: Punctuated<WherePredicate, Token![,]>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// A single predicate in a `where` clause: `T: Deserialize<'de>`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums
+    pub enum WherePredicate {
+        /// A type predicate in a `where` clause: `for<'c> Foo<'c>: Trait<'c>`.
+        Type(PredicateType),
+
+        /// A lifetime predicate in a `where` clause: `'a: 'b + 'c`.
+        Lifetime(PredicateLifetime),
+
+        /// An equality predicate in a `where` clause (unsupported).
+        Eq(PredicateEq),
+    }
+}
+
+ast_struct! {
+    /// A type predicate in a `where` clause: `for<'c> Foo<'c>: Trait<'c>`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct PredicateType {
+        /// Any lifetimes from a `for` binding
+        pub lifetimes: Option<BoundLifetimes>,
+        /// The type being bounded
+        pub bounded_ty: Type,
+        pub colon_token: Token![:],
+        /// Trait and lifetime bounds (`Clone+Send+'static`)
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// A lifetime predicate in a `where` clause: `'a: 'b + 'c`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct PredicateLifetime {
+        pub lifetime: Lifetime,
+        pub colon_token: Token![:],
+        pub bounds: Punctuated<Lifetime, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// An equality predicate in a `where` clause (unsupported).
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct PredicateEq {
+        pub lhs_ty: Type,
+        pub eq_token: Token![=],
+        pub rhs_ty: Type,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub mod parsing {
+    use super::*;
+
+    use crate::parse::{Parse, ParseStream, Result};
+
+    impl Parse for Generics {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if !input.peek(Token![<]) {
+                return Ok(Generics::default());
+            }
+
+            let lt_token: Token![<] = input.parse()?;
+
+            let mut params = Punctuated::new();
+            let mut allow_lifetime_param = true;
+            let mut allow_type_param = true;
+            loop {
+                if input.peek(Token![>]) {
+                    break;
+                }
+
+                let attrs = input.call(Attribute::parse_outer)?;
+                let lookahead = input.lookahead1();
+                if allow_lifetime_param && lookahead.peek(Lifetime) {
+                    params.push_value(GenericParam::Lifetime(LifetimeDef {
+                        attrs,
+                        ..input.parse()?
+                    }));
+                } else if allow_type_param && lookahead.peek(Ident) {
+                    allow_lifetime_param = false;
+                    params.push_value(GenericParam::Type(TypeParam {
+                        attrs,
+                        ..input.parse()?
+                    }));
+                } else if lookahead.peek(Token![const]) {
+                    allow_lifetime_param = false;
+                    allow_type_param = false;
+                    params.push_value(GenericParam::Const(ConstParam {
+                        attrs,
+                        ..input.parse()?
+                    }));
+                } else {
+                    return Err(lookahead.error());
+                }
+
+                if input.peek(Token![>]) {
+                    break;
+                }
+                let punct = input.parse()?;
+                params.push_punct(punct);
+            }
+
+            let gt_token: Token![>] = input.parse()?;
+
+            Ok(Generics {
+                lt_token: Some(lt_token),
+                params,
+                gt_token: Some(gt_token),
+                where_clause: None,
+            })
+        }
+    }
+
+    impl Parse for GenericParam {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+
+            let lookahead = input.lookahead1();
+            if lookahead.peek(Ident) {
+                Ok(GenericParam::Type(TypeParam {
+                    attrs,
+                    ..input.parse()?
+                }))
+            } else if lookahead.peek(Lifetime) {
+                Ok(GenericParam::Lifetime(LifetimeDef {
+                    attrs,
+                    ..input.parse()?
+                }))
+            } else if lookahead.peek(Token![const]) {
+                Ok(GenericParam::Const(ConstParam {
+                    attrs,
+                    ..input.parse()?
+                }))
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+
+    impl Parse for LifetimeDef {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let has_colon;
+            Ok(LifetimeDef {
+                attrs: input.call(Attribute::parse_outer)?,
+                lifetime: input.parse()?,
+                colon_token: {
+                    if input.peek(Token![:]) {
+                        has_colon = true;
+                        Some(input.parse()?)
+                    } else {
+                        has_colon = false;
+                        None
+                    }
+                },
+                bounds: {
+                    let mut bounds = Punctuated::new();
+                    if has_colon {
+                        loop {
+                            if input.peek(Token![,]) || input.peek(Token![>]) {
+                                break;
+                            }
+                            let value = input.parse()?;
+                            bounds.push_value(value);
+                            if !input.peek(Token![+]) {
+                                break;
+                            }
+                            let punct = input.parse()?;
+                            bounds.push_punct(punct);
+                        }
+                    }
+                    bounds
+                },
+            })
+        }
+    }
+
+    impl Parse for BoundLifetimes {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(BoundLifetimes {
+                for_token: input.parse()?,
+                lt_token: input.parse()?,
+                lifetimes: {
+                    let mut lifetimes = Punctuated::new();
+                    while !input.peek(Token![>]) {
+                        lifetimes.push_value(input.parse()?);
+                        if input.peek(Token![>]) {
+                            break;
+                        }
+                        lifetimes.push_punct(input.parse()?);
+                    }
+                    lifetimes
+                },
+                gt_token: input.parse()?,
+            })
+        }
+    }
+
+    impl Parse for Option<BoundLifetimes> {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![for]) {
+                input.parse().map(Some)
+            } else {
+                Ok(None)
+            }
+        }
+    }
+
+    impl Parse for TypeParam {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let has_colon;
+            let has_default;
+            Ok(TypeParam {
+                attrs: input.call(Attribute::parse_outer)?,
+                ident: input.parse()?,
+                colon_token: {
+                    if input.peek(Token![:]) {
+                        has_colon = true;
+                        Some(input.parse()?)
+                    } else {
+                        has_colon = false;
+                        None
+                    }
+                },
+                bounds: {
+                    let mut bounds = Punctuated::new();
+                    if has_colon {
+                        loop {
+                            if input.peek(Token![,])
+                                || input.peek(Token![>])
+                                || input.peek(Token![=])
+                            {
+                                break;
+                            }
+                            let value = input.parse()?;
+                            bounds.push_value(value);
+                            if !input.peek(Token![+]) {
+                                break;
+                            }
+                            let punct = input.parse()?;
+                            bounds.push_punct(punct);
+                        }
+                    }
+                    bounds
+                },
+                eq_token: {
+                    if input.peek(Token![=]) {
+                        has_default = true;
+                        Some(input.parse()?)
+                    } else {
+                        has_default = false;
+                        None
+                    }
+                },
+                default: {
+                    if has_default {
+                        Some(input.parse()?)
+                    } else {
+                        None
+                    }
+                },
+            })
+        }
+    }
+
+    impl Parse for TypeParamBound {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Lifetime) {
+                return input.parse().map(TypeParamBound::Lifetime);
+            }
+
+            if input.peek(token::Paren) {
+                let content;
+                let paren_token = parenthesized!(content in input);
+                let mut bound: TraitBound = content.parse()?;
+                bound.paren_token = Some(paren_token);
+                return Ok(TypeParamBound::Trait(bound));
+            }
+
+            input.parse().map(TypeParamBound::Trait)
+        }
+    }
+
+    impl Parse for TraitBound {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let modifier: TraitBoundModifier = input.parse()?;
+            let lifetimes: Option<BoundLifetimes> = input.parse()?;
+
+            let mut path: Path = input.parse()?;
+            if path.segments.last().unwrap().arguments.is_empty() && input.peek(token::Paren) {
+                let parenthesized = PathArguments::Parenthesized(input.parse()?);
+                path.segments.last_mut().unwrap().arguments = parenthesized;
+            }
+
+            Ok(TraitBound {
+                paren_token: None,
+                modifier,
+                lifetimes,
+                path,
+            })
+        }
+    }
+
+    impl Parse for TraitBoundModifier {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![?]) {
+                input.parse().map(TraitBoundModifier::Maybe)
+            } else {
+                Ok(TraitBoundModifier::None)
+            }
+        }
+    }
+
+    impl Parse for ConstParam {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut default = None;
+            Ok(ConstParam {
+                attrs: input.call(Attribute::parse_outer)?,
+                const_token: input.parse()?,
+                ident: input.parse()?,
+                colon_token: input.parse()?,
+                ty: input.parse()?,
+                eq_token: {
+                    if input.peek(Token![=]) {
+                        let eq_token = input.parse()?;
+                        default = Some(input.parse::<Expr>()?);
+                        Some(eq_token)
+                    } else {
+                        None
+                    }
+                },
+                default,
+            })
+        }
+    }
+
+    impl Parse for WhereClause {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(WhereClause {
+                where_token: input.parse()?,
+                predicates: {
+                    let mut predicates = Punctuated::new();
+                    loop {
+                        if input.is_empty()
+                            || input.peek(token::Brace)
+                            || input.peek(Token![,])
+                            || input.peek(Token![;])
+                            || input.peek(Token![:]) && !input.peek(Token![::])
+                            || input.peek(Token![=])
+                        {
+                            break;
+                        }
+                        let value = input.parse()?;
+                        predicates.push_value(value);
+                        if !input.peek(Token![,]) {
+                            break;
+                        }
+                        let punct = input.parse()?;
+                        predicates.push_punct(punct);
+                    }
+                    predicates
+                },
+            })
+        }
+    }
+
+    impl Parse for Option<WhereClause> {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![where]) {
+                input.parse().map(Some)
+            } else {
+                Ok(None)
+            }
+        }
+    }
+
+    impl Parse for WherePredicate {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Lifetime) && input.peek2(Token![:]) {
+                Ok(WherePredicate::Lifetime(PredicateLifetime {
+                    lifetime: input.parse()?,
+                    colon_token: input.parse()?,
+                    bounds: {
+                        let mut bounds = Punctuated::new();
+                        loop {
+                            if input.is_empty()
+                                || input.peek(token::Brace)
+                                || input.peek(Token![,])
+                                || input.peek(Token![;])
+                                || input.peek(Token![:])
+                                || input.peek(Token![=])
+                            {
+                                break;
+                            }
+                            let value = input.parse()?;
+                            bounds.push_value(value);
+                            if !input.peek(Token![+]) {
+                                break;
+                            }
+                            let punct = input.parse()?;
+                            bounds.push_punct(punct);
+                        }
+                        bounds
+                    },
+                }))
+            } else {
+                Ok(WherePredicate::Type(PredicateType {
+                    lifetimes: input.parse()?,
+                    bounded_ty: input.parse()?,
+                    colon_token: input.parse()?,
+                    bounds: {
+                        let mut bounds = Punctuated::new();
+                        loop {
+                            if input.is_empty()
+                                || input.peek(token::Brace)
+                                || input.peek(Token![,])
+                                || input.peek(Token![;])
+                                || input.peek(Token![:]) && !input.peek(Token![::])
+                                || input.peek(Token![=])
+                            {
+                                break;
+                            }
+                            let value = input.parse()?;
+                            bounds.push_value(value);
+                            if !input.peek(Token![+]) {
+                                break;
+                            }
+                            let punct = input.parse()?;
+                            bounds.push_punct(punct);
+                        }
+                        bounds
+                    },
+                }))
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use super::*;
+
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    use crate::attr::FilterAttrs;
+    use crate::print::TokensOrDefault;
+
+    impl ToTokens for Generics {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if self.params.is_empty() {
+                return;
+            }
+
+            TokensOrDefault(&self.lt_token).to_tokens(tokens);
+
+            // Print lifetimes before types and consts, regardless of their
+            // order in self.params.
+            //
+            // TODO: ordering rules for const parameters vs type parameters have
+            // not been settled yet. https://github.com/rust-lang/rust/issues/44580
+            let mut trailing_or_empty = true;
+            for param in self.params.pairs() {
+                if let GenericParam::Lifetime(_) = **param.value() {
+                    param.to_tokens(tokens);
+                    trailing_or_empty = param.punct().is_some();
+                }
+            }
+            for param in self.params.pairs() {
+                match **param.value() {
+                    GenericParam::Type(_) | GenericParam::Const(_) => {
+                        if !trailing_or_empty {
+                            <Token![,]>::default().to_tokens(tokens);
+                            trailing_or_empty = true;
+                        }
+                        param.to_tokens(tokens);
+                    }
+                    GenericParam::Lifetime(_) => {}
+                }
+            }
+
+            TokensOrDefault(&self.gt_token).to_tokens(tokens);
+        }
+    }
+
+    impl<'a> ToTokens for ImplGenerics<'a> {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if self.0.params.is_empty() {
+                return;
+            }
+
+            TokensOrDefault(&self.0.lt_token).to_tokens(tokens);
+
+            // Print lifetimes before types and consts, regardless of their
+            // order in self.params.
+            //
+            // TODO: ordering rules for const parameters vs type parameters have
+            // not been settled yet. https://github.com/rust-lang/rust/issues/44580
+            let mut trailing_or_empty = true;
+            for param in self.0.params.pairs() {
+                if let GenericParam::Lifetime(_) = **param.value() {
+                    param.to_tokens(tokens);
+                    trailing_or_empty = param.punct().is_some();
+                }
+            }
+            for param in self.0.params.pairs() {
+                if let GenericParam::Lifetime(_) = **param.value() {
+                    continue;
+                }
+                if !trailing_or_empty {
+                    <Token![,]>::default().to_tokens(tokens);
+                    trailing_or_empty = true;
+                }
+                match *param.value() {
+                    GenericParam::Lifetime(_) => unreachable!(),
+                    GenericParam::Type(param) => {
+                        // Leave off the type parameter defaults
+                        tokens.append_all(param.attrs.outer());
+                        param.ident.to_tokens(tokens);
+                        if !param.bounds.is_empty() {
+                            TokensOrDefault(&param.colon_token).to_tokens(tokens);
+                            param.bounds.to_tokens(tokens);
+                        }
+                    }
+                    GenericParam::Const(param) => {
+                        // Leave off the const parameter defaults
+                        tokens.append_all(param.attrs.outer());
+                        param.const_token.to_tokens(tokens);
+                        param.ident.to_tokens(tokens);
+                        param.colon_token.to_tokens(tokens);
+                        param.ty.to_tokens(tokens);
+                    }
+                }
+                param.punct().to_tokens(tokens);
+            }
+
+            TokensOrDefault(&self.0.gt_token).to_tokens(tokens);
+        }
+    }
+
+    impl<'a> ToTokens for TypeGenerics<'a> {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if self.0.params.is_empty() {
+                return;
+            }
+
+            TokensOrDefault(&self.0.lt_token).to_tokens(tokens);
+
+            // Print lifetimes before types and consts, regardless of their
+            // order in self.params.
+            //
+            // TODO: ordering rules for const parameters vs type parameters have
+            // not been settled yet. https://github.com/rust-lang/rust/issues/44580
+            let mut trailing_or_empty = true;
+            for param in self.0.params.pairs() {
+                if let GenericParam::Lifetime(def) = *param.value() {
+                    // Leave off the lifetime bounds and attributes
+                    def.lifetime.to_tokens(tokens);
+                    param.punct().to_tokens(tokens);
+                    trailing_or_empty = param.punct().is_some();
+                }
+            }
+            for param in self.0.params.pairs() {
+                if let GenericParam::Lifetime(_) = **param.value() {
+                    continue;
+                }
+                if !trailing_or_empty {
+                    <Token![,]>::default().to_tokens(tokens);
+                    trailing_or_empty = true;
+                }
+                match *param.value() {
+                    GenericParam::Lifetime(_) => unreachable!(),
+                    GenericParam::Type(param) => {
+                        // Leave off the type parameter defaults
+                        param.ident.to_tokens(tokens);
+                    }
+                    GenericParam::Const(param) => {
+                        // Leave off the const parameter defaults
+                        param.ident.to_tokens(tokens);
+                    }
+                }
+                param.punct().to_tokens(tokens);
+            }
+
+            TokensOrDefault(&self.0.gt_token).to_tokens(tokens);
+        }
+    }
+
+    impl<'a> ToTokens for Turbofish<'a> {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if !self.0.params.is_empty() {
+                <Token![::]>::default().to_tokens(tokens);
+                TypeGenerics(self.0).to_tokens(tokens);
+            }
+        }
+    }
+
+    impl ToTokens for BoundLifetimes {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.for_token.to_tokens(tokens);
+            self.lt_token.to_tokens(tokens);
+            self.lifetimes.to_tokens(tokens);
+            self.gt_token.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for LifetimeDef {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.lifetime.to_tokens(tokens);
+            if !self.bounds.is_empty() {
+                TokensOrDefault(&self.colon_token).to_tokens(tokens);
+                self.bounds.to_tokens(tokens);
+            }
+        }
+    }
+
+    impl ToTokens for TypeParam {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.ident.to_tokens(tokens);
+            if !self.bounds.is_empty() {
+                TokensOrDefault(&self.colon_token).to_tokens(tokens);
+                self.bounds.to_tokens(tokens);
+            }
+            if self.default.is_some() {
+                TokensOrDefault(&self.eq_token).to_tokens(tokens);
+                self.default.to_tokens(tokens);
+            }
+        }
+    }
+
+    impl ToTokens for TraitBound {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            let to_tokens = |tokens: &mut TokenStream| {
+                self.modifier.to_tokens(tokens);
+                self.lifetimes.to_tokens(tokens);
+                self.path.to_tokens(tokens);
+            };
+            match &self.paren_token {
+                Some(paren) => paren.surround(tokens, to_tokens),
+                None => to_tokens(tokens),
+            }
+        }
+    }
+
+    impl ToTokens for TraitBoundModifier {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                TraitBoundModifier::None => {}
+                TraitBoundModifier::Maybe(t) => t.to_tokens(tokens),
+            }
+        }
+    }
+
+    impl ToTokens for ConstParam {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.const_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            if self.default.is_some() {
+                TokensOrDefault(&self.eq_token).to_tokens(tokens);
+                self.default.to_tokens(tokens);
+            }
+        }
+    }
+
+    impl ToTokens for WhereClause {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if !self.predicates.is_empty() {
+                self.where_token.to_tokens(tokens);
+                self.predicates.to_tokens(tokens);
+            }
+        }
+    }
+
+    impl ToTokens for PredicateType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.lifetimes.to_tokens(tokens);
+            self.bounded_ty.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for PredicateLifetime {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.lifetime.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for PredicateEq {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.lhs_ty.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.rhs_ty.to_tokens(tokens);
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/group.rs.html b/src/syn/group.rs.html new file mode 100644 index 0000000..b3adba8 --- /dev/null +++ b/src/syn/group.rs.html @@ -0,0 +1,563 @@ +group.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+
+use proc_macro2::{Delimiter, Span};
+
+use crate::error::Result;
+use crate::parse::ParseBuffer;
+use crate::token;
+
+// Not public API.
+#[doc(hidden)]
+pub struct Parens<'a> {
+    pub token: token::Paren,
+    pub content: ParseBuffer<'a>,
+}
+
+// Not public API.
+#[doc(hidden)]
+pub struct Braces<'a> {
+    pub token: token::Brace,
+    pub content: ParseBuffer<'a>,
+}
+
+// Not public API.
+#[doc(hidden)]
+pub struct Brackets<'a> {
+    pub token: token::Bracket,
+    pub content: ParseBuffer<'a>,
+}
+
+// Not public API.
+#[cfg(any(feature = "full", feature = "derive"))]
+#[doc(hidden)]
+pub struct Group<'a> {
+    pub token: token::Group,
+    pub content: ParseBuffer<'a>,
+}
+
+// Not public API.
+#[doc(hidden)]
+pub fn parse_parens<'a>(input: &ParseBuffer<'a>) -> Result<Parens<'a>> {
+    parse_delimited(input, Delimiter::Parenthesis).map(|(span, content)| Parens {
+        token: token::Paren(span),
+        content,
+    })
+}
+
+// Not public API.
+#[doc(hidden)]
+pub fn parse_braces<'a>(input: &ParseBuffer<'a>) -> Result<Braces<'a>> {
+    parse_delimited(input, Delimiter::Brace).map(|(span, content)| Braces {
+        token: token::Brace(span),
+        content,
+    })
+}
+
+// Not public API.
+#[doc(hidden)]
+pub fn parse_brackets<'a>(input: &ParseBuffer<'a>) -> Result<Brackets<'a>> {
+    parse_delimited(input, Delimiter::Bracket).map(|(span, content)| Brackets {
+        token: token::Bracket(span),
+        content,
+    })
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+pub(crate) fn parse_group<'a>(input: &ParseBuffer<'a>) -> Result<Group<'a>> {
+    parse_delimited(input, Delimiter::None).map(|(span, content)| Group {
+        token: token::Group(span),
+        content,
+    })
+}
+
+fn parse_delimited<'a>(
+    input: &ParseBuffer<'a>,
+    delimiter: Delimiter,
+) -> Result<(Span, ParseBuffer<'a>)> {
+    input.step(|cursor| {
+        if let Some((content, span, rest)) = cursor.group(delimiter) {
+            let scope = crate::buffer::close_span_of_group(*cursor);
+            let nested = crate::parse::advance_step_cursor(cursor, content);
+            let unexpected = crate::parse::get_unexpected(input);
+            let content = crate::parse::new_parse_buffer(scope, nested, unexpected);
+            Ok(((span, content), rest))
+        } else {
+            let message = match delimiter {
+                Delimiter::Parenthesis => "expected parentheses",
+                Delimiter::Brace => "expected curly braces",
+                Delimiter::Bracket => "expected square brackets",
+                Delimiter::None => "expected invisible group",
+            };
+            Err(cursor.error(message))
+        }
+    })
+}
+
+/// Parse a set of parentheses and expose their content to subsequent parsers.
+///
+/// # Example
+///
+/// ```
+/// # use quote::quote;
+/// #
+/// use syn::{parenthesized, token, Ident, Result, Token, Type};
+/// use syn::parse::{Parse, ParseStream};
+/// use syn::punctuated::Punctuated;
+///
+/// // Parse a simplified tuple struct syntax like:
+/// //
+/// //     struct S(A, B);
+/// struct TupleStruct {
+///     struct_token: Token![struct],
+///     ident: Ident,
+///     paren_token: token::Paren,
+///     fields: Punctuated<Type, Token![,]>,
+///     semi_token: Token![;],
+/// }
+///
+/// impl Parse for TupleStruct {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let content;
+///         Ok(TupleStruct {
+///             struct_token: input.parse()?,
+///             ident: input.parse()?,
+///             paren_token: parenthesized!(content in input),
+///             fields: content.parse_terminated(Type::parse)?,
+///             semi_token: input.parse()?,
+///         })
+///     }
+/// }
+/// #
+/// # fn main() {
+/// #     let input = quote! {
+/// #         struct S(A, B);
+/// #     };
+/// #     syn::parse2::<TupleStruct>(input).unwrap();
+/// # }
+/// ```
+#[macro_export]
+macro_rules! parenthesized {
+    ($content:ident in $cursor:expr) => {
+        match $crate::group::parse_parens(&$cursor) {
+            $crate::export::Ok(parens) => {
+                $content = parens.content;
+                parens.token
+            }
+            $crate::export::Err(error) => {
+                return $crate::export::Err(error);
+            }
+        }
+    };
+}
+
+/// Parse a set of curly braces and expose their content to subsequent parsers.
+///
+/// # Example
+///
+/// ```
+/// # use quote::quote;
+/// #
+/// use syn::{braced, token, Ident, Result, Token, Type};
+/// use syn::parse::{Parse, ParseStream};
+/// use syn::punctuated::Punctuated;
+///
+/// // Parse a simplified struct syntax like:
+/// //
+/// //     struct S {
+/// //         a: A,
+/// //         b: B,
+/// //     }
+/// struct Struct {
+///     struct_token: Token![struct],
+///     ident: Ident,
+///     brace_token: token::Brace,
+///     fields: Punctuated<Field, Token![,]>,
+/// }
+///
+/// struct Field {
+///     name: Ident,
+///     colon_token: Token![:],
+///     ty: Type,
+/// }
+///
+/// impl Parse for Struct {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let content;
+///         Ok(Struct {
+///             struct_token: input.parse()?,
+///             ident: input.parse()?,
+///             brace_token: braced!(content in input),
+///             fields: content.parse_terminated(Field::parse)?,
+///         })
+///     }
+/// }
+///
+/// impl Parse for Field {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         Ok(Field {
+///             name: input.parse()?,
+///             colon_token: input.parse()?,
+///             ty: input.parse()?,
+///         })
+///     }
+/// }
+/// #
+/// # fn main() {
+/// #     let input = quote! {
+/// #         struct S {
+/// #             a: A,
+/// #             b: B,
+/// #         }
+/// #     };
+/// #     syn::parse2::<Struct>(input).unwrap();
+/// # }
+/// ```
+#[macro_export]
+macro_rules! braced {
+    ($content:ident in $cursor:expr) => {
+        match $crate::group::parse_braces(&$cursor) {
+            $crate::export::Ok(braces) => {
+                $content = braces.content;
+                braces.token
+            }
+            $crate::export::Err(error) => {
+                return $crate::export::Err(error);
+            }
+        }
+    };
+}
+
+/// Parse a set of square brackets and expose their content to subsequent
+/// parsers.
+///
+/// # Example
+///
+/// ```
+/// # use quote::quote;
+/// #
+/// use proc_macro2::TokenStream;
+/// use syn::{bracketed, token, Result, Token};
+/// use syn::parse::{Parse, ParseStream};
+///
+/// // Parse an outer attribute like:
+/// //
+/// //     #[repr(C, packed)]
+/// struct OuterAttribute {
+///     pound_token: Token![#],
+///     bracket_token: token::Bracket,
+///     content: TokenStream,
+/// }
+///
+/// impl Parse for OuterAttribute {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let content;
+///         Ok(OuterAttribute {
+///             pound_token: input.parse()?,
+///             bracket_token: bracketed!(content in input),
+///             content: content.parse()?,
+///         })
+///     }
+/// }
+/// #
+/// # fn main() {
+/// #     let input = quote! {
+/// #         #[repr(C, packed)]
+/// #     };
+/// #     syn::parse2::<OuterAttribute>(input).unwrap();
+/// # }
+/// ```
+#[macro_export]
+macro_rules! bracketed {
+    ($content:ident in $cursor:expr) => {
+        match $crate::group::parse_brackets(&$cursor) {
+            $crate::export::Ok(brackets) => {
+                $content = brackets.content;
+                brackets.token
+            }
+            $crate::export::Err(error) => {
+                return $crate::export::Err(error);
+            }
+        }
+    };
+}
+
+
\ No newline at end of file diff --git a/src/syn/ident.rs.html b/src/syn/ident.rs.html new file mode 100644 index 0000000..1138839 --- /dev/null +++ b/src/syn/ident.rs.html @@ -0,0 +1,205 @@ +ident.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+
+#[cfg(feature = "parsing")]
+use crate::buffer::Cursor;
+#[cfg(feature = "parsing")]
+use crate::lookahead;
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, ParseStream, Result};
+#[cfg(feature = "parsing")]
+use crate::token::Token;
+use unicode_xid::UnicodeXID;
+
+pub use proc_macro2::Ident;
+
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+#[allow(non_snake_case)]
+pub fn Ident(marker: lookahead::TokenMarker) -> Ident {
+    match marker {}
+}
+
+#[cfg(feature = "parsing")]
+fn accept_as_ident(ident: &Ident) -> bool {
+    match ident.to_string().as_str() {
+        "_" |
+        // Based on https://doc.rust-lang.org/grammar.html#keywords
+        // and https://github.com/rust-lang/rfcs/blob/master/text/2421-unreservations-2018.md
+        // and https://github.com/rust-lang/rfcs/blob/master/text/2420-unreserve-proc.md
+        "abstract" | "as" | "become" | "box" | "break" | "const" | "continue" |
+        "crate" | "do" | "else" | "enum" | "extern" | "false" | "final" | "fn" |
+        "for" | "if" | "impl" | "in" | "let" | "loop" | "macro" | "match" |
+        "mod" | "move" | "mut" | "override" | "priv" | "pub" | "ref" |
+        "return" | "Self" | "self" | "static" | "struct" | "super" | "trait" |
+        "true" | "type" | "typeof" | "unsafe" | "unsized" | "use" | "virtual" |
+        "where" | "while" | "yield" => false,
+        _ => true,
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Parse for Ident {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| {
+            if let Some((ident, rest)) = cursor.ident() {
+                if accept_as_ident(&ident) {
+                    return Ok((ident, rest));
+                }
+            }
+            Err(cursor.error("expected identifier"))
+        })
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Token for Ident {
+    fn peek(cursor: Cursor) -> bool {
+        if let Some((ident, _rest)) = cursor.ident() {
+            accept_as_ident(&ident)
+        } else {
+            false
+        }
+    }
+
+    fn display() -> &'static str {
+        "identifier"
+    }
+}
+
+macro_rules! ident_from_token {
+    ($token:ident) => {
+        impl From<Token![$token]> for Ident {
+            fn from(token: Token![$token]) -> Ident {
+                Ident::new(stringify!($token), token.span)
+            }
+        }
+    };
+}
+
+ident_from_token!(self);
+ident_from_token!(Self);
+ident_from_token!(super);
+ident_from_token!(crate);
+ident_from_token!(extern);
+
+impl From<Token![_]> for Ident {
+    fn from(token: Token![_]) -> Ident {
+        Ident::new("_", token.span)
+    }
+}
+
+pub fn xid_ok(symbol: &str) -> bool {
+    let mut chars = symbol.chars();
+    let first = chars.next().unwrap();
+    if !(UnicodeXID::is_xid_start(first) || first == '_') {
+        return false;
+    }
+    for ch in chars {
+        if !UnicodeXID::is_xid_continue(ch) {
+            return false;
+        }
+    }
+    true
+}
+
+
\ No newline at end of file diff --git a/src/syn/lib.rs.html b/src/syn/lib.rs.html new file mode 100644 index 0000000..3094f9e --- /dev/null +++ b/src/syn/lib.rs.html @@ -0,0 +1,1897 @@ +lib.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+
+//! Syn is a parsing library for parsing a stream of Rust tokens into a syntax
+//! tree of Rust source code.
+//!
+//! Currently this library is geared toward use in Rust procedural macros, but
+//! contains some APIs that may be useful more generally.
+//!
+//! - **Data structures** — Syn provides a complete syntax tree that can
+//!   represent any valid Rust source code. The syntax tree is rooted at
+//!   [`syn::File`] which represents a full source file, but there are other
+//!   entry points that may be useful to procedural macros including
+//!   [`syn::Item`], [`syn::Expr`] and [`syn::Type`].
+//!
+//! - **Derives** — Of particular interest to derive macros is
+//!   [`syn::DeriveInput`] which is any of the three legal input items to a
+//!   derive macro. An example below shows using this type in a library that can
+//!   derive implementations of a user-defined trait.
+//!
+//! - **Parsing** — Parsing in Syn is built around [parser functions] with the
+//!   signature `fn(ParseStream) -> Result<T>`. Every syntax tree node defined
+//!   by Syn is individually parsable and may be used as a building block for
+//!   custom syntaxes, or you may dream up your own brand new syntax without
+//!   involving any of our syntax tree types.
+//!
+//! - **Location information** — Every token parsed by Syn is associated with a
+//!   `Span` that tracks line and column information back to the source of that
+//!   token. These spans allow a procedural macro to display detailed error
+//!   messages pointing to all the right places in the user's code. There is an
+//!   example of this below.
+//!
+//! - **Feature flags** — Functionality is aggressively feature gated so your
+//!   procedural macros enable only what they need, and do not pay in compile
+//!   time for all the rest.
+//!
+//! [`syn::File`]: struct.File.html
+//! [`syn::Item`]: enum.Item.html
+//! [`syn::Expr`]: enum.Expr.html
+//! [`syn::Type`]: enum.Type.html
+//! [`syn::DeriveInput`]: struct.DeriveInput.html
+//! [parser functions]: parse/index.html
+//!
+//! <br>
+//!
+//! # Example of a derive macro
+//!
+//! The canonical derive macro using Syn looks like this. We write an ordinary
+//! Rust function tagged with a `proc_macro_derive` attribute and the name of
+//! the trait we are deriving. Any time that derive appears in the user's code,
+//! the Rust compiler passes their data structure as tokens into our macro. We
+//! get to execute arbitrary Rust code to figure out what to do with those
+//! tokens, then hand some tokens back to the compiler to compile into the
+//! user's crate.
+//!
+//! [`TokenStream`]: https://doc.rust-lang.org/proc_macro/struct.TokenStream.html
+//!
+//! ```toml
+//! [dependencies]
+//! syn = "1.0"
+//! quote = "1.0"
+//!
+//! [lib]
+//! proc-macro = true
+//! ```
+//!
+//! ```
+//! extern crate proc_macro;
+//!
+//! use proc_macro::TokenStream;
+//! use quote::quote;
+//! use syn::{parse_macro_input, DeriveInput};
+//!
+//! # const IGNORE_TOKENS: &str = stringify! {
+//! #[proc_macro_derive(MyMacro)]
+//! # };
+//! pub fn my_macro(input: TokenStream) -> TokenStream {
+//!     // Parse the input tokens into a syntax tree
+//!     let input = parse_macro_input!(input as DeriveInput);
+//!
+//!     // Build the output, possibly using quasi-quotation
+//!     let expanded = quote! {
+//!         // ...
+//!     };
+//!
+//!     // Hand the output tokens back to the compiler
+//!     TokenStream::from(expanded)
+//! }
+//! ```
+//!
+//! The [`heapsize`] example directory shows a complete working implementation
+//! of a derive macro. It works on any Rust compiler 1.31+. The example derives
+//! a `HeapSize` trait which computes an estimate of the amount of heap memory
+//! owned by a value.
+//!
+//! [`heapsize`]: https://github.com/dtolnay/syn/tree/master/examples/heapsize
+//!
+//! ```
+//! pub trait HeapSize {
+//!     /// Total number of bytes of heap memory owned by `self`.
+//!     fn heap_size_of_children(&self) -> usize;
+//! }
+//! ```
+//!
+//! The derive macro allows users to write `#[derive(HeapSize)]` on data
+//! structures in their program.
+//!
+//! ```
+//! # const IGNORE_TOKENS: &str = stringify! {
+//! #[derive(HeapSize)]
+//! # };
+//! struct Demo<'a, T: ?Sized> {
+//!     a: Box<T>,
+//!     b: u8,
+//!     c: &'a str,
+//!     d: String,
+//! }
+//! ```
+//!
+//! <p><br></p>
+//!
+//! # Spans and error reporting
+//!
+//! The token-based procedural macro API provides great control over where the
+//! compiler's error messages are displayed in user code. Consider the error the
+//! user sees if one of their field types does not implement `HeapSize`.
+//!
+//! ```
+//! # const IGNORE_TOKENS: &str = stringify! {
+//! #[derive(HeapSize)]
+//! # };
+//! struct Broken {
+//!     ok: String,
+//!     bad: std::thread::Thread,
+//! }
+//! ```
+//!
+//! By tracking span information all the way through the expansion of a
+//! procedural macro as shown in the `heapsize` example, token-based macros in
+//! Syn are able to trigger errors that directly pinpoint the source of the
+//! problem.
+//!
+//! ```text
+//! error[E0277]: the trait bound `std::thread::Thread: HeapSize` is not satisfied
+//!  --> src/main.rs:7:5
+//!   |
+//! 7 |     bad: std::thread::Thread,
+//!   |     ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HeapSize` is not implemented for `Thread`
+//! ```
+//!
+//! <br>
+//!
+//! # Parsing a custom syntax
+//!
+//! The [`lazy-static`] example directory shows the implementation of a
+//! `functionlike!(...)` procedural macro in which the input tokens are parsed
+//! using Syn's parsing API.
+//!
+//! [`lazy-static`]: https://github.com/dtolnay/syn/tree/master/examples/lazy-static
+//!
+//! The example reimplements the popular `lazy_static` crate from crates.io as a
+//! procedural macro.
+//!
+//! ```
+//! # macro_rules! lazy_static {
+//! #     ($($tt:tt)*) => {}
+//! # }
+//! #
+//! lazy_static! {
+//!     static ref USERNAME: Regex = Regex::new("^[a-z0-9_-]{3,16}$").unwrap();
+//! }
+//! ```
+//!
+//! The implementation shows how to trigger custom warnings and error messages
+//! on the macro input.
+//!
+//! ```text
+//! warning: come on, pick a more creative name
+//!   --> src/main.rs:10:16
+//!    |
+//! 10 |     static ref FOO: String = "lazy_static".to_owned();
+//!    |                ^^^
+//! ```
+//!
+//! <br>
+//!
+//! # Testing
+//!
+//! When testing macros, we often care not just that the macro can be used
+//! successfully but also that when the macro is provided with invalid input it
+//! produces maximally helpful error messages. Consider using the [`trybuild`]
+//! crate to write tests for errors that are emitted by your macro or errors
+//! detected by the Rust compiler in the expanded code following misuse of the
+//! macro. Such tests help avoid regressions from later refactors that
+//! mistakenly make an error no longer trigger or be less helpful than it used
+//! to be.
+//!
+//! [`trybuild`]: https://github.com/dtolnay/trybuild
+//!
+//! <br>
+//!
+//! # Debugging
+//!
+//! When developing a procedural macro it can be helpful to look at what the
+//! generated code looks like. Use `cargo rustc -- -Zunstable-options
+//! --pretty=expanded` or the [`cargo expand`] subcommand.
+//!
+//! [`cargo expand`]: https://github.com/dtolnay/cargo-expand
+//!
+//! To show the expanded code for some crate that uses your procedural macro,
+//! run `cargo expand` from that crate. To show the expanded code for one of
+//! your own test cases, run `cargo expand --test the_test_case` where the last
+//! argument is the name of the test file without the `.rs` extension.
+//!
+//! This write-up by Brandon W Maister discusses debugging in more detail:
+//! [Debugging Rust's new Custom Derive system][debugging].
+//!
+//! [debugging]: https://quodlibetor.github.io/posts/debugging-rusts-new-custom-derive-system/
+//!
+//! <br>
+//!
+//! # Optional features
+//!
+//! Syn puts a lot of functionality behind optional features in order to
+//! optimize compile time for the most common use cases. The following features
+//! are available.
+//!
+//! - **`derive`** *(enabled by default)* — Data structures for representing the
+//!   possible input to a derive macro, including structs and enums and types.
+//! - **`full`** — Data structures for representing the syntax tree of all valid
+//!   Rust source code, including items and expressions.
+//! - **`parsing`** *(enabled by default)* — Ability to parse input tokens into
+//!   a syntax tree node of a chosen type.
+//! - **`printing`** *(enabled by default)* — Ability to print a syntax tree
+//!   node as tokens of Rust source code.
+//! - **`visit`** — Trait for traversing a syntax tree.
+//! - **`visit-mut`** — Trait for traversing and mutating in place a syntax
+//!   tree.
+//! - **`fold`** — Trait for transforming an owned syntax tree.
+//! - **`clone-impls`** *(enabled by default)* — Clone impls for all syntax tree
+//!   types.
+//! - **`extra-traits`** — Debug, Eq, PartialEq, Hash impls for all syntax tree
+//!   types.
+//! - **`proc-macro`** *(enabled by default)* — Runtime dependency on the
+//!   dynamic library libproc_macro from rustc toolchain.
+
+// Syn types in rustdoc of other crates get linked to here.
+#![doc(html_root_url = "https://docs.rs/syn/1.0.14")]
+#![deny(clippy::all, clippy::pedantic)]
+// Ignored clippy lints.
+#![allow(
+    clippy::block_in_if_condition_stmt,
+    clippy::cognitive_complexity,
+    clippy::doc_markdown,
+    clippy::eval_order_dependence,
+    clippy::inherent_to_string,
+    clippy::large_enum_variant,
+    clippy::needless_doctest_main,
+    clippy::needless_pass_by_value,
+    clippy::never_loop,
+    clippy::suspicious_op_assign_impl,
+    clippy::too_many_arguments,
+    clippy::trivially_copy_pass_by_ref
+)]
+// Ignored clippy_pedantic lints.
+#![allow(
+    clippy::cast_possible_truncation,
+    clippy::empty_enum,
+    clippy::if_not_else,
+    clippy::items_after_statements,
+    clippy::missing_errors_doc,
+    clippy::module_name_repetitions,
+    clippy::must_use_candidate,
+    clippy::shadow_unrelated,
+    clippy::similar_names,
+    clippy::single_match_else,
+    clippy::too_many_lines,
+    clippy::unseparated_literal_suffix,
+    clippy::use_self,
+    clippy::used_underscore_binding
+)]
+
+#[cfg(all(
+    not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
+    feature = "proc-macro"
+))]
+extern crate proc_macro;
+extern crate proc_macro2;
+extern crate unicode_xid;
+
+#[cfg(feature = "printing")]
+extern crate quote;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+#[macro_use]
+mod macros;
+
+// Not public API.
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+#[macro_use]
+pub mod group;
+
+#[macro_use]
+pub mod token;
+
+mod ident;
+pub use crate::ident::Ident;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod attr;
+#[cfg(any(feature = "full", feature = "derive"))]
+pub use crate::attr::{
+    AttrStyle, Attribute, AttributeArgs, Meta, MetaList, MetaNameValue, NestedMeta,
+};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod bigint;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod data;
+#[cfg(any(feature = "full", feature = "derive"))]
+pub use crate::data::{
+    Field, Fields, FieldsNamed, FieldsUnnamed, Variant, VisCrate, VisPublic, VisRestricted,
+    Visibility,
+};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod expr;
+#[cfg(feature = "full")]
+pub use crate::expr::{
+    Arm, FieldValue, GenericMethodArgument, Label, MethodTurbofish, RangeLimits,
+};
+#[cfg(any(feature = "full", feature = "derive"))]
+pub use crate::expr::{
+    Expr, ExprArray, ExprAssign, ExprAssignOp, ExprAsync, ExprAwait, ExprBinary, ExprBlock,
+    ExprBox, ExprBreak, ExprCall, ExprCast, ExprClosure, ExprContinue, ExprField, ExprForLoop,
+    ExprGroup, ExprIf, ExprIndex, ExprLet, ExprLit, ExprLoop, ExprMacro, ExprMatch, ExprMethodCall,
+    ExprParen, ExprPath, ExprRange, ExprReference, ExprRepeat, ExprReturn, ExprStruct, ExprTry,
+    ExprTryBlock, ExprTuple, ExprType, ExprUnary, ExprUnsafe, ExprWhile, ExprYield, Index, Member,
+};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod generics;
+#[cfg(any(feature = "full", feature = "derive"))]
+pub use crate::generics::{
+    BoundLifetimes, ConstParam, GenericParam, Generics, LifetimeDef, PredicateEq,
+    PredicateLifetime, PredicateType, TraitBound, TraitBoundModifier, TypeParam, TypeParamBound,
+    WhereClause, WherePredicate,
+};
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))]
+pub use crate::generics::{ImplGenerics, Turbofish, TypeGenerics};
+
+#[cfg(feature = "full")]
+mod item;
+#[cfg(feature = "full")]
+pub use crate::item::{
+    FnArg, ForeignItem, ForeignItemFn, ForeignItemMacro, ForeignItemStatic, ForeignItemType,
+    ImplItem, ImplItemConst, ImplItemMacro, ImplItemMethod, ImplItemType, Item, ItemConst,
+    ItemEnum, ItemExternCrate, ItemFn, ItemForeignMod, ItemImpl, ItemMacro, ItemMacro2, ItemMod,
+    ItemStatic, ItemStruct, ItemTrait, ItemTraitAlias, ItemType, ItemUnion, ItemUse, Receiver,
+    Signature, TraitItem, TraitItemConst, TraitItemMacro, TraitItemMethod, TraitItemType, UseGlob,
+    UseGroup, UseName, UsePath, UseRename, UseTree,
+};
+
+#[cfg(feature = "full")]
+mod file;
+#[cfg(feature = "full")]
+pub use crate::file::File;
+
+mod lifetime;
+pub use crate::lifetime::Lifetime;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod lit;
+#[cfg(any(feature = "full", feature = "derive"))]
+pub use crate::lit::{
+    Lit, LitBool, LitByte, LitByteStr, LitChar, LitFloat, LitInt, LitStr, StrStyle,
+};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod mac;
+#[cfg(any(feature = "full", feature = "derive"))]
+pub use crate::mac::{Macro, MacroDelimiter};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod derive;
+#[cfg(feature = "derive")]
+pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod op;
+#[cfg(any(feature = "full", feature = "derive"))]
+pub use crate::op::{BinOp, UnOp};
+
+#[cfg(feature = "full")]
+mod stmt;
+#[cfg(feature = "full")]
+pub use crate::stmt::{Block, Local, Stmt};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod ty;
+#[cfg(any(feature = "full", feature = "derive"))]
+pub use crate::ty::{
+    Abi, BareFnArg, ReturnType, Type, TypeArray, TypeBareFn, TypeGroup, TypeImplTrait, TypeInfer,
+    TypeMacro, TypeNever, TypeParen, TypePath, TypePtr, TypeReference, TypeSlice, TypeTraitObject,
+    TypeTuple, Variadic,
+};
+
+#[cfg(feature = "full")]
+mod pat;
+#[cfg(feature = "full")]
+pub use crate::pat::{
+    FieldPat, Pat, PatBox, PatIdent, PatLit, PatMacro, PatOr, PatPath, PatRange, PatReference,
+    PatRest, PatSlice, PatStruct, PatTuple, PatTupleStruct, PatType, PatWild,
+};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod path;
+#[cfg(any(feature = "full", feature = "derive"))]
+pub use crate::path::{
+    AngleBracketedGenericArguments, Binding, Constraint, GenericArgument,
+    ParenthesizedGenericArguments, Path, PathArguments, PathSegment, QSelf,
+};
+
+#[cfg(feature = "parsing")]
+pub mod buffer;
+#[cfg(feature = "parsing")]
+pub mod ext;
+pub mod punctuated;
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "extra-traits"))]
+mod tt;
+
+// Not public API except the `parse_quote!` macro.
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+pub mod parse_quote;
+
+// Not public API except the `parse_macro_input!` macro.
+#[cfg(all(
+    not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
+    feature = "parsing",
+    feature = "proc-macro"
+))]
+#[doc(hidden)]
+pub mod parse_macro_input;
+
+#[cfg(all(feature = "parsing", feature = "printing"))]
+pub mod spanned;
+
+mod gen {
+    /// Syntax tree traversal to walk a shared borrow of a syntax tree.
+    ///
+    /// Each method of the [`Visit`] trait is a hook that can be overridden to
+    /// customize the behavior when visiting the corresponding type of node. By
+    /// default, every method recursively visits the substructure of the input
+    /// by invoking the right visitor method of each of its fields.
+    ///
+    /// [`Visit`]: visit::Visit
+    ///
+    /// ```
+    /// # use syn::{Attribute, BinOp, Expr, ExprBinary};
+    /// #
+    /// pub trait Visit<'ast> {
+    ///     /* ... */
+    ///
+    ///     fn visit_expr_binary(&mut self, node: &'ast ExprBinary) {
+    ///         visit_expr_binary(self, node);
+    ///     }
+    ///
+    ///     /* ... */
+    ///     # fn visit_attribute(&mut self, node: &'ast Attribute);
+    ///     # fn visit_expr(&mut self, node: &'ast Expr);
+    ///     # fn visit_bin_op(&mut self, node: &'ast BinOp);
+    /// }
+    ///
+    /// pub fn visit_expr_binary<'ast, V>(v: &mut V, node: &'ast ExprBinary)
+    /// where
+    ///     V: Visit<'ast> + ?Sized,
+    /// {
+    ///     for attr in &node.attrs {
+    ///         v.visit_attribute(attr);
+    ///     }
+    ///     v.visit_expr(&*node.left);
+    ///     v.visit_bin_op(&node.op);
+    ///     v.visit_expr(&*node.right);
+    /// }
+    ///
+    /// /* ... */
+    /// ```
+    ///
+    /// *This module is available if Syn is built with the `"visit"` feature.*
+    ///
+    /// <br>
+    ///
+    /// # Example
+    ///
+    /// This visitor will print the name of every freestanding function in the
+    /// syntax tree, including nested functions.
+    ///
+    /// ```
+    /// // [dependencies]
+    /// // quote = "1.0"
+    /// // syn = { version = "1.0", features = ["full", "visit"] }
+    ///
+    /// use quote::quote;
+    /// use syn::visit::{self, Visit};
+    /// use syn::{File, ItemFn};
+    ///
+    /// struct FnVisitor;
+    ///
+    /// impl<'ast> Visit<'ast> for FnVisitor {
+    ///     fn visit_item_fn(&mut self, node: &'ast ItemFn) {
+    ///         println!("Function with name={}", node.sig.ident);
+    ///
+    ///         // Delegate to the default impl to visit any nested functions.
+    ///         visit::visit_item_fn(self, node);
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let code = quote! {
+    ///         pub fn f() {
+    ///             fn g() {}
+    ///         }
+    ///     };
+    ///
+    ///     let syntax_tree: File = syn::parse2(code).unwrap();
+    ///     FnVisitor.visit_file(&syntax_tree);
+    /// }
+    /// ```
+    ///
+    /// The `'ast` lifetime on the input references means that the syntax tree
+    /// outlives the complete recursive visit call, so the visitor is allowed to
+    /// hold on to references into the syntax tree.
+    ///
+    /// ```
+    /// use quote::quote;
+    /// use syn::visit::{self, Visit};
+    /// use syn::{File, ItemFn};
+    ///
+    /// struct FnVisitor<'ast> {
+    ///     functions: Vec<&'ast ItemFn>,
+    /// }
+    ///
+    /// impl<'ast> Visit<'ast> for FnVisitor<'ast> {
+    ///     fn visit_item_fn(&mut self, node: &'ast ItemFn) {
+    ///         self.functions.push(node);
+    ///         visit::visit_item_fn(self, node);
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let code = quote! {
+    ///         pub fn f() {
+    ///             fn g() {}
+    ///         }
+    ///     };
+    ///
+    ///     let syntax_tree: File = syn::parse2(code).unwrap();
+    ///     let mut visitor = FnVisitor { functions: Vec::new() };
+    ///     visitor.visit_file(&syntax_tree);
+    ///     for f in visitor.functions {
+    ///         println!("Function with name={}", f.sig.ident);
+    ///     }
+    /// }
+    /// ```
+    #[cfg(feature = "visit")]
+    #[rustfmt::skip]
+    pub mod visit;
+
+    /// Syntax tree traversal to mutate an exclusive borrow of a syntax tree in
+    /// place.
+    ///
+    /// Each method of the [`VisitMut`] trait is a hook that can be overridden
+    /// to customize the behavior when mutating the corresponding type of node.
+    /// By default, every method recursively visits the substructure of the
+    /// input by invoking the right visitor method of each of its fields.
+    ///
+    /// [`VisitMut`]: visit_mut::VisitMut
+    ///
+    /// ```
+    /// # use syn::{Attribute, BinOp, Expr, ExprBinary};
+    /// #
+    /// pub trait VisitMut {
+    ///     /* ... */
+    ///
+    ///     fn visit_expr_binary_mut(&mut self, node: &mut ExprBinary) {
+    ///         visit_expr_binary_mut(self, node);
+    ///     }
+    ///
+    ///     /* ... */
+    ///     # fn visit_attribute_mut(&mut self, node: &mut Attribute);
+    ///     # fn visit_expr_mut(&mut self, node: &mut Expr);
+    ///     # fn visit_bin_op_mut(&mut self, node: &mut BinOp);
+    /// }
+    ///
+    /// pub fn visit_expr_binary_mut<V>(v: &mut V, node: &mut ExprBinary)
+    /// where
+    ///     V: VisitMut + ?Sized,
+    /// {
+    ///     for attr in &mut node.attrs {
+    ///         v.visit_attribute_mut(attr);
+    ///     }
+    ///     v.visit_expr_mut(&mut *node.left);
+    ///     v.visit_bin_op_mut(&mut node.op);
+    ///     v.visit_expr_mut(&mut *node.right);
+    /// }
+    ///
+    /// /* ... */
+    /// ```
+    ///
+    /// *This module is available if Syn is built with the `"visit-mut"`
+    /// feature.*
+    ///
+    /// <br>
+    ///
+    /// # Example
+    ///
+    /// This mut visitor replace occurrences of u256 suffixed integer literals
+    /// like `999u256` with a macro invocation `bigint::u256!(999)`.
+    ///
+    /// ```
+    /// // [dependencies]
+    /// // quote = "1.0"
+    /// // syn = { version = "1.0", features = ["full", "visit-mut"] }
+    ///
+    /// use quote::quote;
+    /// use syn::visit_mut::{self, VisitMut};
+    /// use syn::{parse_quote, Expr, File, Lit, LitInt};
+    ///
+    /// struct BigintReplace;
+    ///
+    /// impl VisitMut for BigintReplace {
+    ///     fn visit_expr_mut(&mut self, node: &mut Expr) {
+    ///         if let Expr::Lit(expr) = &node {
+    ///             if let Lit::Int(int) = &expr.lit {
+    ///                 if int.suffix() == "u256" {
+    ///                     let digits = int.base10_digits();
+    ///                     let unsuffixed: LitInt = syn::parse_str(digits).unwrap();
+    ///                     *node = parse_quote!(bigint::u256!(#unsuffixed));
+    ///                     return;
+    ///                 }
+    ///             }
+    ///         }
+    ///
+    ///         // Delegate to the default impl to visit nested expressions.
+    ///         visit_mut::visit_expr_mut(self, node);
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let code = quote! {
+    ///         fn main() {
+    ///             let _ = 999u256;
+    ///         }
+    ///     };
+    ///
+    ///     let mut syntax_tree: File = syn::parse2(code).unwrap();
+    ///     BigintReplace.visit_file_mut(&mut syntax_tree);
+    ///     println!("{}", quote!(#syntax_tree));
+    /// }
+    /// ```
+    #[cfg(feature = "visit-mut")]
+    #[rustfmt::skip]
+    pub mod visit_mut;
+
+    /// Syntax tree traversal to transform the nodes of an owned syntax tree.
+    ///
+    /// Each method of the [`Fold`] trait is a hook that can be overridden to
+    /// customize the behavior when transforming the corresponding type of node.
+    /// By default, every method recursively visits the substructure of the
+    /// input by invoking the right visitor method of each of its fields.
+    ///
+    /// [`Fold`]: fold::Fold
+    ///
+    /// ```
+    /// # use syn::{Attribute, BinOp, Expr, ExprBinary};
+    /// #
+    /// pub trait Fold {
+    ///     /* ... */
+    ///
+    ///     fn fold_expr_binary(&mut self, node: ExprBinary) -> ExprBinary {
+    ///         fold_expr_binary(self, node)
+    ///     }
+    ///
+    ///     /* ... */
+    ///     # fn fold_attribute(&mut self, node: Attribute) -> Attribute;
+    ///     # fn fold_expr(&mut self, node: Expr) -> Expr;
+    ///     # fn fold_bin_op(&mut self, node: BinOp) -> BinOp;
+    /// }
+    ///
+    /// pub fn fold_expr_binary<V>(v: &mut V, node: ExprBinary) -> ExprBinary
+    /// where
+    ///     V: Fold + ?Sized,
+    /// {
+    ///     ExprBinary {
+    ///         attrs: node
+    ///             .attrs
+    ///             .into_iter()
+    ///             .map(|attr| v.fold_attribute(attr))
+    ///             .collect(),
+    ///         left: Box::new(v.fold_expr(*node.left)),
+    ///         op: v.fold_bin_op(node.op),
+    ///         right: Box::new(v.fold_expr(*node.right)),
+    ///     }
+    /// }
+    ///
+    /// /* ... */
+    /// ```
+    ///
+    /// *This module is available if Syn is built with the `"fold"` feature.*
+    ///
+    /// <br>
+    ///
+    /// # Example
+    ///
+    /// This fold inserts parentheses to fully parenthesizes any expression.
+    ///
+    /// ```
+    /// // [dependencies]
+    /// // quote = "1.0"
+    /// // syn = { version = "1.0", features = ["fold", "full"] }
+    ///
+    /// use quote::quote;
+    /// use syn::fold::{fold_expr, Fold};
+    /// use syn::{token, Expr, ExprParen};
+    ///
+    /// struct ParenthesizeEveryExpr;
+    ///
+    /// impl Fold for ParenthesizeEveryExpr {
+    ///     fn fold_expr(&mut self, expr: Expr) -> Expr {
+    ///         Expr::Paren(ExprParen {
+    ///             attrs: Vec::new(),
+    ///             expr: Box::new(fold_expr(self, expr)),
+    ///             paren_token: token::Paren::default(),
+    ///         })
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let code = quote! { a() + b(1) * c.d };
+    ///     let expr: Expr = syn::parse2(code).unwrap();
+    ///     let parenthesized = ParenthesizeEveryExpr.fold_expr(expr);
+    ///     println!("{}", quote!(#parenthesized));
+    ///
+    ///     // Output: (((a)()) + (((b)((1))) * ((c).d)))
+    /// }
+    /// ```
+    #[cfg(feature = "fold")]
+    #[rustfmt::skip]
+    pub mod fold;
+
+    #[cfg(any(feature = "full", feature = "derive"))]
+    #[path = "../gen_helper.rs"]
+    mod helper;
+}
+pub use crate::gen::*;
+
+// Not public API.
+#[doc(hidden)]
+pub mod export;
+
+mod custom_keyword;
+mod custom_punctuation;
+mod sealed;
+
+#[cfg(feature = "parsing")]
+mod lookahead;
+
+#[cfg(feature = "parsing")]
+pub mod parse;
+
+mod span;
+
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))]
+mod print;
+
+mod thread;
+
+////////////////////////////////////////////////////////////////////////////////
+
+#[allow(dead_code, non_camel_case_types)]
+struct private;
+
+// https://github.com/rust-lang/rust/issues/62830
+#[cfg(feature = "parsing")]
+mod rustdoc_workaround {
+    pub use crate::parse::{self as parse_module};
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+mod error;
+pub use crate::error::{Error, Result};
+
+/// Parse tokens of source code into the chosen syntax tree node.
+///
+/// This is preferred over parsing a string because tokens are able to preserve
+/// information about where in the user's code they were originally written (the
+/// "span" of the token), possibly allowing the compiler to produce better error
+/// messages.
+///
+/// This function parses a `proc_macro::TokenStream` which is the type used for
+/// interop with the compiler in a procedural macro. To parse a
+/// `proc_macro2::TokenStream`, use [`syn::parse2`] instead.
+///
+/// [`syn::parse2`]: parse2
+///
+/// *This function is available if Syn is built with both the `"parsing"` and
+/// `"proc-macro"` features.*
+///
+/// # Examples
+///
+/// ```
+/// extern crate proc_macro;
+///
+/// use proc_macro::TokenStream;
+/// use quote::quote;
+/// use syn::DeriveInput;
+///
+/// # const IGNORE_TOKENS: &str = stringify! {
+/// #[proc_macro_derive(MyMacro)]
+/// # };
+/// pub fn my_macro(input: TokenStream) -> TokenStream {
+///     // Parse the tokens into a syntax tree
+///     let ast: DeriveInput = syn::parse(input).unwrap();
+///
+///     // Build the output, possibly using quasi-quotation
+///     let expanded = quote! {
+///         /* ... */
+///     };
+///
+///     // Convert into a token stream and return it
+///     expanded.into()
+/// }
+/// ```
+#[cfg(all(
+    not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
+    feature = "parsing",
+    feature = "proc-macro"
+))]
+pub fn parse<T: parse::Parse>(tokens: proc_macro::TokenStream) -> Result<T> {
+    parse::Parser::parse(T::parse, tokens)
+}
+
+/// Parse a proc-macro2 token stream into the chosen syntax tree node.
+///
+/// This function parses a `proc_macro2::TokenStream` which is commonly useful
+/// when the input comes from a node of the Syn syntax tree, for example the
+/// body tokens of a [`Macro`] node. When in a procedural macro parsing the
+/// `proc_macro::TokenStream` provided by the compiler, use [`syn::parse`]
+/// instead.
+///
+/// [`syn::parse`]: parse()
+///
+/// *This function is available if Syn is built with the `"parsing"` feature.*
+#[cfg(feature = "parsing")]
+pub fn parse2<T: parse::Parse>(tokens: proc_macro2::TokenStream) -> Result<T> {
+    parse::Parser::parse2(T::parse, tokens)
+}
+
+/// Parse a string of Rust code into the chosen syntax tree node.
+///
+/// *This function is available if Syn is built with the `"parsing"` feature.*
+///
+/// # Hygiene
+///
+/// Every span in the resulting syntax tree will be set to resolve at the macro
+/// call site.
+///
+/// # Examples
+///
+/// ```
+/// use syn::{Expr, Result};
+///
+/// fn run() -> Result<()> {
+///     let code = "assert_eq!(u8::max_value(), 255)";
+///     let expr = syn::parse_str::<Expr>(code)?;
+///     println!("{:#?}", expr);
+///     Ok(())
+/// }
+/// #
+/// # run().unwrap();
+/// ```
+#[cfg(feature = "parsing")]
+pub fn parse_str<T: parse::Parse>(s: &str) -> Result<T> {
+    parse::Parser::parse_str(T::parse, s)
+}
+
+// FIXME the name parse_file makes it sound like you might pass in a path to a
+// file, rather than the content.
+/// Parse the content of a file of Rust code.
+///
+/// This is different from `syn::parse_str::<File>(content)` in two ways:
+///
+/// - It discards a leading byte order mark `\u{FEFF}` if the file has one.
+/// - It preserves the shebang line of the file, such as `#!/usr/bin/env rustx`.
+///
+/// If present, either of these would be an error using `from_str`.
+///
+/// *This function is available if Syn is built with the `"parsing"` and
+/// `"full"` features.*
+///
+/// # Examples
+///
+/// ```no_run
+/// use std::error::Error;
+/// use std::fs::File;
+/// use std::io::Read;
+///
+/// fn run() -> Result<(), Box<Error>> {
+///     let mut file = File::open("path/to/code.rs")?;
+///     let mut content = String::new();
+///     file.read_to_string(&mut content)?;
+///
+///     let ast = syn::parse_file(&content)?;
+///     if let Some(shebang) = ast.shebang {
+///         println!("{}", shebang);
+///     }
+///     println!("{} items", ast.items.len());
+///
+///     Ok(())
+/// }
+/// #
+/// # run().unwrap();
+/// ```
+#[cfg(all(feature = "parsing", feature = "full"))]
+pub fn parse_file(mut content: &str) -> Result<File> {
+    // Strip the BOM if it is present
+    const BOM: &str = "\u{feff}";
+    if content.starts_with(BOM) {
+        content = &content[BOM.len()..];
+    }
+
+    let mut shebang = None;
+    if content.starts_with("#!") && !content.starts_with("#![") {
+        if let Some(idx) = content.find('\n') {
+            shebang = Some(content[..idx].to_string());
+            content = &content[idx..];
+        } else {
+            shebang = Some(content.to_string());
+            content = "";
+        }
+    }
+
+    let mut file: File = parse_str(content)?;
+    file.shebang = shebang;
+    Ok(file)
+}
+
+
\ No newline at end of file diff --git a/src/syn/lifetime.rs.html b/src/syn/lifetime.rs.html new file mode 100644 index 0000000..6b315d5 --- /dev/null +++ b/src/syn/lifetime.rs.html @@ -0,0 +1,283 @@ +lifetime.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+
+use std::cmp::Ordering;
+use std::fmt::{self, Display};
+use std::hash::{Hash, Hasher};
+
+use proc_macro2::{Ident, Span};
+
+#[cfg(feature = "parsing")]
+use crate::lookahead;
+
+/// A Rust lifetime: `'a`.
+///
+/// Lifetime names must conform to the following rules:
+///
+/// - Must start with an apostrophe.
+/// - Must not consist of just an apostrophe: `'`.
+/// - Character after the apostrophe must be `_` or a Unicode code point with
+///   the XID_Start property.
+/// - All following characters must be Unicode code points with the XID_Continue
+///   property.
+///
+/// *This type is available if Syn is built with the `"derive"` or `"full"`
+/// feature.*
+#[cfg_attr(feature = "extra-traits", derive(Debug))]
+#[derive(Clone)]
+pub struct Lifetime {
+    pub apostrophe: Span,
+    pub ident: Ident,
+}
+
+impl Lifetime {
+    /// # Panics
+    ///
+    /// Panics if the lifetime does not conform to the bulleted rules above.
+    ///
+    /// # Invocation
+    ///
+    /// ```
+    /// # use proc_macro2::Span;
+    /// # use syn::Lifetime;
+    /// #
+    /// # fn f() -> Lifetime {
+    /// Lifetime::new("'a", Span::call_site())
+    /// # }
+    /// ```
+    pub fn new(symbol: &str, span: Span) -> Self {
+        if !symbol.starts_with('\'') {
+            panic!(
+                "lifetime name must start with apostrophe as in \"'a\", got {:?}",
+                symbol
+            );
+        }
+
+        if symbol == "'" {
+            panic!("lifetime name must not be empty");
+        }
+
+        if !crate::ident::xid_ok(&symbol[1..]) {
+            panic!("{:?} is not a valid lifetime name", symbol);
+        }
+
+        Lifetime {
+            apostrophe: span,
+            ident: Ident::new(&symbol[1..], span),
+        }
+    }
+}
+
+impl Display for Lifetime {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        "'".fmt(formatter)?;
+        self.ident.fmt(formatter)
+    }
+}
+
+impl PartialEq for Lifetime {
+    fn eq(&self, other: &Lifetime) -> bool {
+        self.ident.eq(&other.ident)
+    }
+}
+
+impl Eq for Lifetime {}
+
+impl PartialOrd for Lifetime {
+    fn partial_cmp(&self, other: &Lifetime) -> Option<Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+impl Ord for Lifetime {
+    fn cmp(&self, other: &Lifetime) -> Ordering {
+        self.ident.cmp(&other.ident)
+    }
+}
+
+impl Hash for Lifetime {
+    fn hash<H: Hasher>(&self, h: &mut H) {
+        self.ident.hash(h)
+    }
+}
+
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+#[allow(non_snake_case)]
+pub fn Lifetime(marker: lookahead::TokenMarker) -> Lifetime {
+    match marker {}
+}
+
+#[cfg(feature = "parsing")]
+pub mod parsing {
+    use super::*;
+
+    use crate::parse::{Parse, ParseStream, Result};
+
+    impl Parse for Lifetime {
+        fn parse(input: ParseStream) -> Result<Self> {
+            input.step(|cursor| {
+                cursor
+                    .lifetime()
+                    .ok_or_else(|| cursor.error("expected lifetime"))
+            })
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use super::*;
+
+    use proc_macro2::{Punct, Spacing, TokenStream};
+    use quote::{ToTokens, TokenStreamExt};
+
+    impl ToTokens for Lifetime {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            let mut apostrophe = Punct::new('\'', Spacing::Joint);
+            apostrophe.set_span(self.apostrophe);
+            tokens.append(apostrophe);
+            self.ident.to_tokens(tokens);
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/lit.rs.html b/src/syn/lit.rs.html new file mode 100644 index 0000000..1d7200b --- /dev/null +++ b/src/syn/lit.rs.html @@ -0,0 +1,2767 @@ +lit.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+
+use proc_macro2::{Literal, Span};
+use std::fmt::{self, Display};
+use std::str::{self, FromStr};
+
+#[cfg(feature = "printing")]
+use proc_macro2::Ident;
+
+#[cfg(feature = "parsing")]
+use proc_macro2::TokenStream;
+
+use proc_macro2::TokenTree;
+
+#[cfg(feature = "extra-traits")]
+use std::hash::{Hash, Hasher};
+
+#[cfg(feature = "parsing")]
+use crate::lookahead;
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, Parser};
+use crate::{Error, Result};
+
+ast_enum_of_structs! {
+    /// A Rust literal such as a string or integer or boolean.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums
+    //
+    // TODO: change syntax-tree-enum link to an intra rustdoc link, currently
+    // blocked on https://github.com/rust-lang/rust/issues/62833
+    pub enum Lit #manual_extra_traits {
+        /// A UTF-8 string literal: `"foo"`.
+        Str(LitStr),
+
+        /// A byte string literal: `b"foo"`.
+        ByteStr(LitByteStr),
+
+        /// A byte literal: `b'f'`.
+        Byte(LitByte),
+
+        /// A character literal: `'a'`.
+        Char(LitChar),
+
+        /// An integer literal: `1` or `1u16`.
+        Int(LitInt),
+
+        /// A floating point literal: `1f64` or `1.0e10f64`.
+        ///
+        /// Must be finite. May not be infinte or NaN.
+        Float(LitFloat),
+
+        /// A boolean literal: `true` or `false`.
+        Bool(LitBool),
+
+        /// A raw token literal not interpreted by Syn.
+        Verbatim(Literal),
+    }
+}
+
+ast_struct! {
+    /// A UTF-8 string literal: `"foo"`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct LitStr #manual_extra_traits_debug {
+        repr: Box<LitStrRepr>,
+    }
+}
+
+#[cfg_attr(feature = "clone-impls", derive(Clone))]
+struct LitStrRepr {
+    token: Literal,
+    suffix: Box<str>,
+}
+
+ast_struct! {
+    /// A byte string literal: `b"foo"`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct LitByteStr #manual_extra_traits_debug {
+        token: Literal,
+    }
+}
+
+ast_struct! {
+    /// A byte literal: `b'f'`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct LitByte #manual_extra_traits_debug {
+        token: Literal,
+    }
+}
+
+ast_struct! {
+    /// A character literal: `'a'`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct LitChar #manual_extra_traits_debug {
+        token: Literal,
+    }
+}
+
+ast_struct! {
+    /// An integer literal: `1` or `1u16`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct LitInt #manual_extra_traits_debug {
+        repr: Box<LitIntRepr>,
+    }
+}
+
+#[cfg_attr(feature = "clone-impls", derive(Clone))]
+struct LitIntRepr {
+    token: Literal,
+    digits: Box<str>,
+    suffix: Box<str>,
+}
+
+ast_struct! {
+    /// A floating point literal: `1f64` or `1.0e10f64`.
+    ///
+    /// Must be finite. May not be infinte or NaN.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct LitFloat #manual_extra_traits_debug {
+        repr: Box<LitFloatRepr>,
+    }
+}
+
+#[cfg_attr(feature = "clone-impls", derive(Clone))]
+struct LitFloatRepr {
+    token: Literal,
+    digits: Box<str>,
+    suffix: Box<str>,
+}
+
+ast_struct! {
+    /// A boolean literal: `true` or `false`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct LitBool #manual_extra_traits_debug {
+        pub value: bool,
+        pub span: Span,
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+impl Eq for Lit {}
+
+#[cfg(feature = "extra-traits")]
+impl PartialEq for Lit {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (Lit::Str(this), Lit::Str(other)) => this == other,
+            (Lit::ByteStr(this), Lit::ByteStr(other)) => this == other,
+            (Lit::Byte(this), Lit::Byte(other)) => this == other,
+            (Lit::Char(this), Lit::Char(other)) => this == other,
+            (Lit::Int(this), Lit::Int(other)) => this == other,
+            (Lit::Float(this), Lit::Float(other)) => this == other,
+            (Lit::Bool(this), Lit::Bool(other)) => this == other,
+            (Lit::Verbatim(this), Lit::Verbatim(other)) => this.to_string() == other.to_string(),
+            _ => false,
+        }
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+impl Hash for Lit {
+    fn hash<H>(&self, hash: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            Lit::Str(lit) => {
+                hash.write_u8(0);
+                lit.hash(hash);
+            }
+            Lit::ByteStr(lit) => {
+                hash.write_u8(1);
+                lit.hash(hash);
+            }
+            Lit::Byte(lit) => {
+                hash.write_u8(2);
+                lit.hash(hash);
+            }
+            Lit::Char(lit) => {
+                hash.write_u8(3);
+                lit.hash(hash);
+            }
+            Lit::Int(lit) => {
+                hash.write_u8(4);
+                lit.hash(hash);
+            }
+            Lit::Float(lit) => {
+                hash.write_u8(5);
+                lit.hash(hash);
+            }
+            Lit::Bool(lit) => {
+                hash.write_u8(6);
+                lit.hash(hash);
+            }
+            Lit::Verbatim(lit) => {
+                hash.write_u8(7);
+                lit.to_string().hash(hash);
+            }
+        }
+    }
+}
+
+impl LitStr {
+    pub fn new(value: &str, span: Span) -> Self {
+        let mut lit = Literal::string(value);
+        lit.set_span(span);
+        LitStr {
+            repr: Box::new(LitStrRepr {
+                token: lit,
+                suffix: Box::<str>::default(),
+            }),
+        }
+    }
+
+    pub fn value(&self) -> String {
+        let (value, _) = value::parse_lit_str(&self.repr.token.to_string());
+        String::from(value)
+    }
+
+    /// Parse a syntax tree node from the content of this string literal.
+    ///
+    /// All spans in the syntax tree will point to the span of this `LitStr`.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use proc_macro2::Span;
+    /// use syn::{Attribute, Error, Ident, Lit, Meta, MetaNameValue, Path, Result};
+    ///
+    /// // Parses the path from an attribute that looks like:
+    /// //
+    /// //     #[path = "a::b::c"]
+    /// //
+    /// // or returns `None` if the input is some other attribute.
+    /// fn get_path(attr: &Attribute) -> Result<Option<Path>> {
+    ///     if !attr.path.is_ident("path") {
+    ///         return Ok(None);
+    ///     }
+    ///
+    ///     match attr.parse_meta()? {
+    ///         Meta::NameValue(MetaNameValue { lit: Lit::Str(lit_str), .. }) => {
+    ///             lit_str.parse().map(Some)
+    ///         }
+    ///         _ => {
+    ///             let message = "expected #[path = \"...\"]";
+    ///             Err(Error::new_spanned(attr, message))
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    #[cfg(feature = "parsing")]
+    pub fn parse<T: Parse>(&self) -> Result<T> {
+        self.parse_with(T::parse)
+    }
+
+    /// Invoke parser on the content of this string literal.
+    ///
+    /// All spans in the syntax tree will point to the span of this `LitStr`.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// # use proc_macro2::Span;
+    /// # use syn::{LitStr, Result};
+    /// #
+    /// # fn main() -> Result<()> {
+    /// #     let lit_str = LitStr::new("a::b::c", Span::call_site());
+    /// #
+    /// #     const IGNORE: &str = stringify! {
+    /// let lit_str: LitStr = /* ... */;
+    /// #     };
+    ///
+    /// // Parse a string literal like "a::b::c" into a Path, not allowing
+    /// // generic arguments on any of the path segments.
+    /// let basic_path = lit_str.parse_with(syn::Path::parse_mod_style)?;
+    /// #
+    /// #     Ok(())
+    /// # }
+    /// ```
+    #[cfg(feature = "parsing")]
+    pub fn parse_with<F: Parser>(&self, parser: F) -> Result<F::Output> {
+        use proc_macro2::Group;
+
+        // Token stream with every span replaced by the given one.
+        fn respan_token_stream(stream: TokenStream, span: Span) -> TokenStream {
+            stream
+                .into_iter()
+                .map(|token| respan_token_tree(token, span))
+                .collect()
+        }
+
+        // Token tree with every span replaced by the given one.
+        fn respan_token_tree(mut token: TokenTree, span: Span) -> TokenTree {
+            match &mut token {
+                TokenTree::Group(g) => {
+                    let stream = respan_token_stream(g.stream(), span);
+                    *g = Group::new(g.delimiter(), stream);
+                    g.set_span(span);
+                }
+                other => other.set_span(span),
+            }
+            token
+        }
+
+        // Parse string literal into a token stream with every span equal to the
+        // original literal's span.
+        let mut tokens = crate::parse_str(&self.value())?;
+        tokens = respan_token_stream(tokens, self.span());
+
+        parser.parse2(tokens)
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span)
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+}
+
+impl LitByteStr {
+    pub fn new(value: &[u8], span: Span) -> Self {
+        let mut token = Literal::byte_string(value);
+        token.set_span(span);
+        LitByteStr { token }
+    }
+
+    pub fn value(&self) -> Vec<u8> {
+        value::parse_lit_byte_str(&self.token.to_string())
+    }
+
+    pub fn span(&self) -> Span {
+        self.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.token.set_span(span)
+    }
+}
+
+impl LitByte {
+    pub fn new(value: u8, span: Span) -> Self {
+        let mut token = Literal::u8_suffixed(value);
+        token.set_span(span);
+        LitByte { token }
+    }
+
+    pub fn value(&self) -> u8 {
+        value::parse_lit_byte(&self.token.to_string())
+    }
+
+    pub fn span(&self) -> Span {
+        self.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.token.set_span(span)
+    }
+}
+
+impl LitChar {
+    pub fn new(value: char, span: Span) -> Self {
+        let mut token = Literal::character(value);
+        token.set_span(span);
+        LitChar { token }
+    }
+
+    pub fn value(&self) -> char {
+        value::parse_lit_char(&self.token.to_string())
+    }
+
+    pub fn span(&self) -> Span {
+        self.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.token.set_span(span)
+    }
+}
+
+impl LitInt {
+    pub fn new(repr: &str, span: Span) -> Self {
+        if let Some((digits, suffix)) = value::parse_lit_int(repr) {
+            let mut token = value::to_literal(repr);
+            token.set_span(span);
+            LitInt {
+                repr: Box::new(LitIntRepr {
+                    token,
+                    digits,
+                    suffix,
+                }),
+            }
+        } else {
+            panic!("Not an integer literal: `{}`", repr);
+        }
+    }
+
+    pub fn base10_digits(&self) -> &str {
+        &self.repr.digits
+    }
+
+    /// Parses the literal into a selected number type.
+    ///
+    /// This is equivalent to `lit.base10_digits().parse()` except that the
+    /// resulting errors will be correctly spanned to point to the literal token
+    /// in the macro input.
+    ///
+    /// ```
+    /// use syn::LitInt;
+    /// use syn::parse::{Parse, ParseStream, Result};
+    ///
+    /// struct Port {
+    ///     value: u16,
+    /// }
+    ///
+    /// impl Parse for Port {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let lit: LitInt = input.parse()?;
+    ///         let value = lit.base10_parse::<u16>()?;
+    ///         Ok(Port { value })
+    ///     }
+    /// }
+    /// ```
+    pub fn base10_parse<N>(&self) -> Result<N>
+    where
+        N: FromStr,
+        N::Err: Display,
+    {
+        self.base10_digits()
+            .parse()
+            .map_err(|err| Error::new(self.span(), err))
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span)
+    }
+}
+
+impl From<Literal> for LitInt {
+    fn from(token: Literal) -> Self {
+        let repr = token.to_string();
+        if let Some((digits, suffix)) = value::parse_lit_int(&repr) {
+            LitInt {
+                repr: Box::new(LitIntRepr {
+                    token,
+                    digits,
+                    suffix,
+                }),
+            }
+        } else {
+            panic!("Not an integer literal: `{}`", repr);
+        }
+    }
+}
+
+impl Display for LitInt {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.repr.token.fmt(formatter)
+    }
+}
+
+impl LitFloat {
+    pub fn new(repr: &str, span: Span) -> Self {
+        if let Some((digits, suffix)) = value::parse_lit_float(repr) {
+            let mut token = value::to_literal(repr);
+            token.set_span(span);
+            LitFloat {
+                repr: Box::new(LitFloatRepr {
+                    token,
+                    digits,
+                    suffix,
+                }),
+            }
+        } else {
+            panic!("Not a float literal: `{}`", repr);
+        }
+    }
+
+    pub fn base10_digits(&self) -> &str {
+        &self.repr.digits
+    }
+
+    pub fn base10_parse<N>(&self) -> Result<N>
+    where
+        N: FromStr,
+        N::Err: Display,
+    {
+        self.base10_digits()
+            .parse()
+            .map_err(|err| Error::new(self.span(), err))
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span)
+    }
+}
+
+impl From<Literal> for LitFloat {
+    fn from(token: Literal) -> Self {
+        let repr = token.to_string();
+        if let Some((digits, suffix)) = value::parse_lit_float(&repr) {
+            LitFloat {
+                repr: Box::new(LitFloatRepr {
+                    token,
+                    digits,
+                    suffix,
+                }),
+            }
+        } else {
+            panic!("Not a float literal: `{}`", repr);
+        }
+    }
+}
+
+impl Display for LitFloat {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.repr.token.fmt(formatter)
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+mod debug_impls {
+    use super::*;
+    use std::fmt::{self, Debug};
+
+    impl Debug for LitStr {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            formatter
+                .debug_struct("LitStr")
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    impl Debug for LitByteStr {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            formatter
+                .debug_struct("LitByteStr")
+                .field("token", &format_args!("{}", self.token))
+                .finish()
+        }
+    }
+
+    impl Debug for LitByte {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            formatter
+                .debug_struct("LitByte")
+                .field("token", &format_args!("{}", self.token))
+                .finish()
+        }
+    }
+
+    impl Debug for LitChar {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            formatter
+                .debug_struct("LitChar")
+                .field("token", &format_args!("{}", self.token))
+                .finish()
+        }
+    }
+
+    impl Debug for LitInt {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            formatter
+                .debug_struct("LitInt")
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    impl Debug for LitFloat {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            formatter
+                .debug_struct("LitFloat")
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    impl Debug for LitBool {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            formatter
+                .debug_struct("LitBool")
+                .field("value", &self.value)
+                .finish()
+        }
+    }
+}
+
+macro_rules! lit_extra_traits {
+    ($ty:ident, $($field:ident).+) => {
+        #[cfg(feature = "extra-traits")]
+        impl Eq for $ty {}
+
+        #[cfg(feature = "extra-traits")]
+        impl PartialEq for $ty {
+            fn eq(&self, other: &Self) -> bool {
+                self.$($field).+.to_string() == other.$($field).+.to_string()
+            }
+        }
+
+        #[cfg(feature = "extra-traits")]
+        impl Hash for $ty {
+            fn hash<H>(&self, state: &mut H)
+            where
+                H: Hasher,
+            {
+                self.$($field).+.to_string().hash(state);
+            }
+        }
+
+        #[cfg(feature = "parsing")]
+        #[doc(hidden)]
+        #[allow(non_snake_case)]
+        pub fn $ty(marker: lookahead::TokenMarker) -> $ty {
+            match marker {}
+        }
+    };
+}
+
+lit_extra_traits!(LitStr, repr.token);
+lit_extra_traits!(LitByteStr, token);
+lit_extra_traits!(LitByte, token);
+lit_extra_traits!(LitChar, token);
+lit_extra_traits!(LitInt, repr.token);
+lit_extra_traits!(LitFloat, repr.token);
+lit_extra_traits!(LitBool, value);
+
+ast_enum! {
+    /// The style of a string literal, either plain quoted or a raw string like
+    /// `r##"data"##`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub enum StrStyle #no_visit {
+        /// An ordinary string like `"data"`.
+        Cooked,
+        /// A raw string like `r##"data"##`.
+        ///
+        /// The unsigned integer is the number of `#` symbols used.
+        Raw(usize),
+    }
+}
+
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+#[allow(non_snake_case)]
+pub fn Lit(marker: lookahead::TokenMarker) -> Lit {
+    match marker {}
+}
+
+#[cfg(feature = "parsing")]
+pub mod parsing {
+    use super::*;
+    use crate::parse::{Parse, ParseStream, Result};
+
+    impl Parse for Lit {
+        fn parse(input: ParseStream) -> Result<Self> {
+            input.step(|cursor| {
+                if let Some((lit, rest)) = cursor.literal() {
+                    return Ok((Lit::new(lit), rest));
+                }
+                while let Some((ident, rest)) = cursor.ident() {
+                    let value = if ident == "true" {
+                        true
+                    } else if ident == "false" {
+                        false
+                    } else {
+                        break;
+                    };
+                    let lit_bool = LitBool {
+                        value,
+                        span: ident.span(),
+                    };
+                    return Ok((Lit::Bool(lit_bool), rest));
+                }
+                Err(cursor.error("expected literal"))
+            })
+        }
+    }
+
+    impl Parse for LitStr {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse()? {
+                Lit::Str(lit) => Ok(lit),
+                _ => Err(head.error("expected string literal")),
+            }
+        }
+    }
+
+    impl Parse for LitByteStr {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse()? {
+                Lit::ByteStr(lit) => Ok(lit),
+                _ => Err(head.error("expected byte string literal")),
+            }
+        }
+    }
+
+    impl Parse for LitByte {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse()? {
+                Lit::Byte(lit) => Ok(lit),
+                _ => Err(head.error("expected byte literal")),
+            }
+        }
+    }
+
+    impl Parse for LitChar {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse()? {
+                Lit::Char(lit) => Ok(lit),
+                _ => Err(head.error("expected character literal")),
+            }
+        }
+    }
+
+    impl Parse for LitInt {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse()? {
+                Lit::Int(lit) => Ok(lit),
+                _ => Err(head.error("expected integer literal")),
+            }
+        }
+    }
+
+    impl Parse for LitFloat {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse()? {
+                Lit::Float(lit) => Ok(lit),
+                _ => Err(head.error("expected floating point literal")),
+            }
+        }
+    }
+
+    impl Parse for LitBool {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse()? {
+                Lit::Bool(lit) => Ok(lit),
+                _ => Err(head.error("expected boolean literal")),
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use super::*;
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    impl ToTokens for LitStr {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for LitByteStr {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.token.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for LitByte {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.token.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for LitChar {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.token.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for LitInt {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for LitFloat {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for LitBool {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            let s = if self.value { "true" } else { "false" };
+            tokens.append(Ident::new(s, self.span));
+        }
+    }
+}
+
+mod value {
+    use super::*;
+    use crate::bigint::BigInt;
+    use proc_macro2::TokenStream;
+    use std::char;
+    use std::ops::{Index, RangeFrom};
+
+    impl Lit {
+        /// Interpret a Syn literal from a proc-macro2 literal.
+        pub fn new(token: Literal) -> Self {
+            let repr = token.to_string();
+
+            match byte(&repr, 0) {
+                b'"' | b'r' => {
+                    let (_, suffix) = parse_lit_str(&repr);
+                    return Lit::Str(LitStr {
+                        repr: Box::new(LitStrRepr { token, suffix }),
+                    });
+                }
+                b'b' => match byte(&repr, 1) {
+                    b'"' | b'r' => {
+                        return Lit::ByteStr(LitByteStr { token });
+                    }
+                    b'\'' => {
+                        return Lit::Byte(LitByte { token });
+                    }
+                    _ => {}
+                },
+                b'\'' => {
+                    return Lit::Char(LitChar { token });
+                }
+                b'0'..=b'9' | b'-' => {
+                    if !(repr.ends_with("f32") || repr.ends_with("f64")) {
+                        if let Some((digits, suffix)) = parse_lit_int(&repr) {
+                            return Lit::Int(LitInt {
+                                repr: Box::new(LitIntRepr {
+                                    token,
+                                    digits,
+                                    suffix,
+                                }),
+                            });
+                        }
+                    }
+                    if let Some((digits, suffix)) = parse_lit_float(&repr) {
+                        return Lit::Float(LitFloat {
+                            repr: Box::new(LitFloatRepr {
+                                token,
+                                digits,
+                                suffix,
+                            }),
+                        });
+                    }
+                }
+                b't' | b'f' => {
+                    if repr == "true" || repr == "false" {
+                        return Lit::Bool(LitBool {
+                            value: repr == "true",
+                            span: token.span(),
+                        });
+                    }
+                }
+                _ => {}
+            }
+
+            panic!("Unrecognized literal: `{}`", repr);
+        }
+    }
+
+    /// Get the byte at offset idx, or a default of `b'\0'` if we're looking
+    /// past the end of the input buffer.
+    pub fn byte<S: AsRef<[u8]> + ?Sized>(s: &S, idx: usize) -> u8 {
+        let s = s.as_ref();
+        if idx < s.len() {
+            s[idx]
+        } else {
+            0
+        }
+    }
+
+    fn next_chr(s: &str) -> char {
+        s.chars().next().unwrap_or('\0')
+    }
+
+    // Returns (content, suffix).
+    pub fn parse_lit_str(s: &str) -> (Box<str>, Box<str>) {
+        match byte(s, 0) {
+            b'"' => parse_lit_str_cooked(s),
+            b'r' => parse_lit_str_raw(s),
+            _ => unreachable!(),
+        }
+    }
+
+    // Clippy false positive
+    // https://github.com/rust-lang-nursery/rust-clippy/issues/2329
+    #[allow(clippy::needless_continue)]
+    fn parse_lit_str_cooked(mut s: &str) -> (Box<str>, Box<str>) {
+        assert_eq!(byte(s, 0), b'"');
+        s = &s[1..];
+
+        let mut content = String::new();
+        'outer: loop {
+            let ch = match byte(s, 0) {
+                b'"' => break,
+                b'\\' => {
+                    let b = byte(s, 1);
+                    s = &s[2..];
+                    match b {
+                        b'x' => {
+                            let (byte, rest) = backslash_x(s);
+                            s = rest;
+                            assert!(byte <= 0x80, "Invalid \\x byte in string literal");
+                            char::from_u32(u32::from(byte)).unwrap()
+                        }
+                        b'u' => {
+                            let (chr, rest) = backslash_u(s);
+                            s = rest;
+                            chr
+                        }
+                        b'n' => '\n',
+                        b'r' => '\r',
+                        b't' => '\t',
+                        b'\\' => '\\',
+                        b'0' => '\0',
+                        b'\'' => '\'',
+                        b'"' => '"',
+                        b'\r' | b'\n' => loop {
+                            let ch = next_chr(s);
+                            if ch.is_whitespace() {
+                                s = &s[ch.len_utf8()..];
+                            } else {
+                                continue 'outer;
+                            }
+                        },
+                        b => panic!("unexpected byte {:?} after \\ character in byte literal", b),
+                    }
+                }
+                b'\r' => {
+                    assert_eq!(byte(s, 1), b'\n', "Bare CR not allowed in string");
+                    s = &s[2..];
+                    '\n'
+                }
+                _ => {
+                    let ch = next_chr(s);
+                    s = &s[ch.len_utf8()..];
+                    ch
+                }
+            };
+            content.push(ch);
+        }
+
+        assert!(s.starts_with('"'));
+        let content = content.into_boxed_str();
+        let suffix = s[1..].to_owned().into_boxed_str();
+        (content, suffix)
+    }
+
+    fn parse_lit_str_raw(mut s: &str) -> (Box<str>, Box<str>) {
+        assert_eq!(byte(s, 0), b'r');
+        s = &s[1..];
+
+        let mut pounds = 0;
+        while byte(s, pounds) == b'#' {
+            pounds += 1;
+        }
+        assert_eq!(byte(s, pounds), b'"');
+        assert_eq!(byte(s, s.len() - pounds - 1), b'"');
+        for end in s[s.len() - pounds..].bytes() {
+            assert_eq!(end, b'#');
+        }
+
+        let content = s[pounds + 1..s.len() - pounds - 1]
+            .to_owned()
+            .into_boxed_str();
+        let suffix = Box::<str>::default(); // todo
+        (content, suffix)
+    }
+
+    pub fn parse_lit_byte_str(s: &str) -> Vec<u8> {
+        assert_eq!(byte(s, 0), b'b');
+        match byte(s, 1) {
+            b'"' => parse_lit_byte_str_cooked(s),
+            b'r' => parse_lit_byte_str_raw(s),
+            _ => unreachable!(),
+        }
+    }
+
+    // Clippy false positive
+    // https://github.com/rust-lang-nursery/rust-clippy/issues/2329
+    #[allow(clippy::needless_continue)]
+    fn parse_lit_byte_str_cooked(mut s: &str) -> Vec<u8> {
+        assert_eq!(byte(s, 0), b'b');
+        assert_eq!(byte(s, 1), b'"');
+        s = &s[2..];
+
+        // We're going to want to have slices which don't respect codepoint boundaries.
+        let mut s = s.as_bytes();
+
+        let mut out = Vec::new();
+        'outer: loop {
+            let byte = match byte(s, 0) {
+                b'"' => break,
+                b'\\' => {
+                    let b = byte(s, 1);
+                    s = &s[2..];
+                    match b {
+                        b'x' => {
+                            let (b, rest) = backslash_x(s);
+                            s = rest;
+                            b
+                        }
+                        b'n' => b'\n',
+                        b'r' => b'\r',
+                        b't' => b'\t',
+                        b'\\' => b'\\',
+                        b'0' => b'\0',
+                        b'\'' => b'\'',
+                        b'"' => b'"',
+                        b'\r' | b'\n' => loop {
+                            let byte = byte(s, 0);
+                            let ch = char::from_u32(u32::from(byte)).unwrap();
+                            if ch.is_whitespace() {
+                                s = &s[1..];
+                            } else {
+                                continue 'outer;
+                            }
+                        },
+                        b => panic!("unexpected byte {:?} after \\ character in byte literal", b),
+                    }
+                }
+                b'\r' => {
+                    assert_eq!(byte(s, 1), b'\n', "Bare CR not allowed in string");
+                    s = &s[2..];
+                    b'\n'
+                }
+                b => {
+                    s = &s[1..];
+                    b
+                }
+            };
+            out.push(byte);
+        }
+
+        assert_eq!(s, b"\"");
+        out
+    }
+
+    fn parse_lit_byte_str_raw(s: &str) -> Vec<u8> {
+        assert_eq!(byte(s, 0), b'b');
+        String::from(parse_lit_str_raw(&s[1..]).0).into_bytes()
+    }
+
+    pub fn parse_lit_byte(s: &str) -> u8 {
+        assert_eq!(byte(s, 0), b'b');
+        assert_eq!(byte(s, 1), b'\'');
+
+        // We're going to want to have slices which don't respect codepoint boundaries.
+        let mut s = s[2..].as_bytes();
+
+        let b = match byte(s, 0) {
+            b'\\' => {
+                let b = byte(s, 1);
+                s = &s[2..];
+                match b {
+                    b'x' => {
+                        let (b, rest) = backslash_x(s);
+                        s = rest;
+                        b
+                    }
+                    b'n' => b'\n',
+                    b'r' => b'\r',
+                    b't' => b'\t',
+                    b'\\' => b'\\',
+                    b'0' => b'\0',
+                    b'\'' => b'\'',
+                    b'"' => b'"',
+                    b => panic!("unexpected byte {:?} after \\ character in byte literal", b),
+                }
+            }
+            b => {
+                s = &s[1..];
+                b
+            }
+        };
+
+        assert_eq!(byte(s, 0), b'\'');
+        b
+    }
+
+    pub fn parse_lit_char(mut s: &str) -> char {
+        assert_eq!(byte(s, 0), b'\'');
+        s = &s[1..];
+
+        let ch = match byte(s, 0) {
+            b'\\' => {
+                let b = byte(s, 1);
+                s = &s[2..];
+                match b {
+                    b'x' => {
+                        let (byte, rest) = backslash_x(s);
+                        s = rest;
+                        assert!(byte <= 0x80, "Invalid \\x byte in string literal");
+                        char::from_u32(u32::from(byte)).unwrap()
+                    }
+                    b'u' => {
+                        let (chr, rest) = backslash_u(s);
+                        s = rest;
+                        chr
+                    }
+                    b'n' => '\n',
+                    b'r' => '\r',
+                    b't' => '\t',
+                    b'\\' => '\\',
+                    b'0' => '\0',
+                    b'\'' => '\'',
+                    b'"' => '"',
+                    b => panic!("unexpected byte {:?} after \\ character in byte literal", b),
+                }
+            }
+            _ => {
+                let ch = next_chr(s);
+                s = &s[ch.len_utf8()..];
+                ch
+            }
+        };
+        assert_eq!(s, "\'", "Expected end of char literal");
+        ch
+    }
+
+    fn backslash_x<S>(s: &S) -> (u8, &S)
+    where
+        S: Index<RangeFrom<usize>, Output = S> + AsRef<[u8]> + ?Sized,
+    {
+        let mut ch = 0;
+        let b0 = byte(s, 0);
+        let b1 = byte(s, 1);
+        ch += 0x10
+            * match b0 {
+                b'0'..=b'9' => b0 - b'0',
+                b'a'..=b'f' => 10 + (b0 - b'a'),
+                b'A'..=b'F' => 10 + (b0 - b'A'),
+                _ => panic!("unexpected non-hex character after \\x"),
+            };
+        ch += match b1 {
+            b'0'..=b'9' => b1 - b'0',
+            b'a'..=b'f' => 10 + (b1 - b'a'),
+            b'A'..=b'F' => 10 + (b1 - b'A'),
+            _ => panic!("unexpected non-hex character after \\x"),
+        };
+        (ch, &s[2..])
+    }
+
+    fn backslash_u(mut s: &str) -> (char, &str) {
+        if byte(s, 0) != b'{' {
+            panic!("expected {{ after \\u");
+        }
+        s = &s[1..];
+
+        let mut ch = 0;
+        for _ in 0..6 {
+            let b = byte(s, 0);
+            match b {
+                b'0'..=b'9' => {
+                    ch *= 0x10;
+                    ch += u32::from(b - b'0');
+                    s = &s[1..];
+                }
+                b'a'..=b'f' => {
+                    ch *= 0x10;
+                    ch += u32::from(10 + b - b'a');
+                    s = &s[1..];
+                }
+                b'A'..=b'F' => {
+                    ch *= 0x10;
+                    ch += u32::from(10 + b - b'A');
+                    s = &s[1..];
+                }
+                b'}' => break,
+                _ => panic!("unexpected non-hex character after \\u"),
+            }
+        }
+        assert!(byte(s, 0) == b'}');
+        s = &s[1..];
+
+        if let Some(ch) = char::from_u32(ch) {
+            (ch, s)
+        } else {
+            panic!("character code {:x} is not a valid unicode character", ch);
+        }
+    }
+
+    // Returns base 10 digits and suffix.
+    pub fn parse_lit_int(mut s: &str) -> Option<(Box<str>, Box<str>)> {
+        let negative = byte(s, 0) == b'-';
+        if negative {
+            s = &s[1..];
+        }
+
+        let base = match (byte(s, 0), byte(s, 1)) {
+            (b'0', b'x') => {
+                s = &s[2..];
+                16
+            }
+            (b'0', b'o') => {
+                s = &s[2..];
+                8
+            }
+            (b'0', b'b') => {
+                s = &s[2..];
+                2
+            }
+            (b'0'..=b'9', _) => 10,
+            _ => return None,
+        };
+
+        let mut value = BigInt::new();
+        loop {
+            let b = byte(s, 0);
+            let digit = match b {
+                b'0'..=b'9' => b - b'0',
+                b'a'..=b'f' if base > 10 => b - b'a' + 10,
+                b'A'..=b'F' if base > 10 => b - b'A' + 10,
+                b'_' => {
+                    s = &s[1..];
+                    continue;
+                }
+                // NOTE: Looking at a floating point literal, we don't want to
+                // consider these integers.
+                b'.' if base == 10 => return None,
+                b'e' | b'E' if base == 10 => return None,
+                _ => break,
+            };
+
+            if digit >= base {
+                return None;
+            }
+
+            value *= base;
+            value += digit;
+            s = &s[1..];
+        }
+
+        let suffix = s;
+        if suffix.is_empty() || crate::ident::xid_ok(&suffix) {
+            let mut repr = value.to_string();
+            if negative {
+                repr.insert(0, '-');
+            }
+            Some((repr.into_boxed_str(), suffix.to_owned().into_boxed_str()))
+        } else {
+            None
+        }
+    }
+
+    // Returns base 10 digits and suffix.
+    pub fn parse_lit_float(input: &str) -> Option<(Box<str>, Box<str>)> {
+        // Rust's floating point literals are very similar to the ones parsed by
+        // the standard library, except that rust's literals can contain
+        // ignorable underscores. Let's remove those underscores.
+
+        let mut bytes = input.to_owned().into_bytes();
+
+        let start = (*bytes.get(0)? == b'-') as usize;
+        match bytes.get(start)? {
+            b'0'..=b'9' => {}
+            _ => return None,
+        }
+
+        let mut read = start;
+        let mut write = start;
+        let mut has_dot = false;
+        let mut has_e = false;
+        let mut has_sign = false;
+        let mut has_exponent = false;
+        while read < bytes.len() {
+            match bytes[read] {
+                b'_' => {
+                    // Don't increase write
+                    read += 1;
+                    continue;
+                }
+                b'0'..=b'9' => {
+                    if has_e {
+                        has_exponent = true;
+                    }
+                    bytes[write] = bytes[read];
+                }
+                b'.' => {
+                    if has_e || has_dot {
+                        return None;
+                    }
+                    has_dot = true;
+                    bytes[write] = b'.';
+                }
+                b'e' | b'E' => {
+                    if has_e {
+                        return None;
+                    }
+                    has_e = true;
+                    bytes[write] = b'e';
+                }
+                b'-' | b'+' => {
+                    if has_sign || has_exponent || !has_e {
+                        return None;
+                    }
+                    has_sign = true;
+                    if bytes[read] == b'-' {
+                        bytes[write] = bytes[read];
+                    } else {
+                        // Omit '+'
+                        read += 1;
+                        continue;
+                    }
+                }
+                _ => break,
+            }
+            read += 1;
+            write += 1;
+        }
+
+        if has_e && !has_exponent {
+            return None;
+        }
+
+        let mut digits = String::from_utf8(bytes).unwrap();
+        let suffix = digits.split_off(read);
+        digits.truncate(write);
+        if suffix.is_empty() || crate::ident::xid_ok(&suffix) {
+            Some((digits.into_boxed_str(), suffix.into_boxed_str()))
+        } else {
+            None
+        }
+    }
+
+    pub fn to_literal(s: &str) -> Literal {
+        let stream = s.parse::<TokenStream>().unwrap();
+        match stream.into_iter().next().unwrap() {
+            TokenTree::Literal(l) => l,
+            _ => unreachable!(),
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/lookahead.rs.html b/src/syn/lookahead.rs.html new file mode 100644 index 0000000..1079dd6 --- /dev/null +++ b/src/syn/lookahead.rs.html @@ -0,0 +1,339 @@ +lookahead.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+
+use std::cell::RefCell;
+
+use proc_macro2::{Delimiter, Span};
+
+use crate::buffer::Cursor;
+use crate::error::{self, Error};
+use crate::sealed::lookahead::Sealed;
+use crate::span::IntoSpans;
+use crate::token::Token;
+
+/// Support for checking the next token in a stream to decide how to parse.
+///
+/// An important advantage over [`ParseStream::peek`] is that here we
+/// automatically construct an appropriate error message based on the token
+/// alternatives that get peeked. If you are producing your own error message,
+/// go ahead and use `ParseStream::peek` instead.
+///
+/// Use [`ParseStream::lookahead1`] to construct this object.
+///
+/// [`ParseStream::peek`]: crate::parse::ParseBuffer::peek
+/// [`ParseStream::lookahead1`]: crate::parse::ParseBuffer::lookahead1
+///
+/// # Example
+///
+/// ```
+/// use syn::{ConstParam, Ident, Lifetime, LifetimeDef, Result, Token, TypeParam};
+/// use syn::parse::{Parse, ParseStream};
+///
+/// // A generic parameter, a single one of the comma-separated elements inside
+/// // angle brackets in:
+/// //
+/// //     fn f<T: Clone, 'a, 'b: 'a, const N: usize>() { ... }
+/// //
+/// // On invalid input, lookahead gives us a reasonable error message.
+/// //
+/// //     error: expected one of: identifier, lifetime, `const`
+/// //       |
+/// //     5 |     fn f<!Sized>() {}
+/// //       |          ^
+/// enum GenericParam {
+///     Type(TypeParam),
+///     Lifetime(LifetimeDef),
+///     Const(ConstParam),
+/// }
+///
+/// impl Parse for GenericParam {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let lookahead = input.lookahead1();
+///         if lookahead.peek(Ident) {
+///             input.parse().map(GenericParam::Type)
+///         } else if lookahead.peek(Lifetime) {
+///             input.parse().map(GenericParam::Lifetime)
+///         } else if lookahead.peek(Token![const]) {
+///             input.parse().map(GenericParam::Const)
+///         } else {
+///             Err(lookahead.error())
+///         }
+///     }
+/// }
+/// ```
+pub struct Lookahead1<'a> {
+    scope: Span,
+    cursor: Cursor<'a>,
+    comparisons: RefCell<Vec<&'static str>>,
+}
+
+pub fn new(scope: Span, cursor: Cursor) -> Lookahead1 {
+    Lookahead1 {
+        scope,
+        cursor,
+        comparisons: RefCell::new(Vec::new()),
+    }
+}
+
+fn peek_impl(
+    lookahead: &Lookahead1,
+    peek: fn(Cursor) -> bool,
+    display: fn() -> &'static str,
+) -> bool {
+    if peek(lookahead.cursor) {
+        return true;
+    }
+    lookahead.comparisons.borrow_mut().push(display());
+    false
+}
+
+impl<'a> Lookahead1<'a> {
+    /// Looks at the next token in the parse stream to determine whether it
+    /// matches the requested type of token.
+    ///
+    /// # Syntax
+    ///
+    /// Note that this method does not use turbofish syntax. Pass the peek type
+    /// inside of parentheses.
+    ///
+    /// - `input.peek(Token![struct])`
+    /// - `input.peek(Token![==])`
+    /// - `input.peek(Ident)`&emsp;*(does not accept keywords)*
+    /// - `input.peek(Ident::peek_any)`
+    /// - `input.peek(Lifetime)`
+    /// - `input.peek(token::Brace)`
+    pub fn peek<T: Peek>(&self, token: T) -> bool {
+        let _ = token;
+        peek_impl(self, T::Token::peek, T::Token::display)
+    }
+
+    /// Triggers an error at the current position of the parse stream.
+    ///
+    /// The error message will identify all of the expected token types that
+    /// have been peeked against this lookahead instance.
+    pub fn error(self) -> Error {
+        let comparisons = self.comparisons.borrow();
+        match comparisons.len() {
+            0 => {
+                if self.cursor.eof() {
+                    Error::new(self.scope, "unexpected end of input")
+                } else {
+                    Error::new(self.cursor.span(), "unexpected token")
+                }
+            }
+            1 => {
+                let message = format!("expected {}", comparisons[0]);
+                error::new_at(self.scope, self.cursor, message)
+            }
+            2 => {
+                let message = format!("expected {} or {}", comparisons[0], comparisons[1]);
+                error::new_at(self.scope, self.cursor, message)
+            }
+            _ => {
+                let join = comparisons.join(", ");
+                let message = format!("expected one of: {}", join);
+                error::new_at(self.scope, self.cursor, message)
+            }
+        }
+    }
+}
+
+/// Types that can be parsed by looking at just one token.
+///
+/// Use [`ParseStream::peek`] to peek one of these types in a parse stream
+/// without consuming it from the stream.
+///
+/// This trait is sealed and cannot be implemented for types outside of Syn.
+///
+/// [`ParseStream::peek`]: crate::parse::ParseBuffer::peek
+pub trait Peek: Sealed {
+    // Not public API.
+    #[doc(hidden)]
+    type Token: Token;
+}
+
+impl<F: Copy + FnOnce(TokenMarker) -> T, T: Token> Peek for F {
+    type Token = T;
+}
+
+pub enum TokenMarker {}
+
+impl<S> IntoSpans<S> for TokenMarker {
+    fn into_spans(self) -> S {
+        match self {}
+    }
+}
+
+pub fn is_delimiter(cursor: Cursor, delimiter: Delimiter) -> bool {
+    cursor.group(delimiter).is_some()
+}
+
+impl<F: Copy + FnOnce(TokenMarker) -> T, T: Token> Sealed for F {}
+
+
\ No newline at end of file diff --git a/src/syn/mac.rs.html b/src/syn/mac.rs.html new file mode 100644 index 0000000..bffb406 --- /dev/null +++ b/src/syn/mac.rs.html @@ -0,0 +1,481 @@ +mac.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+
+use super::*;
+use crate::token::{Brace, Bracket, Paren};
+use proc_macro2::TokenStream;
+#[cfg(feature = "parsing")]
+use proc_macro2::{Delimiter, Span, TokenTree};
+
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, ParseStream, Parser, Result};
+#[cfg(feature = "extra-traits")]
+use crate::tt::TokenStreamHelper;
+#[cfg(feature = "extra-traits")]
+use std::hash::{Hash, Hasher};
+
+ast_struct! {
+    /// A macro invocation: `println!("{}", mac)`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct Macro #manual_extra_traits {
+        pub path: Path,
+        pub bang_token: Token![!],
+        pub delimiter: MacroDelimiter,
+        pub tokens: TokenStream,
+    }
+}
+
+ast_enum! {
+    /// A grouping token that surrounds a macro body: `m!(...)` or `m!{...}` or `m![...]`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub enum MacroDelimiter {
+        Paren(Paren),
+        Brace(Brace),
+        Bracket(Bracket),
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+impl Eq for Macro {}
+
+#[cfg(feature = "extra-traits")]
+impl PartialEq for Macro {
+    fn eq(&self, other: &Self) -> bool {
+        self.path == other.path
+            && self.bang_token == other.bang_token
+            && self.delimiter == other.delimiter
+            && TokenStreamHelper(&self.tokens) == TokenStreamHelper(&other.tokens)
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+impl Hash for Macro {
+    fn hash<H>(&self, state: &mut H)
+    where
+        H: Hasher,
+    {
+        self.path.hash(state);
+        self.bang_token.hash(state);
+        self.delimiter.hash(state);
+        TokenStreamHelper(&self.tokens).hash(state);
+    }
+}
+
+#[cfg(feature = "parsing")]
+fn delimiter_span(delimiter: &MacroDelimiter) -> Span {
+    match delimiter {
+        MacroDelimiter::Paren(token) => token.span,
+        MacroDelimiter::Brace(token) => token.span,
+        MacroDelimiter::Bracket(token) => token.span,
+    }
+}
+
+impl Macro {
+    /// Parse the tokens within the macro invocation's delimiters into a syntax
+    /// tree.
+    ///
+    /// This is equivalent to `syn::parse2::<T>(mac.tokens)` except that it
+    /// produces a more useful span when `tokens` is empty.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{parse_quote, Expr, ExprLit, Ident, Lit, LitStr, Macro, Token};
+    /// use syn::ext::IdentExt;
+    /// use syn::parse::{Error, Parse, ParseStream, Result};
+    /// use syn::punctuated::Punctuated;
+    ///
+    /// // The arguments expected by libcore's format_args macro, and as a
+    /// // result most other formatting and printing macros like println.
+    /// //
+    /// //     println!("{} is {number:.prec$}", "x", prec=5, number=0.01)
+    /// struct FormatArgs {
+    ///     format_string: Expr,
+    ///     positional_args: Vec<Expr>,
+    ///     named_args: Vec<(Ident, Expr)>,
+    /// }
+    ///
+    /// impl Parse for FormatArgs {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let format_string: Expr;
+    ///         let mut positional_args = Vec::new();
+    ///         let mut named_args = Vec::new();
+    ///
+    ///         format_string = input.parse()?;
+    ///         while !input.is_empty() {
+    ///             input.parse::<Token![,]>()?;
+    ///             if input.is_empty() {
+    ///                 break;
+    ///             }
+    ///             if input.peek(Ident::peek_any) && input.peek2(Token![=]) {
+    ///                 while !input.is_empty() {
+    ///                     let name: Ident = input.call(Ident::parse_any)?;
+    ///                     input.parse::<Token![=]>()?;
+    ///                     let value: Expr = input.parse()?;
+    ///                     named_args.push((name, value));
+    ///                     if input.is_empty() {
+    ///                         break;
+    ///                     }
+    ///                     input.parse::<Token![,]>()?;
+    ///                 }
+    ///                 break;
+    ///             }
+    ///             positional_args.push(input.parse()?);
+    ///         }
+    ///
+    ///         Ok(FormatArgs {
+    ///             format_string,
+    ///             positional_args,
+    ///             named_args,
+    ///         })
+    ///     }
+    /// }
+    ///
+    /// // Extract the first argument, the format string literal, from an
+    /// // invocation of a formatting or printing macro.
+    /// fn get_format_string(m: &Macro) -> Result<LitStr> {
+    ///     let args: FormatArgs = m.parse_body()?;
+    ///     match args.format_string {
+    ///         Expr::Lit(ExprLit { lit: Lit::Str(lit), .. }) => Ok(lit),
+    ///         other => {
+    ///             // First argument was not a string literal expression.
+    ///             // Maybe something like: println!(concat!(...), ...)
+    ///             Err(Error::new_spanned(other, "format string must be a string literal"))
+    ///         }
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let invocation = parse_quote! {
+    ///         println!("{:?}", Instant::now())
+    ///     };
+    ///     let lit = get_format_string(&invocation).unwrap();
+    ///     assert_eq!(lit.value(), "{:?}");
+    /// }
+    /// ```
+    #[cfg(feature = "parsing")]
+    pub fn parse_body<T: Parse>(&self) -> Result<T> {
+        self.parse_body_with(T::parse)
+    }
+
+    /// Parse the tokens within the macro invocation's delimiters using the
+    /// given parser.
+    #[cfg(feature = "parsing")]
+    pub fn parse_body_with<F: Parser>(&self, parser: F) -> Result<F::Output> {
+        // TODO: see if we can get a group.span_close() span in here as the
+        // scope, rather than the span of the whole group.
+        let scope = delimiter_span(&self.delimiter);
+        crate::parse::parse_scoped(parser, scope, self.tokens.clone())
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub fn parse_delimiter(input: ParseStream) -> Result<(MacroDelimiter, TokenStream)> {
+    input.step(|cursor| {
+        if let Some((TokenTree::Group(g), rest)) = cursor.token_tree() {
+            let span = g.span();
+            let delimiter = match g.delimiter() {
+                Delimiter::Parenthesis => MacroDelimiter::Paren(Paren(span)),
+                Delimiter::Brace => MacroDelimiter::Brace(Brace(span)),
+                Delimiter::Bracket => MacroDelimiter::Bracket(Bracket(span)),
+                Delimiter::None => {
+                    return Err(cursor.error("expected delimiter"));
+                }
+            };
+            Ok(((delimiter, g.stream()), rest))
+        } else {
+            Err(cursor.error("expected delimiter"))
+        }
+    })
+}
+
+#[cfg(feature = "parsing")]
+pub mod parsing {
+    use super::*;
+
+    use crate::parse::{Parse, ParseStream, Result};
+
+    impl Parse for Macro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let tokens;
+            Ok(Macro {
+                path: input.call(Path::parse_mod_style)?,
+                bang_token: input.parse()?,
+                delimiter: {
+                    let (delimiter, content) = parse_delimiter(input)?;
+                    tokens = content;
+                    delimiter
+                },
+                tokens,
+            })
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use super::*;
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+
+    impl ToTokens for Macro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.path.to_tokens(tokens);
+            self.bang_token.to_tokens(tokens);
+            match &self.delimiter {
+                MacroDelimiter::Paren(paren) => {
+                    paren.surround(tokens, |tokens| self.tokens.to_tokens(tokens));
+                }
+                MacroDelimiter::Brace(brace) => {
+                    brace.surround(tokens, |tokens| self.tokens.to_tokens(tokens));
+                }
+                MacroDelimiter::Bracket(bracket) => {
+                    bracket.surround(tokens, |tokens| self.tokens.to_tokens(tokens));
+                }
+            }
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/macros.rs.html b/src/syn/macros.rs.html new file mode 100644 index 0000000..360464e --- /dev/null +++ b/src/syn/macros.rs.html @@ -0,0 +1,385 @@ +macros.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+
+macro_rules! ast_struct {
+    (
+        [$($attrs_pub:tt)*]
+        struct $name:ident #full $($rest:tt)*
+    ) => {
+        #[cfg(feature = "full")]
+        #[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))]
+        #[cfg_attr(feature = "clone-impls", derive(Clone))]
+        $($attrs_pub)* struct $name $($rest)*
+
+        #[cfg(not(feature = "full"))]
+        #[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))]
+        #[cfg_attr(feature = "clone-impls", derive(Clone))]
+        $($attrs_pub)* struct $name {
+            _noconstruct: (),
+        }
+
+        #[cfg(all(not(feature = "full"), feature = "printing"))]
+        impl ::quote::ToTokens for $name {
+            fn to_tokens(&self, _: &mut ::proc_macro2::TokenStream) {
+                unreachable!()
+            }
+        }
+    };
+
+    (
+        [$($attrs_pub:tt)*]
+        struct $name:ident #manual_extra_traits $($rest:tt)*
+    ) => {
+        #[cfg_attr(feature = "extra-traits", derive(Debug))]
+        #[cfg_attr(feature = "clone-impls", derive(Clone))]
+        $($attrs_pub)* struct $name $($rest)*
+    };
+
+    (
+        [$($attrs_pub:tt)*]
+        struct $name:ident #manual_extra_traits_debug $($rest:tt)*
+    ) => {
+        #[cfg_attr(feature = "clone-impls", derive(Clone))]
+        $($attrs_pub)* struct $name $($rest)*
+    };
+
+    (
+        [$($attrs_pub:tt)*]
+        struct $name:ident $($rest:tt)*
+    ) => {
+        #[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))]
+        #[cfg_attr(feature = "clone-impls", derive(Clone))]
+        $($attrs_pub)* struct $name $($rest)*
+    };
+
+    ($($t:tt)*) => {
+        strip_attrs_pub!(ast_struct!($($t)*));
+    };
+}
+
+macro_rules! ast_enum {
+    // Drop the `#no_visit` attribute, if present.
+    (
+        [$($attrs_pub:tt)*]
+        enum $name:ident #no_visit $($rest:tt)*
+    ) => (
+        ast_enum!([$($attrs_pub)*] enum $name $($rest)*);
+    );
+
+    (
+        [$($attrs_pub:tt)*]
+        enum $name:ident #manual_extra_traits $($rest:tt)*
+    ) => (
+        #[cfg_attr(feature = "extra-traits", derive(Debug))]
+        #[cfg_attr(feature = "clone-impls", derive(Clone))]
+        $($attrs_pub)* enum $name $($rest)*
+    );
+
+    (
+        [$($attrs_pub:tt)*]
+        enum $name:ident $($rest:tt)*
+    ) => (
+        #[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))]
+        #[cfg_attr(feature = "clone-impls", derive(Clone))]
+        $($attrs_pub)* enum $name $($rest)*
+    );
+
+    ($($t:tt)*) => {
+        strip_attrs_pub!(ast_enum!($($t)*));
+    };
+}
+
+macro_rules! ast_enum_of_structs {
+    (
+        $(#[$enum_attr:meta])*
+        $pub:ident $enum:ident $name:ident #$tag:ident $body:tt
+        $($remaining:tt)*
+    ) => {
+        ast_enum!($(#[$enum_attr])* $pub $enum $name #$tag $body);
+        ast_enum_of_structs_impl!($pub $enum $name $body $($remaining)*);
+    };
+
+    (
+        $(#[$enum_attr:meta])*
+        $pub:ident $enum:ident $name:ident $body:tt
+        $($remaining:tt)*
+    ) => {
+        ast_enum!($(#[$enum_attr])* $pub $enum $name $body);
+        ast_enum_of_structs_impl!($pub $enum $name $body $($remaining)*);
+    };
+}
+
+macro_rules! ast_enum_of_structs_impl {
+    (
+        $pub:ident $enum:ident $name:ident {
+            $(
+                $(#[$variant_attr:meta])*
+                $variant:ident $( ($member:ident) )*,
+            )*
+        }
+
+        $($remaining:tt)*
+    ) => {
+        check_keyword_matches!(pub $pub);
+        check_keyword_matches!(enum $enum);
+
+        $($(
+            ast_enum_from_struct!($name::$variant, $member);
+        )*)*
+
+        #[cfg(feature = "printing")]
+        generate_to_tokens! {
+            $($remaining)*
+            ()
+            tokens
+            $name { $($variant $($member)*,)* }
+        }
+    };
+}
+
+macro_rules! ast_enum_from_struct {
+    // No From<TokenStream> for verbatim variants.
+    ($name:ident::Verbatim, $member:ident) => {};
+
+    ($name:ident::$variant:ident, $member:ident) => {
+        impl From<$member> for $name {
+            fn from(e: $member) -> $name {
+                $name::$variant(e)
+            }
+        }
+    };
+}
+
+#[cfg(feature = "printing")]
+macro_rules! generate_to_tokens {
+    (do_not_generate_to_tokens $($foo:tt)*) => ();
+
+    (($($arms:tt)*) $tokens:ident $name:ident { $variant:ident, $($next:tt)*}) => {
+        generate_to_tokens!(
+            ($($arms)* $name::$variant => {})
+            $tokens $name { $($next)* }
+        );
+    };
+
+    (($($arms:tt)*) $tokens:ident $name:ident { $variant:ident $member:ident, $($next:tt)*}) => {
+        generate_to_tokens!(
+            ($($arms)* $name::$variant(_e) => _e.to_tokens($tokens),)
+            $tokens $name { $($next)* }
+        );
+    };
+
+    (($($arms:tt)*) $tokens:ident $name:ident {}) => {
+        impl ::quote::ToTokens for $name {
+            fn to_tokens(&self, $tokens: &mut ::proc_macro2::TokenStream) {
+                match self {
+                    $($arms)*
+                }
+            }
+        }
+    };
+}
+
+macro_rules! strip_attrs_pub {
+    ($mac:ident!($(#[$m:meta])* $pub:ident $($t:tt)*)) => {
+        check_keyword_matches!(pub $pub);
+
+        $mac!([$(#[$m])* $pub] $($t)*);
+    };
+}
+
+macro_rules! check_keyword_matches {
+    (struct struct) => {};
+    (enum enum) => {};
+    (pub pub) => {};
+}
+
+
\ No newline at end of file diff --git a/src/syn/op.rs.html b/src/syn/op.rs.html new file mode 100644 index 0000000..a4b0a70 --- /dev/null +++ b/src/syn/op.rs.html @@ -0,0 +1,465 @@ +op.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+
+ast_enum! {
+    /// A binary operator: `+`, `+=`, `&`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    #[cfg_attr(feature = "clone-impls", derive(Copy))]
+    pub enum BinOp {
+        /// The `+` operator (addition)
+        Add(Token![+]),
+        /// The `-` operator (subtraction)
+        Sub(Token![-]),
+        /// The `*` operator (multiplication)
+        Mul(Token![*]),
+        /// The `/` operator (division)
+        Div(Token![/]),
+        /// The `%` operator (modulus)
+        Rem(Token![%]),
+        /// The `&&` operator (logical and)
+        And(Token![&&]),
+        /// The `||` operator (logical or)
+        Or(Token![||]),
+        /// The `^` operator (bitwise xor)
+        BitXor(Token![^]),
+        /// The `&` operator (bitwise and)
+        BitAnd(Token![&]),
+        /// The `|` operator (bitwise or)
+        BitOr(Token![|]),
+        /// The `<<` operator (shift left)
+        Shl(Token![<<]),
+        /// The `>>` operator (shift right)
+        Shr(Token![>>]),
+        /// The `==` operator (equality)
+        Eq(Token![==]),
+        /// The `<` operator (less than)
+        Lt(Token![<]),
+        /// The `<=` operator (less than or equal to)
+        Le(Token![<=]),
+        /// The `!=` operator (not equal to)
+        Ne(Token![!=]),
+        /// The `>=` operator (greater than or equal to)
+        Ge(Token![>=]),
+        /// The `>` operator (greater than)
+        Gt(Token![>]),
+        /// The `+=` operator
+        AddEq(Token![+=]),
+        /// The `-=` operator
+        SubEq(Token![-=]),
+        /// The `*=` operator
+        MulEq(Token![*=]),
+        /// The `/=` operator
+        DivEq(Token![/=]),
+        /// The `%=` operator
+        RemEq(Token![%=]),
+        /// The `^=` operator
+        BitXorEq(Token![^=]),
+        /// The `&=` operator
+        BitAndEq(Token![&=]),
+        /// The `|=` operator
+        BitOrEq(Token![|=]),
+        /// The `<<=` operator
+        ShlEq(Token![<<=]),
+        /// The `>>=` operator
+        ShrEq(Token![>>=]),
+    }
+}
+
+ast_enum! {
+    /// A unary operator: `*`, `!`, `-`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    #[cfg_attr(feature = "clone-impls", derive(Copy))]
+    pub enum UnOp {
+        /// The `*` operator for dereferencing
+        Deref(Token![*]),
+        /// The `!` operator for logical inversion
+        Not(Token![!]),
+        /// The `-` operator for negation
+        Neg(Token![-]),
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub mod parsing {
+    use super::*;
+
+    use crate::parse::{Parse, ParseStream, Result};
+
+    fn parse_binop(input: ParseStream) -> Result<BinOp> {
+        if input.peek(Token![&&]) {
+            input.parse().map(BinOp::And)
+        } else if input.peek(Token![||]) {
+            input.parse().map(BinOp::Or)
+        } else if input.peek(Token![<<]) {
+            input.parse().map(BinOp::Shl)
+        } else if input.peek(Token![>>]) {
+            input.parse().map(BinOp::Shr)
+        } else if input.peek(Token![==]) {
+            input.parse().map(BinOp::Eq)
+        } else if input.peek(Token![<=]) {
+            input.parse().map(BinOp::Le)
+        } else if input.peek(Token![!=]) {
+            input.parse().map(BinOp::Ne)
+        } else if input.peek(Token![>=]) {
+            input.parse().map(BinOp::Ge)
+        } else if input.peek(Token![+]) {
+            input.parse().map(BinOp::Add)
+        } else if input.peek(Token![-]) {
+            input.parse().map(BinOp::Sub)
+        } else if input.peek(Token![*]) {
+            input.parse().map(BinOp::Mul)
+        } else if input.peek(Token![/]) {
+            input.parse().map(BinOp::Div)
+        } else if input.peek(Token![%]) {
+            input.parse().map(BinOp::Rem)
+        } else if input.peek(Token![^]) {
+            input.parse().map(BinOp::BitXor)
+        } else if input.peek(Token![&]) {
+            input.parse().map(BinOp::BitAnd)
+        } else if input.peek(Token![|]) {
+            input.parse().map(BinOp::BitOr)
+        } else if input.peek(Token![<]) {
+            input.parse().map(BinOp::Lt)
+        } else if input.peek(Token![>]) {
+            input.parse().map(BinOp::Gt)
+        } else {
+            Err(input.error("expected binary operator"))
+        }
+    }
+
+    impl Parse for BinOp {
+        #[cfg(not(feature = "full"))]
+        fn parse(input: ParseStream) -> Result<Self> {
+            parse_binop(input)
+        }
+
+        #[cfg(feature = "full")]
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![+=]) {
+                input.parse().map(BinOp::AddEq)
+            } else if input.peek(Token![-=]) {
+                input.parse().map(BinOp::SubEq)
+            } else if input.peek(Token![*=]) {
+                input.parse().map(BinOp::MulEq)
+            } else if input.peek(Token![/=]) {
+                input.parse().map(BinOp::DivEq)
+            } else if input.peek(Token![%=]) {
+                input.parse().map(BinOp::RemEq)
+            } else if input.peek(Token![^=]) {
+                input.parse().map(BinOp::BitXorEq)
+            } else if input.peek(Token![&=]) {
+                input.parse().map(BinOp::BitAndEq)
+            } else if input.peek(Token![|=]) {
+                input.parse().map(BinOp::BitOrEq)
+            } else if input.peek(Token![<<=]) {
+                input.parse().map(BinOp::ShlEq)
+            } else if input.peek(Token![>>=]) {
+                input.parse().map(BinOp::ShrEq)
+            } else {
+                parse_binop(input)
+            }
+        }
+    }
+
+    impl Parse for UnOp {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let lookahead = input.lookahead1();
+            if lookahead.peek(Token![*]) {
+                input.parse().map(UnOp::Deref)
+            } else if lookahead.peek(Token![!]) {
+                input.parse().map(UnOp::Not)
+            } else if lookahead.peek(Token![-]) {
+                input.parse().map(UnOp::Neg)
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use super::*;
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+
+    impl ToTokens for BinOp {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                BinOp::Add(t) => t.to_tokens(tokens),
+                BinOp::Sub(t) => t.to_tokens(tokens),
+                BinOp::Mul(t) => t.to_tokens(tokens),
+                BinOp::Div(t) => t.to_tokens(tokens),
+                BinOp::Rem(t) => t.to_tokens(tokens),
+                BinOp::And(t) => t.to_tokens(tokens),
+                BinOp::Or(t) => t.to_tokens(tokens),
+                BinOp::BitXor(t) => t.to_tokens(tokens),
+                BinOp::BitAnd(t) => t.to_tokens(tokens),
+                BinOp::BitOr(t) => t.to_tokens(tokens),
+                BinOp::Shl(t) => t.to_tokens(tokens),
+                BinOp::Shr(t) => t.to_tokens(tokens),
+                BinOp::Eq(t) => t.to_tokens(tokens),
+                BinOp::Lt(t) => t.to_tokens(tokens),
+                BinOp::Le(t) => t.to_tokens(tokens),
+                BinOp::Ne(t) => t.to_tokens(tokens),
+                BinOp::Ge(t) => t.to_tokens(tokens),
+                BinOp::Gt(t) => t.to_tokens(tokens),
+                BinOp::AddEq(t) => t.to_tokens(tokens),
+                BinOp::SubEq(t) => t.to_tokens(tokens),
+                BinOp::MulEq(t) => t.to_tokens(tokens),
+                BinOp::DivEq(t) => t.to_tokens(tokens),
+                BinOp::RemEq(t) => t.to_tokens(tokens),
+                BinOp::BitXorEq(t) => t.to_tokens(tokens),
+                BinOp::BitAndEq(t) => t.to_tokens(tokens),
+                BinOp::BitOrEq(t) => t.to_tokens(tokens),
+                BinOp::ShlEq(t) => t.to_tokens(tokens),
+                BinOp::ShrEq(t) => t.to_tokens(tokens),
+            }
+        }
+    }
+
+    impl ToTokens for UnOp {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                UnOp::Deref(t) => t.to_tokens(tokens),
+                UnOp::Not(t) => t.to_tokens(tokens),
+                UnOp::Neg(t) => t.to_tokens(tokens),
+            }
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/parse.rs.html b/src/syn/parse.rs.html new file mode 100644 index 0000000..1357d71 --- /dev/null +++ b/src/syn/parse.rs.html @@ -0,0 +1,2447 @@ +parse.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+
+//! Parsing interface for parsing a token stream into a syntax tree node.
+//!
+//! Parsing in Syn is built on parser functions that take in a [`ParseStream`]
+//! and produce a [`Result<T>`] where `T` is some syntax tree node. Underlying
+//! these parser functions is a lower level mechanism built around the
+//! [`Cursor`] type. `Cursor` is a cheaply copyable cursor over a range of
+//! tokens in a token stream.
+//!
+//! [`ParseStream`]: type.ParseStream.html
+//! [`Result<T>`]: type.Result.html
+//! [`Cursor`]: ../buffer/index.html
+//!
+//! # Example
+//!
+//! Here is a snippet of parsing code to get a feel for the style of the
+//! library. We define data structures for a subset of Rust syntax including
+//! enums (not shown) and structs, then provide implementations of the [`Parse`]
+//! trait to parse these syntax tree data structures from a token stream.
+//!
+//! Once `Parse` impls have been defined, they can be called conveniently from a
+//! procedural macro through [`parse_macro_input!`] as shown at the bottom of
+//! the snippet. If the caller provides syntactically invalid input to the
+//! procedural macro, they will receive a helpful compiler error message
+//! pointing out the exact token that triggered the failure to parse.
+//!
+//! [`parse_macro_input!`]: ../macro.parse_macro_input.html
+//!
+//! ```
+//! extern crate proc_macro;
+//!
+//! use proc_macro::TokenStream;
+//! use syn::{braced, parse_macro_input, token, Field, Ident, Result, Token};
+//! use syn::parse::{Parse, ParseStream};
+//! use syn::punctuated::Punctuated;
+//!
+//! enum Item {
+//!     Struct(ItemStruct),
+//!     Enum(ItemEnum),
+//! }
+//!
+//! struct ItemStruct {
+//!     struct_token: Token![struct],
+//!     ident: Ident,
+//!     brace_token: token::Brace,
+//!     fields: Punctuated<Field, Token![,]>,
+//! }
+//! #
+//! # enum ItemEnum {}
+//!
+//! impl Parse for Item {
+//!     fn parse(input: ParseStream) -> Result<Self> {
+//!         let lookahead = input.lookahead1();
+//!         if lookahead.peek(Token![struct]) {
+//!             input.parse().map(Item::Struct)
+//!         } else if lookahead.peek(Token![enum]) {
+//!             input.parse().map(Item::Enum)
+//!         } else {
+//!             Err(lookahead.error())
+//!         }
+//!     }
+//! }
+//!
+//! impl Parse for ItemStruct {
+//!     fn parse(input: ParseStream) -> Result<Self> {
+//!         let content;
+//!         Ok(ItemStruct {
+//!             struct_token: input.parse()?,
+//!             ident: input.parse()?,
+//!             brace_token: braced!(content in input),
+//!             fields: content.parse_terminated(Field::parse_named)?,
+//!         })
+//!     }
+//! }
+//! #
+//! # impl Parse for ItemEnum {
+//! #     fn parse(input: ParseStream) -> Result<Self> {
+//! #         unimplemented!()
+//! #     }
+//! # }
+//!
+//! # const IGNORE: &str = stringify! {
+//! #[proc_macro]
+//! # };
+//! pub fn my_macro(tokens: TokenStream) -> TokenStream {
+//!     let input = parse_macro_input!(tokens as Item);
+//!
+//!     /* ... */
+//! #   "".parse().unwrap()
+//! }
+//! ```
+//!
+//! # The `syn::parse*` functions
+//!
+//! The [`syn::parse`], [`syn::parse2`], and [`syn::parse_str`] functions serve
+//! as an entry point for parsing syntax tree nodes that can be parsed in an
+//! obvious default way. These functions can return any syntax tree node that
+//! implements the [`Parse`] trait, which includes most types in Syn.
+//!
+//! [`syn::parse`]: ../fn.parse.html
+//! [`syn::parse2`]: ../fn.parse2.html
+//! [`syn::parse_str`]: ../fn.parse_str.html
+//! [`Parse`]: trait.Parse.html
+//!
+//! ```
+//! use syn::Type;
+//!
+//! # fn run_parser() -> syn::Result<()> {
+//! let t: Type = syn::parse_str("std::collections::HashMap<String, Value>")?;
+//! #     Ok(())
+//! # }
+//! #
+//! # run_parser().unwrap();
+//! ```
+//!
+//! The [`parse_quote!`] macro also uses this approach.
+//!
+//! [`parse_quote!`]: ../macro.parse_quote.html
+//!
+//! # The `Parser` trait
+//!
+//! Some types can be parsed in several ways depending on context. For example
+//! an [`Attribute`] can be either "outer" like `#[...]` or "inner" like
+//! `#![...]` and parsing the wrong one would be a bug. Similarly [`Punctuated`]
+//! may or may not allow trailing punctuation, and parsing it the wrong way
+//! would either reject valid input or accept invalid input.
+//!
+//! [`Attribute`]: ../struct.Attribute.html
+//! [`Punctuated`]: ../punctuated/index.html
+//!
+//! The `Parse` trait is not implemented in these cases because there is no good
+//! behavior to consider the default.
+//!
+//! ```compile_fail
+//! # extern crate proc_macro;
+//! #
+//! # use syn::punctuated::Punctuated;
+//! # use syn::{PathSegment, Result, Token};
+//! #
+//! # fn f(tokens: proc_macro::TokenStream) -> Result<()> {
+//! #
+//! // Can't parse `Punctuated` without knowing whether trailing punctuation
+//! // should be allowed in this context.
+//! let path: Punctuated<PathSegment, Token![::]> = syn::parse(tokens)?;
+//! #
+//! #     Ok(())
+//! # }
+//! ```
+//!
+//! In these cases the types provide a choice of parser functions rather than a
+//! single `Parse` implementation, and those parser functions can be invoked
+//! through the [`Parser`] trait.
+//!
+//! [`Parser`]: trait.Parser.html
+//!
+//! ```
+//! extern crate proc_macro;
+//!
+//! use proc_macro::TokenStream;
+//! use syn::parse::Parser;
+//! use syn::punctuated::Punctuated;
+//! use syn::{Attribute, Expr, PathSegment, Result, Token};
+//!
+//! fn call_some_parser_methods(input: TokenStream) -> Result<()> {
+//!     // Parse a nonempty sequence of path segments separated by `::` punctuation
+//!     // with no trailing punctuation.
+//!     let tokens = input.clone();
+//!     let parser = Punctuated::<PathSegment, Token![::]>::parse_separated_nonempty;
+//!     let _path = parser.parse(tokens)?;
+//!
+//!     // Parse a possibly empty sequence of expressions terminated by commas with
+//!     // an optional trailing punctuation.
+//!     let tokens = input.clone();
+//!     let parser = Punctuated::<Expr, Token![,]>::parse_terminated;
+//!     let _args = parser.parse(tokens)?;
+//!
+//!     // Parse zero or more outer attributes but not inner attributes.
+//!     let tokens = input.clone();
+//!     let parser = Attribute::parse_outer;
+//!     let _attrs = parser.parse(tokens)?;
+//!
+//!     Ok(())
+//! }
+//! ```
+//!
+//! ---
+//!
+//! *This module is available if Syn is built with the `"parsing"` feature.*
+
+#[path = "discouraged.rs"]
+pub mod discouraged;
+
+use std::cell::Cell;
+use std::fmt::{self, Debug, Display};
+use std::marker::PhantomData;
+use std::mem;
+use std::ops::Deref;
+use std::rc::Rc;
+use std::str::FromStr;
+
+#[cfg(all(
+    not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
+    feature = "proc-macro"
+))]
+use crate::proc_macro;
+use proc_macro2::{self, Delimiter, Group, Literal, Punct, Span, TokenStream, TokenTree};
+
+use crate::buffer::{Cursor, TokenBuffer};
+use crate::error;
+use crate::lookahead;
+use crate::punctuated::Punctuated;
+use crate::token::Token;
+
+pub use crate::error::{Error, Result};
+pub use crate::lookahead::{Lookahead1, Peek};
+
+/// Parsing interface implemented by all types that can be parsed in a default
+/// way from a token stream.
+pub trait Parse: Sized {
+    fn parse(input: ParseStream) -> Result<Self>;
+}
+
+/// Input to a Syn parser function.
+///
+/// See the methods of this type under the documentation of [`ParseBuffer`]. For
+/// an overview of parsing in Syn, refer to the [module documentation].
+///
+/// [module documentation]: self
+pub type ParseStream<'a> = &'a ParseBuffer<'a>;
+
+/// Cursor position within a buffered token stream.
+///
+/// This type is more commonly used through the type alias [`ParseStream`] which
+/// is an alias for `&ParseBuffer`.
+///
+/// `ParseStream` is the input type for all parser functions in Syn. They have
+/// the signature `fn(ParseStream) -> Result<T>`.
+///
+/// ## Calling a parser function
+///
+/// There is no public way to construct a `ParseBuffer`. Instead, if you are
+/// looking to invoke a parser function that requires `ParseStream` as input,
+/// you will need to go through one of the public parsing entry points.
+///
+/// - The [`parse_macro_input!`] macro if parsing input of a procedural macro;
+/// - One of [the `syn::parse*` functions][syn-parse]; or
+/// - A method of the [`Parser`] trait.
+///
+/// [syn-parse]: index.html#the-synparse-functions
+pub struct ParseBuffer<'a> {
+    scope: Span,
+    // Instead of Cell<Cursor<'a>> so that ParseBuffer<'a> is covariant in 'a.
+    // The rest of the code in this module needs to be careful that only a
+    // cursor derived from this `cell` is ever assigned to this `cell`.
+    //
+    // Cell<Cursor<'a>> cannot be covariant in 'a because then we could take a
+    // ParseBuffer<'a>, upcast to ParseBuffer<'short> for some lifetime shorter
+    // than 'a, and then assign a Cursor<'short> into the Cell.
+    //
+    // By extension, it would not be safe to expose an API that accepts a
+    // Cursor<'a> and trusts that it lives as long as the cursor currently in
+    // the cell.
+    cell: Cell<Cursor<'static>>,
+    marker: PhantomData<Cursor<'a>>,
+    unexpected: Cell<Option<Rc<Cell<Unexpected>>>>,
+}
+
+impl<'a> Drop for ParseBuffer<'a> {
+    fn drop(&mut self) {
+        if !self.is_empty() {
+            let (inner, old_span) = inner_unexpected(self);
+            if old_span.is_none() {
+                inner.set(Unexpected::Some(self.cursor().span()));
+            }
+        }
+    }
+}
+
+impl<'a> Display for ParseBuffer<'a> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.cursor().token_stream(), f)
+    }
+}
+
+impl<'a> Debug for ParseBuffer<'a> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.cursor().token_stream(), f)
+    }
+}
+
+/// Cursor state associated with speculative parsing.
+///
+/// This type is the input of the closure provided to [`ParseStream::step`].
+///
+/// [`ParseStream::step`]: ParseBuffer::step
+///
+/// # Example
+///
+/// ```
+/// use proc_macro2::TokenTree;
+/// use syn::Result;
+/// use syn::parse::ParseStream;
+///
+/// // This function advances the stream past the next occurrence of `@`. If
+/// // no `@` is present in the stream, the stream position is unchanged and
+/// // an error is returned.
+/// fn skip_past_next_at(input: ParseStream) -> Result<()> {
+///     input.step(|cursor| {
+///         let mut rest = *cursor;
+///         while let Some((tt, next)) = rest.token_tree() {
+///             match &tt {
+///                 TokenTree::Punct(punct) if punct.as_char() == '@' => {
+///                     return Ok(((), next));
+///                 }
+///                 _ => rest = next,
+///             }
+///         }
+///         Err(cursor.error("no `@` was found after this point"))
+///     })
+/// }
+/// #
+/// # fn remainder_after_skipping_past_next_at(
+/// #     input: ParseStream,
+/// # ) -> Result<proc_macro2::TokenStream> {
+/// #     skip_past_next_at(input)?;
+/// #     input.parse()
+/// # }
+/// #
+/// # use syn::parse::Parser;
+/// # let remainder = remainder_after_skipping_past_next_at
+/// #     .parse_str("a @ b c")
+/// #     .unwrap();
+/// # assert_eq!(remainder.to_string(), "b c");
+/// ```
+#[derive(Copy, Clone)]
+pub struct StepCursor<'c, 'a> {
+    scope: Span,
+    // This field is covariant in 'c.
+    cursor: Cursor<'c>,
+    // This field is contravariant in 'c. Together these make StepCursor
+    // invariant in 'c. Also covariant in 'a. The user cannot cast 'c to a
+    // different lifetime but can upcast into a StepCursor with a shorter
+    // lifetime 'a.
+    //
+    // As long as we only ever construct a StepCursor for which 'c outlives 'a,
+    // this means if ever a StepCursor<'c, 'a> exists we are guaranteed that 'c
+    // outlives 'a.
+    marker: PhantomData<fn(Cursor<'c>) -> Cursor<'a>>,
+}
+
+impl<'c, 'a> Deref for StepCursor<'c, 'a> {
+    type Target = Cursor<'c>;
+
+    fn deref(&self) -> &Self::Target {
+        &self.cursor
+    }
+}
+
+impl<'c, 'a> StepCursor<'c, 'a> {
+    /// Triggers an error at the current position of the parse stream.
+    ///
+    /// The `ParseStream::step` invocation will return this same error without
+    /// advancing the stream state.
+    pub fn error<T: Display>(self, message: T) -> Error {
+        error::new_at(self.scope, self.cursor, message)
+    }
+}
+
+pub(crate) fn advance_step_cursor<'c, 'a>(proof: StepCursor<'c, 'a>, to: Cursor<'c>) -> Cursor<'a> {
+    // Refer to the comments within the StepCursor definition. We use the
+    // fact that a StepCursor<'c, 'a> exists as proof that 'c outlives 'a.
+    // Cursor is covariant in its lifetime parameter so we can cast a
+    // Cursor<'c> to one with the shorter lifetime Cursor<'a>.
+    let _ = proof;
+    unsafe { mem::transmute::<Cursor<'c>, Cursor<'a>>(to) }
+}
+
+pub(crate) fn new_parse_buffer(
+    scope: Span,
+    cursor: Cursor,
+    unexpected: Rc<Cell<Unexpected>>,
+) -> ParseBuffer {
+    ParseBuffer {
+        scope,
+        // See comment on `cell` in the struct definition.
+        cell: Cell::new(unsafe { mem::transmute::<Cursor, Cursor<'static>>(cursor) }),
+        marker: PhantomData,
+        unexpected: Cell::new(Some(unexpected)),
+    }
+}
+
+#[derive(Clone)]
+pub(crate) enum Unexpected {
+    None,
+    Some(Span),
+    Chain(Rc<Cell<Unexpected>>),
+}
+
+impl Default for Unexpected {
+    fn default() -> Self {
+        Unexpected::None
+    }
+}
+
+// We call this on Cell<Unexpected> and Cell<Option<T>> where temporarily
+// swapping in a None is cheap.
+fn cell_clone<T: Default + Clone>(cell: &Cell<T>) -> T {
+    let prev = cell.take();
+    let ret = prev.clone();
+    cell.set(prev);
+    ret
+}
+
+fn inner_unexpected(buffer: &ParseBuffer) -> (Rc<Cell<Unexpected>>, Option<Span>) {
+    let mut unexpected = get_unexpected(buffer);
+    loop {
+        match cell_clone(&unexpected) {
+            Unexpected::None => return (unexpected, None),
+            Unexpected::Some(span) => return (unexpected, Some(span)),
+            Unexpected::Chain(next) => unexpected = next,
+        }
+    }
+}
+
+pub(crate) fn get_unexpected(buffer: &ParseBuffer) -> Rc<Cell<Unexpected>> {
+    cell_clone(&buffer.unexpected).unwrap()
+}
+
+impl<'a> ParseBuffer<'a> {
+    /// Parses a syntax tree node of type `T`, advancing the position of our
+    /// parse stream past it.
+    pub fn parse<T: Parse>(&self) -> Result<T> {
+        T::parse(self)
+    }
+
+    /// Calls the given parser function to parse a syntax tree node of type `T`
+    /// from this stream.
+    ///
+    /// # Example
+    ///
+    /// The parser below invokes [`Attribute::parse_outer`] to parse a vector of
+    /// zero or more outer attributes.
+    ///
+    /// [`Attribute::parse_outer`]: crate::Attribute::parse_outer
+    ///
+    /// ```
+    /// use syn::{Attribute, Ident, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Parses a unit struct with attributes.
+    /// //
+    /// //     #[path = "s.tmpl"]
+    /// //     struct S;
+    /// struct UnitStruct {
+    ///     attrs: Vec<Attribute>,
+    ///     struct_token: Token![struct],
+    ///     name: Ident,
+    ///     semi_token: Token![;],
+    /// }
+    ///
+    /// impl Parse for UnitStruct {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         Ok(UnitStruct {
+    ///             attrs: input.call(Attribute::parse_outer)?,
+    ///             struct_token: input.parse()?,
+    ///             name: input.parse()?,
+    ///             semi_token: input.parse()?,
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    pub fn call<T>(&self, function: fn(ParseStream) -> Result<T>) -> Result<T> {
+        function(self)
+    }
+
+    /// Looks at the next token in the parse stream to determine whether it
+    /// matches the requested type of token.
+    ///
+    /// Does not advance the position of the parse stream.
+    ///
+    /// # Syntax
+    ///
+    /// Note that this method does not use turbofish syntax. Pass the peek type
+    /// inside of parentheses.
+    ///
+    /// - `input.peek(Token![struct])`
+    /// - `input.peek(Token![==])`
+    /// - `input.peek(Ident)`&emsp;*(does not accept keywords)*
+    /// - `input.peek(Ident::peek_any)`
+    /// - `input.peek(Lifetime)`
+    /// - `input.peek(token::Brace)`
+    ///
+    /// # Example
+    ///
+    /// In this example we finish parsing the list of supertraits when the next
+    /// token in the input is either `where` or an opening curly brace.
+    ///
+    /// ```
+    /// use syn::{braced, token, Generics, Ident, Result, Token, TypeParamBound};
+    /// use syn::parse::{Parse, ParseStream};
+    /// use syn::punctuated::Punctuated;
+    ///
+    /// // Parses a trait definition containing no associated items.
+    /// //
+    /// //     trait Marker<'de, T>: A + B<'de> where Box<T>: Clone {}
+    /// struct MarkerTrait {
+    ///     trait_token: Token![trait],
+    ///     ident: Ident,
+    ///     generics: Generics,
+    ///     colon_token: Option<Token![:]>,
+    ///     supertraits: Punctuated<TypeParamBound, Token![+]>,
+    ///     brace_token: token::Brace,
+    /// }
+    ///
+    /// impl Parse for MarkerTrait {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let trait_token: Token![trait] = input.parse()?;
+    ///         let ident: Ident = input.parse()?;
+    ///         let mut generics: Generics = input.parse()?;
+    ///         let colon_token: Option<Token![:]> = input.parse()?;
+    ///
+    ///         let mut supertraits = Punctuated::new();
+    ///         if colon_token.is_some() {
+    ///             loop {
+    ///                 supertraits.push_value(input.parse()?);
+    ///                 if input.peek(Token![where]) || input.peek(token::Brace) {
+    ///                     break;
+    ///                 }
+    ///                 supertraits.push_punct(input.parse()?);
+    ///             }
+    ///         }
+    ///
+    ///         generics.where_clause = input.parse()?;
+    ///         let content;
+    ///         let empty_brace_token = braced!(content in input);
+    ///
+    ///         Ok(MarkerTrait {
+    ///             trait_token,
+    ///             ident,
+    ///             generics,
+    ///             colon_token,
+    ///             supertraits,
+    ///             brace_token: empty_brace_token,
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    pub fn peek<T: Peek>(&self, token: T) -> bool {
+        let _ = token;
+        T::Token::peek(self.cursor())
+    }
+
+    /// Looks at the second-next token in the parse stream.
+    ///
+    /// This is commonly useful as a way to implement contextual keywords.
+    ///
+    /// # Example
+    ///
+    /// This example needs to use `peek2` because the symbol `union` is not a
+    /// keyword in Rust. We can't use just `peek` and decide to parse a union if
+    /// the very next token is `union`, because someone is free to write a `mod
+    /// union` and a macro invocation that looks like `union::some_macro! { ...
+    /// }`. In other words `union` is a contextual keyword.
+    ///
+    /// ```
+    /// use syn::{Ident, ItemUnion, Macro, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Parses either a union or a macro invocation.
+    /// enum UnionOrMacro {
+    ///     // union MaybeUninit<T> { uninit: (), value: T }
+    ///     Union(ItemUnion),
+    ///     // lazy_static! { ... }
+    ///     Macro(Macro),
+    /// }
+    ///
+    /// impl Parse for UnionOrMacro {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         if input.peek(Token![union]) && input.peek2(Ident) {
+    ///             input.parse().map(UnionOrMacro::Union)
+    ///         } else {
+    ///             input.parse().map(UnionOrMacro::Macro)
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    pub fn peek2<T: Peek>(&self, token: T) -> bool {
+        let _ = token;
+        self.cursor().skip().map_or(false, T::Token::peek)
+    }
+
+    /// Looks at the third-next token in the parse stream.
+    pub fn peek3<T: Peek>(&self, token: T) -> bool {
+        let _ = token;
+        self.cursor()
+            .skip()
+            .and_then(Cursor::skip)
+            .map_or(false, T::Token::peek)
+    }
+
+    /// Parses zero or more occurrences of `T` separated by punctuation of type
+    /// `P`, with optional trailing punctuation.
+    ///
+    /// Parsing continues until the end of this parse stream. The entire content
+    /// of this parse stream must consist of `T` and `P`.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// # use quote::quote;
+    /// #
+    /// use syn::{parenthesized, token, Ident, Result, Token, Type};
+    /// use syn::parse::{Parse, ParseStream};
+    /// use syn::punctuated::Punctuated;
+    ///
+    /// // Parse a simplified tuple struct syntax like:
+    /// //
+    /// //     struct S(A, B);
+    /// struct TupleStruct {
+    ///     struct_token: Token![struct],
+    ///     ident: Ident,
+    ///     paren_token: token::Paren,
+    ///     fields: Punctuated<Type, Token![,]>,
+    ///     semi_token: Token![;],
+    /// }
+    ///
+    /// impl Parse for TupleStruct {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let content;
+    ///         Ok(TupleStruct {
+    ///             struct_token: input.parse()?,
+    ///             ident: input.parse()?,
+    ///             paren_token: parenthesized!(content in input),
+    ///             fields: content.parse_terminated(Type::parse)?,
+    ///             semi_token: input.parse()?,
+    ///         })
+    ///     }
+    /// }
+    /// #
+    /// # let input = quote! {
+    /// #     struct S(A, B);
+    /// # };
+    /// # syn::parse2::<TupleStruct>(input).unwrap();
+    /// ```
+    pub fn parse_terminated<T, P: Parse>(
+        &self,
+        parser: fn(ParseStream) -> Result<T>,
+    ) -> Result<Punctuated<T, P>> {
+        Punctuated::parse_terminated_with(self, parser)
+    }
+
+    /// Returns whether there are tokens remaining in this stream.
+    ///
+    /// This method returns true at the end of the content of a set of
+    /// delimiters, as well as at the very end of the complete macro input.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{braced, token, Ident, Item, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Parses a Rust `mod m { ... }` containing zero or more items.
+    /// struct Mod {
+    ///     mod_token: Token![mod],
+    ///     name: Ident,
+    ///     brace_token: token::Brace,
+    ///     items: Vec<Item>,
+    /// }
+    ///
+    /// impl Parse for Mod {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let content;
+    ///         Ok(Mod {
+    ///             mod_token: input.parse()?,
+    ///             name: input.parse()?,
+    ///             brace_token: braced!(content in input),
+    ///             items: {
+    ///                 let mut items = Vec::new();
+    ///                 while !content.is_empty() {
+    ///                     items.push(content.parse()?);
+    ///                 }
+    ///                 items
+    ///             },
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    pub fn is_empty(&self) -> bool {
+        self.cursor().eof()
+    }
+
+    /// Constructs a helper for peeking at the next token in this stream and
+    /// building an error message if it is not one of a set of expected tokens.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{ConstParam, Ident, Lifetime, LifetimeDef, Result, Token, TypeParam};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // A generic parameter, a single one of the comma-separated elements inside
+    /// // angle brackets in:
+    /// //
+    /// //     fn f<T: Clone, 'a, 'b: 'a, const N: usize>() { ... }
+    /// //
+    /// // On invalid input, lookahead gives us a reasonable error message.
+    /// //
+    /// //     error: expected one of: identifier, lifetime, `const`
+    /// //       |
+    /// //     5 |     fn f<!Sized>() {}
+    /// //       |          ^
+    /// enum GenericParam {
+    ///     Type(TypeParam),
+    ///     Lifetime(LifetimeDef),
+    ///     Const(ConstParam),
+    /// }
+    ///
+    /// impl Parse for GenericParam {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let lookahead = input.lookahead1();
+    ///         if lookahead.peek(Ident) {
+    ///             input.parse().map(GenericParam::Type)
+    ///         } else if lookahead.peek(Lifetime) {
+    ///             input.parse().map(GenericParam::Lifetime)
+    ///         } else if lookahead.peek(Token![const]) {
+    ///             input.parse().map(GenericParam::Const)
+    ///         } else {
+    ///             Err(lookahead.error())
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    pub fn lookahead1(&self) -> Lookahead1<'a> {
+        lookahead::new(self.scope, self.cursor())
+    }
+
+    /// Forks a parse stream so that parsing tokens out of either the original
+    /// or the fork does not advance the position of the other.
+    ///
+    /// # Performance
+    ///
+    /// Forking a parse stream is a cheap fixed amount of work and does not
+    /// involve copying token buffers. Where you might hit performance problems
+    /// is if your macro ends up parsing a large amount of content more than
+    /// once.
+    ///
+    /// ```
+    /// # use syn::{Expr, Result};
+    /// # use syn::parse::ParseStream;
+    /// #
+    /// # fn bad(input: ParseStream) -> Result<Expr> {
+    /// // Do not do this.
+    /// if input.fork().parse::<Expr>().is_ok() {
+    ///     return input.parse::<Expr>();
+    /// }
+    /// # unimplemented!()
+    /// # }
+    /// ```
+    ///
+    /// As a rule, avoid parsing an unbounded amount of tokens out of a forked
+    /// parse stream. Only use a fork when the amount of work performed against
+    /// the fork is small and bounded.
+    ///
+    /// When complex speculative parsing against the forked stream is
+    /// unavoidable, use [`parse::discouraged::Speculative`] to advance the
+    /// original stream once the fork's parse is determined to have been
+    /// successful.
+    ///
+    /// For a lower level way to perform speculative parsing at the token level,
+    /// consider using [`ParseStream::step`] instead.
+    ///
+    /// [`parse::discouraged::Speculative`]: discouraged::Speculative
+    /// [`ParseStream::step`]: ParseBuffer::step
+    ///
+    /// # Example
+    ///
+    /// The parse implementation shown here parses possibly restricted `pub`
+    /// visibilities.
+    ///
+    /// - `pub`
+    /// - `pub(crate)`
+    /// - `pub(self)`
+    /// - `pub(super)`
+    /// - `pub(in some::path)`
+    ///
+    /// To handle the case of visibilities inside of tuple structs, the parser
+    /// needs to distinguish parentheses that specify visibility restrictions
+    /// from parentheses that form part of a tuple type.
+    ///
+    /// ```
+    /// # struct A;
+    /// # struct B;
+    /// # struct C;
+    /// #
+    /// struct S(pub(crate) A, pub (B, C));
+    /// ```
+    ///
+    /// In this example input the first tuple struct element of `S` has
+    /// `pub(crate)` visibility while the second tuple struct element has `pub`
+    /// visibility; the parentheses around `(B, C)` are part of the type rather
+    /// than part of a visibility restriction.
+    ///
+    /// The parser uses a forked parse stream to check the first token inside of
+    /// parentheses after the `pub` keyword. This is a small bounded amount of
+    /// work performed against the forked parse stream.
+    ///
+    /// ```
+    /// use syn::{parenthesized, token, Ident, Path, Result, Token};
+    /// use syn::ext::IdentExt;
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// struct PubVisibility {
+    ///     pub_token: Token![pub],
+    ///     restricted: Option<Restricted>,
+    /// }
+    ///
+    /// struct Restricted {
+    ///     paren_token: token::Paren,
+    ///     in_token: Option<Token![in]>,
+    ///     path: Path,
+    /// }
+    ///
+    /// impl Parse for PubVisibility {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let pub_token: Token![pub] = input.parse()?;
+    ///
+    ///         if input.peek(token::Paren) {
+    ///             let ahead = input.fork();
+    ///             let mut content;
+    ///             parenthesized!(content in ahead);
+    ///
+    ///             if content.peek(Token![crate])
+    ///                 || content.peek(Token![self])
+    ///                 || content.peek(Token![super])
+    ///             {
+    ///                 return Ok(PubVisibility {
+    ///                     pub_token,
+    ///                     restricted: Some(Restricted {
+    ///                         paren_token: parenthesized!(content in input),
+    ///                         in_token: None,
+    ///                         path: Path::from(content.call(Ident::parse_any)?),
+    ///                     }),
+    ///                 });
+    ///             } else if content.peek(Token![in]) {
+    ///                 return Ok(PubVisibility {
+    ///                     pub_token,
+    ///                     restricted: Some(Restricted {
+    ///                         paren_token: parenthesized!(content in input),
+    ///                         in_token: Some(content.parse()?),
+    ///                         path: content.call(Path::parse_mod_style)?,
+    ///                     }),
+    ///                 });
+    ///             }
+    ///         }
+    ///
+    ///         Ok(PubVisibility {
+    ///             pub_token,
+    ///             restricted: None,
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    pub fn fork(&self) -> Self {
+        ParseBuffer {
+            scope: self.scope,
+            cell: self.cell.clone(),
+            marker: PhantomData,
+            // Not the parent's unexpected. Nothing cares whether the clone
+            // parses all the way unless we `advance_to`.
+            unexpected: Cell::new(Some(Rc::new(Cell::new(Unexpected::None)))),
+        }
+    }
+
+    /// Triggers an error at the current position of the parse stream.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{Expr, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Some kind of loop: `while` or `for` or `loop`.
+    /// struct Loop {
+    ///     expr: Expr,
+    /// }
+    ///
+    /// impl Parse for Loop {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         if input.peek(Token![while])
+    ///             || input.peek(Token![for])
+    ///             || input.peek(Token![loop])
+    ///         {
+    ///             Ok(Loop {
+    ///                 expr: input.parse()?,
+    ///             })
+    ///         } else {
+    ///             Err(input.error("expected some kind of loop"))
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    pub fn error<T: Display>(&self, message: T) -> Error {
+        error::new_at(self.scope, self.cursor(), message)
+    }
+
+    /// Speculatively parses tokens from this parse stream, advancing the
+    /// position of this stream only if parsing succeeds.
+    ///
+    /// This is a powerful low-level API used for defining the `Parse` impls of
+    /// the basic built-in token types. It is not something that will be used
+    /// widely outside of the Syn codebase.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use proc_macro2::TokenTree;
+    /// use syn::Result;
+    /// use syn::parse::ParseStream;
+    ///
+    /// // This function advances the stream past the next occurrence of `@`. If
+    /// // no `@` is present in the stream, the stream position is unchanged and
+    /// // an error is returned.
+    /// fn skip_past_next_at(input: ParseStream) -> Result<()> {
+    ///     input.step(|cursor| {
+    ///         let mut rest = *cursor;
+    ///         while let Some((tt, next)) = rest.token_tree() {
+    ///             match &tt {
+    ///                 TokenTree::Punct(punct) if punct.as_char() == '@' => {
+    ///                     return Ok(((), next));
+    ///                 }
+    ///                 _ => rest = next,
+    ///             }
+    ///         }
+    ///         Err(cursor.error("no `@` was found after this point"))
+    ///     })
+    /// }
+    /// #
+    /// # fn remainder_after_skipping_past_next_at(
+    /// #     input: ParseStream,
+    /// # ) -> Result<proc_macro2::TokenStream> {
+    /// #     skip_past_next_at(input)?;
+    /// #     input.parse()
+    /// # }
+    /// #
+    /// # use syn::parse::Parser;
+    /// # let remainder = remainder_after_skipping_past_next_at
+    /// #     .parse_str("a @ b c")
+    /// #     .unwrap();
+    /// # assert_eq!(remainder.to_string(), "b c");
+    /// ```
+    pub fn step<F, R>(&self, function: F) -> Result<R>
+    where
+        F: for<'c> FnOnce(StepCursor<'c, 'a>) -> Result<(R, Cursor<'c>)>,
+    {
+        // Since the user's function is required to work for any 'c, we know
+        // that the Cursor<'c> they return is either derived from the input
+        // StepCursor<'c, 'a> or from a Cursor<'static>.
+        //
+        // It would not be legal to write this function without the invariant
+        // lifetime 'c in StepCursor<'c, 'a>. If this function were written only
+        // in terms of 'a, the user could take our ParseBuffer<'a>, upcast it to
+        // a ParseBuffer<'short> which some shorter lifetime than 'a, invoke
+        // `step` on their ParseBuffer<'short> with a closure that returns
+        // Cursor<'short>, and we would wrongly write that Cursor<'short> into
+        // the Cell intended to hold Cursor<'a>.
+        //
+        // In some cases it may be necessary for R to contain a Cursor<'a>.
+        // Within Syn we solve this using `advance_step_cursor` which uses the
+        // existence of a StepCursor<'c, 'a> as proof that it is safe to cast
+        // from Cursor<'c> to Cursor<'a>. If needed outside of Syn, it would be
+        // safe to expose that API as a method on StepCursor.
+        let (node, rest) = function(StepCursor {
+            scope: self.scope,
+            cursor: self.cell.get(),
+            marker: PhantomData,
+        })?;
+        self.cell.set(rest);
+        Ok(node)
+    }
+
+    /// Returns the `Span` of the next token in the parse stream, or
+    /// `Span::call_site()` if this parse stream has completely exhausted its
+    /// input `TokenStream`.
+    pub fn span(&self) -> Span {
+        let cursor = self.cursor();
+        if cursor.eof() {
+            self.scope
+        } else {
+            crate::buffer::open_span_of_group(cursor)
+        }
+    }
+
+    /// Provides low-level access to the token representation underlying this
+    /// parse stream.
+    ///
+    /// Cursors are immutable so no operations you perform against the cursor
+    /// will affect the state of this parse stream.
+    pub fn cursor(&self) -> Cursor<'a> {
+        self.cell.get()
+    }
+
+    fn check_unexpected(&self) -> Result<()> {
+        match inner_unexpected(self).1 {
+            Some(span) => Err(Error::new(span, "unexpected token")),
+            None => Ok(()),
+        }
+    }
+}
+
+impl<T: Parse> Parse for Box<T> {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.parse().map(Box::new)
+    }
+}
+
+impl<T: Parse + Token> Parse for Option<T> {
+    fn parse(input: ParseStream) -> Result<Self> {
+        if T::peek(input.cursor()) {
+            Ok(Some(input.parse()?))
+        } else {
+            Ok(None)
+        }
+    }
+}
+
+impl Parse for TokenStream {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| Ok((cursor.token_stream(), Cursor::empty())))
+    }
+}
+
+impl Parse for TokenTree {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| match cursor.token_tree() {
+            Some((tt, rest)) => Ok((tt, rest)),
+            None => Err(cursor.error("expected token tree")),
+        })
+    }
+}
+
+impl Parse for Group {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| {
+            for delim in &[Delimiter::Parenthesis, Delimiter::Brace, Delimiter::Bracket] {
+                if let Some((inside, span, rest)) = cursor.group(*delim) {
+                    let mut group = Group::new(*delim, inside.token_stream());
+                    group.set_span(span);
+                    return Ok((group, rest));
+                }
+            }
+            Err(cursor.error("expected group token"))
+        })
+    }
+}
+
+impl Parse for Punct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| match cursor.punct() {
+            Some((punct, rest)) => Ok((punct, rest)),
+            None => Err(cursor.error("expected punctuation token")),
+        })
+    }
+}
+
+impl Parse for Literal {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| match cursor.literal() {
+            Some((literal, rest)) => Ok((literal, rest)),
+            None => Err(cursor.error("expected literal token")),
+        })
+    }
+}
+
+/// Parser that can parse Rust tokens into a particular syntax tree node.
+///
+/// Refer to the [module documentation] for details about parsing in Syn.
+///
+/// [module documentation]: self
+///
+/// *This trait is available if Syn is built with the `"parsing"` feature.*
+pub trait Parser: Sized {
+    type Output;
+
+    /// Parse a proc-macro2 token stream into the chosen syntax tree node.
+    ///
+    /// This function will check that the input is fully parsed. If there are
+    /// any unparsed tokens at the end of the stream, an error is returned.
+    fn parse2(self, tokens: TokenStream) -> Result<Self::Output>;
+
+    /// Parse tokens of source code into the chosen syntax tree node.
+    ///
+    /// This function will check that the input is fully parsed. If there are
+    /// any unparsed tokens at the end of the stream, an error is returned.
+    ///
+    /// *This method is available if Syn is built with both the `"parsing"` and
+    /// `"proc-macro"` features.*
+    #[cfg(all(
+        not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
+        feature = "proc-macro"
+    ))]
+    fn parse(self, tokens: proc_macro::TokenStream) -> Result<Self::Output> {
+        self.parse2(proc_macro2::TokenStream::from(tokens))
+    }
+
+    /// Parse a string of Rust code into the chosen syntax tree node.
+    ///
+    /// This function will check that the input is fully parsed. If there are
+    /// any unparsed tokens at the end of the string, an error is returned.
+    ///
+    /// # Hygiene
+    ///
+    /// Every span in the resulting syntax tree will be set to resolve at the
+    /// macro call site.
+    fn parse_str(self, s: &str) -> Result<Self::Output> {
+        self.parse2(proc_macro2::TokenStream::from_str(s)?)
+    }
+
+    // Not public API.
+    #[doc(hidden)]
+    fn __parse_scoped(self, scope: Span, tokens: TokenStream) -> Result<Self::Output> {
+        let _ = scope;
+        self.parse2(tokens)
+    }
+
+    // Not public API.
+    #[doc(hidden)]
+    fn __parse_stream(self, input: ParseStream) -> Result<Self::Output> {
+        input.parse().and_then(|tokens| self.parse2(tokens))
+    }
+}
+
+fn tokens_to_parse_buffer(tokens: &TokenBuffer) -> ParseBuffer {
+    let scope = Span::call_site();
+    let cursor = tokens.begin();
+    let unexpected = Rc::new(Cell::new(Unexpected::None));
+    new_parse_buffer(scope, cursor, unexpected)
+}
+
+impl<F, T> Parser for F
+where
+    F: FnOnce(ParseStream) -> Result<T>,
+{
+    type Output = T;
+
+    fn parse2(self, tokens: TokenStream) -> Result<T> {
+        let buf = TokenBuffer::new2(tokens);
+        let state = tokens_to_parse_buffer(&buf);
+        let node = self(&state)?;
+        state.check_unexpected()?;
+        if state.is_empty() {
+            Ok(node)
+        } else {
+            Err(state.error("unexpected token"))
+        }
+    }
+
+    #[doc(hidden)]
+    fn __parse_scoped(self, scope: Span, tokens: TokenStream) -> Result<Self::Output> {
+        let buf = TokenBuffer::new2(tokens);
+        let cursor = buf.begin();
+        let unexpected = Rc::new(Cell::new(Unexpected::None));
+        let state = new_parse_buffer(scope, cursor, unexpected);
+        let node = self(&state)?;
+        state.check_unexpected()?;
+        if state.is_empty() {
+            Ok(node)
+        } else {
+            Err(state.error("unexpected token"))
+        }
+    }
+
+    #[doc(hidden)]
+    fn __parse_stream(self, input: ParseStream) -> Result<Self::Output> {
+        self(input)
+    }
+}
+
+pub(crate) fn parse_scoped<F: Parser>(f: F, scope: Span, tokens: TokenStream) -> Result<F::Output> {
+    f.__parse_scoped(scope, tokens)
+}
+
+pub(crate) fn parse_stream<F: Parser>(f: F, input: ParseStream) -> Result<F::Output> {
+    f.__parse_stream(input)
+}
+
+/// An empty syntax tree node that consumes no tokens when parsed.
+///
+/// This is useful for attribute macros that want to ensure they are not
+/// provided any attribute args.
+///
+/// ```
+/// extern crate proc_macro;
+///
+/// use proc_macro::TokenStream;
+/// use syn::parse_macro_input;
+/// use syn::parse::Nothing;
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro_attribute]
+/// # };
+/// pub fn my_attr(args: TokenStream, input: TokenStream) -> TokenStream {
+///     parse_macro_input!(args as Nothing);
+///
+///     /* ... */
+/// #   "".parse().unwrap()
+/// }
+/// ```
+///
+/// ```text
+/// error: unexpected token
+///  --> src/main.rs:3:19
+///   |
+/// 3 | #[my_attr(asdf)]
+///   |           ^^^^
+/// ```
+pub struct Nothing;
+
+impl Parse for Nothing {
+    fn parse(_input: ParseStream) -> Result<Self> {
+        Ok(Nothing)
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/parse_macro_input.rs.html b/src/syn/parse_macro_input.rs.html new file mode 100644 index 0000000..fbf63a8 --- /dev/null +++ b/src/syn/parse_macro_input.rs.html @@ -0,0 +1,223 @@ +parse_macro_input.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+
+/// Parse the input TokenStream of a macro, triggering a compile error if the
+/// tokens fail to parse.
+///
+/// Refer to the [`parse` module] documentation for more details about parsing
+/// in Syn.
+///
+/// [`parse` module]: crate::rustdoc_workaround::parse_module
+///
+/// <br>
+///
+/// # Intended usage
+///
+/// This macro must be called from a function that returns
+/// `proc_macro::TokenStream`. Usually this will be your proc macro entry point,
+/// the function that has the #\[proc_macro\] / #\[proc_macro_derive\] /
+/// #\[proc_macro_attribute\] attribute.
+///
+/// ```
+/// extern crate proc_macro;
+///
+/// use proc_macro::TokenStream;
+/// use syn::{parse_macro_input, Result};
+/// use syn::parse::{Parse, ParseStream};
+///
+/// struct MyMacroInput {
+///     /* ... */
+/// }
+///
+/// impl Parse for MyMacroInput {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         /* ... */
+/// #       Ok(MyMacroInput {})
+///     }
+/// }
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro]
+/// # };
+/// pub fn my_macro(tokens: TokenStream) -> TokenStream {
+///     let input = parse_macro_input!(tokens as MyMacroInput);
+///
+///     /* ... */
+/// #   "".parse().unwrap()
+/// }
+/// ```
+#[macro_export(local_inner_macros)]
+macro_rules! parse_macro_input {
+    ($tokenstream:ident as $ty:ty) => {
+        match $crate::parse_macro_input::parse::<$ty>($tokenstream) {
+            $crate::export::Ok(data) => data,
+            $crate::export::Err(err) => {
+                return $crate::export::TokenStream::from(err.to_compile_error());
+            }
+        }
+    };
+    ($tokenstream:ident) => {
+        parse_macro_input!($tokenstream as _)
+    };
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Can parse any type that implements Parse.
+
+use crate::parse::{Parse, ParseStream, Parser, Result};
+use proc_macro::TokenStream;
+
+// Not public API.
+#[doc(hidden)]
+pub fn parse<T: ParseMacroInput>(token_stream: TokenStream) -> Result<T> {
+    T::parse.parse(token_stream)
+}
+
+// Not public API.
+#[doc(hidden)]
+pub trait ParseMacroInput: Sized {
+    fn parse(input: ParseStream) -> Result<Self>;
+}
+
+impl<T: Parse> ParseMacroInput for T {
+    fn parse(input: ParseStream) -> Result<Self> {
+        <T as Parse>::parse(input)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Any other types that we want `parse_macro_input!` to be able to parse.
+
+#[cfg(any(feature = "full", feature = "derive"))]
+use crate::AttributeArgs;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+impl ParseMacroInput for AttributeArgs {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let mut metas = Vec::new();
+
+        loop {
+            if input.is_empty() {
+                break;
+            }
+            let value = input.parse()?;
+            metas.push(value);
+            if input.is_empty() {
+                break;
+            }
+            input.parse::<Token![,]>()?;
+        }
+
+        Ok(metas)
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/parse_quote.rs.html b/src/syn/parse_quote.rs.html new file mode 100644 index 0000000..152bdd2 --- /dev/null +++ b/src/syn/parse_quote.rs.html @@ -0,0 +1,287 @@ +parse_quote.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+
+/// Quasi-quotation macro that accepts input like the [`quote!`] macro but uses
+/// type inference to figure out a return type for those tokens.
+///
+/// [`quote!`]: https://docs.rs/quote/1.0/quote/index.html
+///
+/// The return type can be any syntax tree node that implements the [`Parse`]
+/// trait.
+///
+/// [`Parse`]: parse::Parse
+///
+/// ```
+/// use quote::quote;
+/// use syn::{parse_quote, Stmt};
+///
+/// fn main() {
+///     let name = quote!(v);
+///     let ty = quote!(u8);
+///
+///     let stmt: Stmt = parse_quote! {
+///         let #name: #ty = Default::default();
+///     };
+///
+///     println!("{:#?}", stmt);
+/// }
+/// ```
+///
+/// *This macro is available if Syn is built with the `"parsing"` feature,
+/// although interpolation of syntax tree nodes into the quoted tokens is only
+/// supported if Syn is built with the `"printing"` feature as well.*
+///
+/// # Example
+///
+/// The following helper function adds a bound `T: HeapSize` to every type
+/// parameter `T` in the input generics.
+///
+/// ```
+/// use syn::{parse_quote, Generics, GenericParam};
+///
+/// // Add a bound `T: HeapSize` to every type parameter T.
+/// fn add_trait_bounds(mut generics: Generics) -> Generics {
+///     for param in &mut generics.params {
+///         if let GenericParam::Type(type_param) = param {
+///             type_param.bounds.push(parse_quote!(HeapSize));
+///         }
+///     }
+///     generics
+/// }
+/// ```
+///
+/// # Special cases
+///
+/// This macro can parse the following additional types as a special case even
+/// though they do not implement the `Parse` trait.
+///
+/// - [`Attribute`] — parses one attribute, allowing either outer like `#[...]`
+///   or inner like `#![...]`
+/// - [`Punctuated<T, P>`] — parses zero or more `T` separated by punctuation
+///   `P` with optional trailing punctuation
+/// - [`Vec<Stmt>`] — parses the same as `Block::parse_within`
+///
+/// [`Punctuated<T, P>`]: punctuated::Punctuated
+/// [`Vec<Stmt>`]: Block::parse_within
+///
+/// # Panics
+///
+/// Panics if the tokens fail to parse as the expected syntax tree type. The
+/// caller is responsible for ensuring that the input tokens are syntactically
+/// valid.
+//
+// TODO: allow Punctuated to be inferred as intra doc link, currently blocked on
+// https://github.com/rust-lang/rust/issues/62834
+#[macro_export(local_inner_macros)]
+macro_rules! parse_quote {
+    ($($tt:tt)*) => {
+        $crate::parse_quote::parse(
+            $crate::export::From::from(
+                $crate::export::quote::quote!($($tt)*)
+            )
+        )
+    };
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Can parse any type that implements Parse.
+
+use crate::parse::{Parse, ParseStream, Parser, Result};
+use proc_macro2::TokenStream;
+
+// Not public API.
+#[doc(hidden)]
+pub fn parse<T: ParseQuote>(token_stream: TokenStream) -> T {
+    let parser = T::parse;
+    match parser.parse2(token_stream) {
+        Ok(t) => t,
+        Err(err) => panic!("{}", err),
+    }
+}
+
+// Not public API.
+#[doc(hidden)]
+pub trait ParseQuote: Sized {
+    fn parse(input: ParseStream) -> Result<Self>;
+}
+
+impl<T: Parse> ParseQuote for T {
+    fn parse(input: ParseStream) -> Result<Self> {
+        <T as Parse>::parse(input)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Any other types that we want `parse_quote!` to be able to parse.
+
+use crate::punctuated::Punctuated;
+#[cfg(any(feature = "full", feature = "derive"))]
+use crate::{attr, Attribute};
+#[cfg(feature = "full")]
+use crate::{Block, Stmt};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+impl ParseQuote for Attribute {
+    fn parse(input: ParseStream) -> Result<Self> {
+        if input.peek(Token![#]) && input.peek2(Token![!]) {
+            attr::parsing::single_parse_inner(input)
+        } else {
+            attr::parsing::single_parse_outer(input)
+        }
+    }
+}
+
+impl<T: Parse, P: Parse> ParseQuote for Punctuated<T, P> {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Self::parse_terminated(input)
+    }
+}
+
+#[cfg(feature = "full")]
+impl ParseQuote for Vec<Stmt> {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Block::parse_within(input)
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/path.rs.html b/src/syn/path.rs.html new file mode 100644 index 0000000..4f45a8f --- /dev/null +++ b/src/syn/path.rs.html @@ -0,0 +1,1491 @@ +path.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+
+use super::*;
+use crate::punctuated::Punctuated;
+
+ast_struct! {
+    /// A path at which a named item is exported: `std::collections::HashMap`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct Path {
+        pub leading_colon: Option<Token![::]>,
+        pub segments: Punctuated<PathSegment, Token![::]>,
+    }
+}
+
+impl<T> From<T> for Path
+where
+    T: Into<PathSegment>,
+{
+    fn from(segment: T) -> Self {
+        let mut path = Path {
+            leading_colon: None,
+            segments: Punctuated::new(),
+        };
+        path.segments.push_value(segment.into());
+        path
+    }
+}
+
+ast_struct! {
+    /// A segment of a path together with any path arguments on that segment.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct PathSegment {
+        pub ident: Ident,
+        pub arguments: PathArguments,
+    }
+}
+
+impl<T> From<T> for PathSegment
+where
+    T: Into<Ident>,
+{
+    fn from(ident: T) -> Self {
+        PathSegment {
+            ident: ident.into(),
+            arguments: PathArguments::None,
+        }
+    }
+}
+
+ast_enum! {
+    /// Angle bracketed or parenthesized arguments of a path segment.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    ///
+    /// ## Angle bracketed
+    ///
+    /// The `<'a, T>` in `std::slice::iter<'a, T>`.
+    ///
+    /// ## Parenthesized
+    ///
+    /// The `(A, B) -> C` in `Fn(A, B) -> C`.
+    pub enum PathArguments {
+        None,
+        /// The `<'a, T>` in `std::slice::iter<'a, T>`.
+        AngleBracketed(AngleBracketedGenericArguments),
+        /// The `(A, B) -> C` in `Fn(A, B) -> C`.
+        Parenthesized(ParenthesizedGenericArguments),
+    }
+}
+
+impl Default for PathArguments {
+    fn default() -> Self {
+        PathArguments::None
+    }
+}
+
+impl PathArguments {
+    pub fn is_empty(&self) -> bool {
+        match self {
+            PathArguments::None => true,
+            PathArguments::AngleBracketed(bracketed) => bracketed.args.is_empty(),
+            PathArguments::Parenthesized(_) => false,
+        }
+    }
+
+    #[cfg(feature = "parsing")]
+    fn is_none(&self) -> bool {
+        match *self {
+            PathArguments::None => true,
+            PathArguments::AngleBracketed(_) | PathArguments::Parenthesized(_) => false,
+        }
+    }
+}
+
+ast_enum! {
+    /// An individual generic argument, like `'a`, `T`, or `Item = T`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub enum GenericArgument {
+        /// A lifetime argument.
+        Lifetime(Lifetime),
+        /// A type argument.
+        Type(Type),
+        /// A binding (equality constraint) on an associated type: the `Item =
+        /// u8` in `Iterator<Item = u8>`.
+        Binding(Binding),
+        /// An associated type bound: `Iterator<Item: Display>`.
+        Constraint(Constraint),
+        /// A const expression. Must be inside of a block.
+        ///
+        /// NOTE: Identity expressions are represented as Type arguments, as
+        /// they are indistinguishable syntactically.
+        Const(Expr),
+    }
+}
+
+ast_struct! {
+    /// Angle bracketed arguments of a path segment: the `<K, V>` in `HashMap<K,
+    /// V>`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct AngleBracketedGenericArguments {
+        pub colon2_token: Option<Token![::]>,
+        pub lt_token: Token![<],
+        pub args: Punctuated<GenericArgument, Token![,]>,
+        pub gt_token: Token![>],
+    }
+}
+
+ast_struct! {
+    /// A binding (equality constraint) on an associated type: `Item = u8`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct Binding {
+        pub ident: Ident,
+        pub eq_token: Token![=],
+        pub ty: Type,
+    }
+}
+
+ast_struct! {
+    /// An associated type bound: `Iterator<Item: Display>`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct Constraint {
+        pub ident: Ident,
+        pub colon_token: Token![:],
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// Arguments of a function path segment: the `(A, B) -> C` in `Fn(A,B) ->
+    /// C`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct ParenthesizedGenericArguments {
+        pub paren_token: token::Paren,
+        /// `(A, B)`
+        pub inputs: Punctuated<Type, Token![,]>,
+        /// `C`
+        pub output: ReturnType,
+    }
+}
+
+ast_struct! {
+    /// The explicit Self type in a qualified path: the `T` in `<T as
+    /// Display>::fmt`.
+    ///
+    /// The actual path, including the trait and the associated item, is stored
+    /// separately. The `position` field represents the index of the associated
+    /// item qualified with this Self type.
+    ///
+    /// ```text
+    /// <Vec<T> as a::b::Trait>::AssociatedItem
+    ///  ^~~~~~    ~~~~~~~~~~~~~~^
+    ///  ty        position = 3
+    ///
+    /// <Vec<T>>::AssociatedItem
+    ///  ^~~~~~   ^
+    ///  ty       position = 0
+    /// ```
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct QSelf {
+        pub lt_token: Token![<],
+        pub ty: Box<Type>,
+        pub position: usize,
+        pub as_token: Option<Token![as]>,
+        pub gt_token: Token![>],
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub mod parsing {
+    use super::*;
+
+    #[cfg(feature = "full")]
+    use crate::expr;
+    use crate::ext::IdentExt;
+    use crate::parse::{Parse, ParseStream, Result};
+
+    impl Parse for Path {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Self::parse_helper(input, false)
+        }
+    }
+
+    impl Parse for GenericArgument {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Lifetime) && !input.peek2(Token![+]) {
+                return Ok(GenericArgument::Lifetime(input.parse()?));
+            }
+
+            if input.peek(Ident) && input.peek2(Token![=]) {
+                return Ok(GenericArgument::Binding(input.parse()?));
+            }
+
+            #[cfg(feature = "full")]
+            {
+                if input.peek(Ident) && input.peek2(Token![:]) && !input.peek2(Token![::]) {
+                    return Ok(GenericArgument::Constraint(input.parse()?));
+                }
+
+                if input.peek(Lit) {
+                    let lit = input.parse()?;
+                    return Ok(GenericArgument::Const(Expr::Lit(lit)));
+                }
+
+                if input.peek(token::Brace) {
+                    let block = input.call(expr::parsing::expr_block)?;
+                    return Ok(GenericArgument::Const(Expr::Block(block)));
+                }
+            }
+
+            input.parse().map(GenericArgument::Type)
+        }
+    }
+
+    impl Parse for AngleBracketedGenericArguments {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(AngleBracketedGenericArguments {
+                colon2_token: input.parse()?,
+                lt_token: input.parse()?,
+                args: {
+                    let mut args = Punctuated::new();
+                    loop {
+                        if input.peek(Token![>]) {
+                            break;
+                        }
+                        let value = input.parse()?;
+                        args.push_value(value);
+                        if input.peek(Token![>]) {
+                            break;
+                        }
+                        let punct = input.parse()?;
+                        args.push_punct(punct);
+                    }
+                    args
+                },
+                gt_token: input.parse()?,
+            })
+        }
+    }
+
+    impl Parse for ParenthesizedGenericArguments {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(ParenthesizedGenericArguments {
+                paren_token: parenthesized!(content in input),
+                inputs: content.parse_terminated(Type::parse)?,
+                output: input.call(ReturnType::without_plus)?,
+            })
+        }
+    }
+
+    impl Parse for PathSegment {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Self::parse_helper(input, false)
+        }
+    }
+
+    impl PathSegment {
+        fn parse_helper(input: ParseStream, expr_style: bool) -> Result<Self> {
+            if input.peek(Token![super])
+                || input.peek(Token![self])
+                || input.peek(Token![crate])
+                || input.peek(Token![extern])
+            {
+                let ident = input.call(Ident::parse_any)?;
+                return Ok(PathSegment::from(ident));
+            }
+
+            let ident = if input.peek(Token![Self]) {
+                input.call(Ident::parse_any)?
+            } else {
+                input.parse()?
+            };
+
+            if !expr_style && input.peek(Token![<]) && !input.peek(Token![<=])
+                || input.peek(Token![::]) && input.peek3(Token![<])
+            {
+                Ok(PathSegment {
+                    ident,
+                    arguments: PathArguments::AngleBracketed(input.parse()?),
+                })
+            } else {
+                Ok(PathSegment::from(ident))
+            }
+        }
+    }
+
+    impl Parse for Binding {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(Binding {
+                ident: input.parse()?,
+                eq_token: input.parse()?,
+                ty: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl Parse for Constraint {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(Constraint {
+                ident: input.parse()?,
+                colon_token: input.parse()?,
+                bounds: {
+                    let mut bounds = Punctuated::new();
+                    loop {
+                        if input.peek(Token![,]) || input.peek(Token![>]) {
+                            break;
+                        }
+                        let value = input.parse()?;
+                        bounds.push_value(value);
+                        if !input.peek(Token![+]) {
+                            break;
+                        }
+                        let punct = input.parse()?;
+                        bounds.push_punct(punct);
+                    }
+                    bounds
+                },
+            })
+        }
+    }
+
+    impl Path {
+        /// Parse a `Path` containing no path arguments on any of its segments.
+        ///
+        /// *This function is available if Syn is built with the `"parsing"`
+        /// feature.*
+        ///
+        /// # Example
+        ///
+        /// ```
+        /// use syn::{Path, Result, Token};
+        /// use syn::parse::{Parse, ParseStream};
+        ///
+        /// // A simplified single `use` statement like:
+        /// //
+        /// //     use std::collections::HashMap;
+        /// //
+        /// // Note that generic parameters are not allowed in a `use` statement
+        /// // so the following must not be accepted.
+        /// //
+        /// //     use a::<b>::c;
+        /// struct SingleUse {
+        ///     use_token: Token![use],
+        ///     path: Path,
+        /// }
+        ///
+        /// impl Parse for SingleUse {
+        ///     fn parse(input: ParseStream) -> Result<Self> {
+        ///         Ok(SingleUse {
+        ///             use_token: input.parse()?,
+        ///             path: input.call(Path::parse_mod_style)?,
+        ///         })
+        ///     }
+        /// }
+        /// ```
+        pub fn parse_mod_style(input: ParseStream) -> Result<Self> {
+            Ok(Path {
+                leading_colon: input.parse()?,
+                segments: {
+                    let mut segments = Punctuated::new();
+                    loop {
+                        if !input.peek(Ident)
+                            && !input.peek(Token![super])
+                            && !input.peek(Token![self])
+                            && !input.peek(Token![Self])
+                            && !input.peek(Token![crate])
+                            && !input.peek(Token![extern])
+                        {
+                            break;
+                        }
+                        let ident = Ident::parse_any(input)?;
+                        segments.push_value(PathSegment::from(ident));
+                        if !input.peek(Token![::]) {
+                            break;
+                        }
+                        let punct = input.parse()?;
+                        segments.push_punct(punct);
+                    }
+                    if segments.is_empty() {
+                        return Err(input.error("expected path"));
+                    } else if segments.trailing_punct() {
+                        return Err(input.error("expected path segment"));
+                    }
+                    segments
+                },
+            })
+        }
+
+        /// Determines whether this is a path of length 1 equal to the given
+        /// ident.
+        ///
+        /// For them to compare equal, it must be the case that:
+        ///
+        /// - the path has no leading colon,
+        /// - the number of path segments is 1,
+        /// - the first path segment has no angle bracketed or parenthesized
+        ///   path arguments, and
+        /// - the ident of the first path segment is equal to the given one.
+        ///
+        /// *This function is available if Syn is built with the `"parsing"`
+        /// feature.*
+        ///
+        /// # Example
+        ///
+        /// ```
+        /// use syn::{Attribute, Error, Meta, NestedMeta, Result};
+        /// # use std::iter::FromIterator;
+        ///
+        /// fn get_serde_meta_items(attr: &Attribute) -> Result<Vec<NestedMeta>> {
+        ///     if attr.path.is_ident("serde") {
+        ///         match attr.parse_meta()? {
+        ///             Meta::List(meta) => Ok(Vec::from_iter(meta.nested)),
+        ///             bad => Err(Error::new_spanned(bad, "unrecognized attribute")),
+        ///         }
+        ///     } else {
+        ///         Ok(Vec::new())
+        ///     }
+        /// }
+        /// ```
+        pub fn is_ident<I: ?Sized>(&self, ident: &I) -> bool
+        where
+            Ident: PartialEq<I>,
+        {
+            match self.get_ident() {
+                Some(id) => id == ident,
+                None => false,
+            }
+        }
+
+        /// If this path consists of a single ident, returns the ident.
+        ///
+        /// A path is considered an ident if:
+        ///
+        /// - the path has no leading colon,
+        /// - the number of path segments is 1, and
+        /// - the first path segment has no angle bracketed or parenthesized
+        ///   path arguments.
+        ///
+        /// *This function is available if Syn is built with the `"parsing"`
+        /// feature.*
+        pub fn get_ident(&self) -> Option<&Ident> {
+            if self.leading_colon.is_none()
+                && self.segments.len() == 1
+                && self.segments[0].arguments.is_none()
+            {
+                Some(&self.segments[0].ident)
+            } else {
+                None
+            }
+        }
+
+        fn parse_helper(input: ParseStream, expr_style: bool) -> Result<Self> {
+            Ok(Path {
+                leading_colon: input.parse()?,
+                segments: {
+                    let mut segments = Punctuated::new();
+                    let value = PathSegment::parse_helper(input, expr_style)?;
+                    segments.push_value(value);
+                    while input.peek(Token![::]) {
+                        let punct: Token![::] = input.parse()?;
+                        segments.push_punct(punct);
+                        let value = PathSegment::parse_helper(input, expr_style)?;
+                        segments.push_value(value);
+                    }
+                    segments
+                },
+            })
+        }
+    }
+
+    pub fn qpath(input: ParseStream, expr_style: bool) -> Result<(Option<QSelf>, Path)> {
+        if input.peek(Token![<]) {
+            let lt_token: Token![<] = input.parse()?;
+            let this: Type = input.parse()?;
+            let path = if input.peek(Token![as]) {
+                let as_token: Token![as] = input.parse()?;
+                let path: Path = input.parse()?;
+                Some((as_token, path))
+            } else {
+                None
+            };
+            let gt_token: Token![>] = input.parse()?;
+            let colon2_token: Token![::] = input.parse()?;
+            let mut rest = Punctuated::new();
+            loop {
+                let path = PathSegment::parse_helper(input, expr_style)?;
+                rest.push_value(path);
+                if !input.peek(Token![::]) {
+                    break;
+                }
+                let punct: Token![::] = input.parse()?;
+                rest.push_punct(punct);
+            }
+            let (position, as_token, path) = match path {
+                Some((as_token, mut path)) => {
+                    let pos = path.segments.len();
+                    path.segments.push_punct(colon2_token);
+                    path.segments.extend(rest.into_pairs());
+                    (pos, Some(as_token), path)
+                }
+                None => {
+                    let path = Path {
+                        leading_colon: Some(colon2_token),
+                        segments: rest,
+                    };
+                    (0, None, path)
+                }
+            };
+            let qself = QSelf {
+                lt_token,
+                ty: Box::new(this),
+                position,
+                as_token,
+                gt_token,
+            };
+            Ok((Some(qself), path))
+        } else {
+            let path = Path::parse_helper(input, expr_style)?;
+            Ok((None, path))
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use super::*;
+
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+
+    use crate::print::TokensOrDefault;
+
+    impl ToTokens for Path {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.leading_colon.to_tokens(tokens);
+            self.segments.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for PathSegment {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.arguments.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for PathArguments {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                PathArguments::None => {}
+                PathArguments::AngleBracketed(arguments) => {
+                    arguments.to_tokens(tokens);
+                }
+                PathArguments::Parenthesized(arguments) => {
+                    arguments.to_tokens(tokens);
+                }
+            }
+        }
+    }
+
+    impl ToTokens for GenericArgument {
+        #[allow(clippy::match_same_arms)]
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                GenericArgument::Lifetime(lt) => lt.to_tokens(tokens),
+                GenericArgument::Type(ty) => ty.to_tokens(tokens),
+                GenericArgument::Binding(tb) => tb.to_tokens(tokens),
+                GenericArgument::Constraint(tc) => tc.to_tokens(tokens),
+                GenericArgument::Const(e) => match *e {
+                    Expr::Lit(_) => e.to_tokens(tokens),
+
+                    // NOTE: We should probably support parsing blocks with only
+                    // expressions in them without the full feature for const
+                    // generics.
+                    #[cfg(feature = "full")]
+                    Expr::Block(_) => e.to_tokens(tokens),
+
+                    // ERROR CORRECTION: Add braces to make sure that the
+                    // generated code is valid.
+                    _ => token::Brace::default().surround(tokens, |tokens| {
+                        e.to_tokens(tokens);
+                    }),
+                },
+            }
+        }
+    }
+
+    impl ToTokens for AngleBracketedGenericArguments {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.colon2_token.to_tokens(tokens);
+            self.lt_token.to_tokens(tokens);
+
+            // Print lifetimes before types and consts, all before bindings,
+            // regardless of their order in self.args.
+            //
+            // TODO: ordering rules for const arguments vs type arguments have
+            // not been settled yet. https://github.com/rust-lang/rust/issues/44580
+            let mut trailing_or_empty = true;
+            for param in self.args.pairs() {
+                match **param.value() {
+                    GenericArgument::Lifetime(_) => {
+                        param.to_tokens(tokens);
+                        trailing_or_empty = param.punct().is_some();
+                    }
+                    GenericArgument::Type(_)
+                    | GenericArgument::Binding(_)
+                    | GenericArgument::Constraint(_)
+                    | GenericArgument::Const(_) => {}
+                }
+            }
+            for param in self.args.pairs() {
+                match **param.value() {
+                    GenericArgument::Type(_) | GenericArgument::Const(_) => {
+                        if !trailing_or_empty {
+                            <Token![,]>::default().to_tokens(tokens);
+                        }
+                        param.to_tokens(tokens);
+                        trailing_or_empty = param.punct().is_some();
+                    }
+                    GenericArgument::Lifetime(_)
+                    | GenericArgument::Binding(_)
+                    | GenericArgument::Constraint(_) => {}
+                }
+            }
+            for param in self.args.pairs() {
+                match **param.value() {
+                    GenericArgument::Binding(_) | GenericArgument::Constraint(_) => {
+                        if !trailing_or_empty {
+                            <Token![,]>::default().to_tokens(tokens);
+                            trailing_or_empty = true;
+                        }
+                        param.to_tokens(tokens);
+                    }
+                    GenericArgument::Lifetime(_)
+                    | GenericArgument::Type(_)
+                    | GenericArgument::Const(_) => {}
+                }
+            }
+
+            self.gt_token.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for Binding {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for Constraint {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for ParenthesizedGenericArguments {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.paren_token.surround(tokens, |tokens| {
+                self.inputs.to_tokens(tokens);
+            });
+            self.output.to_tokens(tokens);
+        }
+    }
+
+    impl private {
+        pub fn print_path(tokens: &mut TokenStream, qself: &Option<QSelf>, path: &Path) {
+            let qself = match qself {
+                Some(qself) => qself,
+                None => {
+                    path.to_tokens(tokens);
+                    return;
+                }
+            };
+            qself.lt_token.to_tokens(tokens);
+            qself.ty.to_tokens(tokens);
+
+            let pos = if qself.position > 0 && qself.position >= path.segments.len() {
+                path.segments.len() - 1
+            } else {
+                qself.position
+            };
+            let mut segments = path.segments.pairs();
+            if pos > 0 {
+                TokensOrDefault(&qself.as_token).to_tokens(tokens);
+                path.leading_colon.to_tokens(tokens);
+                for (i, segment) in segments.by_ref().take(pos).enumerate() {
+                    if i + 1 == pos {
+                        segment.value().to_tokens(tokens);
+                        qself.gt_token.to_tokens(tokens);
+                        segment.punct().to_tokens(tokens);
+                    } else {
+                        segment.to_tokens(tokens);
+                    }
+                }
+            } else {
+                qself.gt_token.to_tokens(tokens);
+                path.leading_colon.to_tokens(tokens);
+            }
+            for segment in segments {
+                segment.to_tokens(tokens);
+            }
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/print.rs.html b/src/syn/print.rs.html new file mode 100644 index 0000000..9d0465e --- /dev/null +++ b/src/syn/print.rs.html @@ -0,0 +1,35 @@ +print.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+
+use proc_macro2::TokenStream;
+use quote::ToTokens;
+
+pub struct TokensOrDefault<'a, T: 'a>(pub &'a Option<T>);
+
+impl<'a, T> ToTokens for TokensOrDefault<'a, T>
+where
+    T: ToTokens + Default,
+{
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        match self.0 {
+            Some(t) => t.to_tokens(tokens),
+            None => T::default().to_tokens(tokens),
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/punctuated.rs.html b/src/syn/punctuated.rs.html new file mode 100644 index 0000000..5c75fc7 --- /dev/null +++ b/src/syn/punctuated.rs.html @@ -0,0 +1,1839 @@ +punctuated.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+
+//! A punctuated sequence of syntax tree nodes separated by punctuation.
+//!
+//! Lots of things in Rust are punctuated sequences.
+//!
+//! - The fields of a struct are `Punctuated<Field, Token![,]>`.
+//! - The segments of a path are `Punctuated<PathSegment, Token![::]>`.
+//! - The bounds on a generic parameter are `Punctuated<TypeParamBound,
+//!   Token![+]>`.
+//! - The arguments to a function call are `Punctuated<Expr, Token![,]>`.
+//!
+//! This module provides a common representation for these punctuated sequences
+//! in the form of the [`Punctuated<T, P>`] type. We store a vector of pairs of
+//! syntax tree node + punctuation, where every node in the sequence is followed
+//! by punctuation except for possibly the final one.
+//!
+//! [`Punctuated<T, P>`]: struct.Punctuated.html
+//!
+//! ```text
+//! a_function_call(arg1, arg2, arg3);
+//!                 ~~~~^ ~~~~^ ~~~~
+//! ```
+
+#[cfg(feature = "extra-traits")]
+use std::fmt::{self, Debug};
+#[cfg(any(feature = "full", feature = "derive"))]
+use std::iter;
+use std::iter::FromIterator;
+use std::ops::{Index, IndexMut};
+use std::option;
+use std::slice;
+use std::vec;
+
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, ParseStream, Result};
+#[cfg(feature = "parsing")]
+use crate::token::Token;
+
+/// A punctuated sequence of syntax tree nodes of type `T` separated by
+/// punctuation of type `P`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+#[cfg_attr(feature = "extra-traits", derive(Eq, PartialEq, Hash))]
+#[cfg_attr(feature = "clone-impls", derive(Clone))]
+pub struct Punctuated<T, P> {
+    inner: Vec<(T, P)>,
+    last: Option<Box<T>>,
+}
+
+impl<T, P> Punctuated<T, P> {
+    /// Creates an empty punctuated sequence.
+    pub fn new() -> Punctuated<T, P> {
+        Punctuated {
+            inner: Vec::new(),
+            last: None,
+        }
+    }
+
+    /// Determines whether this punctuated sequence is empty, meaning it
+    /// contains no syntax tree nodes or punctuation.
+    pub fn is_empty(&self) -> bool {
+        self.inner.len() == 0 && self.last.is_none()
+    }
+
+    /// Returns the number of syntax tree nodes in this punctuated sequence.
+    ///
+    /// This is the number of nodes of type `T`, not counting the punctuation of
+    /// type `P`.
+    pub fn len(&self) -> usize {
+        self.inner.len() + if self.last.is_some() { 1 } else { 0 }
+    }
+
+    /// Borrows the first element in this sequence.
+    pub fn first(&self) -> Option<&T> {
+        self.iter().next()
+    }
+
+    /// Borrows the last element in this sequence.
+    pub fn last(&self) -> Option<&T> {
+        if self.last.is_some() {
+            self.last.as_ref().map(Box::as_ref)
+        } else {
+            self.inner.last().map(|pair| &pair.0)
+        }
+    }
+
+    /// Mutably borrows the last element in this sequence.
+    pub fn last_mut(&mut self) -> Option<&mut T> {
+        if self.last.is_some() {
+            self.last.as_mut().map(Box::as_mut)
+        } else {
+            self.inner.last_mut().map(|pair| &mut pair.0)
+        }
+    }
+
+    /// Returns an iterator over borrowed syntax tree nodes of type `&T`.
+    pub fn iter(&self) -> Iter<T> {
+        Iter {
+            inner: Box::new(PrivateIter {
+                inner: self.inner.iter(),
+                last: self.last.as_ref().map(Box::as_ref).into_iter(),
+            }),
+        }
+    }
+
+    /// Returns an iterator over mutably borrowed syntax tree nodes of type
+    /// `&mut T`.
+    pub fn iter_mut(&mut self) -> IterMut<T> {
+        IterMut {
+            inner: Box::new(PrivateIterMut {
+                inner: self.inner.iter_mut(),
+                last: self.last.as_mut().map(Box::as_mut).into_iter(),
+            }),
+        }
+    }
+
+    /// Returns an iterator over the contents of this sequence as borrowed
+    /// punctuated pairs.
+    pub fn pairs(&self) -> Pairs<T, P> {
+        Pairs {
+            inner: self.inner.iter(),
+            last: self.last.as_ref().map(Box::as_ref).into_iter(),
+        }
+    }
+
+    /// Returns an iterator over the contents of this sequence as mutably
+    /// borrowed punctuated pairs.
+    pub fn pairs_mut(&mut self) -> PairsMut<T, P> {
+        PairsMut {
+            inner: self.inner.iter_mut(),
+            last: self.last.as_mut().map(Box::as_mut).into_iter(),
+        }
+    }
+
+    /// Returns an iterator over the contents of this sequence as owned
+    /// punctuated pairs.
+    pub fn into_pairs(self) -> IntoPairs<T, P> {
+        IntoPairs {
+            inner: self.inner.into_iter(),
+            last: self.last.map(|t| *t).into_iter(),
+        }
+    }
+
+    /// Appends a syntax tree node onto the end of this punctuated sequence. The
+    /// sequence must previously have a trailing punctuation.
+    ///
+    /// Use [`push`] instead if the punctuated sequence may or may not already
+    /// have trailing punctuation.
+    ///
+    /// [`push`]: Punctuated::push
+    ///
+    /// # Panics
+    ///
+    /// Panics if the sequence does not already have a trailing punctuation when
+    /// this method is called.
+    pub fn push_value(&mut self, value: T) {
+        assert!(self.empty_or_trailing());
+        self.last = Some(Box::new(value));
+    }
+
+    /// Appends a trailing punctuation onto the end of this punctuated sequence.
+    /// The sequence must be non-empty and must not already have trailing
+    /// punctuation.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the sequence is empty or already has a trailing punctuation.
+    pub fn push_punct(&mut self, punctuation: P) {
+        assert!(self.last.is_some());
+        let last = self.last.take().unwrap();
+        self.inner.push((*last, punctuation));
+    }
+
+    /// Removes the last punctuated pair from this sequence, or `None` if the
+    /// sequence is empty.
+    pub fn pop(&mut self) -> Option<Pair<T, P>> {
+        if self.last.is_some() {
+            self.last.take().map(|t| Pair::End(*t))
+        } else {
+            self.inner.pop().map(|(t, d)| Pair::Punctuated(t, d))
+        }
+    }
+
+    /// Determines whether this punctuated sequence ends with a trailing
+    /// punctuation.
+    pub fn trailing_punct(&self) -> bool {
+        self.last.is_none() && !self.is_empty()
+    }
+
+    /// Returns true if either this `Punctuated` is empty, or it has a trailing
+    /// punctuation.
+    ///
+    /// Equivalent to `punctuated.is_empty() || punctuated.trailing_punct()`.
+    pub fn empty_or_trailing(&self) -> bool {
+        self.last.is_none()
+    }
+
+    /// Appends a syntax tree node onto the end of this punctuated sequence.
+    ///
+    /// If there is not a trailing punctuation in this sequence when this method
+    /// is called, the default value of punctuation type `P` is inserted before
+    /// the given value of type `T`.
+    pub fn push(&mut self, value: T)
+    where
+        P: Default,
+    {
+        if !self.empty_or_trailing() {
+            self.push_punct(Default::default());
+        }
+        self.push_value(value);
+    }
+
+    /// Inserts an element at position `index`.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `index` is greater than the number of elements previously in
+    /// this punctuated sequence.
+    pub fn insert(&mut self, index: usize, value: T)
+    where
+        P: Default,
+    {
+        assert!(index <= self.len());
+
+        if index == self.len() {
+            self.push(value);
+        } else {
+            self.inner.insert(index, (value, Default::default()));
+        }
+    }
+
+    /// Parses zero or more occurrences of `T` separated by punctuation of type
+    /// `P`, with optional trailing punctuation.
+    ///
+    /// Parsing continues until the end of this parse stream. The entire content
+    /// of this parse stream must consist of `T` and `P`.
+    ///
+    /// *This function is available if Syn is built with the `"parsing"`
+    /// feature.*
+    #[cfg(feature = "parsing")]
+    pub fn parse_terminated(input: ParseStream) -> Result<Self>
+    where
+        T: Parse,
+        P: Parse,
+    {
+        Self::parse_terminated_with(input, T::parse)
+    }
+
+    /// Parses zero or more occurrences of `T` using the given parse function,
+    /// separated by punctuation of type `P`, with optional trailing
+    /// punctuation.
+    ///
+    /// Like [`parse_terminated`], the entire content of this stream is expected
+    /// to be parsed.
+    ///
+    /// [`parse_terminated`]: Punctuated::parse_terminated
+    ///
+    /// *This function is available if Syn is built with the `"parsing"`
+    /// feature.*
+    #[cfg(feature = "parsing")]
+    pub fn parse_terminated_with(
+        input: ParseStream,
+        parser: fn(ParseStream) -> Result<T>,
+    ) -> Result<Self>
+    where
+        P: Parse,
+    {
+        let mut punctuated = Punctuated::new();
+
+        loop {
+            if input.is_empty() {
+                break;
+            }
+            let value = parser(input)?;
+            punctuated.push_value(value);
+            if input.is_empty() {
+                break;
+            }
+            let punct = input.parse()?;
+            punctuated.push_punct(punct);
+        }
+
+        Ok(punctuated)
+    }
+
+    /// Parses one or more occurrences of `T` separated by punctuation of type
+    /// `P`, not accepting trailing punctuation.
+    ///
+    /// Parsing continues as long as punctuation `P` is present at the head of
+    /// the stream. This method returns upon parsing a `T` and observing that it
+    /// is not followed by a `P`, even if there are remaining tokens in the
+    /// stream.
+    ///
+    /// *This function is available if Syn is built with the `"parsing"`
+    /// feature.*
+    #[cfg(feature = "parsing")]
+    pub fn parse_separated_nonempty(input: ParseStream) -> Result<Self>
+    where
+        T: Parse,
+        P: Token + Parse,
+    {
+        Self::parse_separated_nonempty_with(input, T::parse)
+    }
+
+    /// Parses one or more occurrences of `T` using the given parse function,
+    /// separated by punctuation of type `P`, not accepting trailing
+    /// punctuation.
+    ///
+    /// Like [`parse_separated_nonempty`], may complete early without parsing
+    /// the entire content of this stream.
+    ///
+    /// [`parse_separated_nonempty`]: Punctuated::parse_separated_nonempty
+    ///
+    /// *This function is available if Syn is built with the `"parsing"`
+    /// feature.*
+    #[cfg(feature = "parsing")]
+    pub fn parse_separated_nonempty_with(
+        input: ParseStream,
+        parser: fn(ParseStream) -> Result<T>,
+    ) -> Result<Self>
+    where
+        P: Token + Parse,
+    {
+        let mut punctuated = Punctuated::new();
+
+        loop {
+            let value = parser(input)?;
+            punctuated.push_value(value);
+            if !P::peek(input.cursor()) {
+                break;
+            }
+            let punct = input.parse()?;
+            punctuated.push_punct(punct);
+        }
+
+        Ok(punctuated)
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+impl<T: Debug, P: Debug> Debug for Punctuated<T, P> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut list = f.debug_list();
+        for (t, p) in &self.inner {
+            list.entry(t);
+            list.entry(p);
+        }
+        if let Some(last) = &self.last {
+            list.entry(last);
+        }
+        list.finish()
+    }
+}
+
+impl<T, P> FromIterator<T> for Punctuated<T, P>
+where
+    P: Default,
+{
+    fn from_iter<I: IntoIterator<Item = T>>(i: I) -> Self {
+        let mut ret = Punctuated::new();
+        ret.extend(i);
+        ret
+    }
+}
+
+impl<T, P> Extend<T> for Punctuated<T, P>
+where
+    P: Default,
+{
+    fn extend<I: IntoIterator<Item = T>>(&mut self, i: I) {
+        for value in i {
+            self.push(value);
+        }
+    }
+}
+
+impl<T, P> FromIterator<Pair<T, P>> for Punctuated<T, P> {
+    fn from_iter<I: IntoIterator<Item = Pair<T, P>>>(i: I) -> Self {
+        let mut ret = Punctuated::new();
+        ret.extend(i);
+        ret
+    }
+}
+
+impl<T, P> Extend<Pair<T, P>> for Punctuated<T, P> {
+    fn extend<I: IntoIterator<Item = Pair<T, P>>>(&mut self, i: I) {
+        assert!(self.empty_or_trailing());
+        let mut nomore = false;
+        for pair in i {
+            if nomore {
+                panic!("Punctuated extended with items after a Pair::End");
+            }
+            match pair {
+                Pair::Punctuated(a, b) => self.inner.push((a, b)),
+                Pair::End(a) => {
+                    self.last = Some(Box::new(a));
+                    nomore = true;
+                }
+            }
+        }
+    }
+}
+
+impl<T, P> IntoIterator for Punctuated<T, P> {
+    type Item = T;
+    type IntoIter = IntoIter<T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        let mut elements = Vec::with_capacity(self.len());
+        elements.extend(self.inner.into_iter().map(|pair| pair.0));
+        elements.extend(self.last.map(|t| *t));
+
+        IntoIter {
+            inner: elements.into_iter(),
+        }
+    }
+}
+
+impl<'a, T, P> IntoIterator for &'a Punctuated<T, P> {
+    type Item = &'a T;
+    type IntoIter = Iter<'a, T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        Punctuated::iter(self)
+    }
+}
+
+impl<'a, T, P> IntoIterator for &'a mut Punctuated<T, P> {
+    type Item = &'a mut T;
+    type IntoIter = IterMut<'a, T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        Punctuated::iter_mut(self)
+    }
+}
+
+impl<T, P> Default for Punctuated<T, P> {
+    fn default() -> Self {
+        Punctuated::new()
+    }
+}
+
+/// An iterator over borrowed pairs of type `Pair<&T, &P>`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct Pairs<'a, T: 'a, P: 'a> {
+    inner: slice::Iter<'a, (T, P)>,
+    last: option::IntoIter<&'a T>,
+}
+
+impl<'a, T, P> Iterator for Pairs<'a, T, P> {
+    type Item = Pair<&'a T, &'a P>;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|(t, p)| Pair::Punctuated(t, p))
+            .or_else(|| self.last.next().map(Pair::End))
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<'a, T, P> DoubleEndedIterator for Pairs<'a, T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .map(Pair::End)
+            .or_else(|| self.inner.next_back().map(|(t, p)| Pair::Punctuated(t, p)))
+    }
+}
+
+impl<'a, T, P> ExactSizeIterator for Pairs<'a, T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+// No Clone bound on T or P.
+impl<'a, T, P> Clone for Pairs<'a, T, P> {
+    fn clone(&self) -> Self {
+        Pairs {
+            inner: self.inner.clone(),
+            last: self.last.clone(),
+        }
+    }
+}
+
+/// An iterator over mutably borrowed pairs of type `Pair<&mut T, &mut P>`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct PairsMut<'a, T: 'a, P: 'a> {
+    inner: slice::IterMut<'a, (T, P)>,
+    last: option::IntoIter<&'a mut T>,
+}
+
+impl<'a, T, P> Iterator for PairsMut<'a, T, P> {
+    type Item = Pair<&'a mut T, &'a mut P>;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|(t, p)| Pair::Punctuated(t, p))
+            .or_else(|| self.last.next().map(Pair::End))
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<'a, T, P> DoubleEndedIterator for PairsMut<'a, T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .map(Pair::End)
+            .or_else(|| self.inner.next_back().map(|(t, p)| Pair::Punctuated(t, p)))
+    }
+}
+
+impl<'a, T, P> ExactSizeIterator for PairsMut<'a, T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+/// An iterator over owned pairs of type `Pair<T, P>`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+#[derive(Clone)]
+pub struct IntoPairs<T, P> {
+    inner: vec::IntoIter<(T, P)>,
+    last: option::IntoIter<T>,
+}
+
+impl<T, P> Iterator for IntoPairs<T, P> {
+    type Item = Pair<T, P>;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|(t, p)| Pair::Punctuated(t, p))
+            .or_else(|| self.last.next().map(Pair::End))
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<T, P> DoubleEndedIterator for IntoPairs<T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .map(Pair::End)
+            .or_else(|| self.inner.next_back().map(|(t, p)| Pair::Punctuated(t, p)))
+    }
+}
+
+impl<T, P> ExactSizeIterator for IntoPairs<T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+/// An iterator over owned values of type `T`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+#[derive(Clone)]
+pub struct IntoIter<T> {
+    inner: vec::IntoIter<T>,
+}
+
+impl<T> Iterator for IntoIter<T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner.next()
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<T> DoubleEndedIterator for IntoIter<T> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.inner.next_back()
+    }
+}
+
+impl<T> ExactSizeIterator for IntoIter<T> {
+    fn len(&self) -> usize {
+        self.inner.len()
+    }
+}
+
+/// An iterator over borrowed values of type `&T`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct Iter<'a, T: 'a> {
+    // The `Item = &'a T` needs to be specified to support rustc 1.31 and older.
+    // On modern compilers we would be able to write just IterTrait<'a, T> where
+    // Item can be inferred unambiguously from the supertrait.
+    inner: Box<dyn IterTrait<'a, T, Item = &'a T> + 'a>,
+}
+
+trait IterTrait<'a, T: 'a>:
+    DoubleEndedIterator<Item = &'a T> + ExactSizeIterator<Item = &'a T>
+{
+    fn clone_box(&self) -> Box<dyn IterTrait<'a, T, Item = &'a T> + 'a>;
+}
+
+struct PrivateIter<'a, T: 'a, P: 'a> {
+    inner: slice::Iter<'a, (T, P)>,
+    last: option::IntoIter<&'a T>,
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+pub(crate) fn empty_punctuated_iter<'a, T>() -> Iter<'a, T> {
+    Iter {
+        inner: Box::new(iter::empty()),
+    }
+}
+
+// No Clone bound on T.
+impl<'a, T> Clone for Iter<'a, T> {
+    fn clone(&self) -> Self {
+        Iter {
+            inner: self.inner.clone_box(),
+        }
+    }
+}
+
+impl<'a, T> Iterator for Iter<'a, T> {
+    type Item = &'a T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner.next()
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.inner.next_back()
+    }
+}
+
+impl<'a, T> ExactSizeIterator for Iter<'a, T> {
+    fn len(&self) -> usize {
+        self.inner.len()
+    }
+}
+
+impl<'a, T, P> Iterator for PrivateIter<'a, T, P> {
+    type Item = &'a T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|pair| &pair.0)
+            .or_else(|| self.last.next())
+    }
+}
+
+impl<'a, T, P> DoubleEndedIterator for PrivateIter<'a, T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .or_else(|| self.inner.next_back().map(|pair| &pair.0))
+    }
+}
+
+impl<'a, T, P> ExactSizeIterator for PrivateIter<'a, T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+// No Clone bound on T or P.
+impl<'a, T, P> Clone for PrivateIter<'a, T, P> {
+    fn clone(&self) -> Self {
+        PrivateIter {
+            inner: self.inner.clone(),
+            last: self.last.clone(),
+        }
+    }
+}
+
+impl<'a, T: 'a, I: 'a> IterTrait<'a, T> for I
+where
+    I: DoubleEndedIterator<Item = &'a T> + ExactSizeIterator<Item = &'a T> + Clone,
+{
+    fn clone_box(&self) -> Box<dyn IterTrait<'a, T, Item = &'a T> + 'a> {
+        Box::new(self.clone())
+    }
+}
+
+/// An iterator over mutably borrowed values of type `&mut T`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct IterMut<'a, T: 'a> {
+    inner: Box<dyn IterMutTrait<'a, T, Item = &'a mut T> + 'a>,
+}
+
+trait IterMutTrait<'a, T: 'a>:
+    DoubleEndedIterator<Item = &'a mut T> + ExactSizeIterator<Item = &'a mut T>
+{
+}
+
+struct PrivateIterMut<'a, T: 'a, P: 'a> {
+    inner: slice::IterMut<'a, (T, P)>,
+    last: option::IntoIter<&'a mut T>,
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+pub(crate) fn empty_punctuated_iter_mut<'a, T>() -> IterMut<'a, T> {
+    IterMut {
+        inner: Box::new(iter::empty()),
+    }
+}
+
+impl<'a, T> Iterator for IterMut<'a, T> {
+    type Item = &'a mut T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner.next()
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<'a, T> DoubleEndedIterator for IterMut<'a, T> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.inner.next_back()
+    }
+}
+
+impl<'a, T> ExactSizeIterator for IterMut<'a, T> {
+    fn len(&self) -> usize {
+        self.inner.len()
+    }
+}
+
+impl<'a, T, P> Iterator for PrivateIterMut<'a, T, P> {
+    type Item = &'a mut T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|pair| &mut pair.0)
+            .or_else(|| self.last.next())
+    }
+}
+
+impl<'a, T, P> DoubleEndedIterator for PrivateIterMut<'a, T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .or_else(|| self.inner.next_back().map(|pair| &mut pair.0))
+    }
+}
+
+impl<'a, T, P> ExactSizeIterator for PrivateIterMut<'a, T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+impl<'a, T: 'a, I: 'a> IterMutTrait<'a, T> for I where
+    I: DoubleEndedIterator<Item = &'a mut T> + ExactSizeIterator<Item = &'a mut T>
+{
+}
+
+/// A single syntax tree node of type `T` followed by its trailing punctuation
+/// of type `P` if any.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+#[cfg_attr(feature = "clone-impls", derive(Clone))]
+pub enum Pair<T, P> {
+    Punctuated(T, P),
+    End(T),
+}
+
+impl<T, P> Pair<T, P> {
+    /// Extracts the syntax tree node from this punctuated pair, discarding the
+    /// following punctuation.
+    pub fn into_value(self) -> T {
+        match self {
+            Pair::Punctuated(t, _) | Pair::End(t) => t,
+        }
+    }
+
+    /// Borrows the syntax tree node from this punctuated pair.
+    pub fn value(&self) -> &T {
+        match self {
+            Pair::Punctuated(t, _) | Pair::End(t) => t,
+        }
+    }
+
+    /// Mutably borrows the syntax tree node from this punctuated pair.
+    pub fn value_mut(&mut self) -> &mut T {
+        match self {
+            Pair::Punctuated(t, _) | Pair::End(t) => t,
+        }
+    }
+
+    /// Borrows the punctuation from this punctuated pair, unless this pair is
+    /// the final one and there is no trailing punctuation.
+    pub fn punct(&self) -> Option<&P> {
+        match self {
+            Pair::Punctuated(_, d) => Some(d),
+            Pair::End(_) => None,
+        }
+    }
+
+    /// Creates a punctuated pair out of a syntax tree node and an optional
+    /// following punctuation.
+    pub fn new(t: T, d: Option<P>) -> Self {
+        match d {
+            Some(d) => Pair::Punctuated(t, d),
+            None => Pair::End(t),
+        }
+    }
+
+    /// Produces this punctuated pair as a tuple of syntax tree node and
+    /// optional following punctuation.
+    pub fn into_tuple(self) -> (T, Option<P>) {
+        match self {
+            Pair::Punctuated(t, d) => (t, Some(d)),
+            Pair::End(t) => (t, None),
+        }
+    }
+}
+
+impl<T, P> Index<usize> for Punctuated<T, P> {
+    type Output = T;
+
+    fn index(&self, index: usize) -> &Self::Output {
+        if index == self.len() - 1 {
+            match &self.last {
+                Some(t) => t,
+                None => &self.inner[index].0,
+            }
+        } else {
+            &self.inner[index].0
+        }
+    }
+}
+
+impl<T, P> IndexMut<usize> for Punctuated<T, P> {
+    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
+        if index == self.len() - 1 {
+            match &mut self.last {
+                Some(t) => t,
+                None => &mut self.inner[index].0,
+            }
+        } else {
+            &mut self.inner[index].0
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use super::*;
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    impl<T, P> ToTokens for Punctuated<T, P>
+    where
+        T: ToTokens,
+        P: ToTokens,
+    {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.pairs())
+        }
+    }
+
+    impl<T, P> ToTokens for Pair<T, P>
+    where
+        T: ToTokens,
+        P: ToTokens,
+    {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                Pair::Punctuated(a, b) => {
+                    a.to_tokens(tokens);
+                    b.to_tokens(tokens);
+                }
+                Pair::End(a) => a.to_tokens(tokens),
+            }
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/sealed.rs.html b/src/syn/sealed.rs.html new file mode 100644 index 0000000..bf0d52a --- /dev/null +++ b/src/syn/sealed.rs.html @@ -0,0 +1,11 @@ +sealed.rs.html -- source
1
+2
+3
+4
+
+#[cfg(feature = "parsing")]
+pub mod lookahead {
+    pub trait Sealed: Copy {}
+}
+
+
\ No newline at end of file diff --git a/src/syn/span.rs.html b/src/syn/span.rs.html new file mode 100644 index 0000000..a49a58a --- /dev/null +++ b/src/syn/span.rs.html @@ -0,0 +1,137 @@ +span.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+
+use proc_macro2::Span;
+
+pub trait IntoSpans<S> {
+    fn into_spans(self) -> S;
+}
+
+impl IntoSpans<[Span; 1]> for Span {
+    fn into_spans(self) -> [Span; 1] {
+        [self]
+    }
+}
+
+impl IntoSpans<[Span; 2]> for Span {
+    fn into_spans(self) -> [Span; 2] {
+        [self, self]
+    }
+}
+
+impl IntoSpans<[Span; 3]> for Span {
+    fn into_spans(self) -> [Span; 3] {
+        [self, self, self]
+    }
+}
+
+impl IntoSpans<[Span; 1]> for [Span; 1] {
+    fn into_spans(self) -> [Span; 1] {
+        self
+    }
+}
+
+impl IntoSpans<[Span; 2]> for [Span; 2] {
+    fn into_spans(self) -> [Span; 2] {
+        self
+    }
+}
+
+impl IntoSpans<[Span; 3]> for [Span; 3] {
+    fn into_spans(self) -> [Span; 3] {
+        self
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub trait FromSpans: Sized {
+    fn from_spans(spans: &[Span]) -> Self;
+}
+
+#[cfg(feature = "parsing")]
+impl FromSpans for [Span; 1] {
+    fn from_spans(spans: &[Span]) -> Self {
+        [spans[0]]
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl FromSpans for [Span; 2] {
+    fn from_spans(spans: &[Span]) -> Self {
+        [spans[0], spans[1]]
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl FromSpans for [Span; 3] {
+    fn from_spans(spans: &[Span]) -> Self {
+        [spans[0], spans[1], spans[2]]
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/spanned.rs.html b/src/syn/spanned.rs.html new file mode 100644 index 0000000..6a55402 --- /dev/null +++ b/src/syn/spanned.rs.html @@ -0,0 +1,231 @@ +spanned.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+
+//! A trait that can provide the `Span` of the complete contents of a syntax
+//! tree node.
+//!
+//! *This module is available if Syn is built with both the `"parsing"` and
+//! `"printing"` features.*
+//!
+//! <br>
+//!
+//! # Example
+//!
+//! Suppose in a procedural macro we have a [`Type`] that we want to assert
+//! implements the [`Sync`] trait. Maybe this is the type of one of the fields
+//! of a struct for which we are deriving a trait implementation, and we need to
+//! be able to pass a reference to one of those fields across threads.
+//!
+//! [`Type`]: ../enum.Type.html
+//! [`Sync`]: https://doc.rust-lang.org/std/marker/trait.Sync.html
+//!
+//! If the field type does *not* implement `Sync` as required, we want the
+//! compiler to report an error pointing out exactly which type it was.
+//!
+//! The following macro code takes a variable `ty` of type `Type` and produces a
+//! static assertion that `Sync` is implemented for that type.
+//!
+//! ```
+//! # extern crate proc_macro;
+//! #
+//! use proc_macro::TokenStream;
+//! use proc_macro2::Span;
+//! use quote::quote_spanned;
+//! use syn::Type;
+//! use syn::spanned::Spanned;
+//!
+//! # const IGNORE_TOKENS: &str = stringify! {
+//! #[proc_macro_derive(MyMacro)]
+//! # };
+//! pub fn my_macro(input: TokenStream) -> TokenStream {
+//!     # let ty = get_a_type();
+//!     /* ... */
+//!
+//!     let assert_sync = quote_spanned! {ty.span()=>
+//!         struct _AssertSync where #ty: Sync;
+//!     };
+//!
+//!     /* ... */
+//!     # input
+//! }
+//! #
+//! # fn get_a_type() -> Type {
+//! #     unimplemented!()
+//! # }
+//! ```
+//!
+//! By inserting this `assert_sync` fragment into the output code generated by
+//! our macro, the user's code will fail to compile if `ty` does not implement
+//! `Sync`. The errors they would see look like the following.
+//!
+//! ```text
+//! error[E0277]: the trait bound `*const i32: std::marker::Sync` is not satisfied
+//!   --> src/main.rs:10:21
+//!    |
+//! 10 |     bad_field: *const i32,
+//!    |                ^^^^^^^^^^ `*const i32` cannot be shared between threads safely
+//! ```
+//!
+//! In this technique, using the `Type`'s span for the error message makes the
+//! error appear in the correct place underlining the right type.
+//!
+//! <br>
+//!
+//! # Limitations
+//!
+//! The underlying [`proc_macro::Span::join`] method is nightly-only. When
+//! called from within a procedural macro in a nightly compiler, `Spanned` will
+//! use `join` to produce the intended span. When not using a nightly compiler,
+//! only the span of the *first token* of the syntax tree node is returned.
+//!
+//! In the common case of wanting to use the joined span as the span of a
+//! `syn::Error`, consider instead using [`syn::Error::new_spanned`] which is
+//! able to span the error correctly under the complete syntax tree node without
+//! needing the unstable `join`.
+//!
+//! [`syn::Error::new_spanned`]: crate::Error::new_spanned
+
+use proc_macro2::Span;
+use quote::spanned::Spanned as ToTokens;
+
+/// A trait that can provide the `Span` of the complete contents of a syntax
+/// tree node.
+///
+/// This trait is automatically implemented for all types that implement
+/// [`ToTokens`] from the `quote` crate, as well as for `Span` itself.
+///
+/// [`ToTokens`]: quote::ToTokens
+///
+/// See the [module documentation] for an example.
+///
+/// [module documentation]: self
+///
+/// *This trait is available if Syn is built with both the `"parsing"` and
+/// `"printing"` features.*
+pub trait Spanned {
+    /// Returns a `Span` covering the complete contents of this syntax tree
+    /// node, or [`Span::call_site()`] if this node is empty.
+    ///
+    /// [`Span::call_site()`]: proc_macro2::Span::call_site
+    fn span(&self) -> Span;
+}
+
+impl<T: ?Sized + ToTokens> Spanned for T {
+    fn span(&self) -> Span {
+        self.__span()
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/thread.rs.html b/src/syn/thread.rs.html new file mode 100644 index 0000000..e44025e --- /dev/null +++ b/src/syn/thread.rs.html @@ -0,0 +1,85 @@ +thread.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
+use std::fmt::{self, Debug};
+use std::thread::{self, ThreadId};
+
+/// ThreadBound is a Sync-maker and Send-maker that allows accessing a value
+/// of type T only from the original thread on which the ThreadBound was
+/// constructed.
+pub struct ThreadBound<T> {
+    value: T,
+    thread_id: ThreadId,
+}
+
+unsafe impl<T> Sync for ThreadBound<T> {}
+
+// Send bound requires Copy, as otherwise Drop could run in the wrong place.
+unsafe impl<T: Copy> Send for ThreadBound<T> {}
+
+impl<T> ThreadBound<T> {
+    pub fn new(value: T) -> Self {
+        ThreadBound {
+            value,
+            thread_id: thread::current().id(),
+        }
+    }
+
+    pub fn get(&self) -> Option<&T> {
+        if thread::current().id() == self.thread_id {
+            Some(&self.value)
+        } else {
+            None
+        }
+    }
+}
+
+impl<T: Debug> Debug for ThreadBound<T> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match self.get() {
+            Some(value) => Debug::fmt(value, formatter),
+            None => formatter.write_str("unknown"),
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/token.rs.html b/src/syn/token.rs.html new file mode 100644 index 0000000..674e708 --- /dev/null +++ b/src/syn/token.rs.html @@ -0,0 +1,1915 @@ +token.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+
+//! Tokens representing Rust punctuation, keywords, and delimiters.
+//!
+//! The type names in this module can be difficult to keep straight, so we
+//! prefer to use the [`Token!`] macro instead. This is a type-macro that
+//! expands to the token type of the given token.
+//!
+//! [`Token!`]: ../macro.Token.html
+//!
+//! # Example
+//!
+//! The [`ItemStatic`] syntax tree node is defined like this.
+//!
+//! [`ItemStatic`]: ../struct.ItemStatic.html
+//!
+//! ```
+//! # use syn::{Attribute, Expr, Ident, Token, Type, Visibility};
+//! #
+//! pub struct ItemStatic {
+//!     pub attrs: Vec<Attribute>,
+//!     pub vis: Visibility,
+//!     pub static_token: Token![static],
+//!     pub mutability: Option<Token![mut]>,
+//!     pub ident: Ident,
+//!     pub colon_token: Token![:],
+//!     pub ty: Box<Type>,
+//!     pub eq_token: Token![=],
+//!     pub expr: Box<Expr>,
+//!     pub semi_token: Token![;],
+//! }
+//! ```
+//!
+//! # Parsing
+//!
+//! Keywords and punctuation can be parsed through the [`ParseStream::parse`]
+//! method. Delimiter tokens are parsed using the [`parenthesized!`],
+//! [`bracketed!`] and [`braced!`] macros.
+//!
+//! [`ParseStream::parse`]: ../parse/struct.ParseBuffer.html#method.parse
+//! [`parenthesized!`]: ../macro.parenthesized.html
+//! [`bracketed!`]: ../macro.bracketed.html
+//! [`braced!`]: ../macro.braced.html
+//!
+//! ```
+//! use syn::{Attribute, Result};
+//! use syn::parse::{Parse, ParseStream};
+//! #
+//! # enum ItemStatic {}
+//!
+//! // Parse the ItemStatic struct shown above.
+//! impl Parse for ItemStatic {
+//!     fn parse(input: ParseStream) -> Result<Self> {
+//!         # use syn::ItemStatic;
+//!         # fn parse(input: ParseStream) -> Result<ItemStatic> {
+//!         Ok(ItemStatic {
+//!             attrs: input.call(Attribute::parse_outer)?,
+//!             vis: input.parse()?,
+//!             static_token: input.parse()?,
+//!             mutability: input.parse()?,
+//!             ident: input.parse()?,
+//!             colon_token: input.parse()?,
+//!             ty: input.parse()?,
+//!             eq_token: input.parse()?,
+//!             expr: input.parse()?,
+//!             semi_token: input.parse()?,
+//!         })
+//!         # }
+//!         # unimplemented!()
+//!     }
+//! }
+//! ```
+//!
+//! # Other operations
+//!
+//! Every keyword and punctuation token supports the following operations.
+//!
+//! - [Peeking] — `input.peek(Token![...])`
+//!
+//! - [Parsing] — `input.parse::<Token![...]>()?`
+//!
+//! - [Printing] — `quote!( ... #the_token ... )`
+//!
+//! - Construction from a [`Span`] — `let the_token = Token![...](sp)`
+//!
+//! - Field access to its span — `let sp = the_token.span`
+//!
+//! [Peeking]: ../parse/struct.ParseBuffer.html#method.peek
+//! [Parsing]: ../parse/struct.ParseBuffer.html#method.parse
+//! [Printing]: https://docs.rs/quote/1.0/quote/trait.ToTokens.html
+//! [`Span`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.Span.html
+
+use std;
+#[cfg(feature = "extra-traits")]
+use std::cmp;
+#[cfg(feature = "extra-traits")]
+use std::fmt::{self, Debug};
+#[cfg(feature = "extra-traits")]
+use std::hash::{Hash, Hasher};
+use std::ops::{Deref, DerefMut};
+
+#[cfg(feature = "parsing")]
+use proc_macro2::Delimiter;
+#[cfg(any(feature = "parsing", feature = "printing"))]
+use proc_macro2::Ident;
+use proc_macro2::Span;
+#[cfg(feature = "printing")]
+use proc_macro2::TokenStream;
+#[cfg(feature = "printing")]
+use quote::{ToTokens, TokenStreamExt};
+
+use self::private::WithSpan;
+#[cfg(feature = "parsing")]
+use crate::buffer::Cursor;
+#[cfg(feature = "parsing")]
+use crate::error::Result;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg(feature = "parsing")]
+use crate::lifetime::Lifetime;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg(feature = "parsing")]
+use crate::lit::{Lit, LitBool, LitByte, LitByteStr, LitChar, LitFloat, LitInt, LitStr};
+#[cfg(feature = "parsing")]
+use crate::lookahead;
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, ParseStream};
+use crate::span::IntoSpans;
+
+/// Marker trait for types that represent single tokens.
+///
+/// This trait is sealed and cannot be implemented for types outside of Syn.
+#[cfg(feature = "parsing")]
+pub trait Token: private::Sealed {
+    // Not public API.
+    #[doc(hidden)]
+    fn peek(cursor: Cursor) -> bool;
+
+    // Not public API.
+    #[doc(hidden)]
+    fn display() -> &'static str;
+}
+
+mod private {
+    use proc_macro2::Span;
+
+    #[cfg(feature = "parsing")]
+    pub trait Sealed {}
+
+    /// Support writing `token.span` rather than `token.spans[0]` on tokens that
+    /// hold a single span.
+    #[repr(C)]
+    pub struct WithSpan {
+        pub span: Span,
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl private::Sealed for Ident {}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg(feature = "parsing")]
+fn peek_impl(cursor: Cursor, peek: fn(ParseStream) -> bool) -> bool {
+    use crate::parse::Unexpected;
+    use std::cell::Cell;
+    use std::rc::Rc;
+
+    let scope = Span::call_site();
+    let unexpected = Rc::new(Cell::new(Unexpected::None));
+    let buffer = crate::parse::new_parse_buffer(scope, cursor, unexpected);
+    peek(&buffer)
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+macro_rules! impl_token {
+    ($name:ident $display:expr) => {
+        #[cfg(feature = "parsing")]
+        impl Token for $name {
+            fn peek(cursor: Cursor) -> bool {
+                fn peek(input: ParseStream) -> bool {
+                    <$name as Parse>::parse(input).is_ok()
+                }
+                peek_impl(cursor, peek)
+            }
+
+            fn display() -> &'static str {
+                $display
+            }
+        }
+
+        #[cfg(feature = "parsing")]
+        impl private::Sealed for $name {}
+    };
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+impl_token!(Lifetime "lifetime");
+#[cfg(any(feature = "full", feature = "derive"))]
+impl_token!(Lit "literal");
+#[cfg(any(feature = "full", feature = "derive"))]
+impl_token!(LitStr "string literal");
+#[cfg(any(feature = "full", feature = "derive"))]
+impl_token!(LitByteStr "byte string literal");
+#[cfg(any(feature = "full", feature = "derive"))]
+impl_token!(LitByte "byte literal");
+#[cfg(any(feature = "full", feature = "derive"))]
+impl_token!(LitChar "character literal");
+#[cfg(any(feature = "full", feature = "derive"))]
+impl_token!(LitInt "integer literal");
+#[cfg(any(feature = "full", feature = "derive"))]
+impl_token!(LitFloat "floating point literal");
+#[cfg(any(feature = "full", feature = "derive"))]
+impl_token!(LitBool "boolean literal");
+
+// Not public API.
+#[doc(hidden)]
+#[cfg(feature = "parsing")]
+pub trait CustomToken {
+    fn peek(cursor: Cursor) -> bool;
+    fn display() -> &'static str;
+}
+
+#[cfg(feature = "parsing")]
+impl<T: CustomToken> private::Sealed for T {}
+
+#[cfg(feature = "parsing")]
+impl<T: CustomToken> Token for T {
+    fn peek(cursor: Cursor) -> bool {
+        <Self as CustomToken>::peek(cursor)
+    }
+
+    fn display() -> &'static str {
+        <Self as CustomToken>::display()
+    }
+}
+
+macro_rules! define_keywords {
+    ($($token:tt pub struct $name:ident #[$doc:meta])*) => {
+        $(
+            #[cfg_attr(feature = "clone-impls", derive(Copy, Clone))]
+            #[$doc]
+            ///
+            /// Don't try to remember the name of this type &mdash; use the
+            /// [`Token!`] macro instead.
+            ///
+            /// [`Token!`]: crate::token
+            pub struct $name {
+                pub span: Span,
+            }
+
+            #[doc(hidden)]
+            #[allow(non_snake_case)]
+            pub fn $name<S: IntoSpans<[Span; 1]>>(span: S) -> $name {
+                $name {
+                    span: span.into_spans()[0],
+                }
+            }
+
+            impl std::default::Default for $name {
+                fn default() -> Self {
+                    $name {
+                        span: Span::call_site(),
+                    }
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            impl Debug for $name {
+                fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                    f.write_str(stringify!($name))
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            impl cmp::Eq for $name {}
+
+            #[cfg(feature = "extra-traits")]
+            impl PartialEq for $name {
+                fn eq(&self, _other: &$name) -> bool {
+                    true
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            impl Hash for $name {
+                fn hash<H: Hasher>(&self, _state: &mut H) {}
+            }
+
+            #[cfg(feature = "printing")]
+            impl ToTokens for $name {
+                fn to_tokens(&self, tokens: &mut TokenStream) {
+                    printing::keyword($token, self.span, tokens);
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl Parse for $name {
+                fn parse(input: ParseStream) -> Result<Self> {
+                    Ok($name {
+                        span: parsing::keyword(input, $token)?,
+                    })
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl Token for $name {
+                fn peek(cursor: Cursor) -> bool {
+                    parsing::peek_keyword(cursor, $token)
+                }
+
+                fn display() -> &'static str {
+                    concat!("`", $token, "`")
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl private::Sealed for $name {}
+        )*
+    };
+}
+
+macro_rules! impl_deref_if_len_is_1 {
+    ($name:ident/1) => {
+        impl Deref for $name {
+            type Target = WithSpan;
+
+            fn deref(&self) -> &Self::Target {
+                unsafe { &*(self as *const Self as *const WithSpan) }
+            }
+        }
+
+        impl DerefMut for $name {
+            fn deref_mut(&mut self) -> &mut Self::Target {
+                unsafe { &mut *(self as *mut Self as *mut WithSpan) }
+            }
+        }
+    };
+
+    ($name:ident/$len:tt) => {};
+}
+
+macro_rules! define_punctuation_structs {
+    ($($token:tt pub struct $name:ident/$len:tt #[$doc:meta])*) => {
+        $(
+            #[cfg_attr(feature = "clone-impls", derive(Copy, Clone))]
+            #[repr(C)]
+            #[$doc]
+            ///
+            /// Don't try to remember the name of this type &mdash; use the
+            /// [`Token!`] macro instead.
+            ///
+            /// [`Token!`]: crate::token
+            pub struct $name {
+                pub spans: [Span; $len],
+            }
+
+            #[doc(hidden)]
+            #[allow(non_snake_case)]
+            pub fn $name<S: IntoSpans<[Span; $len]>>(spans: S) -> $name {
+                $name {
+                    spans: spans.into_spans(),
+                }
+            }
+
+            impl std::default::Default for $name {
+                fn default() -> Self {
+                    $name {
+                        spans: [Span::call_site(); $len],
+                    }
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            impl Debug for $name {
+                fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                    f.write_str(stringify!($name))
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            impl cmp::Eq for $name {}
+
+            #[cfg(feature = "extra-traits")]
+            impl PartialEq for $name {
+                fn eq(&self, _other: &$name) -> bool {
+                    true
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            impl Hash for $name {
+                fn hash<H: Hasher>(&self, _state: &mut H) {}
+            }
+
+            impl_deref_if_len_is_1!($name/$len);
+        )*
+    };
+}
+
+macro_rules! define_punctuation {
+    ($($token:tt pub struct $name:ident/$len:tt #[$doc:meta])*) => {
+        $(
+            define_punctuation_structs! {
+                $token pub struct $name/$len #[$doc]
+            }
+
+            #[cfg(feature = "printing")]
+            impl ToTokens for $name {
+                fn to_tokens(&self, tokens: &mut TokenStream) {
+                    printing::punct($token, &self.spans, tokens);
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl Parse for $name {
+                fn parse(input: ParseStream) -> Result<Self> {
+                    Ok($name {
+                        spans: parsing::punct(input, $token)?,
+                    })
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl Token for $name {
+                fn peek(cursor: Cursor) -> bool {
+                    parsing::peek_punct(cursor, $token)
+                }
+
+                fn display() -> &'static str {
+                    concat!("`", $token, "`")
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl private::Sealed for $name {}
+        )*
+    };
+}
+
+macro_rules! define_delimiters {
+    ($($token:tt pub struct $name:ident #[$doc:meta])*) => {
+        $(
+            #[cfg_attr(feature = "clone-impls", derive(Copy, Clone))]
+            #[$doc]
+            pub struct $name {
+                pub span: Span,
+            }
+
+            #[doc(hidden)]
+            #[allow(non_snake_case)]
+            pub fn $name<S: IntoSpans<[Span; 1]>>(span: S) -> $name {
+                $name {
+                    span: span.into_spans()[0],
+                }
+            }
+
+            impl std::default::Default for $name {
+                fn default() -> Self {
+                    $name {
+                        span: Span::call_site(),
+                    }
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            impl Debug for $name {
+                fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                    f.write_str(stringify!($name))
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            impl cmp::Eq for $name {}
+
+            #[cfg(feature = "extra-traits")]
+            impl PartialEq for $name {
+                fn eq(&self, _other: &$name) -> bool {
+                    true
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            impl Hash for $name {
+                fn hash<H: Hasher>(&self, _state: &mut H) {}
+            }
+
+            impl $name {
+                #[cfg(feature = "printing")]
+                pub fn surround<F>(&self, tokens: &mut TokenStream, f: F)
+                where
+                    F: FnOnce(&mut TokenStream),
+                {
+                    printing::delim($token, self.span, tokens, f);
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl private::Sealed for $name {}
+        )*
+    };
+}
+
+define_punctuation_structs! {
+    "_" pub struct Underscore/1 /// `_`
+}
+
+#[cfg(feature = "printing")]
+impl ToTokens for Underscore {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(Ident::new("_", self.span));
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Parse for Underscore {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| {
+            if let Some((ident, rest)) = cursor.ident() {
+                if ident == "_" {
+                    return Ok((Underscore(ident.span()), rest));
+                }
+            }
+            if let Some((punct, rest)) = cursor.punct() {
+                if punct.as_char() == '_' {
+                    return Ok((Underscore(punct.span()), rest));
+                }
+            }
+            Err(cursor.error("expected `_`"))
+        })
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Token for Underscore {
+    fn peek(cursor: Cursor) -> bool {
+        if let Some((ident, _rest)) = cursor.ident() {
+            return ident == "_";
+        }
+        if let Some((punct, _rest)) = cursor.punct() {
+            return punct.as_char() == '_';
+        }
+        false
+    }
+
+    fn display() -> &'static str {
+        "`_`"
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl private::Sealed for Underscore {}
+
+#[cfg(feature = "parsing")]
+impl Token for Paren {
+    fn peek(cursor: Cursor) -> bool {
+        lookahead::is_delimiter(cursor, Delimiter::Parenthesis)
+    }
+
+    fn display() -> &'static str {
+        "parentheses"
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Token for Brace {
+    fn peek(cursor: Cursor) -> bool {
+        lookahead::is_delimiter(cursor, Delimiter::Brace)
+    }
+
+    fn display() -> &'static str {
+        "curly braces"
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Token for Bracket {
+    fn peek(cursor: Cursor) -> bool {
+        lookahead::is_delimiter(cursor, Delimiter::Bracket)
+    }
+
+    fn display() -> &'static str {
+        "square brackets"
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Token for Group {
+    fn peek(cursor: Cursor) -> bool {
+        lookahead::is_delimiter(cursor, Delimiter::None)
+    }
+
+    fn display() -> &'static str {
+        "invisible group"
+    }
+}
+
+define_keywords! {
+    "abstract"    pub struct Abstract     /// `abstract`
+    "as"          pub struct As           /// `as`
+    "async"       pub struct Async        /// `async`
+    "auto"        pub struct Auto         /// `auto`
+    "await"       pub struct Await        /// `await`
+    "become"      pub struct Become       /// `become`
+    "box"         pub struct Box          /// `box`
+    "break"       pub struct Break        /// `break`
+    "const"       pub struct Const        /// `const`
+    "continue"    pub struct Continue     /// `continue`
+    "crate"       pub struct Crate        /// `crate`
+    "default"     pub struct Default      /// `default`
+    "do"          pub struct Do           /// `do`
+    "dyn"         pub struct Dyn          /// `dyn`
+    "else"        pub struct Else         /// `else`
+    "enum"        pub struct Enum         /// `enum`
+    "extern"      pub struct Extern       /// `extern`
+    "final"       pub struct Final        /// `final`
+    "fn"          pub struct Fn           /// `fn`
+    "for"         pub struct For          /// `for`
+    "if"          pub struct If           /// `if`
+    "impl"        pub struct Impl         /// `impl`
+    "in"          pub struct In           /// `in`
+    "let"         pub struct Let          /// `let`
+    "loop"        pub struct Loop         /// `loop`
+    "macro"       pub struct Macro        /// `macro`
+    "match"       pub struct Match        /// `match`
+    "mod"         pub struct Mod          /// `mod`
+    "move"        pub struct Move         /// `move`
+    "mut"         pub struct Mut          /// `mut`
+    "override"    pub struct Override     /// `override`
+    "priv"        pub struct Priv         /// `priv`
+    "pub"         pub struct Pub          /// `pub`
+    "ref"         pub struct Ref          /// `ref`
+    "return"      pub struct Return       /// `return`
+    "Self"        pub struct SelfType     /// `Self`
+    "self"        pub struct SelfValue    /// `self`
+    "static"      pub struct Static       /// `static`
+    "struct"      pub struct Struct       /// `struct`
+    "super"       pub struct Super        /// `super`
+    "trait"       pub struct Trait        /// `trait`
+    "try"         pub struct Try          /// `try`
+    "type"        pub struct Type         /// `type`
+    "typeof"      pub struct Typeof       /// `typeof`
+    "union"       pub struct Union        /// `union`
+    "unsafe"      pub struct Unsafe       /// `unsafe`
+    "unsized"     pub struct Unsized      /// `unsized`
+    "use"         pub struct Use          /// `use`
+    "virtual"     pub struct Virtual      /// `virtual`
+    "where"       pub struct Where        /// `where`
+    "while"       pub struct While        /// `while`
+    "yield"       pub struct Yield        /// `yield`
+}
+
+define_punctuation! {
+    "+"           pub struct Add/1        /// `+`
+    "+="          pub struct AddEq/2      /// `+=`
+    "&"           pub struct And/1        /// `&`
+    "&&"          pub struct AndAnd/2     /// `&&`
+    "&="          pub struct AndEq/2      /// `&=`
+    "@"           pub struct At/1         /// `@`
+    "!"           pub struct Bang/1       /// `!`
+    "^"           pub struct Caret/1      /// `^`
+    "^="          pub struct CaretEq/2    /// `^=`
+    ":"           pub struct Colon/1      /// `:`
+    "::"          pub struct Colon2/2     /// `::`
+    ","           pub struct Comma/1      /// `,`
+    "/"           pub struct Div/1        /// `/`
+    "/="          pub struct DivEq/2      /// `/=`
+    "$"           pub struct Dollar/1     /// `$`
+    "."           pub struct Dot/1        /// `.`
+    ".."          pub struct Dot2/2       /// `..`
+    "..."         pub struct Dot3/3       /// `...`
+    "..="         pub struct DotDotEq/3   /// `..=`
+    "="           pub struct Eq/1         /// `=`
+    "=="          pub struct EqEq/2       /// `==`
+    ">="          pub struct Ge/2         /// `>=`
+    ">"           pub struct Gt/1         /// `>`
+    "<="          pub struct Le/2         /// `<=`
+    "<"           pub struct Lt/1         /// `<`
+    "*="          pub struct MulEq/2      /// `*=`
+    "!="          pub struct Ne/2         /// `!=`
+    "|"           pub struct Or/1         /// `|`
+    "|="          pub struct OrEq/2       /// `|=`
+    "||"          pub struct OrOr/2       /// `||`
+    "#"           pub struct Pound/1      /// `#`
+    "?"           pub struct Question/1   /// `?`
+    "->"          pub struct RArrow/2     /// `->`
+    "<-"          pub struct LArrow/2     /// `<-`
+    "%"           pub struct Rem/1        /// `%`
+    "%="          pub struct RemEq/2      /// `%=`
+    "=>"          pub struct FatArrow/2   /// `=>`
+    ";"           pub struct Semi/1       /// `;`
+    "<<"          pub struct Shl/2        /// `<<`
+    "<<="         pub struct ShlEq/3      /// `<<=`
+    ">>"          pub struct Shr/2        /// `>>`
+    ">>="         pub struct ShrEq/3      /// `>>=`
+    "*"           pub struct Star/1       /// `*`
+    "-"           pub struct Sub/1        /// `-`
+    "-="          pub struct SubEq/2      /// `-=`
+    "~"           pub struct Tilde/1      /// `~`
+}
+
+define_delimiters! {
+    "{"           pub struct Brace        /// `{...}`
+    "["           pub struct Bracket      /// `[...]`
+    "("           pub struct Paren        /// `(...)`
+    " "           pub struct Group        /// None-delimited group
+}
+
+macro_rules! export_token_macro {
+    ($($await_rule:tt)*) => {
+        /// A type-macro that expands to the name of the Rust type representation of a
+        /// given token.
+        ///
+        /// See the [token module] documentation for details and examples.
+        ///
+        /// [token module]: crate::token
+        // Unfortunate duplication due to a rustdoc bug.
+        // https://github.com/rust-lang/rust/issues/45939
+        #[macro_export]
+        macro_rules! Token {
+            (abstract)    => { $crate::token::Abstract };
+            (as)          => { $crate::token::As };
+            (async)       => { $crate::token::Async };
+            (auto)        => { $crate::token::Auto };
+            $($await_rule => { $crate::token::Await };)*
+            (become)      => { $crate::token::Become };
+            (box)         => { $crate::token::Box };
+            (break)       => { $crate::token::Break };
+            (const)       => { $crate::token::Const };
+            (continue)    => { $crate::token::Continue };
+            (crate)       => { $crate::token::Crate };
+            (default)     => { $crate::token::Default };
+            (do)          => { $crate::token::Do };
+            (dyn)         => { $crate::token::Dyn };
+            (else)        => { $crate::token::Else };
+            (enum)        => { $crate::token::Enum };
+            (extern)      => { $crate::token::Extern };
+            (final)       => { $crate::token::Final };
+            (fn)          => { $crate::token::Fn };
+            (for)         => { $crate::token::For };
+            (if)          => { $crate::token::If };
+            (impl)        => { $crate::token::Impl };
+            (in)          => { $crate::token::In };
+            (let)         => { $crate::token::Let };
+            (loop)        => { $crate::token::Loop };
+            (macro)       => { $crate::token::Macro };
+            (match)       => { $crate::token::Match };
+            (mod)         => { $crate::token::Mod };
+            (move)        => { $crate::token::Move };
+            (mut)         => { $crate::token::Mut };
+            (override)    => { $crate::token::Override };
+            (priv)        => { $crate::token::Priv };
+            (pub)         => { $crate::token::Pub };
+            (ref)         => { $crate::token::Ref };
+            (return)      => { $crate::token::Return };
+            (Self)        => { $crate::token::SelfType };
+            (self)        => { $crate::token::SelfValue };
+            (static)      => { $crate::token::Static };
+            (struct)      => { $crate::token::Struct };
+            (super)       => { $crate::token::Super };
+            (trait)       => { $crate::token::Trait };
+            (try)         => { $crate::token::Try };
+            (type)        => { $crate::token::Type };
+            (typeof)      => { $crate::token::Typeof };
+            (union)       => { $crate::token::Union };
+            (unsafe)      => { $crate::token::Unsafe };
+            (unsized)     => { $crate::token::Unsized };
+            (use)         => { $crate::token::Use };
+            (virtual)     => { $crate::token::Virtual };
+            (where)       => { $crate::token::Where };
+            (while)       => { $crate::token::While };
+            (yield)       => { $crate::token::Yield };
+            (+)           => { $crate::token::Add };
+            (+=)          => { $crate::token::AddEq };
+            (&)           => { $crate::token::And };
+            (&&)          => { $crate::token::AndAnd };
+            (&=)          => { $crate::token::AndEq };
+            (@)           => { $crate::token::At };
+            (!)           => { $crate::token::Bang };
+            (^)           => { $crate::token::Caret };
+            (^=)          => { $crate::token::CaretEq };
+            (:)           => { $crate::token::Colon };
+            (::)          => { $crate::token::Colon2 };
+            (,)           => { $crate::token::Comma };
+            (/)           => { $crate::token::Div };
+            (/=)          => { $crate::token::DivEq };
+            ($)           => { $crate::token::Dollar };
+            (.)           => { $crate::token::Dot };
+            (..)          => { $crate::token::Dot2 };
+            (...)         => { $crate::token::Dot3 };
+            (..=)         => { $crate::token::DotDotEq };
+            (=)           => { $crate::token::Eq };
+            (==)          => { $crate::token::EqEq };
+            (>=)          => { $crate::token::Ge };
+            (>)           => { $crate::token::Gt };
+            (<=)          => { $crate::token::Le };
+            (<)           => { $crate::token::Lt };
+            (*=)          => { $crate::token::MulEq };
+            (!=)          => { $crate::token::Ne };
+            (|)           => { $crate::token::Or };
+            (|=)          => { $crate::token::OrEq };
+            (||)          => { $crate::token::OrOr };
+            (#)           => { $crate::token::Pound };
+            (?)           => { $crate::token::Question };
+            (->)          => { $crate::token::RArrow };
+            (<-)          => { $crate::token::LArrow };
+            (%)           => { $crate::token::Rem };
+            (%=)          => { $crate::token::RemEq };
+            (=>)          => { $crate::token::FatArrow };
+            (;)           => { $crate::token::Semi };
+            (<<)          => { $crate::token::Shl };
+            (<<=)         => { $crate::token::ShlEq };
+            (>>)          => { $crate::token::Shr };
+            (>>=)         => { $crate::token::ShrEq };
+            (*)           => { $crate::token::Star };
+            (-)           => { $crate::token::Sub };
+            (-=)          => { $crate::token::SubEq };
+            (~)           => { $crate::token::Tilde };
+            (_)           => { $crate::token::Underscore };
+        }
+    };
+}
+
+// Old rustc does not permit `await` appearing anywhere in the source file.
+// https://github.com/rust-lang/rust/issues/57919
+// We put the Token![await] rule in a place that is not lexed by old rustc.
+#[cfg(not(syn_omit_await_from_token_macro))]
+include!("await.rs"); // export_token_macro![(await)];
+#[cfg(syn_omit_await_from_token_macro)]
+export_token_macro![];
+
+// Not public API.
+#[doc(hidden)]
+#[cfg(feature = "parsing")]
+pub mod parsing {
+    use proc_macro2::{Spacing, Span};
+
+    use crate::buffer::Cursor;
+    use crate::error::{Error, Result};
+    use crate::parse::ParseStream;
+    use crate::span::FromSpans;
+
+    pub fn keyword(input: ParseStream, token: &str) -> Result<Span> {
+        input.step(|cursor| {
+            if let Some((ident, rest)) = cursor.ident() {
+                if ident == token {
+                    return Ok((ident.span(), rest));
+                }
+            }
+            Err(cursor.error(format!("expected `{}`", token)))
+        })
+    }
+
+    pub fn peek_keyword(cursor: Cursor, token: &str) -> bool {
+        if let Some((ident, _rest)) = cursor.ident() {
+            ident == token
+        } else {
+            false
+        }
+    }
+
+    pub fn punct<S: FromSpans>(input: ParseStream, token: &str) -> Result<S> {
+        let mut spans = [input.span(); 3];
+        punct_helper(input, token, &mut spans)?;
+        Ok(S::from_spans(&spans))
+    }
+
+    fn punct_helper(input: ParseStream, token: &str, spans: &mut [Span; 3]) -> Result<()> {
+        input.step(|cursor| {
+            let mut cursor = *cursor;
+            assert!(token.len() <= spans.len());
+
+            for (i, ch) in token.chars().enumerate() {
+                match cursor.punct() {
+                    Some((punct, rest)) => {
+                        spans[i] = punct.span();
+                        if punct.as_char() != ch {
+                            break;
+                        } else if i == token.len() - 1 {
+                            return Ok(((), rest));
+                        } else if punct.spacing() != Spacing::Joint {
+                            break;
+                        }
+                        cursor = rest;
+                    }
+                    None => break,
+                }
+            }
+
+            Err(Error::new(spans[0], format!("expected `{}`", token)))
+        })
+    }
+
+    pub fn peek_punct(mut cursor: Cursor, token: &str) -> bool {
+        for (i, ch) in token.chars().enumerate() {
+            match cursor.punct() {
+                Some((punct, rest)) => {
+                    if punct.as_char() != ch {
+                        break;
+                    } else if i == token.len() - 1 {
+                        return true;
+                    } else if punct.spacing() != Spacing::Joint {
+                        break;
+                    }
+                    cursor = rest;
+                }
+                None => break,
+            }
+        }
+        false
+    }
+}
+
+// Not public API.
+#[doc(hidden)]
+#[cfg(feature = "printing")]
+pub mod printing {
+    use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream};
+    use quote::TokenStreamExt;
+
+    pub fn punct(s: &str, spans: &[Span], tokens: &mut TokenStream) {
+        assert_eq!(s.len(), spans.len());
+
+        let mut chars = s.chars();
+        let mut spans = spans.iter();
+        let ch = chars.next_back().unwrap();
+        let span = spans.next_back().unwrap();
+        for (ch, span) in chars.zip(spans) {
+            let mut op = Punct::new(ch, Spacing::Joint);
+            op.set_span(*span);
+            tokens.append(op);
+        }
+
+        let mut op = Punct::new(ch, Spacing::Alone);
+        op.set_span(*span);
+        tokens.append(op);
+    }
+
+    pub fn keyword(s: &str, span: Span, tokens: &mut TokenStream) {
+        tokens.append(Ident::new(s, span));
+    }
+
+    pub fn delim<F>(s: &str, span: Span, tokens: &mut TokenStream, f: F)
+    where
+        F: FnOnce(&mut TokenStream),
+    {
+        let delim = match s {
+            "(" => Delimiter::Parenthesis,
+            "[" => Delimiter::Bracket,
+            "{" => Delimiter::Brace,
+            " " => Delimiter::None,
+            _ => panic!("unknown delimiter: {}", s),
+        };
+        let mut inner = TokenStream::new();
+        f(&mut inner);
+        let mut g = Group::new(delim, inner);
+        g.set_span(span);
+        tokens.append(g);
+    }
+}
+
+
\ No newline at end of file diff --git a/src/syn/ty.rs.html b/src/syn/ty.rs.html new file mode 100644 index 0000000..70ff420 --- /dev/null +++ b/src/syn/ty.rs.html @@ -0,0 +1,2359 @@ +ty.rs.html -- source
   1
+   2
+   3
+   4
+   5
+   6
+   7
+   8
+   9
+  10
+  11
+  12
+  13
+  14
+  15
+  16
+  17
+  18
+  19
+  20
+  21
+  22
+  23
+  24
+  25
+  26
+  27
+  28
+  29
+  30
+  31
+  32
+  33
+  34
+  35
+  36
+  37
+  38
+  39
+  40
+  41
+  42
+  43
+  44
+  45
+  46
+  47
+  48
+  49
+  50
+  51
+  52
+  53
+  54
+  55
+  56
+  57
+  58
+  59
+  60
+  61
+  62
+  63
+  64
+  65
+  66
+  67
+  68
+  69
+  70
+  71
+  72
+  73
+  74
+  75
+  76
+  77
+  78
+  79
+  80
+  81
+  82
+  83
+  84
+  85
+  86
+  87
+  88
+  89
+  90
+  91
+  92
+  93
+  94
+  95
+  96
+  97
+  98
+  99
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+ 201
+ 202
+ 203
+ 204
+ 205
+ 206
+ 207
+ 208
+ 209
+ 210
+ 211
+ 212
+ 213
+ 214
+ 215
+ 216
+ 217
+ 218
+ 219
+ 220
+ 221
+ 222
+ 223
+ 224
+ 225
+ 226
+ 227
+ 228
+ 229
+ 230
+ 231
+ 232
+ 233
+ 234
+ 235
+ 236
+ 237
+ 238
+ 239
+ 240
+ 241
+ 242
+ 243
+ 244
+ 245
+ 246
+ 247
+ 248
+ 249
+ 250
+ 251
+ 252
+ 253
+ 254
+ 255
+ 256
+ 257
+ 258
+ 259
+ 260
+ 261
+ 262
+ 263
+ 264
+ 265
+ 266
+ 267
+ 268
+ 269
+ 270
+ 271
+ 272
+ 273
+ 274
+ 275
+ 276
+ 277
+ 278
+ 279
+ 280
+ 281
+ 282
+ 283
+ 284
+ 285
+ 286
+ 287
+ 288
+ 289
+ 290
+ 291
+ 292
+ 293
+ 294
+ 295
+ 296
+ 297
+ 298
+ 299
+ 300
+ 301
+ 302
+ 303
+ 304
+ 305
+ 306
+ 307
+ 308
+ 309
+ 310
+ 311
+ 312
+ 313
+ 314
+ 315
+ 316
+ 317
+ 318
+ 319
+ 320
+ 321
+ 322
+ 323
+ 324
+ 325
+ 326
+ 327
+ 328
+ 329
+ 330
+ 331
+ 332
+ 333
+ 334
+ 335
+ 336
+ 337
+ 338
+ 339
+ 340
+ 341
+ 342
+ 343
+ 344
+ 345
+ 346
+ 347
+ 348
+ 349
+ 350
+ 351
+ 352
+ 353
+ 354
+ 355
+ 356
+ 357
+ 358
+ 359
+ 360
+ 361
+ 362
+ 363
+ 364
+ 365
+ 366
+ 367
+ 368
+ 369
+ 370
+ 371
+ 372
+ 373
+ 374
+ 375
+ 376
+ 377
+ 378
+ 379
+ 380
+ 381
+ 382
+ 383
+ 384
+ 385
+ 386
+ 387
+ 388
+ 389
+ 390
+ 391
+ 392
+ 393
+ 394
+ 395
+ 396
+ 397
+ 398
+ 399
+ 400
+ 401
+ 402
+ 403
+ 404
+ 405
+ 406
+ 407
+ 408
+ 409
+ 410
+ 411
+ 412
+ 413
+ 414
+ 415
+ 416
+ 417
+ 418
+ 419
+ 420
+ 421
+ 422
+ 423
+ 424
+ 425
+ 426
+ 427
+ 428
+ 429
+ 430
+ 431
+ 432
+ 433
+ 434
+ 435
+ 436
+ 437
+ 438
+ 439
+ 440
+ 441
+ 442
+ 443
+ 444
+ 445
+ 446
+ 447
+ 448
+ 449
+ 450
+ 451
+ 452
+ 453
+ 454
+ 455
+ 456
+ 457
+ 458
+ 459
+ 460
+ 461
+ 462
+ 463
+ 464
+ 465
+ 466
+ 467
+ 468
+ 469
+ 470
+ 471
+ 472
+ 473
+ 474
+ 475
+ 476
+ 477
+ 478
+ 479
+ 480
+ 481
+ 482
+ 483
+ 484
+ 485
+ 486
+ 487
+ 488
+ 489
+ 490
+ 491
+ 492
+ 493
+ 494
+ 495
+ 496
+ 497
+ 498
+ 499
+ 500
+ 501
+ 502
+ 503
+ 504
+ 505
+ 506
+ 507
+ 508
+ 509
+ 510
+ 511
+ 512
+ 513
+ 514
+ 515
+ 516
+ 517
+ 518
+ 519
+ 520
+ 521
+ 522
+ 523
+ 524
+ 525
+ 526
+ 527
+ 528
+ 529
+ 530
+ 531
+ 532
+ 533
+ 534
+ 535
+ 536
+ 537
+ 538
+ 539
+ 540
+ 541
+ 542
+ 543
+ 544
+ 545
+ 546
+ 547
+ 548
+ 549
+ 550
+ 551
+ 552
+ 553
+ 554
+ 555
+ 556
+ 557
+ 558
+ 559
+ 560
+ 561
+ 562
+ 563
+ 564
+ 565
+ 566
+ 567
+ 568
+ 569
+ 570
+ 571
+ 572
+ 573
+ 574
+ 575
+ 576
+ 577
+ 578
+ 579
+ 580
+ 581
+ 582
+ 583
+ 584
+ 585
+ 586
+ 587
+ 588
+ 589
+ 590
+ 591
+ 592
+ 593
+ 594
+ 595
+ 596
+ 597
+ 598
+ 599
+ 600
+ 601
+ 602
+ 603
+ 604
+ 605
+ 606
+ 607
+ 608
+ 609
+ 610
+ 611
+ 612
+ 613
+ 614
+ 615
+ 616
+ 617
+ 618
+ 619
+ 620
+ 621
+ 622
+ 623
+ 624
+ 625
+ 626
+ 627
+ 628
+ 629
+ 630
+ 631
+ 632
+ 633
+ 634
+ 635
+ 636
+ 637
+ 638
+ 639
+ 640
+ 641
+ 642
+ 643
+ 644
+ 645
+ 646
+ 647
+ 648
+ 649
+ 650
+ 651
+ 652
+ 653
+ 654
+ 655
+ 656
+ 657
+ 658
+ 659
+ 660
+ 661
+ 662
+ 663
+ 664
+ 665
+ 666
+ 667
+ 668
+ 669
+ 670
+ 671
+ 672
+ 673
+ 674
+ 675
+ 676
+ 677
+ 678
+ 679
+ 680
+ 681
+ 682
+ 683
+ 684
+ 685
+ 686
+ 687
+ 688
+ 689
+ 690
+ 691
+ 692
+ 693
+ 694
+ 695
+ 696
+ 697
+ 698
+ 699
+ 700
+ 701
+ 702
+ 703
+ 704
+ 705
+ 706
+ 707
+ 708
+ 709
+ 710
+ 711
+ 712
+ 713
+ 714
+ 715
+ 716
+ 717
+ 718
+ 719
+ 720
+ 721
+ 722
+ 723
+ 724
+ 725
+ 726
+ 727
+ 728
+ 729
+ 730
+ 731
+ 732
+ 733
+ 734
+ 735
+ 736
+ 737
+ 738
+ 739
+ 740
+ 741
+ 742
+ 743
+ 744
+ 745
+ 746
+ 747
+ 748
+ 749
+ 750
+ 751
+ 752
+ 753
+ 754
+ 755
+ 756
+ 757
+ 758
+ 759
+ 760
+ 761
+ 762
+ 763
+ 764
+ 765
+ 766
+ 767
+ 768
+ 769
+ 770
+ 771
+ 772
+ 773
+ 774
+ 775
+ 776
+ 777
+ 778
+ 779
+ 780
+ 781
+ 782
+ 783
+ 784
+ 785
+ 786
+ 787
+ 788
+ 789
+ 790
+ 791
+ 792
+ 793
+ 794
+ 795
+ 796
+ 797
+ 798
+ 799
+ 800
+ 801
+ 802
+ 803
+ 804
+ 805
+ 806
+ 807
+ 808
+ 809
+ 810
+ 811
+ 812
+ 813
+ 814
+ 815
+ 816
+ 817
+ 818
+ 819
+ 820
+ 821
+ 822
+ 823
+ 824
+ 825
+ 826
+ 827
+ 828
+ 829
+ 830
+ 831
+ 832
+ 833
+ 834
+ 835
+ 836
+ 837
+ 838
+ 839
+ 840
+ 841
+ 842
+ 843
+ 844
+ 845
+ 846
+ 847
+ 848
+ 849
+ 850
+ 851
+ 852
+ 853
+ 854
+ 855
+ 856
+ 857
+ 858
+ 859
+ 860
+ 861
+ 862
+ 863
+ 864
+ 865
+ 866
+ 867
+ 868
+ 869
+ 870
+ 871
+ 872
+ 873
+ 874
+ 875
+ 876
+ 877
+ 878
+ 879
+ 880
+ 881
+ 882
+ 883
+ 884
+ 885
+ 886
+ 887
+ 888
+ 889
+ 890
+ 891
+ 892
+ 893
+ 894
+ 895
+ 896
+ 897
+ 898
+ 899
+ 900
+ 901
+ 902
+ 903
+ 904
+ 905
+ 906
+ 907
+ 908
+ 909
+ 910
+ 911
+ 912
+ 913
+ 914
+ 915
+ 916
+ 917
+ 918
+ 919
+ 920
+ 921
+ 922
+ 923
+ 924
+ 925
+ 926
+ 927
+ 928
+ 929
+ 930
+ 931
+ 932
+ 933
+ 934
+ 935
+ 936
+ 937
+ 938
+ 939
+ 940
+ 941
+ 942
+ 943
+ 944
+ 945
+ 946
+ 947
+ 948
+ 949
+ 950
+ 951
+ 952
+ 953
+ 954
+ 955
+ 956
+ 957
+ 958
+ 959
+ 960
+ 961
+ 962
+ 963
+ 964
+ 965
+ 966
+ 967
+ 968
+ 969
+ 970
+ 971
+ 972
+ 973
+ 974
+ 975
+ 976
+ 977
+ 978
+ 979
+ 980
+ 981
+ 982
+ 983
+ 984
+ 985
+ 986
+ 987
+ 988
+ 989
+ 990
+ 991
+ 992
+ 993
+ 994
+ 995
+ 996
+ 997
+ 998
+ 999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+
+use super::*;
+use crate::punctuated::Punctuated;
+#[cfg(feature = "extra-traits")]
+use crate::tt::TokenStreamHelper;
+use proc_macro2::TokenStream;
+#[cfg(feature = "extra-traits")]
+use std::hash::{Hash, Hasher};
+
+ast_enum_of_structs! {
+    /// The possible types that a Rust value could have.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums
+    //
+    // TODO: change syntax-tree-enum link to an intra rustdoc link, currently
+    // blocked on https://github.com/rust-lang/rust/issues/62833
+    pub enum Type #manual_extra_traits {
+        /// A fixed size array type: `[T; n]`.
+        Array(TypeArray),
+
+        /// A bare function type: `fn(usize) -> bool`.
+        BareFn(TypeBareFn),
+
+        /// A type contained within invisible delimiters.
+        Group(TypeGroup),
+
+        /// An `impl Bound1 + Bound2 + Bound3` type where `Bound` is a trait or
+        /// a lifetime.
+        ImplTrait(TypeImplTrait),
+
+        /// Indication that a type should be inferred by the compiler: `_`.
+        Infer(TypeInfer),
+
+        /// A macro in the type position.
+        Macro(TypeMacro),
+
+        /// The never type: `!`.
+        Never(TypeNever),
+
+        /// A parenthesized type equivalent to the inner type.
+        Paren(TypeParen),
+
+        /// A path like `std::slice::Iter`, optionally qualified with a
+        /// self-type as in `<Vec<T> as SomeTrait>::Associated`.
+        Path(TypePath),
+
+        /// A raw pointer type: `*const T` or `*mut T`.
+        Ptr(TypePtr),
+
+        /// A reference type: `&'a T` or `&'a mut T`.
+        Reference(TypeReference),
+
+        /// A dynamically sized slice type: `[T]`.
+        Slice(TypeSlice),
+
+        /// A trait object type `Bound1 + Bound2 + Bound3` where `Bound` is a
+        /// trait or a lifetime.
+        TraitObject(TypeTraitObject),
+
+        /// A tuple type: `(A, B, C, String)`.
+        Tuple(TypeTuple),
+
+        /// Tokens in type position not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        #[doc(hidden)]
+        __Nonexhaustive,
+    }
+}
+
+ast_struct! {
+    /// A fixed size array type: `[T; n]`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypeArray {
+        pub bracket_token: token::Bracket,
+        pub elem: Box<Type>,
+        pub semi_token: Token![;],
+        pub len: Expr,
+    }
+}
+
+ast_struct! {
+    /// A bare function type: `fn(usize) -> bool`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypeBareFn {
+        pub lifetimes: Option<BoundLifetimes>,
+        pub unsafety: Option<Token![unsafe]>,
+        pub abi: Option<Abi>,
+        pub fn_token: Token![fn],
+        pub paren_token: token::Paren,
+        pub inputs: Punctuated<BareFnArg, Token![,]>,
+        pub variadic: Option<Variadic>,
+        pub output: ReturnType,
+    }
+}
+
+ast_struct! {
+    /// A type contained within invisible delimiters.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypeGroup {
+        pub group_token: token::Group,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// An `impl Bound1 + Bound2 + Bound3` type where `Bound` is a trait or
+    /// a lifetime.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypeImplTrait {
+        pub impl_token: Token![impl],
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// Indication that a type should be inferred by the compiler: `_`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypeInfer {
+        pub underscore_token: Token![_],
+    }
+}
+
+ast_struct! {
+    /// A macro in the type position.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypeMacro {
+        pub mac: Macro,
+    }
+}
+
+ast_struct! {
+    /// The never type: `!`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypeNever {
+        pub bang_token: Token![!],
+    }
+}
+
+ast_struct! {
+    /// A parenthesized type equivalent to the inner type.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypeParen {
+        pub paren_token: token::Paren,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A path like `std::slice::Iter`, optionally qualified with a
+    /// self-type as in `<Vec<T> as SomeTrait>::Associated`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypePath {
+        pub qself: Option<QSelf>,
+        pub path: Path,
+    }
+}
+
+ast_struct! {
+    /// A raw pointer type: `*const T` or `*mut T`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypePtr {
+        pub star_token: Token![*],
+        pub const_token: Option<Token![const]>,
+        pub mutability: Option<Token![mut]>,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A reference type: `&'a T` or `&'a mut T`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypeReference {
+        pub and_token: Token![&],
+        pub lifetime: Option<Lifetime>,
+        pub mutability: Option<Token![mut]>,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A dynamically sized slice type: `[T]`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypeSlice {
+        pub bracket_token: token::Bracket,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A trait object type `Bound1 + Bound2 + Bound3` where `Bound` is a
+    /// trait or a lifetime.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypeTraitObject {
+        pub dyn_token: Option<Token![dyn]>,
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// A tuple type: `(A, B, C, String)`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or
+    /// `"full"` feature.*
+    pub struct TypeTuple {
+        pub paren_token: token::Paren,
+        pub elems: Punctuated<Type, Token![,]>,
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+impl Eq for Type {}
+
+#[cfg(feature = "extra-traits")]
+impl PartialEq for Type {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (Type::Array(this), Type::Array(other)) => this == other,
+            (Type::BareFn(this), Type::BareFn(other)) => this == other,
+            (Type::Group(this), Type::Group(other)) => this == other,
+            (Type::ImplTrait(this), Type::ImplTrait(other)) => this == other,
+            (Type::Infer(this), Type::Infer(other)) => this == other,
+            (Type::Macro(this), Type::Macro(other)) => this == other,
+            (Type::Never(this), Type::Never(other)) => this == other,
+            (Type::Paren(this), Type::Paren(other)) => this == other,
+            (Type::Path(this), Type::Path(other)) => this == other,
+            (Type::Ptr(this), Type::Ptr(other)) => this == other,
+            (Type::Reference(this), Type::Reference(other)) => this == other,
+            (Type::Slice(this), Type::Slice(other)) => this == other,
+            (Type::TraitObject(this), Type::TraitObject(other)) => this == other,
+            (Type::Tuple(this), Type::Tuple(other)) => this == other,
+            (Type::Verbatim(this), Type::Verbatim(other)) => {
+                TokenStreamHelper(this) == TokenStreamHelper(other)
+            }
+            _ => false,
+        }
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+impl Hash for Type {
+    fn hash<H>(&self, hash: &mut H)
+    where
+        H: Hasher,
+    {
+        match self {
+            Type::Array(ty) => {
+                hash.write_u8(0);
+                ty.hash(hash);
+            }
+            Type::BareFn(ty) => {
+                hash.write_u8(1);
+                ty.hash(hash);
+            }
+            Type::Group(ty) => {
+                hash.write_u8(2);
+                ty.hash(hash);
+            }
+            Type::ImplTrait(ty) => {
+                hash.write_u8(3);
+                ty.hash(hash);
+            }
+            Type::Infer(ty) => {
+                hash.write_u8(4);
+                ty.hash(hash);
+            }
+            Type::Macro(ty) => {
+                hash.write_u8(5);
+                ty.hash(hash);
+            }
+            Type::Never(ty) => {
+                hash.write_u8(6);
+                ty.hash(hash);
+            }
+            Type::Paren(ty) => {
+                hash.write_u8(7);
+                ty.hash(hash);
+            }
+            Type::Path(ty) => {
+                hash.write_u8(8);
+                ty.hash(hash);
+            }
+            Type::Ptr(ty) => {
+                hash.write_u8(9);
+                ty.hash(hash);
+            }
+            Type::Reference(ty) => {
+                hash.write_u8(10);
+                ty.hash(hash);
+            }
+            Type::Slice(ty) => {
+                hash.write_u8(11);
+                ty.hash(hash);
+            }
+            Type::TraitObject(ty) => {
+                hash.write_u8(12);
+                ty.hash(hash);
+            }
+            Type::Tuple(ty) => {
+                hash.write_u8(13);
+                ty.hash(hash);
+            }
+            Type::Verbatim(ty) => {
+                hash.write_u8(14);
+                TokenStreamHelper(ty).hash(hash);
+            }
+            Type::__Nonexhaustive => unreachable!(),
+        }
+    }
+}
+
+ast_struct! {
+    /// The binary interface of a function: `extern "C"`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct Abi {
+        pub extern_token: Token![extern],
+        pub name: Option<LitStr>,
+    }
+}
+
+ast_struct! {
+    /// An argument in a function type: the `usize` in `fn(usize) -> bool`.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct BareFnArg {
+        pub attrs: Vec<Attribute>,
+        pub name: Option<(Ident, Token![:])>,
+        pub ty: Type,
+    }
+}
+
+ast_struct! {
+    /// The variadic argument of a foreign function.
+    ///
+    /// ```rust
+    /// # struct c_char;
+    /// # struct c_int;
+    /// #
+    /// extern "C" {
+    ///     fn printf(format: *const c_char, ...) -> c_int;
+    ///     //                               ^^^
+    /// }
+    /// ```
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub struct Variadic {
+        pub attrs: Vec<Attribute>,
+        pub dots: Token![...],
+    }
+}
+
+ast_enum! {
+    /// Return type of a function signature.
+    ///
+    /// *This type is available if Syn is built with the `"derive"` or `"full"`
+    /// feature.*
+    pub enum ReturnType {
+        /// Return type is not specified.
+        ///
+        /// Functions default to `()` and closures default to type inference.
+        Default,
+        /// A particular type is returned.
+        Type(Token![->], Box<Type>),
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub mod parsing {
+    use super::*;
+
+    use crate::ext::IdentExt;
+    use crate::parse::{Parse, ParseStream, Result};
+    use crate::path;
+    use proc_macro2::{Punct, Spacing, TokenTree};
+    use std::iter::FromIterator;
+
+    impl Parse for Type {
+        fn parse(input: ParseStream) -> Result<Self> {
+            ambig_ty(input, true)
+        }
+    }
+
+    impl Type {
+        /// In some positions, types may not contain the `+` character, to
+        /// disambiguate them. For example in the expression `1 as T`, T may not
+        /// contain a `+` character.
+        ///
+        /// This parser does not allow a `+`, while the default parser does.
+        pub fn without_plus(input: ParseStream) -> Result<Self> {
+            ambig_ty(input, false)
+        }
+    }
+
+    fn ambig_ty(input: ParseStream, allow_plus: bool) -> Result<Type> {
+        if input.peek(token::Group) {
+            return input.parse().map(Type::Group);
+        }
+
+        let mut lifetimes = None::<BoundLifetimes>;
+        let mut lookahead = input.lookahead1();
+        if lookahead.peek(Token![for]) {
+            lifetimes = input.parse()?;
+            lookahead = input.lookahead1();
+            if !lookahead.peek(Ident)
+                && !lookahead.peek(Token![fn])
+                && !lookahead.peek(Token![unsafe])
+                && !lookahead.peek(Token![extern])
+                && !lookahead.peek(Token![super])
+                && !lookahead.peek(Token![self])
+                && !lookahead.peek(Token![Self])
+                && !lookahead.peek(Token![crate])
+            {
+                return Err(lookahead.error());
+            }
+        }
+
+        if lookahead.peek(token::Paren) {
+            let content;
+            let paren_token = parenthesized!(content in input);
+            if content.is_empty() {
+                return Ok(Type::Tuple(TypeTuple {
+                    paren_token,
+                    elems: Punctuated::new(),
+                }));
+            }
+            if content.peek(Lifetime) {
+                return Ok(Type::Paren(TypeParen {
+                    paren_token,
+                    elem: Box::new(Type::TraitObject(content.parse()?)),
+                }));
+            }
+            if content.peek(Token![?]) {
+                return Ok(Type::TraitObject(TypeTraitObject {
+                    dyn_token: None,
+                    bounds: {
+                        let mut bounds = Punctuated::new();
+                        bounds.push_value(TypeParamBound::Trait(TraitBound {
+                            paren_token: Some(paren_token),
+                            ..content.parse()?
+                        }));
+                        while let Some(plus) = input.parse()? {
+                            bounds.push_punct(plus);
+                            bounds.push_value(input.parse()?);
+                        }
+                        bounds
+                    },
+                }));
+            }
+            let mut first: Type = content.parse()?;
+            if content.peek(Token![,]) {
+                return Ok(Type::Tuple(TypeTuple {
+                    paren_token,
+                    elems: {
+                        let mut elems = Punctuated::new();
+                        elems.push_value(first);
+                        elems.push_punct(content.parse()?);
+                        let rest: Punctuated<Type, Token![,]> =
+                            content.parse_terminated(Parse::parse)?;
+                        elems.extend(rest);
+                        elems
+                    },
+                }));
+            }
+            if allow_plus && input.peek(Token![+]) {
+                loop {
+                    let first = match first {
+                        Type::Path(TypePath { qself: None, path }) => {
+                            TypeParamBound::Trait(TraitBound {
+                                paren_token: Some(paren_token),
+                                modifier: TraitBoundModifier::None,
+                                lifetimes: None,
+                                path,
+                            })
+                        }
+                        Type::TraitObject(TypeTraitObject {
+                            dyn_token: None,
+                            bounds,
+                        }) => {
+                            if bounds.len() > 1 || bounds.trailing_punct() {
+                                first = Type::TraitObject(TypeTraitObject {
+                                    dyn_token: None,
+                                    bounds,
+                                });
+                                break;
+                            }
+                            match bounds.into_iter().next().unwrap() {
+                                TypeParamBound::Trait(trait_bound) => {
+                                    TypeParamBound::Trait(TraitBound {
+                                        paren_token: Some(paren_token),
+                                        ..trait_bound
+                                    })
+                                }
+                                other => other,
+                            }
+                        }
+                        _ => break,
+                    };
+                    return Ok(Type::TraitObject(TypeTraitObject {
+                        dyn_token: None,
+                        bounds: {
+                            let mut bounds = Punctuated::new();
+                            bounds.push_value(first);
+                            while let Some(plus) = input.parse()? {
+                                bounds.push_punct(plus);
+                                bounds.push_value(input.parse()?);
+                            }
+                            bounds
+                        },
+                    }));
+                }
+            }
+            Ok(Type::Paren(TypeParen {
+                paren_token,
+                elem: Box::new(first),
+            }))
+        } else if lookahead.peek(Token![fn])
+            || lookahead.peek(Token![unsafe])
+            || lookahead.peek(Token![extern]) && !input.peek2(Token![::])
+        {
+            let mut bare_fn: TypeBareFn = input.parse()?;
+            bare_fn.lifetimes = lifetimes;
+            Ok(Type::BareFn(bare_fn))
+        } else if lookahead.peek(Ident)
+            || input.peek(Token![super])
+            || input.peek(Token![self])
+            || input.peek(Token![Self])
+            || input.peek(Token![crate])
+            || input.peek(Token![extern])
+            || lookahead.peek(Token![::])
+            || lookahead.peek(Token![<])
+        {
+            if input.peek(Token![dyn]) {
+                let mut trait_object: TypeTraitObject = input.parse()?;
+                if lifetimes.is_some() {
+                    match trait_object.bounds.iter_mut().next().unwrap() {
+                        TypeParamBound::Trait(trait_bound) => {
+                            trait_bound.lifetimes = lifetimes;
+                        }
+                        TypeParamBound::Lifetime(_) => unreachable!(),
+                    }
+                }
+                return Ok(Type::TraitObject(trait_object));
+            }
+
+            let ty: TypePath = input.parse()?;
+            if ty.qself.is_some() {
+                return Ok(Type::Path(ty));
+            }
+
+            if input.peek(Token![!]) && !input.peek(Token![!=]) {
+                let mut contains_arguments = false;
+                for segment in &ty.path.segments {
+                    match segment.arguments {
+                        PathArguments::None => {}
+                        PathArguments::AngleBracketed(_) | PathArguments::Parenthesized(_) => {
+                            contains_arguments = true;
+                        }
+                    }
+                }
+
+                if !contains_arguments {
+                    let bang_token: Token![!] = input.parse()?;
+                    let (delimiter, tokens) = mac::parse_delimiter(input)?;
+                    return Ok(Type::Macro(TypeMacro {
+                        mac: Macro {
+                            path: ty.path,
+                            bang_token,
+                            delimiter,
+                            tokens,
+                        },
+                    }));
+                }
+            }
+
+            if lifetimes.is_some() || allow_plus && input.peek(Token![+]) {
+                let mut bounds = Punctuated::new();
+                bounds.push_value(TypeParamBound::Trait(TraitBound {
+                    paren_token: None,
+                    modifier: TraitBoundModifier::None,
+                    lifetimes,
+                    path: ty.path,
+                }));
+                if allow_plus {
+                    while input.peek(Token![+]) {
+                        bounds.push_punct(input.parse()?);
+                        if input.peek(Token![>]) {
+                            break;
+                        }
+                        bounds.push_value(input.parse()?);
+                    }
+                }
+                return Ok(Type::TraitObject(TypeTraitObject {
+                    dyn_token: None,
+                    bounds,
+                }));
+            }
+
+            Ok(Type::Path(ty))
+        } else if lookahead.peek(token::Bracket) {
+            let content;
+            let bracket_token = bracketed!(content in input);
+            let elem: Type = content.parse()?;
+            if content.peek(Token![;]) {
+                Ok(Type::Array(TypeArray {
+                    bracket_token,
+                    elem: Box::new(elem),
+                    semi_token: content.parse()?,
+                    len: content.parse()?,
+                }))
+            } else {
+                Ok(Type::Slice(TypeSlice {
+                    bracket_token,
+                    elem: Box::new(elem),
+                }))
+            }
+        } else if lookahead.peek(Token![*]) {
+            input.parse().map(Type::Ptr)
+        } else if lookahead.peek(Token![&]) {
+            input.parse().map(Type::Reference)
+        } else if lookahead.peek(Token![!]) && !input.peek(Token![=]) {
+            input.parse().map(Type::Never)
+        } else if lookahead.peek(Token![impl]) {
+            input.parse().map(Type::ImplTrait)
+        } else if lookahead.peek(Token![_]) {
+            input.parse().map(Type::Infer)
+        } else if lookahead.peek(Lifetime) {
+            input.parse().map(Type::TraitObject)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+
+    impl Parse for TypeSlice {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(TypeSlice {
+                bracket_token: bracketed!(content in input),
+                elem: content.parse()?,
+            })
+        }
+    }
+
+    impl Parse for TypeArray {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(TypeArray {
+                bracket_token: bracketed!(content in input),
+                elem: content.parse()?,
+                semi_token: content.parse()?,
+                len: content.parse()?,
+            })
+        }
+    }
+
+    impl Parse for TypePtr {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let star_token: Token![*] = input.parse()?;
+
+            let lookahead = input.lookahead1();
+            let (const_token, mutability) = if lookahead.peek(Token![const]) {
+                (Some(input.parse()?), None)
+            } else if lookahead.peek(Token![mut]) {
+                (None, Some(input.parse()?))
+            } else {
+                return Err(lookahead.error());
+            };
+
+            Ok(TypePtr {
+                star_token,
+                const_token,
+                mutability,
+                elem: Box::new(input.call(Type::without_plus)?),
+            })
+        }
+    }
+
+    impl Parse for TypeReference {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(TypeReference {
+                and_token: input.parse()?,
+                lifetime: input.parse()?,
+                mutability: input.parse()?,
+                // & binds tighter than +, so we don't allow + here.
+                elem: Box::new(input.call(Type::without_plus)?),
+            })
+        }
+    }
+
+    impl Parse for TypeBareFn {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let args;
+            let mut variadic = None;
+            Ok(TypeBareFn {
+                lifetimes: input.parse()?,
+                unsafety: input.parse()?,
+                abi: input.parse()?,
+                fn_token: input.parse()?,
+                paren_token: parenthesized!(args in input),
+                inputs: {
+                    let mut inputs = Punctuated::new();
+
+                    while !args.is_empty() {
+                        let attrs = args.call(Attribute::parse_outer)?;
+
+                        if inputs.empty_or_trailing() && args.peek(Token![...]) {
+                            variadic = Some(Variadic {
+                                attrs,
+                                dots: args.parse()?,
+                            });
+                            break;
+                        }
+
+                        inputs.push_value(BareFnArg {
+                            attrs,
+                            ..args.parse()?
+                        });
+                        if args.is_empty() {
+                            break;
+                        }
+
+                        inputs.push_punct(args.parse()?);
+                    }
+
+                    inputs
+                },
+                variadic,
+                output: input.call(ReturnType::without_plus)?,
+            })
+        }
+    }
+
+    impl Parse for TypeNever {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(TypeNever {
+                bang_token: input.parse()?,
+            })
+        }
+    }
+
+    impl Parse for TypeInfer {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(TypeInfer {
+                underscore_token: input.parse()?,
+            })
+        }
+    }
+
+    impl Parse for TypeTuple {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            let paren_token = parenthesized!(content in input);
+
+            if content.is_empty() {
+                return Ok(TypeTuple {
+                    paren_token,
+                    elems: Punctuated::new(),
+                });
+            }
+
+            let first: Type = content.parse()?;
+            Ok(TypeTuple {
+                paren_token,
+                elems: {
+                    let mut elems = Punctuated::new();
+                    elems.push_value(first);
+                    elems.push_punct(content.parse()?);
+                    let rest: Punctuated<Type, Token![,]> =
+                        content.parse_terminated(Parse::parse)?;
+                    elems.extend(rest);
+                    elems
+                },
+            })
+        }
+    }
+
+    impl Parse for TypeMacro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(TypeMacro {
+                mac: input.parse()?,
+            })
+        }
+    }
+
+    impl Parse for TypePath {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let (qself, mut path) = path::parsing::qpath(input, false)?;
+
+            if path.segments.last().unwrap().arguments.is_empty() && input.peek(token::Paren) {
+                let args: ParenthesizedGenericArguments = input.parse()?;
+                let parenthesized = PathArguments::Parenthesized(args);
+                path.segments.last_mut().unwrap().arguments = parenthesized;
+            }
+
+            Ok(TypePath { qself, path })
+        }
+    }
+
+    impl ReturnType {
+        pub fn without_plus(input: ParseStream) -> Result<Self> {
+            Self::parse(input, false)
+        }
+
+        pub fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
+            if input.peek(Token![->]) {
+                let arrow = input.parse()?;
+                let ty = ambig_ty(input, allow_plus)?;
+                Ok(ReturnType::Type(arrow, Box::new(ty)))
+            } else {
+                Ok(ReturnType::Default)
+            }
+        }
+    }
+
+    impl Parse for ReturnType {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Self::parse(input, true)
+        }
+    }
+
+    impl Parse for TypeTraitObject {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Self::parse(input, true)
+        }
+    }
+
+    fn at_least_one_type(bounds: &Punctuated<TypeParamBound, Token![+]>) -> bool {
+        for bound in bounds {
+            if let TypeParamBound::Trait(_) = *bound {
+                return true;
+            }
+        }
+        false
+    }
+
+    impl TypeTraitObject {
+        pub fn without_plus(input: ParseStream) -> Result<Self> {
+            Self::parse(input, false)
+        }
+
+        // Only allow multiple trait references if allow_plus is true.
+        pub fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
+            Ok(TypeTraitObject {
+                dyn_token: input.parse()?,
+                bounds: {
+                    let mut bounds = Punctuated::new();
+                    if allow_plus {
+                        loop {
+                            bounds.push_value(input.parse()?);
+                            if !input.peek(Token![+]) {
+                                break;
+                            }
+                            bounds.push_punct(input.parse()?);
+                            if input.peek(Token![>]) {
+                                break;
+                            }
+                        }
+                    } else {
+                        bounds.push_value(input.parse()?);
+                    }
+                    // Just lifetimes like `'a + 'b` is not a TraitObject.
+                    if !at_least_one_type(&bounds) {
+                        return Err(input.error("expected at least one type"));
+                    }
+                    bounds
+                },
+            })
+        }
+    }
+
+    impl Parse for TypeImplTrait {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(TypeImplTrait {
+                impl_token: input.parse()?,
+                // NOTE: rust-lang/rust#34511 includes discussion about whether
+                // or not + should be allowed in ImplTrait directly without ().
+                bounds: {
+                    let mut bounds = Punctuated::new();
+                    loop {
+                        bounds.push_value(input.parse()?);
+                        if !input.peek(Token![+]) {
+                            break;
+                        }
+                        bounds.push_punct(input.parse()?);
+                    }
+                    bounds
+                },
+            })
+        }
+    }
+
+    impl Parse for TypeGroup {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let group = crate::group::parse_group(input)?;
+            Ok(TypeGroup {
+                group_token: group.token,
+                elem: group.content.parse()?,
+            })
+        }
+    }
+
+    impl Parse for TypeParen {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Self::parse(input, false)
+        }
+    }
+
+    impl TypeParen {
+        fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
+            let content;
+            Ok(TypeParen {
+                paren_token: parenthesized!(content in input),
+                elem: Box::new(ambig_ty(&content, allow_plus)?),
+            })
+        }
+    }
+
+    impl Parse for BareFnArg {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(BareFnArg {
+                attrs: input.call(Attribute::parse_outer)?,
+                name: {
+                    if (input.peek(Ident) || input.peek(Token![_]))
+                        && input.peek2(Token![:])
+                        && !input.peek2(Token![::])
+                    {
+                        let name = input.call(Ident::parse_any)?;
+                        let colon: Token![:] = input.parse()?;
+                        Some((name, colon))
+                    } else {
+                        None
+                    }
+                },
+                ty: match input.parse::<Option<Token![...]>>()? {
+                    Some(dot3) => {
+                        let args = vec![
+                            TokenTree::Punct(Punct::new('.', Spacing::Joint)),
+                            TokenTree::Punct(Punct::new('.', Spacing::Joint)),
+                            TokenTree::Punct(Punct::new('.', Spacing::Alone)),
+                        ];
+                        let tokens = TokenStream::from_iter(args.into_iter().zip(&dot3.spans).map(
+                            |(mut arg, span)| {
+                                arg.set_span(*span);
+                                arg
+                            },
+                        ));
+                        Type::Verbatim(tokens)
+                    }
+                    None => input.parse()?,
+                },
+            })
+        }
+    }
+
+    impl Parse for Abi {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(Abi {
+                extern_token: input.parse()?,
+                name: input.parse()?,
+            })
+        }
+    }
+
+    impl Parse for Option<Abi> {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![extern]) {
+                input.parse().map(Some)
+            } else {
+                Ok(None)
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use super::*;
+
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    use crate::attr::FilterAttrs;
+    use crate::print::TokensOrDefault;
+
+    impl ToTokens for TypeSlice {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.bracket_token.surround(tokens, |tokens| {
+                self.elem.to_tokens(tokens);
+            });
+        }
+    }
+
+    impl ToTokens for TypeArray {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.bracket_token.surround(tokens, |tokens| {
+                self.elem.to_tokens(tokens);
+                self.semi_token.to_tokens(tokens);
+                self.len.to_tokens(tokens);
+            });
+        }
+    }
+
+    impl ToTokens for TypePtr {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.star_token.to_tokens(tokens);
+            match &self.mutability {
+                Some(tok) => tok.to_tokens(tokens),
+                None => {
+                    TokensOrDefault(&self.const_token).to_tokens(tokens);
+                }
+            }
+            self.elem.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for TypeReference {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.and_token.to_tokens(tokens);
+            self.lifetime.to_tokens(tokens);
+            self.mutability.to_tokens(tokens);
+            self.elem.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for TypeBareFn {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.lifetimes.to_tokens(tokens);
+            self.unsafety.to_tokens(tokens);
+            self.abi.to_tokens(tokens);
+            self.fn_token.to_tokens(tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                self.inputs.to_tokens(tokens);
+                if let Some(variadic) = &self.variadic {
+                    if !self.inputs.empty_or_trailing() {
+                        let span = variadic.dots.spans[0];
+                        Token![,](span).to_tokens(tokens);
+                    }
+                    variadic.to_tokens(tokens);
+                }
+            });
+            self.output.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for TypeNever {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.bang_token.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for TypeTuple {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.paren_token.surround(tokens, |tokens| {
+                self.elems.to_tokens(tokens);
+            });
+        }
+    }
+
+    impl ToTokens for TypePath {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            private::print_path(tokens, &self.qself, &self.path);
+        }
+    }
+
+    impl ToTokens for TypeTraitObject {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.dyn_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for TypeImplTrait {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.impl_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for TypeGroup {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.group_token.surround(tokens, |tokens| {
+                self.elem.to_tokens(tokens);
+            });
+        }
+    }
+
+    impl ToTokens for TypeParen {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.paren_token.surround(tokens, |tokens| {
+                self.elem.to_tokens(tokens);
+            });
+        }
+    }
+
+    impl ToTokens for TypeInfer {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.underscore_token.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for TypeMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.mac.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for ReturnType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                ReturnType::Default => {}
+                ReturnType::Type(arrow, ty) => {
+                    arrow.to_tokens(tokens);
+                    ty.to_tokens(tokens);
+                }
+            }
+        }
+    }
+
+    impl ToTokens for BareFnArg {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            if let Some((name, colon)) = &self.name {
+                name.to_tokens(tokens);
+                colon.to_tokens(tokens);
+            }
+            self.ty.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for Variadic {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.dots.to_tokens(tokens);
+        }
+    }
+
+    impl ToTokens for Abi {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.extern_token.to_tokens(tokens);
+            self.name.to_tokens(tokens);
+        }
+    }
+}
+
+
\ No newline at end of file diff --git a/src/unicode_xid/lib.rs.html b/src/unicode_xid/lib.rs.html new file mode 100644 index 0000000..119cea2 --- /dev/null +++ b/src/unicode_xid/lib.rs.html @@ -0,0 +1,177 @@ +lib.rs.html -- source
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+
+// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Determine if a `char` is a valid identifier for a parser and/or lexer according to
+//! [Unicode Standard Annex #31](http://www.unicode.org/reports/tr31/) rules.
+//!
+//! ```rust
+//! extern crate unicode_xid;
+//!
+//! use unicode_xid::UnicodeXID;
+//!
+//! fn main() {
+//!     let ch = 'a';
+//!     println!("Is {} a valid start of an identifier? {}", ch, UnicodeXID::is_xid_start(ch));
+//! }
+//! ```
+//!
+//! # features
+//!
+//! unicode-xid supports a `no_std` feature. This eliminates dependence
+//! on std, and instead uses equivalent functions from core.
+//!
+//! # crates.io
+//!
+//! You can use this package in your project by adding the following
+//! to your `Cargo.toml`:
+//!
+//! ```toml
+//! [dependencies]
+//! unicode-xid = "0.0.4"
+//! ```
+
+#![deny(missing_docs, unsafe_code)]
+#![doc(html_logo_url = "https://unicode-rs.github.io/unicode-rs_sm.png",
+       html_favicon_url = "https://unicode-rs.github.io/unicode-rs_sm.png")]
+
+#![no_std]
+#![cfg_attr(feature = "bench", feature(test, unicode_internals))]
+
+#[cfg(test)]
+#[macro_use]
+extern crate std;
+
+#[cfg(feature = "bench")]
+extern crate test;
+
+use tables::derived_property;
+pub use tables::UNICODE_VERSION;
+
+mod tables;
+
+#[cfg(test)]
+mod tests;
+
+/// Methods for determining if a character is a valid identifier character.
+pub trait UnicodeXID {
+    /// Returns whether the specified character satisfies the 'XID_Start'
+    /// Unicode property.
+    ///
+    /// 'XID_Start' is a Unicode Derived Property specified in
+    /// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
+    /// mostly similar to ID_Start but modified for closure under NFKx.
+    fn is_xid_start(self) -> bool;
+
+    /// Returns whether the specified `char` satisfies the 'XID_Continue'
+    /// Unicode property.
+    ///
+    /// 'XID_Continue' is a Unicode Derived Property specified in
+    /// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
+    /// mostly similar to 'ID_Continue' but modified for closure under NFKx.
+    fn is_xid_continue(self) -> bool;
+}
+
+impl UnicodeXID for char {
+    #[inline]
+    fn is_xid_start(self) -> bool { derived_property::XID_Start(self) }
+
+    #[inline]
+    fn is_xid_continue(self) -> bool { derived_property::XID_Continue(self) }
+}
+
+
\ No newline at end of file diff --git a/src/unicode_xid/tables.rs.html b/src/unicode_xid/tables.rs.html new file mode 100644 index 0000000..fb088c1 --- /dev/null +++ b/src/unicode_xid/tables.rs.html @@ -0,0 +1,905 @@ +tables.rs.html -- source
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+
+// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// NOTE: The following code was generated by "scripts/unicode.py", do not edit directly
+
+#![allow(missing_docs, non_upper_case_globals, non_snake_case)]
+
+/// The version of [Unicode](http://www.unicode.org/)
+/// that this version of unicode-xid is based on.
+pub const UNICODE_VERSION: (u64, u64, u64) = (12, 1, 0);
+
+fn bsearch_range_table(c: char, r: &[(char,char)]) -> bool {
+    use core::cmp::Ordering::{Equal, Less, Greater};
+
+    r.binary_search_by(|&(lo,hi)| {
+        if lo <= c && c <= hi { Equal }
+        else if hi < c { Less }
+        else { Greater }
+    }).is_ok()
+}
+
+pub mod derived_property {
+    pub const XID_Continue_table: &[(char, char)] = &[
+        ('\u{30}', '\u{39}'), ('\u{41}', '\u{5a}'), ('\u{5f}', '\u{5f}'), ('\u{61}', '\u{7a}'),
+        ('\u{aa}', '\u{aa}'), ('\u{b5}', '\u{b5}'), ('\u{b7}', '\u{b7}'), ('\u{ba}', '\u{ba}'),
+        ('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{f6}'), ('\u{f8}', '\u{2c1}'), ('\u{2c6}', '\u{2d1}'),
+        ('\u{2e0}', '\u{2e4}'), ('\u{2ec}', '\u{2ec}'), ('\u{2ee}', '\u{2ee}'), ('\u{300}',
+        '\u{374}'), ('\u{376}', '\u{377}'), ('\u{37b}', '\u{37d}'), ('\u{37f}', '\u{37f}'),
+        ('\u{386}', '\u{38a}'), ('\u{38c}', '\u{38c}'), ('\u{38e}', '\u{3a1}'), ('\u{3a3}',
+        '\u{3f5}'), ('\u{3f7}', '\u{481}'), ('\u{483}', '\u{487}'), ('\u{48a}', '\u{52f}'),
+        ('\u{531}', '\u{556}'), ('\u{559}', '\u{559}'), ('\u{560}', '\u{588}'), ('\u{591}',
+        '\u{5bd}'), ('\u{5bf}', '\u{5bf}'), ('\u{5c1}', '\u{5c2}'), ('\u{5c4}', '\u{5c5}'),
+        ('\u{5c7}', '\u{5c7}'), ('\u{5d0}', '\u{5ea}'), ('\u{5ef}', '\u{5f2}'), ('\u{610}',
+        '\u{61a}'), ('\u{620}', '\u{669}'), ('\u{66e}', '\u{6d3}'), ('\u{6d5}', '\u{6dc}'),
+        ('\u{6df}', '\u{6e8}'), ('\u{6ea}', '\u{6fc}'), ('\u{6ff}', '\u{6ff}'), ('\u{710}',
+        '\u{74a}'), ('\u{74d}', '\u{7b1}'), ('\u{7c0}', '\u{7f5}'), ('\u{7fa}', '\u{7fa}'),
+        ('\u{7fd}', '\u{7fd}'), ('\u{800}', '\u{82d}'), ('\u{840}', '\u{85b}'), ('\u{860}',
+        '\u{86a}'), ('\u{8a0}', '\u{8b4}'), ('\u{8b6}', '\u{8bd}'), ('\u{8d3}', '\u{8e1}'),
+        ('\u{8e3}', '\u{963}'), ('\u{966}', '\u{96f}'), ('\u{971}', '\u{983}'), ('\u{985}',
+        '\u{98c}'), ('\u{98f}', '\u{990}'), ('\u{993}', '\u{9a8}'), ('\u{9aa}', '\u{9b0}'),
+        ('\u{9b2}', '\u{9b2}'), ('\u{9b6}', '\u{9b9}'), ('\u{9bc}', '\u{9c4}'), ('\u{9c7}',
+        '\u{9c8}'), ('\u{9cb}', '\u{9ce}'), ('\u{9d7}', '\u{9d7}'), ('\u{9dc}', '\u{9dd}'),
+        ('\u{9df}', '\u{9e3}'), ('\u{9e6}', '\u{9f1}'), ('\u{9fc}', '\u{9fc}'), ('\u{9fe}',
+        '\u{9fe}'), ('\u{a01}', '\u{a03}'), ('\u{a05}', '\u{a0a}'), ('\u{a0f}', '\u{a10}'),
+        ('\u{a13}', '\u{a28}'), ('\u{a2a}', '\u{a30}'), ('\u{a32}', '\u{a33}'), ('\u{a35}',
+        '\u{a36}'), ('\u{a38}', '\u{a39}'), ('\u{a3c}', '\u{a3c}'), ('\u{a3e}', '\u{a42}'),
+        ('\u{a47}', '\u{a48}'), ('\u{a4b}', '\u{a4d}'), ('\u{a51}', '\u{a51}'), ('\u{a59}',
+        '\u{a5c}'), ('\u{a5e}', '\u{a5e}'), ('\u{a66}', '\u{a75}'), ('\u{a81}', '\u{a83}'),
+        ('\u{a85}', '\u{a8d}'), ('\u{a8f}', '\u{a91}'), ('\u{a93}', '\u{aa8}'), ('\u{aaa}',
+        '\u{ab0}'), ('\u{ab2}', '\u{ab3}'), ('\u{ab5}', '\u{ab9}'), ('\u{abc}', '\u{ac5}'),
+        ('\u{ac7}', '\u{ac9}'), ('\u{acb}', '\u{acd}'), ('\u{ad0}', '\u{ad0}'), ('\u{ae0}',
+        '\u{ae3}'), ('\u{ae6}', '\u{aef}'), ('\u{af9}', '\u{aff}'), ('\u{b01}', '\u{b03}'),
+        ('\u{b05}', '\u{b0c}'), ('\u{b0f}', '\u{b10}'), ('\u{b13}', '\u{b28}'), ('\u{b2a}',
+        '\u{b30}'), ('\u{b32}', '\u{b33}'), ('\u{b35}', '\u{b39}'), ('\u{b3c}', '\u{b44}'),
+        ('\u{b47}', '\u{b48}'), ('\u{b4b}', '\u{b4d}'), ('\u{b56}', '\u{b57}'), ('\u{b5c}',
+        '\u{b5d}'), ('\u{b5f}', '\u{b63}'), ('\u{b66}', '\u{b6f}'), ('\u{b71}', '\u{b71}'),
+        ('\u{b82}', '\u{b83}'), ('\u{b85}', '\u{b8a}'), ('\u{b8e}', '\u{b90}'), ('\u{b92}',
+        '\u{b95}'), ('\u{b99}', '\u{b9a}'), ('\u{b9c}', '\u{b9c}'), ('\u{b9e}', '\u{b9f}'),
+        ('\u{ba3}', '\u{ba4}'), ('\u{ba8}', '\u{baa}'), ('\u{bae}', '\u{bb9}'), ('\u{bbe}',
+        '\u{bc2}'), ('\u{bc6}', '\u{bc8}'), ('\u{bca}', '\u{bcd}'), ('\u{bd0}', '\u{bd0}'),
+        ('\u{bd7}', '\u{bd7}'), ('\u{be6}', '\u{bef}'), ('\u{c00}', '\u{c0c}'), ('\u{c0e}',
+        '\u{c10}'), ('\u{c12}', '\u{c28}'), ('\u{c2a}', '\u{c39}'), ('\u{c3d}', '\u{c44}'),
+        ('\u{c46}', '\u{c48}'), ('\u{c4a}', '\u{c4d}'), ('\u{c55}', '\u{c56}'), ('\u{c58}',
+        '\u{c5a}'), ('\u{c60}', '\u{c63}'), ('\u{c66}', '\u{c6f}'), ('\u{c80}', '\u{c83}'),
+        ('\u{c85}', '\u{c8c}'), ('\u{c8e}', '\u{c90}'), ('\u{c92}', '\u{ca8}'), ('\u{caa}',
+        '\u{cb3}'), ('\u{cb5}', '\u{cb9}'), ('\u{cbc}', '\u{cc4}'), ('\u{cc6}', '\u{cc8}'),
+        ('\u{cca}', '\u{ccd}'), ('\u{cd5}', '\u{cd6}'), ('\u{cde}', '\u{cde}'), ('\u{ce0}',
+        '\u{ce3}'), ('\u{ce6}', '\u{cef}'), ('\u{cf1}', '\u{cf2}'), ('\u{d00}', '\u{d03}'),
+        ('\u{d05}', '\u{d0c}'), ('\u{d0e}', '\u{d10}'), ('\u{d12}', '\u{d44}'), ('\u{d46}',
+        '\u{d48}'), ('\u{d4a}', '\u{d4e}'), ('\u{d54}', '\u{d57}'), ('\u{d5f}', '\u{d63}'),
+        ('\u{d66}', '\u{d6f}'), ('\u{d7a}', '\u{d7f}'), ('\u{d82}', '\u{d83}'), ('\u{d85}',
+        '\u{d96}'), ('\u{d9a}', '\u{db1}'), ('\u{db3}', '\u{dbb}'), ('\u{dbd}', '\u{dbd}'),
+        ('\u{dc0}', '\u{dc6}'), ('\u{dca}', '\u{dca}'), ('\u{dcf}', '\u{dd4}'), ('\u{dd6}',
+        '\u{dd6}'), ('\u{dd8}', '\u{ddf}'), ('\u{de6}', '\u{def}'), ('\u{df2}', '\u{df3}'),
+        ('\u{e01}', '\u{e3a}'), ('\u{e40}', '\u{e4e}'), ('\u{e50}', '\u{e59}'), ('\u{e81}',
+        '\u{e82}'), ('\u{e84}', '\u{e84}'), ('\u{e86}', '\u{e8a}'), ('\u{e8c}', '\u{ea3}'),
+        ('\u{ea5}', '\u{ea5}'), ('\u{ea7}', '\u{ebd}'), ('\u{ec0}', '\u{ec4}'), ('\u{ec6}',
+        '\u{ec6}'), ('\u{ec8}', '\u{ecd}'), ('\u{ed0}', '\u{ed9}'), ('\u{edc}', '\u{edf}'),
+        ('\u{f00}', '\u{f00}'), ('\u{f18}', '\u{f19}'), ('\u{f20}', '\u{f29}'), ('\u{f35}',
+        '\u{f35}'), ('\u{f37}', '\u{f37}'), ('\u{f39}', '\u{f39}'), ('\u{f3e}', '\u{f47}'),
+        ('\u{f49}', '\u{f6c}'), ('\u{f71}', '\u{f84}'), ('\u{f86}', '\u{f97}'), ('\u{f99}',
+        '\u{fbc}'), ('\u{fc6}', '\u{fc6}'), ('\u{1000}', '\u{1049}'), ('\u{1050}', '\u{109d}'),
+        ('\u{10a0}', '\u{10c5}'), ('\u{10c7}', '\u{10c7}'), ('\u{10cd}', '\u{10cd}'), ('\u{10d0}',
+        '\u{10fa}'), ('\u{10fc}', '\u{1248}'), ('\u{124a}', '\u{124d}'), ('\u{1250}', '\u{1256}'),
+        ('\u{1258}', '\u{1258}'), ('\u{125a}', '\u{125d}'), ('\u{1260}', '\u{1288}'), ('\u{128a}',
+        '\u{128d}'), ('\u{1290}', '\u{12b0}'), ('\u{12b2}', '\u{12b5}'), ('\u{12b8}', '\u{12be}'),
+        ('\u{12c0}', '\u{12c0}'), ('\u{12c2}', '\u{12c5}'), ('\u{12c8}', '\u{12d6}'), ('\u{12d8}',
+        '\u{1310}'), ('\u{1312}', '\u{1315}'), ('\u{1318}', '\u{135a}'), ('\u{135d}', '\u{135f}'),
+        ('\u{1369}', '\u{1371}'), ('\u{1380}', '\u{138f}'), ('\u{13a0}', '\u{13f5}'), ('\u{13f8}',
+        '\u{13fd}'), ('\u{1401}', '\u{166c}'), ('\u{166f}', '\u{167f}'), ('\u{1681}', '\u{169a}'),
+        ('\u{16a0}', '\u{16ea}'), ('\u{16ee}', '\u{16f8}'), ('\u{1700}', '\u{170c}'), ('\u{170e}',
+        '\u{1714}'), ('\u{1720}', '\u{1734}'), ('\u{1740}', '\u{1753}'), ('\u{1760}', '\u{176c}'),
+        ('\u{176e}', '\u{1770}'), ('\u{1772}', '\u{1773}'), ('\u{1780}', '\u{17d3}'), ('\u{17d7}',
+        '\u{17d7}'), ('\u{17dc}', '\u{17dd}'), ('\u{17e0}', '\u{17e9}'), ('\u{180b}', '\u{180d}'),
+        ('\u{1810}', '\u{1819}'), ('\u{1820}', '\u{1878}'), ('\u{1880}', '\u{18aa}'), ('\u{18b0}',
+        '\u{18f5}'), ('\u{1900}', '\u{191e}'), ('\u{1920}', '\u{192b}'), ('\u{1930}', '\u{193b}'),
+        ('\u{1946}', '\u{196d}'), ('\u{1970}', '\u{1974}'), ('\u{1980}', '\u{19ab}'), ('\u{19b0}',
+        '\u{19c9}'), ('\u{19d0}', '\u{19da}'), ('\u{1a00}', '\u{1a1b}'), ('\u{1a20}', '\u{1a5e}'),
+        ('\u{1a60}', '\u{1a7c}'), ('\u{1a7f}', '\u{1a89}'), ('\u{1a90}', '\u{1a99}'), ('\u{1aa7}',
+        '\u{1aa7}'), ('\u{1ab0}', '\u{1abd}'), ('\u{1b00}', '\u{1b4b}'), ('\u{1b50}', '\u{1b59}'),
+        ('\u{1b6b}', '\u{1b73}'), ('\u{1b80}', '\u{1bf3}'), ('\u{1c00}', '\u{1c37}'), ('\u{1c40}',
+        '\u{1c49}'), ('\u{1c4d}', '\u{1c7d}'), ('\u{1c80}', '\u{1c88}'), ('\u{1c90}', '\u{1cba}'),
+        ('\u{1cbd}', '\u{1cbf}'), ('\u{1cd0}', '\u{1cd2}'), ('\u{1cd4}', '\u{1cfa}'), ('\u{1d00}',
+        '\u{1df9}'), ('\u{1dfb}', '\u{1f15}'), ('\u{1f18}', '\u{1f1d}'), ('\u{1f20}', '\u{1f45}'),
+        ('\u{1f48}', '\u{1f4d}'), ('\u{1f50}', '\u{1f57}'), ('\u{1f59}', '\u{1f59}'), ('\u{1f5b}',
+        '\u{1f5b}'), ('\u{1f5d}', '\u{1f5d}'), ('\u{1f5f}', '\u{1f7d}'), ('\u{1f80}', '\u{1fb4}'),
+        ('\u{1fb6}', '\u{1fbc}'), ('\u{1fbe}', '\u{1fbe}'), ('\u{1fc2}', '\u{1fc4}'), ('\u{1fc6}',
+        '\u{1fcc}'), ('\u{1fd0}', '\u{1fd3}'), ('\u{1fd6}', '\u{1fdb}'), ('\u{1fe0}', '\u{1fec}'),
+        ('\u{1ff2}', '\u{1ff4}'), ('\u{1ff6}', '\u{1ffc}'), ('\u{203f}', '\u{2040}'), ('\u{2054}',
+        '\u{2054}'), ('\u{2071}', '\u{2071}'), ('\u{207f}', '\u{207f}'), ('\u{2090}', '\u{209c}'),
+        ('\u{20d0}', '\u{20dc}'), ('\u{20e1}', '\u{20e1}'), ('\u{20e5}', '\u{20f0}'), ('\u{2102}',
+        '\u{2102}'), ('\u{2107}', '\u{2107}'), ('\u{210a}', '\u{2113}'), ('\u{2115}', '\u{2115}'),
+        ('\u{2118}', '\u{211d}'), ('\u{2124}', '\u{2124}'), ('\u{2126}', '\u{2126}'), ('\u{2128}',
+        '\u{2128}'), ('\u{212a}', '\u{2139}'), ('\u{213c}', '\u{213f}'), ('\u{2145}', '\u{2149}'),
+        ('\u{214e}', '\u{214e}'), ('\u{2160}', '\u{2188}'), ('\u{2c00}', '\u{2c2e}'), ('\u{2c30}',
+        '\u{2c5e}'), ('\u{2c60}', '\u{2ce4}'), ('\u{2ceb}', '\u{2cf3}'), ('\u{2d00}', '\u{2d25}'),
+        ('\u{2d27}', '\u{2d27}'), ('\u{2d2d}', '\u{2d2d}'), ('\u{2d30}', '\u{2d67}'), ('\u{2d6f}',
+        '\u{2d6f}'), ('\u{2d7f}', '\u{2d96}'), ('\u{2da0}', '\u{2da6}'), ('\u{2da8}', '\u{2dae}'),
+        ('\u{2db0}', '\u{2db6}'), ('\u{2db8}', '\u{2dbe}'), ('\u{2dc0}', '\u{2dc6}'), ('\u{2dc8}',
+        '\u{2dce}'), ('\u{2dd0}', '\u{2dd6}'), ('\u{2dd8}', '\u{2dde}'), ('\u{2de0}', '\u{2dff}'),
+        ('\u{3005}', '\u{3007}'), ('\u{3021}', '\u{302f}'), ('\u{3031}', '\u{3035}'), ('\u{3038}',
+        '\u{303c}'), ('\u{3041}', '\u{3096}'), ('\u{3099}', '\u{309a}'), ('\u{309d}', '\u{309f}'),
+        ('\u{30a1}', '\u{30fa}'), ('\u{30fc}', '\u{30ff}'), ('\u{3105}', '\u{312f}'), ('\u{3131}',
+        '\u{318e}'), ('\u{31a0}', '\u{31ba}'), ('\u{31f0}', '\u{31ff}'), ('\u{3400}', '\u{4db5}'),
+        ('\u{4e00}', '\u{9fef}'), ('\u{a000}', '\u{a48c}'), ('\u{a4d0}', '\u{a4fd}'), ('\u{a500}',
+        '\u{a60c}'), ('\u{a610}', '\u{a62b}'), ('\u{a640}', '\u{a66f}'), ('\u{a674}', '\u{a67d}'),
+        ('\u{a67f}', '\u{a6f1}'), ('\u{a717}', '\u{a71f}'), ('\u{a722}', '\u{a788}'), ('\u{a78b}',
+        '\u{a7bf}'), ('\u{a7c2}', '\u{a7c6}'), ('\u{a7f7}', '\u{a827}'), ('\u{a840}', '\u{a873}'),
+        ('\u{a880}', '\u{a8c5}'), ('\u{a8d0}', '\u{a8d9}'), ('\u{a8e0}', '\u{a8f7}'), ('\u{a8fb}',
+        '\u{a8fb}'), ('\u{a8fd}', '\u{a92d}'), ('\u{a930}', '\u{a953}'), ('\u{a960}', '\u{a97c}'),
+        ('\u{a980}', '\u{a9c0}'), ('\u{a9cf}', '\u{a9d9}'), ('\u{a9e0}', '\u{a9fe}'), ('\u{aa00}',
+        '\u{aa36}'), ('\u{aa40}', '\u{aa4d}'), ('\u{aa50}', '\u{aa59}'), ('\u{aa60}', '\u{aa76}'),
+        ('\u{aa7a}', '\u{aac2}'), ('\u{aadb}', '\u{aadd}'), ('\u{aae0}', '\u{aaef}'), ('\u{aaf2}',
+        '\u{aaf6}'), ('\u{ab01}', '\u{ab06}'), ('\u{ab09}', '\u{ab0e}'), ('\u{ab11}', '\u{ab16}'),
+        ('\u{ab20}', '\u{ab26}'), ('\u{ab28}', '\u{ab2e}'), ('\u{ab30}', '\u{ab5a}'), ('\u{ab5c}',
+        '\u{ab67}'), ('\u{ab70}', '\u{abea}'), ('\u{abec}', '\u{abed}'), ('\u{abf0}', '\u{abf9}'),
+        ('\u{ac00}', '\u{d7a3}'), ('\u{d7b0}', '\u{d7c6}'), ('\u{d7cb}', '\u{d7fb}'), ('\u{f900}',
+        '\u{fa6d}'), ('\u{fa70}', '\u{fad9}'), ('\u{fb00}', '\u{fb06}'), ('\u{fb13}', '\u{fb17}'),
+        ('\u{fb1d}', '\u{fb28}'), ('\u{fb2a}', '\u{fb36}'), ('\u{fb38}', '\u{fb3c}'), ('\u{fb3e}',
+        '\u{fb3e}'), ('\u{fb40}', '\u{fb41}'), ('\u{fb43}', '\u{fb44}'), ('\u{fb46}', '\u{fbb1}'),
+        ('\u{fbd3}', '\u{fc5d}'), ('\u{fc64}', '\u{fd3d}'), ('\u{fd50}', '\u{fd8f}'), ('\u{fd92}',
+        '\u{fdc7}'), ('\u{fdf0}', '\u{fdf9}'), ('\u{fe00}', '\u{fe0f}'), ('\u{fe20}', '\u{fe2f}'),
+        ('\u{fe33}', '\u{fe34}'), ('\u{fe4d}', '\u{fe4f}'), ('\u{fe71}', '\u{fe71}'), ('\u{fe73}',
+        '\u{fe73}'), ('\u{fe77}', '\u{fe77}'), ('\u{fe79}', '\u{fe79}'), ('\u{fe7b}', '\u{fe7b}'),
+        ('\u{fe7d}', '\u{fe7d}'), ('\u{fe7f}', '\u{fefc}'), ('\u{ff10}', '\u{ff19}'), ('\u{ff21}',
+        '\u{ff3a}'), ('\u{ff3f}', '\u{ff3f}'), ('\u{ff41}', '\u{ff5a}'), ('\u{ff66}', '\u{ffbe}'),
+        ('\u{ffc2}', '\u{ffc7}'), ('\u{ffca}', '\u{ffcf}'), ('\u{ffd2}', '\u{ffd7}'), ('\u{ffda}',
+        '\u{ffdc}'), ('\u{10000}', '\u{1000b}'), ('\u{1000d}', '\u{10026}'), ('\u{10028}',
+        '\u{1003a}'), ('\u{1003c}', '\u{1003d}'), ('\u{1003f}', '\u{1004d}'), ('\u{10050}',
+        '\u{1005d}'), ('\u{10080}', '\u{100fa}'), ('\u{10140}', '\u{10174}'), ('\u{101fd}',
+        '\u{101fd}'), ('\u{10280}', '\u{1029c}'), ('\u{102a0}', '\u{102d0}'), ('\u{102e0}',
+        '\u{102e0}'), ('\u{10300}', '\u{1031f}'), ('\u{1032d}', '\u{1034a}'), ('\u{10350}',
+        '\u{1037a}'), ('\u{10380}', '\u{1039d}'), ('\u{103a0}', '\u{103c3}'), ('\u{103c8}',
+        '\u{103cf}'), ('\u{103d1}', '\u{103d5}'), ('\u{10400}', '\u{1049d}'), ('\u{104a0}',
+        '\u{104a9}'), ('\u{104b0}', '\u{104d3}'), ('\u{104d8}', '\u{104fb}'), ('\u{10500}',
+        '\u{10527}'), ('\u{10530}', '\u{10563}'), ('\u{10600}', '\u{10736}'), ('\u{10740}',
+        '\u{10755}'), ('\u{10760}', '\u{10767}'), ('\u{10800}', '\u{10805}'), ('\u{10808}',
+        '\u{10808}'), ('\u{1080a}', '\u{10835}'), ('\u{10837}', '\u{10838}'), ('\u{1083c}',
+        '\u{1083c}'), ('\u{1083f}', '\u{10855}'), ('\u{10860}', '\u{10876}'), ('\u{10880}',
+        '\u{1089e}'), ('\u{108e0}', '\u{108f2}'), ('\u{108f4}', '\u{108f5}'), ('\u{10900}',
+        '\u{10915}'), ('\u{10920}', '\u{10939}'), ('\u{10980}', '\u{109b7}'), ('\u{109be}',
+        '\u{109bf}'), ('\u{10a00}', '\u{10a03}'), ('\u{10a05}', '\u{10a06}'), ('\u{10a0c}',
+        '\u{10a13}'), ('\u{10a15}', '\u{10a17}'), ('\u{10a19}', '\u{10a35}'), ('\u{10a38}',
+        '\u{10a3a}'), ('\u{10a3f}', '\u{10a3f}'), ('\u{10a60}', '\u{10a7c}'), ('\u{10a80}',
+        '\u{10a9c}'), ('\u{10ac0}', '\u{10ac7}'), ('\u{10ac9}', '\u{10ae6}'), ('\u{10b00}',
+        '\u{10b35}'), ('\u{10b40}', '\u{10b55}'), ('\u{10b60}', '\u{10b72}'), ('\u{10b80}',
+        '\u{10b91}'), ('\u{10c00}', '\u{10c48}'), ('\u{10c80}', '\u{10cb2}'), ('\u{10cc0}',
+        '\u{10cf2}'), ('\u{10d00}', '\u{10d27}'), ('\u{10d30}', '\u{10d39}'), ('\u{10f00}',
+        '\u{10f1c}'), ('\u{10f27}', '\u{10f27}'), ('\u{10f30}', '\u{10f50}'), ('\u{10fe0}',
+        '\u{10ff6}'), ('\u{11000}', '\u{11046}'), ('\u{11066}', '\u{1106f}'), ('\u{1107f}',
+        '\u{110ba}'), ('\u{110d0}', '\u{110e8}'), ('\u{110f0}', '\u{110f9}'), ('\u{11100}',
+        '\u{11134}'), ('\u{11136}', '\u{1113f}'), ('\u{11144}', '\u{11146}'), ('\u{11150}',
+        '\u{11173}'), ('\u{11176}', '\u{11176}'), ('\u{11180}', '\u{111c4}'), ('\u{111c9}',
+        '\u{111cc}'), ('\u{111d0}', '\u{111da}'), ('\u{111dc}', '\u{111dc}'), ('\u{11200}',
+        '\u{11211}'), ('\u{11213}', '\u{11237}'), ('\u{1123e}', '\u{1123e}'), ('\u{11280}',
+        '\u{11286}'), ('\u{11288}', '\u{11288}'), ('\u{1128a}', '\u{1128d}'), ('\u{1128f}',
+        '\u{1129d}'), ('\u{1129f}', '\u{112a8}'), ('\u{112b0}', '\u{112ea}'), ('\u{112f0}',
+        '\u{112f9}'), ('\u{11300}', '\u{11303}'), ('\u{11305}', '\u{1130c}'), ('\u{1130f}',
+        '\u{11310}'), ('\u{11313}', '\u{11328}'), ('\u{1132a}', '\u{11330}'), ('\u{11332}',
+        '\u{11333}'), ('\u{11335}', '\u{11339}'), ('\u{1133b}', '\u{11344}'), ('\u{11347}',
+        '\u{11348}'), ('\u{1134b}', '\u{1134d}'), ('\u{11350}', '\u{11350}'), ('\u{11357}',
+        '\u{11357}'), ('\u{1135d}', '\u{11363}'), ('\u{11366}', '\u{1136c}'), ('\u{11370}',
+        '\u{11374}'), ('\u{11400}', '\u{1144a}'), ('\u{11450}', '\u{11459}'), ('\u{1145e}',
+        '\u{1145f}'), ('\u{11480}', '\u{114c5}'), ('\u{114c7}', '\u{114c7}'), ('\u{114d0}',
+        '\u{114d9}'), ('\u{11580}', '\u{115b5}'), ('\u{115b8}', '\u{115c0}'), ('\u{115d8}',
+        '\u{115dd}'), ('\u{11600}', '\u{11640}'), ('\u{11644}', '\u{11644}'), ('\u{11650}',
+        '\u{11659}'), ('\u{11680}', '\u{116b8}'), ('\u{116c0}', '\u{116c9}'), ('\u{11700}',
+        '\u{1171a}'), ('\u{1171d}', '\u{1172b}'), ('\u{11730}', '\u{11739}'), ('\u{11800}',
+        '\u{1183a}'), ('\u{118a0}', '\u{118e9}'), ('\u{118ff}', '\u{118ff}'), ('\u{119a0}',
+        '\u{119a7}'), ('\u{119aa}', '\u{119d7}'), ('\u{119da}', '\u{119e1}'), ('\u{119e3}',
+        '\u{119e4}'), ('\u{11a00}', '\u{11a3e}'), ('\u{11a47}', '\u{11a47}'), ('\u{11a50}',
+        '\u{11a99}'), ('\u{11a9d}', '\u{11a9d}'), ('\u{11ac0}', '\u{11af8}'), ('\u{11c00}',
+        '\u{11c08}'), ('\u{11c0a}', '\u{11c36}'), ('\u{11c38}', '\u{11c40}'), ('\u{11c50}',
+        '\u{11c59}'), ('\u{11c72}', '\u{11c8f}'), ('\u{11c92}', '\u{11ca7}'), ('\u{11ca9}',
+        '\u{11cb6}'), ('\u{11d00}', '\u{11d06}'), ('\u{11d08}', '\u{11d09}'), ('\u{11d0b}',
+        '\u{11d36}'), ('\u{11d3a}', '\u{11d3a}'), ('\u{11d3c}', '\u{11d3d}'), ('\u{11d3f}',
+        '\u{11d47}'), ('\u{11d50}', '\u{11d59}'), ('\u{11d60}', '\u{11d65}'), ('\u{11d67}',
+        '\u{11d68}'), ('\u{11d6a}', '\u{11d8e}'), ('\u{11d90}', '\u{11d91}'), ('\u{11d93}',
+        '\u{11d98}'), ('\u{11da0}', '\u{11da9}'), ('\u{11ee0}', '\u{11ef6}'), ('\u{12000}',
+        '\u{12399}'), ('\u{12400}', '\u{1246e}'), ('\u{12480}', '\u{12543}'), ('\u{13000}',
+        '\u{1342e}'), ('\u{14400}', '\u{14646}'), ('\u{16800}', '\u{16a38}'), ('\u{16a40}',
+        '\u{16a5e}'), ('\u{16a60}', '\u{16a69}'), ('\u{16ad0}', '\u{16aed}'), ('\u{16af0}',
+        '\u{16af4}'), ('\u{16b00}', '\u{16b36}'), ('\u{16b40}', '\u{16b43}'), ('\u{16b50}',
+        '\u{16b59}'), ('\u{16b63}', '\u{16b77}'), ('\u{16b7d}', '\u{16b8f}'), ('\u{16e40}',
+        '\u{16e7f}'), ('\u{16f00}', '\u{16f4a}'), ('\u{16f4f}', '\u{16f87}'), ('\u{16f8f}',
+        '\u{16f9f}'), ('\u{16fe0}', '\u{16fe1}'), ('\u{16fe3}', '\u{16fe3}'), ('\u{17000}',
+        '\u{187f7}'), ('\u{18800}', '\u{18af2}'), ('\u{1b000}', '\u{1b11e}'), ('\u{1b150}',
+        '\u{1b152}'), ('\u{1b164}', '\u{1b167}'), ('\u{1b170}', '\u{1b2fb}'), ('\u{1bc00}',
+        '\u{1bc6a}'), ('\u{1bc70}', '\u{1bc7c}'), ('\u{1bc80}', '\u{1bc88}'), ('\u{1bc90}',
+        '\u{1bc99}'), ('\u{1bc9d}', '\u{1bc9e}'), ('\u{1d165}', '\u{1d169}'), ('\u{1d16d}',
+        '\u{1d172}'), ('\u{1d17b}', '\u{1d182}'), ('\u{1d185}', '\u{1d18b}'), ('\u{1d1aa}',
+        '\u{1d1ad}'), ('\u{1d242}', '\u{1d244}'), ('\u{1d400}', '\u{1d454}'), ('\u{1d456}',
+        '\u{1d49c}'), ('\u{1d49e}', '\u{1d49f}'), ('\u{1d4a2}', '\u{1d4a2}'), ('\u{1d4a5}',
+        '\u{1d4a6}'), ('\u{1d4a9}', '\u{1d4ac}'), ('\u{1d4ae}', '\u{1d4b9}'), ('\u{1d4bb}',
+        '\u{1d4bb}'), ('\u{1d4bd}', '\u{1d4c3}'), ('\u{1d4c5}', '\u{1d505}'), ('\u{1d507}',
+        '\u{1d50a}'), ('\u{1d50d}', '\u{1d514}'), ('\u{1d516}', '\u{1d51c}'), ('\u{1d51e}',
+        '\u{1d539}'), ('\u{1d53b}', '\u{1d53e}'), ('\u{1d540}', '\u{1d544}'), ('\u{1d546}',
+        '\u{1d546}'), ('\u{1d54a}', '\u{1d550}'), ('\u{1d552}', '\u{1d6a5}'), ('\u{1d6a8}',
+        '\u{1d6c0}'), ('\u{1d6c2}', '\u{1d6da}'), ('\u{1d6dc}', '\u{1d6fa}'), ('\u{1d6fc}',
+        '\u{1d714}'), ('\u{1d716}', '\u{1d734}'), ('\u{1d736}', '\u{1d74e}'), ('\u{1d750}',
+        '\u{1d76e}'), ('\u{1d770}', '\u{1d788}'), ('\u{1d78a}', '\u{1d7a8}'), ('\u{1d7aa}',
+        '\u{1d7c2}'), ('\u{1d7c4}', '\u{1d7cb}'), ('\u{1d7ce}', '\u{1d7ff}'), ('\u{1da00}',
+        '\u{1da36}'), ('\u{1da3b}', '\u{1da6c}'), ('\u{1da75}', '\u{1da75}'), ('\u{1da84}',
+        '\u{1da84}'), ('\u{1da9b}', '\u{1da9f}'), ('\u{1daa1}', '\u{1daaf}'), ('\u{1e000}',
+        '\u{1e006}'), ('\u{1e008}', '\u{1e018}'), ('\u{1e01b}', '\u{1e021}'), ('\u{1e023}',
+        '\u{1e024}'), ('\u{1e026}', '\u{1e02a}'), ('\u{1e100}', '\u{1e12c}'), ('\u{1e130}',
+        '\u{1e13d}'), ('\u{1e140}', '\u{1e149}'), ('\u{1e14e}', '\u{1e14e}'), ('\u{1e2c0}',
+        '\u{1e2f9}'), ('\u{1e800}', '\u{1e8c4}'), ('\u{1e8d0}', '\u{1e8d6}'), ('\u{1e900}',
+        '\u{1e94b}'), ('\u{1e950}', '\u{1e959}'), ('\u{1ee00}', '\u{1ee03}'), ('\u{1ee05}',
+        '\u{1ee1f}'), ('\u{1ee21}', '\u{1ee22}'), ('\u{1ee24}', '\u{1ee24}'), ('\u{1ee27}',
+        '\u{1ee27}'), ('\u{1ee29}', '\u{1ee32}'), ('\u{1ee34}', '\u{1ee37}'), ('\u{1ee39}',
+        '\u{1ee39}'), ('\u{1ee3b}', '\u{1ee3b}'), ('\u{1ee42}', '\u{1ee42}'), ('\u{1ee47}',
+        '\u{1ee47}'), ('\u{1ee49}', '\u{1ee49}'), ('\u{1ee4b}', '\u{1ee4b}'), ('\u{1ee4d}',
+        '\u{1ee4f}'), ('\u{1ee51}', '\u{1ee52}'), ('\u{1ee54}', '\u{1ee54}'), ('\u{1ee57}',
+        '\u{1ee57}'), ('\u{1ee59}', '\u{1ee59}'), ('\u{1ee5b}', '\u{1ee5b}'), ('\u{1ee5d}',
+        '\u{1ee5d}'), ('\u{1ee5f}', '\u{1ee5f}'), ('\u{1ee61}', '\u{1ee62}'), ('\u{1ee64}',
+        '\u{1ee64}'), ('\u{1ee67}', '\u{1ee6a}'), ('\u{1ee6c}', '\u{1ee72}'), ('\u{1ee74}',
+        '\u{1ee77}'), ('\u{1ee79}', '\u{1ee7c}'), ('\u{1ee7e}', '\u{1ee7e}'), ('\u{1ee80}',
+        '\u{1ee89}'), ('\u{1ee8b}', '\u{1ee9b}'), ('\u{1eea1}', '\u{1eea3}'), ('\u{1eea5}',
+        '\u{1eea9}'), ('\u{1eeab}', '\u{1eebb}'), ('\u{20000}', '\u{2a6d6}'), ('\u{2a700}',
+        '\u{2b734}'), ('\u{2b740}', '\u{2b81d}'), ('\u{2b820}', '\u{2cea1}'), ('\u{2ceb0}',
+        '\u{2ebe0}'), ('\u{2f800}', '\u{2fa1d}'), ('\u{e0100}', '\u{e01ef}')
+    ];
+
+    pub fn XID_Continue(c: char) -> bool {
+        super::bsearch_range_table(c, XID_Continue_table)
+    }
+
+    pub const XID_Start_table: &[(char, char)] = &[
+        ('\u{41}', '\u{5a}'), ('\u{61}', '\u{7a}'), ('\u{aa}', '\u{aa}'), ('\u{b5}', '\u{b5}'),
+        ('\u{ba}', '\u{ba}'), ('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{f6}'), ('\u{f8}', '\u{2c1}'),
+        ('\u{2c6}', '\u{2d1}'), ('\u{2e0}', '\u{2e4}'), ('\u{2ec}', '\u{2ec}'), ('\u{2ee}',
+        '\u{2ee}'), ('\u{370}', '\u{374}'), ('\u{376}', '\u{377}'), ('\u{37b}', '\u{37d}'),
+        ('\u{37f}', '\u{37f}'), ('\u{386}', '\u{386}'), ('\u{388}', '\u{38a}'), ('\u{38c}',
+        '\u{38c}'), ('\u{38e}', '\u{3a1}'), ('\u{3a3}', '\u{3f5}'), ('\u{3f7}', '\u{481}'),
+        ('\u{48a}', '\u{52f}'), ('\u{531}', '\u{556}'), ('\u{559}', '\u{559}'), ('\u{560}',
+        '\u{588}'), ('\u{5d0}', '\u{5ea}'), ('\u{5ef}', '\u{5f2}'), ('\u{620}', '\u{64a}'),
+        ('\u{66e}', '\u{66f}'), ('\u{671}', '\u{6d3}'), ('\u{6d5}', '\u{6d5}'), ('\u{6e5}',
+        '\u{6e6}'), ('\u{6ee}', '\u{6ef}'), ('\u{6fa}', '\u{6fc}'), ('\u{6ff}', '\u{6ff}'),
+        ('\u{710}', '\u{710}'), ('\u{712}', '\u{72f}'), ('\u{74d}', '\u{7a5}'), ('\u{7b1}',
+        '\u{7b1}'), ('\u{7ca}', '\u{7ea}'), ('\u{7f4}', '\u{7f5}'), ('\u{7fa}', '\u{7fa}'),
+        ('\u{800}', '\u{815}'), ('\u{81a}', '\u{81a}'), ('\u{824}', '\u{824}'), ('\u{828}',
+        '\u{828}'), ('\u{840}', '\u{858}'), ('\u{860}', '\u{86a}'), ('\u{8a0}', '\u{8b4}'),
+        ('\u{8b6}', '\u{8bd}'), ('\u{904}', '\u{939}'), ('\u{93d}', '\u{93d}'), ('\u{950}',
+        '\u{950}'), ('\u{958}', '\u{961}'), ('\u{971}', '\u{980}'), ('\u{985}', '\u{98c}'),
+        ('\u{98f}', '\u{990}'), ('\u{993}', '\u{9a8}'), ('\u{9aa}', '\u{9b0}'), ('\u{9b2}',
+        '\u{9b2}'), ('\u{9b6}', '\u{9b9}'), ('\u{9bd}', '\u{9bd}'), ('\u{9ce}', '\u{9ce}'),
+        ('\u{9dc}', '\u{9dd}'), ('\u{9df}', '\u{9e1}'), ('\u{9f0}', '\u{9f1}'), ('\u{9fc}',
+        '\u{9fc}'), ('\u{a05}', '\u{a0a}'), ('\u{a0f}', '\u{a10}'), ('\u{a13}', '\u{a28}'),
+        ('\u{a2a}', '\u{a30}'), ('\u{a32}', '\u{a33}'), ('\u{a35}', '\u{a36}'), ('\u{a38}',
+        '\u{a39}'), ('\u{a59}', '\u{a5c}'), ('\u{a5e}', '\u{a5e}'), ('\u{a72}', '\u{a74}'),
+        ('\u{a85}', '\u{a8d}'), ('\u{a8f}', '\u{a91}'), ('\u{a93}', '\u{aa8}'), ('\u{aaa}',
+        '\u{ab0}'), ('\u{ab2}', '\u{ab3}'), ('\u{ab5}', '\u{ab9}'), ('\u{abd}', '\u{abd}'),
+        ('\u{ad0}', '\u{ad0}'), ('\u{ae0}', '\u{ae1}'), ('\u{af9}', '\u{af9}'), ('\u{b05}',
+        '\u{b0c}'), ('\u{b0f}', '\u{b10}'), ('\u{b13}', '\u{b28}'), ('\u{b2a}', '\u{b30}'),
+        ('\u{b32}', '\u{b33}'), ('\u{b35}', '\u{b39}'), ('\u{b3d}', '\u{b3d}'), ('\u{b5c}',
+        '\u{b5d}'), ('\u{b5f}', '\u{b61}'), ('\u{b71}', '\u{b71}'), ('\u{b83}', '\u{b83}'),
+        ('\u{b85}', '\u{b8a}'), ('\u{b8e}', '\u{b90}'), ('\u{b92}', '\u{b95}'), ('\u{b99}',
+        '\u{b9a}'), ('\u{b9c}', '\u{b9c}'), ('\u{b9e}', '\u{b9f}'), ('\u{ba3}', '\u{ba4}'),
+        ('\u{ba8}', '\u{baa}'), ('\u{bae}', '\u{bb9}'), ('\u{bd0}', '\u{bd0}'), ('\u{c05}',
+        '\u{c0c}'), ('\u{c0e}', '\u{c10}'), ('\u{c12}', '\u{c28}'), ('\u{c2a}', '\u{c39}'),
+        ('\u{c3d}', '\u{c3d}'), ('\u{c58}', '\u{c5a}'), ('\u{c60}', '\u{c61}'), ('\u{c80}',
+        '\u{c80}'), ('\u{c85}', '\u{c8c}'), ('\u{c8e}', '\u{c90}'), ('\u{c92}', '\u{ca8}'),
+        ('\u{caa}', '\u{cb3}'), ('\u{cb5}', '\u{cb9}'), ('\u{cbd}', '\u{cbd}'), ('\u{cde}',
+        '\u{cde}'), ('\u{ce0}', '\u{ce1}'), ('\u{cf1}', '\u{cf2}'), ('\u{d05}', '\u{d0c}'),
+        ('\u{d0e}', '\u{d10}'), ('\u{d12}', '\u{d3a}'), ('\u{d3d}', '\u{d3d}'), ('\u{d4e}',
+        '\u{d4e}'), ('\u{d54}', '\u{d56}'), ('\u{d5f}', '\u{d61}'), ('\u{d7a}', '\u{d7f}'),
+        ('\u{d85}', '\u{d96}'), ('\u{d9a}', '\u{db1}'), ('\u{db3}', '\u{dbb}'), ('\u{dbd}',
+        '\u{dbd}'), ('\u{dc0}', '\u{dc6}'), ('\u{e01}', '\u{e30}'), ('\u{e32}', '\u{e32}'),
+        ('\u{e40}', '\u{e46}'), ('\u{e81}', '\u{e82}'), ('\u{e84}', '\u{e84}'), ('\u{e86}',
+        '\u{e8a}'), ('\u{e8c}', '\u{ea3}'), ('\u{ea5}', '\u{ea5}'), ('\u{ea7}', '\u{eb0}'),
+        ('\u{eb2}', '\u{eb2}'), ('\u{ebd}', '\u{ebd}'), ('\u{ec0}', '\u{ec4}'), ('\u{ec6}',
+        '\u{ec6}'), ('\u{edc}', '\u{edf}'), ('\u{f00}', '\u{f00}'), ('\u{f40}', '\u{f47}'),
+        ('\u{f49}', '\u{f6c}'), ('\u{f88}', '\u{f8c}'), ('\u{1000}', '\u{102a}'), ('\u{103f}',
+        '\u{103f}'), ('\u{1050}', '\u{1055}'), ('\u{105a}', '\u{105d}'), ('\u{1061}', '\u{1061}'),
+        ('\u{1065}', '\u{1066}'), ('\u{106e}', '\u{1070}'), ('\u{1075}', '\u{1081}'), ('\u{108e}',
+        '\u{108e}'), ('\u{10a0}', '\u{10c5}'), ('\u{10c7}', '\u{10c7}'), ('\u{10cd}', '\u{10cd}'),
+        ('\u{10d0}', '\u{10fa}'), ('\u{10fc}', '\u{1248}'), ('\u{124a}', '\u{124d}'), ('\u{1250}',
+        '\u{1256}'), ('\u{1258}', '\u{1258}'), ('\u{125a}', '\u{125d}'), ('\u{1260}', '\u{1288}'),
+        ('\u{128a}', '\u{128d}'), ('\u{1290}', '\u{12b0}'), ('\u{12b2}', '\u{12b5}'), ('\u{12b8}',
+        '\u{12be}'), ('\u{12c0}', '\u{12c0}'), ('\u{12c2}', '\u{12c5}'), ('\u{12c8}', '\u{12d6}'),
+        ('\u{12d8}', '\u{1310}'), ('\u{1312}', '\u{1315}'), ('\u{1318}', '\u{135a}'), ('\u{1380}',
+        '\u{138f}'), ('\u{13a0}', '\u{13f5}'), ('\u{13f8}', '\u{13fd}'), ('\u{1401}', '\u{166c}'),
+        ('\u{166f}', '\u{167f}'), ('\u{1681}', '\u{169a}'), ('\u{16a0}', '\u{16ea}'), ('\u{16ee}',
+        '\u{16f8}'), ('\u{1700}', '\u{170c}'), ('\u{170e}', '\u{1711}'), ('\u{1720}', '\u{1731}'),
+        ('\u{1740}', '\u{1751}'), ('\u{1760}', '\u{176c}'), ('\u{176e}', '\u{1770}'), ('\u{1780}',
+        '\u{17b3}'), ('\u{17d7}', '\u{17d7}'), ('\u{17dc}', '\u{17dc}'), ('\u{1820}', '\u{1878}'),
+        ('\u{1880}', '\u{18a8}'), ('\u{18aa}', '\u{18aa}'), ('\u{18b0}', '\u{18f5}'), ('\u{1900}',
+        '\u{191e}'), ('\u{1950}', '\u{196d}'), ('\u{1970}', '\u{1974}'), ('\u{1980}', '\u{19ab}'),
+        ('\u{19b0}', '\u{19c9}'), ('\u{1a00}', '\u{1a16}'), ('\u{1a20}', '\u{1a54}'), ('\u{1aa7}',
+        '\u{1aa7}'), ('\u{1b05}', '\u{1b33}'), ('\u{1b45}', '\u{1b4b}'), ('\u{1b83}', '\u{1ba0}'),
+        ('\u{1bae}', '\u{1baf}'), ('\u{1bba}', '\u{1be5}'), ('\u{1c00}', '\u{1c23}'), ('\u{1c4d}',
+        '\u{1c4f}'), ('\u{1c5a}', '\u{1c7d}'), ('\u{1c80}', '\u{1c88}'), ('\u{1c90}', '\u{1cba}'),
+        ('\u{1cbd}', '\u{1cbf}'), ('\u{1ce9}', '\u{1cec}'), ('\u{1cee}', '\u{1cf3}'), ('\u{1cf5}',
+        '\u{1cf6}'), ('\u{1cfa}', '\u{1cfa}'), ('\u{1d00}', '\u{1dbf}'), ('\u{1e00}', '\u{1f15}'),
+        ('\u{1f18}', '\u{1f1d}'), ('\u{1f20}', '\u{1f45}'), ('\u{1f48}', '\u{1f4d}'), ('\u{1f50}',
+        '\u{1f57}'), ('\u{1f59}', '\u{1f59}'), ('\u{1f5b}', '\u{1f5b}'), ('\u{1f5d}', '\u{1f5d}'),
+        ('\u{1f5f}', '\u{1f7d}'), ('\u{1f80}', '\u{1fb4}'), ('\u{1fb6}', '\u{1fbc}'), ('\u{1fbe}',
+        '\u{1fbe}'), ('\u{1fc2}', '\u{1fc4}'), ('\u{1fc6}', '\u{1fcc}'), ('\u{1fd0}', '\u{1fd3}'),
+        ('\u{1fd6}', '\u{1fdb}'), ('\u{1fe0}', '\u{1fec}'), ('\u{1ff2}', '\u{1ff4}'), ('\u{1ff6}',
+        '\u{1ffc}'), ('\u{2071}', '\u{2071}'), ('\u{207f}', '\u{207f}'), ('\u{2090}', '\u{209c}'),
+        ('\u{2102}', '\u{2102}'), ('\u{2107}', '\u{2107}'), ('\u{210a}', '\u{2113}'), ('\u{2115}',
+        '\u{2115}'), ('\u{2118}', '\u{211d}'), ('\u{2124}', '\u{2124}'), ('\u{2126}', '\u{2126}'),
+        ('\u{2128}', '\u{2128}'), ('\u{212a}', '\u{2139}'), ('\u{213c}', '\u{213f}'), ('\u{2145}',
+        '\u{2149}'), ('\u{214e}', '\u{214e}'), ('\u{2160}', '\u{2188}'), ('\u{2c00}', '\u{2c2e}'),
+        ('\u{2c30}', '\u{2c5e}'), ('\u{2c60}', '\u{2ce4}'), ('\u{2ceb}', '\u{2cee}'), ('\u{2cf2}',
+        '\u{2cf3}'), ('\u{2d00}', '\u{2d25}'), ('\u{2d27}', '\u{2d27}'), ('\u{2d2d}', '\u{2d2d}'),
+        ('\u{2d30}', '\u{2d67}'), ('\u{2d6f}', '\u{2d6f}'), ('\u{2d80}', '\u{2d96}'), ('\u{2da0}',
+        '\u{2da6}'), ('\u{2da8}', '\u{2dae}'), ('\u{2db0}', '\u{2db6}'), ('\u{2db8}', '\u{2dbe}'),
+        ('\u{2dc0}', '\u{2dc6}'), ('\u{2dc8}', '\u{2dce}'), ('\u{2dd0}', '\u{2dd6}'), ('\u{2dd8}',
+        '\u{2dde}'), ('\u{3005}', '\u{3007}'), ('\u{3021}', '\u{3029}'), ('\u{3031}', '\u{3035}'),
+        ('\u{3038}', '\u{303c}'), ('\u{3041}', '\u{3096}'), ('\u{309d}', '\u{309f}'), ('\u{30a1}',
+        '\u{30fa}'), ('\u{30fc}', '\u{30ff}'), ('\u{3105}', '\u{312f}'), ('\u{3131}', '\u{318e}'),
+        ('\u{31a0}', '\u{31ba}'), ('\u{31f0}', '\u{31ff}'), ('\u{3400}', '\u{4db5}'), ('\u{4e00}',
+        '\u{9fef}'), ('\u{a000}', '\u{a48c}'), ('\u{a4d0}', '\u{a4fd}'), ('\u{a500}', '\u{a60c}'),
+        ('\u{a610}', '\u{a61f}'), ('\u{a62a}', '\u{a62b}'), ('\u{a640}', '\u{a66e}'), ('\u{a67f}',
+        '\u{a69d}'), ('\u{a6a0}', '\u{a6ef}'), ('\u{a717}', '\u{a71f}'), ('\u{a722}', '\u{a788}'),
+        ('\u{a78b}', '\u{a7bf}'), ('\u{a7c2}', '\u{a7c6}'), ('\u{a7f7}', '\u{a801}'), ('\u{a803}',
+        '\u{a805}'), ('\u{a807}', '\u{a80a}'), ('\u{a80c}', '\u{a822}'), ('\u{a840}', '\u{a873}'),
+        ('\u{a882}', '\u{a8b3}'), ('\u{a8f2}', '\u{a8f7}'), ('\u{a8fb}', '\u{a8fb}'), ('\u{a8fd}',
+        '\u{a8fe}'), ('\u{a90a}', '\u{a925}'), ('\u{a930}', '\u{a946}'), ('\u{a960}', '\u{a97c}'),
+        ('\u{a984}', '\u{a9b2}'), ('\u{a9cf}', '\u{a9cf}'), ('\u{a9e0}', '\u{a9e4}'), ('\u{a9e6}',
+        '\u{a9ef}'), ('\u{a9fa}', '\u{a9fe}'), ('\u{aa00}', '\u{aa28}'), ('\u{aa40}', '\u{aa42}'),
+        ('\u{aa44}', '\u{aa4b}'), ('\u{aa60}', '\u{aa76}'), ('\u{aa7a}', '\u{aa7a}'), ('\u{aa7e}',
+        '\u{aaaf}'), ('\u{aab1}', '\u{aab1}'), ('\u{aab5}', '\u{aab6}'), ('\u{aab9}', '\u{aabd}'),
+        ('\u{aac0}', '\u{aac0}'), ('\u{aac2}', '\u{aac2}'), ('\u{aadb}', '\u{aadd}'), ('\u{aae0}',
+        '\u{aaea}'), ('\u{aaf2}', '\u{aaf4}'), ('\u{ab01}', '\u{ab06}'), ('\u{ab09}', '\u{ab0e}'),
+        ('\u{ab11}', '\u{ab16}'), ('\u{ab20}', '\u{ab26}'), ('\u{ab28}', '\u{ab2e}'), ('\u{ab30}',
+        '\u{ab5a}'), ('\u{ab5c}', '\u{ab67}'), ('\u{ab70}', '\u{abe2}'), ('\u{ac00}', '\u{d7a3}'),
+        ('\u{d7b0}', '\u{d7c6}'), ('\u{d7cb}', '\u{d7fb}'), ('\u{f900}', '\u{fa6d}'), ('\u{fa70}',
+        '\u{fad9}'), ('\u{fb00}', '\u{fb06}'), ('\u{fb13}', '\u{fb17}'), ('\u{fb1d}', '\u{fb1d}'),
+        ('\u{fb1f}', '\u{fb28}'), ('\u{fb2a}', '\u{fb36}'), ('\u{fb38}', '\u{fb3c}'), ('\u{fb3e}',
+        '\u{fb3e}'), ('\u{fb40}', '\u{fb41}'), ('\u{fb43}', '\u{fb44}'), ('\u{fb46}', '\u{fbb1}'),
+        ('\u{fbd3}', '\u{fc5d}'), ('\u{fc64}', '\u{fd3d}'), ('\u{fd50}', '\u{fd8f}'), ('\u{fd92}',
+        '\u{fdc7}'), ('\u{fdf0}', '\u{fdf9}'), ('\u{fe71}', '\u{fe71}'), ('\u{fe73}', '\u{fe73}'),
+        ('\u{fe77}', '\u{fe77}'), ('\u{fe79}', '\u{fe79}'), ('\u{fe7b}', '\u{fe7b}'), ('\u{fe7d}',
+        '\u{fe7d}'), ('\u{fe7f}', '\u{fefc}'), ('\u{ff21}', '\u{ff3a}'), ('\u{ff41}', '\u{ff5a}'),
+        ('\u{ff66}', '\u{ff9d}'), ('\u{ffa0}', '\u{ffbe}'), ('\u{ffc2}', '\u{ffc7}'), ('\u{ffca}',
+        '\u{ffcf}'), ('\u{ffd2}', '\u{ffd7}'), ('\u{ffda}', '\u{ffdc}'), ('\u{10000}', '\u{1000b}'),
+        ('\u{1000d}', '\u{10026}'), ('\u{10028}', '\u{1003a}'), ('\u{1003c}', '\u{1003d}'),
+        ('\u{1003f}', '\u{1004d}'), ('\u{10050}', '\u{1005d}'), ('\u{10080}', '\u{100fa}'),
+        ('\u{10140}', '\u{10174}'), ('\u{10280}', '\u{1029c}'), ('\u{102a0}', '\u{102d0}'),
+        ('\u{10300}', '\u{1031f}'), ('\u{1032d}', '\u{1034a}'), ('\u{10350}', '\u{10375}'),
+        ('\u{10380}', '\u{1039d}'), ('\u{103a0}', '\u{103c3}'), ('\u{103c8}', '\u{103cf}'),
+        ('\u{103d1}', '\u{103d5}'), ('\u{10400}', '\u{1049d}'), ('\u{104b0}', '\u{104d3}'),
+        ('\u{104d8}', '\u{104fb}'), ('\u{10500}', '\u{10527}'), ('\u{10530}', '\u{10563}'),
+        ('\u{10600}', '\u{10736}'), ('\u{10740}', '\u{10755}'), ('\u{10760}', '\u{10767}'),
+        ('\u{10800}', '\u{10805}'), ('\u{10808}', '\u{10808}'), ('\u{1080a}', '\u{10835}'),
+        ('\u{10837}', '\u{10838}'), ('\u{1083c}', '\u{1083c}'), ('\u{1083f}', '\u{10855}'),
+        ('\u{10860}', '\u{10876}'), ('\u{10880}', '\u{1089e}'), ('\u{108e0}', '\u{108f2}'),
+        ('\u{108f4}', '\u{108f5}'), ('\u{10900}', '\u{10915}'), ('\u{10920}', '\u{10939}'),
+        ('\u{10980}', '\u{109b7}'), ('\u{109be}', '\u{109bf}'), ('\u{10a00}', '\u{10a00}'),
+        ('\u{10a10}', '\u{10a13}'), ('\u{10a15}', '\u{10a17}'), ('\u{10a19}', '\u{10a35}'),
+        ('\u{10a60}', '\u{10a7c}'), ('\u{10a80}', '\u{10a9c}'), ('\u{10ac0}', '\u{10ac7}'),
+        ('\u{10ac9}', '\u{10ae4}'), ('\u{10b00}', '\u{10b35}'), ('\u{10b40}', '\u{10b55}'),
+        ('\u{10b60}', '\u{10b72}'), ('\u{10b80}', '\u{10b91}'), ('\u{10c00}', '\u{10c48}'),
+        ('\u{10c80}', '\u{10cb2}'), ('\u{10cc0}', '\u{10cf2}'), ('\u{10d00}', '\u{10d23}'),
+        ('\u{10f00}', '\u{10f1c}'), ('\u{10f27}', '\u{10f27}'), ('\u{10f30}', '\u{10f45}'),
+        ('\u{10fe0}', '\u{10ff6}'), ('\u{11003}', '\u{11037}'), ('\u{11083}', '\u{110af}'),
+        ('\u{110d0}', '\u{110e8}'), ('\u{11103}', '\u{11126}'), ('\u{11144}', '\u{11144}'),
+        ('\u{11150}', '\u{11172}'), ('\u{11176}', '\u{11176}'), ('\u{11183}', '\u{111b2}'),
+        ('\u{111c1}', '\u{111c4}'), ('\u{111da}', '\u{111da}'), ('\u{111dc}', '\u{111dc}'),
+        ('\u{11200}', '\u{11211}'), ('\u{11213}', '\u{1122b}'), ('\u{11280}', '\u{11286}'),
+        ('\u{11288}', '\u{11288}'), ('\u{1128a}', '\u{1128d}'), ('\u{1128f}', '\u{1129d}'),
+        ('\u{1129f}', '\u{112a8}'), ('\u{112b0}', '\u{112de}'), ('\u{11305}', '\u{1130c}'),
+        ('\u{1130f}', '\u{11310}'), ('\u{11313}', '\u{11328}'), ('\u{1132a}', '\u{11330}'),
+        ('\u{11332}', '\u{11333}'), ('\u{11335}', '\u{11339}'), ('\u{1133d}', '\u{1133d}'),
+        ('\u{11350}', '\u{11350}'), ('\u{1135d}', '\u{11361}'), ('\u{11400}', '\u{11434}'),
+        ('\u{11447}', '\u{1144a}'), ('\u{1145f}', '\u{1145f}'), ('\u{11480}', '\u{114af}'),
+        ('\u{114c4}', '\u{114c5}'), ('\u{114c7}', '\u{114c7}'), ('\u{11580}', '\u{115ae}'),
+        ('\u{115d8}', '\u{115db}'), ('\u{11600}', '\u{1162f}'), ('\u{11644}', '\u{11644}'),
+        ('\u{11680}', '\u{116aa}'), ('\u{116b8}', '\u{116b8}'), ('\u{11700}', '\u{1171a}'),
+        ('\u{11800}', '\u{1182b}'), ('\u{118a0}', '\u{118df}'), ('\u{118ff}', '\u{118ff}'),
+        ('\u{119a0}', '\u{119a7}'), ('\u{119aa}', '\u{119d0}'), ('\u{119e1}', '\u{119e1}'),
+        ('\u{119e3}', '\u{119e3}'), ('\u{11a00}', '\u{11a00}'), ('\u{11a0b}', '\u{11a32}'),
+        ('\u{11a3a}', '\u{11a3a}'), ('\u{11a50}', '\u{11a50}'), ('\u{11a5c}', '\u{11a89}'),
+        ('\u{11a9d}', '\u{11a9d}'), ('\u{11ac0}', '\u{11af8}'), ('\u{11c00}', '\u{11c08}'),
+        ('\u{11c0a}', '\u{11c2e}'), ('\u{11c40}', '\u{11c40}'), ('\u{11c72}', '\u{11c8f}'),
+        ('\u{11d00}', '\u{11d06}'), ('\u{11d08}', '\u{11d09}'), ('\u{11d0b}', '\u{11d30}'),
+        ('\u{11d46}', '\u{11d46}'), ('\u{11d60}', '\u{11d65}'), ('\u{11d67}', '\u{11d68}'),
+        ('\u{11d6a}', '\u{11d89}'), ('\u{11d98}', '\u{11d98}'), ('\u{11ee0}', '\u{11ef2}'),
+        ('\u{12000}', '\u{12399}'), ('\u{12400}', '\u{1246e}'), ('\u{12480}', '\u{12543}'),
+        ('\u{13000}', '\u{1342e}'), ('\u{14400}', '\u{14646}'), ('\u{16800}', '\u{16a38}'),
+        ('\u{16a40}', '\u{16a5e}'), ('\u{16ad0}', '\u{16aed}'), ('\u{16b00}', '\u{16b2f}'),
+        ('\u{16b40}', '\u{16b43}'), ('\u{16b63}', '\u{16b77}'), ('\u{16b7d}', '\u{16b8f}'),
+        ('\u{16e40}', '\u{16e7f}'), ('\u{16f00}', '\u{16f4a}'), ('\u{16f50}', '\u{16f50}'),
+        ('\u{16f93}', '\u{16f9f}'), ('\u{16fe0}', '\u{16fe1}'), ('\u{16fe3}', '\u{16fe3}'),
+        ('\u{17000}', '\u{187f7}'), ('\u{18800}', '\u{18af2}'), ('\u{1b000}', '\u{1b11e}'),
+        ('\u{1b150}', '\u{1b152}'), ('\u{1b164}', '\u{1b167}'), ('\u{1b170}', '\u{1b2fb}'),
+        ('\u{1bc00}', '\u{1bc6a}'), ('\u{1bc70}', '\u{1bc7c}'), ('\u{1bc80}', '\u{1bc88}'),
+        ('\u{1bc90}', '\u{1bc99}'), ('\u{1d400}', '\u{1d454}'), ('\u{1d456}', '\u{1d49c}'),
+        ('\u{1d49e}', '\u{1d49f}'), ('\u{1d4a2}', '\u{1d4a2}'), ('\u{1d4a5}', '\u{1d4a6}'),
+        ('\u{1d4a9}', '\u{1d4ac}'), ('\u{1d4ae}', '\u{1d4b9}'), ('\u{1d4bb}', '\u{1d4bb}'),
+        ('\u{1d4bd}', '\u{1d4c3}'), ('\u{1d4c5}', '\u{1d505}'), ('\u{1d507}', '\u{1d50a}'),
+        ('\u{1d50d}', '\u{1d514}'), ('\u{1d516}', '\u{1d51c}'), ('\u{1d51e}', '\u{1d539}'),
+        ('\u{1d53b}', '\u{1d53e}'), ('\u{1d540}', '\u{1d544}'), ('\u{1d546}', '\u{1d546}'),
+        ('\u{1d54a}', '\u{1d550}'), ('\u{1d552}', '\u{1d6a5}'), ('\u{1d6a8}', '\u{1d6c0}'),
+        ('\u{1d6c2}', '\u{1d6da}'), ('\u{1d6dc}', '\u{1d6fa}'), ('\u{1d6fc}', '\u{1d714}'),
+        ('\u{1d716}', '\u{1d734}'), ('\u{1d736}', '\u{1d74e}'), ('\u{1d750}', '\u{1d76e}'),
+        ('\u{1d770}', '\u{1d788}'), ('\u{1d78a}', '\u{1d7a8}'), ('\u{1d7aa}', '\u{1d7c2}'),
+        ('\u{1d7c4}', '\u{1d7cb}'), ('\u{1e100}', '\u{1e12c}'), ('\u{1e137}', '\u{1e13d}'),
+        ('\u{1e14e}', '\u{1e14e}'), ('\u{1e2c0}', '\u{1e2eb}'), ('\u{1e800}', '\u{1e8c4}'),
+        ('\u{1e900}', '\u{1e943}'), ('\u{1e94b}', '\u{1e94b}'), ('\u{1ee00}', '\u{1ee03}'),
+        ('\u{1ee05}', '\u{1ee1f}'), ('\u{1ee21}', '\u{1ee22}'), ('\u{1ee24}', '\u{1ee24}'),
+        ('\u{1ee27}', '\u{1ee27}'), ('\u{1ee29}', '\u{1ee32}'), ('\u{1ee34}', '\u{1ee37}'),
+        ('\u{1ee39}', '\u{1ee39}'), ('\u{1ee3b}', '\u{1ee3b}'), ('\u{1ee42}', '\u{1ee42}'),
+        ('\u{1ee47}', '\u{1ee47}'), ('\u{1ee49}', '\u{1ee49}'), ('\u{1ee4b}', '\u{1ee4b}'),
+        ('\u{1ee4d}', '\u{1ee4f}'), ('\u{1ee51}', '\u{1ee52}'), ('\u{1ee54}', '\u{1ee54}'),
+        ('\u{1ee57}', '\u{1ee57}'), ('\u{1ee59}', '\u{1ee59}'), ('\u{1ee5b}', '\u{1ee5b}'),
+        ('\u{1ee5d}', '\u{1ee5d}'), ('\u{1ee5f}', '\u{1ee5f}'), ('\u{1ee61}', '\u{1ee62}'),
+        ('\u{1ee64}', '\u{1ee64}'), ('\u{1ee67}', '\u{1ee6a}'), ('\u{1ee6c}', '\u{1ee72}'),
+        ('\u{1ee74}', '\u{1ee77}'), ('\u{1ee79}', '\u{1ee7c}'), ('\u{1ee7e}', '\u{1ee7e}'),
+        ('\u{1ee80}', '\u{1ee89}'), ('\u{1ee8b}', '\u{1ee9b}'), ('\u{1eea1}', '\u{1eea3}'),
+        ('\u{1eea5}', '\u{1eea9}'), ('\u{1eeab}', '\u{1eebb}'), ('\u{20000}', '\u{2a6d6}'),
+        ('\u{2a700}', '\u{2b734}'), ('\u{2b740}', '\u{2b81d}'), ('\u{2b820}', '\u{2cea1}'),
+        ('\u{2ceb0}', '\u{2ebe0}'), ('\u{2f800}', '\u{2fa1d}')
+    ];
+
+    pub fn XID_Start(c: char) -> bool {
+        super::bsearch_range_table(c, XID_Start_table)
+    }
+
+}
+
+
+
\ No newline at end of file diff --git a/storage.js b/storage.js new file mode 100644 index 0000000..fdc5f96 --- /dev/null +++ b/storage.js @@ -0,0 +1 @@ +var resourcesSuffix="";var currentTheme=document.getElementById("themeStyle");var mainTheme=document.getElementById("mainThemeStyle");var savedHref=[];function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(!elem||!elem.classList){return}elem.classList.add(className)}function removeClass(elem,className){if(!elem||!elem.classList){return}elem.classList.remove(className)}function onEach(arr,func,reversed){if(arr&&arr.length>0&&func){var length=arr.length;if(reversed!==true){for(var i=0;i=0;--i){if(func(arr[i])===true){return true}}}}return false}function onEachLazy(lazyArray,func,reversed){return onEach(Array.prototype.slice.call(lazyArray),func,reversed)}function usableLocalStorage(){if(typeof Storage==="undefined"){return false}try{return window.localStorage!==null&&window.localStorage!==undefined}catch(err){return false}}function updateLocalStorage(name,value){if(usableLocalStorage()){localStorage[name]=value}else{}}function getCurrentValue(name){if(usableLocalStorage()&&localStorage[name]!==undefined){return localStorage[name]}return null}function switchTheme(styleElem,mainStyleElem,newTheme,saveTheme){var fullBasicCss="rustdoc"+resourcesSuffix+".css";var fullNewTheme=newTheme+resourcesSuffix+".css";var newHref=mainStyleElem.href.replace(fullBasicCss,fullNewTheme);if(styleElem.href===newHref){return}var found=false;if(savedHref.length===0){onEachLazy(document.getElementsByTagName("link"),function(el){savedHref.push(el.href)})}onEach(savedHref,function(el){if(el===newHref){found=true;return true}});if(found===true){styleElem.href=newHref;if(saveTheme===true){updateLocalStorage("rustdoc-theme",newTheme)}}}function getSystemValue(){var property=getComputedStyle(document.documentElement).getPropertyValue('content');return property.replace(/[\"\']/g,"")}switchTheme(currentTheme,mainTheme,getCurrentValue("rustdoc-theme")||getSystemValue()||"light",false) \ No newline at end of file diff --git a/syn/all.html b/syn/all.html new file mode 100644 index 0000000..c2ed173 --- /dev/null +++ b/syn/all.html @@ -0,0 +1,3 @@ +List of all items in this crate

[] + + List of all items

Structs

Enums

Traits

Macros

Functions

Typedefs

\ No newline at end of file diff --git a/syn/attr/enum.AttrStyle.html b/syn/attr/enum.AttrStyle.html new file mode 100644 index 0000000..2feea54 --- /dev/null +++ b/syn/attr/enum.AttrStyle.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.AttrStyle.html...

+ + + \ No newline at end of file diff --git a/syn/attr/enum.Meta.html b/syn/attr/enum.Meta.html new file mode 100644 index 0000000..92a3817 --- /dev/null +++ b/syn/attr/enum.Meta.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.Meta.html...

+ + + \ No newline at end of file diff --git a/syn/attr/enum.NestedMeta.html b/syn/attr/enum.NestedMeta.html new file mode 100644 index 0000000..c290939 --- /dev/null +++ b/syn/attr/enum.NestedMeta.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.NestedMeta.html...

+ + + \ No newline at end of file diff --git a/syn/attr/struct.Attribute.html b/syn/attr/struct.Attribute.html new file mode 100644 index 0000000..1a69f85 --- /dev/null +++ b/syn/attr/struct.Attribute.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Attribute.html...

+ + + \ No newline at end of file diff --git a/syn/attr/struct.MetaList.html b/syn/attr/struct.MetaList.html new file mode 100644 index 0000000..e73a7e2 --- /dev/null +++ b/syn/attr/struct.MetaList.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.MetaList.html...

+ + + \ No newline at end of file diff --git a/syn/attr/struct.MetaNameValue.html b/syn/attr/struct.MetaNameValue.html new file mode 100644 index 0000000..2c22754 --- /dev/null +++ b/syn/attr/struct.MetaNameValue.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.MetaNameValue.html...

+ + + \ No newline at end of file diff --git a/syn/attr/type.AttributeArgs.html b/syn/attr/type.AttributeArgs.html new file mode 100644 index 0000000..949922d --- /dev/null +++ b/syn/attr/type.AttributeArgs.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/type.AttributeArgs.html...

+ + + \ No newline at end of file diff --git a/syn/buffer/index.html b/syn/buffer/index.html new file mode 100644 index 0000000..72b8ab3 --- /dev/null +++ b/syn/buffer/index.html @@ -0,0 +1,9 @@ +syn::buffer - Rust

[][src]Module syn::buffer

A stably addressed token buffer supporting efficient traversal based on a +cheaply copyable cursor.

+

This module is available if Syn is built with the "parsing" feature.

+

Structs

+
Cursor

A cheaply copyable cursor into a TokenBuffer.

+
TokenBuffer

A buffer that can be efficiently traversed multiple times, unlike +TokenStream which requires a deep copy in order to traverse more than +once.

+
\ No newline at end of file diff --git a/syn/buffer/sidebar-items.js b/syn/buffer/sidebar-items.js new file mode 100644 index 0000000..6572d2a --- /dev/null +++ b/syn/buffer/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["Cursor","A cheaply copyable cursor into a `TokenBuffer`."],["TokenBuffer","A buffer that can be efficiently traversed multiple times, unlike `TokenStream` which requires a deep copy in order to traverse more than once."]]}); \ No newline at end of file diff --git a/syn/buffer/struct.Cursor.html b/syn/buffer/struct.Cursor.html new file mode 100644 index 0000000..22315f3 --- /dev/null +++ b/syn/buffer/struct.Cursor.html @@ -0,0 +1,49 @@ +syn::buffer::Cursor - Rust

[][src]Struct syn::buffer::Cursor

pub struct Cursor<'a> { /* fields omitted */ }

A cheaply copyable cursor into a TokenBuffer.

+

This cursor holds a shared reference into the immutable data which is used +internally to represent a TokenStream, and can be efficiently manipulated +and copied around.

+

An empty Cursor can be created directly, or one may create a TokenBuffer +object and get a cursor to its first token with begin().

+

Two cursors are equal if they have the same location in the same input +stream, and have the same scope.

+

This type is available if Syn is built with the "parsing" feature.

+

Methods

impl<'a> Cursor<'a>[src]

pub fn empty() -> Self[src]

Creates a cursor referencing a static empty TokenStream.

+

pub fn eof(self) -> bool[src]

Checks whether the cursor is currently pointing at the end of its valid +scope.

+

pub fn group(self, delim: Delimiter) -> Option<(Cursor<'a>, Span, Cursor<'a>)>[src]

If the cursor is pointing at a Group with the given delimiter, returns +a cursor into that group and one pointing to the next TokenTree.

+

pub fn ident(self) -> Option<(Ident, Cursor<'a>)>[src]

If the cursor is pointing at a Ident, returns it along with a cursor +pointing at the next TokenTree.

+

pub fn punct(self) -> Option<(Punct, Cursor<'a>)>[src]

If the cursor is pointing at an Punct, returns it along with a cursor +pointing at the next TokenTree.

+

pub fn literal(self) -> Option<(Literal, Cursor<'a>)>[src]

If the cursor is pointing at a Literal, return it along with a cursor +pointing at the next TokenTree.

+

pub fn lifetime(self) -> Option<(Lifetime, Cursor<'a>)>[src]

If the cursor is pointing at a Lifetime, returns it along with a +cursor pointing at the next TokenTree.

+

pub fn token_stream(self) -> TokenStream[src]

Copies all remaining tokens visible from this cursor into a +TokenStream.

+

pub fn token_tree(self) -> Option<(TokenTree, Cursor<'a>)>[src]

If the cursor is pointing at a TokenTree, returns it along with a +cursor pointing at the next TokenTree.

+

Returns None if the cursor has reached the end of its stream.

+

This method does not treat None-delimited groups as transparent, and +will return a Group(None, ..) if the cursor is looking at one.

+

pub fn span(self) -> Span[src]

Returns the Span of the current token, or Span::call_site() if this +cursor points to eof.

+

Trait Implementations

impl<'a> Clone for Cursor<'a>[src]

impl<'a> Copy for Cursor<'a>[src]

impl<'a> Eq for Cursor<'a>[src]

impl<'a> PartialEq<Cursor<'a>> for Cursor<'a>[src]

impl<'a> StructuralEq for Cursor<'a>[src]

impl<'a> StructuralPartialEq for Cursor<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Cursor<'a>

impl<'a> !Send for Cursor<'a>

impl<'a> !Sync for Cursor<'a>

impl<'a> Unpin for Cursor<'a>

impl<'a> !UnwindSafe for Cursor<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/buffer/struct.TokenBuffer.html b/syn/buffer/struct.TokenBuffer.html new file mode 100644 index 0000000..a73c9d9 --- /dev/null +++ b/syn/buffer/struct.TokenBuffer.html @@ -0,0 +1,22 @@ +syn::buffer::TokenBuffer - Rust

[][src]Struct syn::buffer::TokenBuffer

pub struct TokenBuffer { /* fields omitted */ }

A buffer that can be efficiently traversed multiple times, unlike +TokenStream which requires a deep copy in order to traverse more than +once.

+

This type is available if Syn is built with the "parsing" feature.

+

Methods

impl TokenBuffer[src]

pub fn new(stream: TokenStream) -> TokenBuffer[src]

Creates a TokenBuffer containing all the tokens from the input +TokenStream.

+

This method is available if Syn is built with both the "parsing" and +"proc-macro" features.

+

pub fn new2(stream: TokenStream) -> TokenBuffer[src]

Creates a TokenBuffer containing all the tokens from the input +TokenStream.

+

pub fn begin(&self) -> Cursor[src]

Creates a cursor referencing the first token in the buffer and able to +traverse until the end of the buffer.

+

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/data/enum.Fields.html b/syn/data/enum.Fields.html new file mode 100644 index 0000000..91aebf1 --- /dev/null +++ b/syn/data/enum.Fields.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.Fields.html...

+ + + \ No newline at end of file diff --git a/syn/data/enum.Visibility.html b/syn/data/enum.Visibility.html new file mode 100644 index 0000000..22f422b --- /dev/null +++ b/syn/data/enum.Visibility.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.Visibility.html...

+ + + \ No newline at end of file diff --git a/syn/data/struct.Field.html b/syn/data/struct.Field.html new file mode 100644 index 0000000..614770c --- /dev/null +++ b/syn/data/struct.Field.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Field.html...

+ + + \ No newline at end of file diff --git a/syn/data/struct.FieldsNamed.html b/syn/data/struct.FieldsNamed.html new file mode 100644 index 0000000..c44a125 --- /dev/null +++ b/syn/data/struct.FieldsNamed.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.FieldsNamed.html...

+ + + \ No newline at end of file diff --git a/syn/data/struct.FieldsUnnamed.html b/syn/data/struct.FieldsUnnamed.html new file mode 100644 index 0000000..f7cf8ec --- /dev/null +++ b/syn/data/struct.FieldsUnnamed.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.FieldsUnnamed.html...

+ + + \ No newline at end of file diff --git a/syn/data/struct.Variant.html b/syn/data/struct.Variant.html new file mode 100644 index 0000000..2cfba36 --- /dev/null +++ b/syn/data/struct.Variant.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Variant.html...

+ + + \ No newline at end of file diff --git a/syn/data/struct.VisCrate.html b/syn/data/struct.VisCrate.html new file mode 100644 index 0000000..d84ec3a --- /dev/null +++ b/syn/data/struct.VisCrate.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.VisCrate.html...

+ + + \ No newline at end of file diff --git a/syn/data/struct.VisPublic.html b/syn/data/struct.VisPublic.html new file mode 100644 index 0000000..c659df7 --- /dev/null +++ b/syn/data/struct.VisPublic.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.VisPublic.html...

+ + + \ No newline at end of file diff --git a/syn/data/struct.VisRestricted.html b/syn/data/struct.VisRestricted.html new file mode 100644 index 0000000..6655619 --- /dev/null +++ b/syn/data/struct.VisRestricted.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.VisRestricted.html...

+ + + \ No newline at end of file diff --git a/syn/derive/enum.Data.html b/syn/derive/enum.Data.html new file mode 100644 index 0000000..5011614 --- /dev/null +++ b/syn/derive/enum.Data.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.Data.html...

+ + + \ No newline at end of file diff --git a/syn/derive/struct.DataEnum.html b/syn/derive/struct.DataEnum.html new file mode 100644 index 0000000..0d5af99 --- /dev/null +++ b/syn/derive/struct.DataEnum.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.DataEnum.html...

+ + + \ No newline at end of file diff --git a/syn/derive/struct.DataStruct.html b/syn/derive/struct.DataStruct.html new file mode 100644 index 0000000..afc7058 --- /dev/null +++ b/syn/derive/struct.DataStruct.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.DataStruct.html...

+ + + \ No newline at end of file diff --git a/syn/derive/struct.DataUnion.html b/syn/derive/struct.DataUnion.html new file mode 100644 index 0000000..3b41785 --- /dev/null +++ b/syn/derive/struct.DataUnion.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.DataUnion.html...

+ + + \ No newline at end of file diff --git a/syn/derive/struct.DeriveInput.html b/syn/derive/struct.DeriveInput.html new file mode 100644 index 0000000..1e21499 --- /dev/null +++ b/syn/derive/struct.DeriveInput.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.DeriveInput.html...

+ + + \ No newline at end of file diff --git a/syn/enum.AttrStyle.html b/syn/enum.AttrStyle.html new file mode 100644 index 0000000..85bbe0a --- /dev/null +++ b/syn/enum.AttrStyle.html @@ -0,0 +1,37 @@ +syn::AttrStyle - Rust

[][src]Enum syn::AttrStyle

pub enum AttrStyle {
+    Outer,
+    Inner(Bang),
+}

Distinguishes between attributes that decorate an item and attributes +that are contained within an item.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

Outer attributes

+
    +
  • #[repr(transparent)]
  • +
  • /// # Example
  • +
  • /** Please file an issue */
  • +
+

Inner attributes

+
    +
  • #![feature(proc_macro)]
  • +
  • //! # Example
  • +
  • /*! Please file an issue */
  • +
+

+ Variants

+
Outer
Inner(Bang)

Trait Implementations

impl Clone for AttrStyle[src]

impl Copy for AttrStyle[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.BinOp.html b/syn/enum.BinOp.html new file mode 100644 index 0000000..2a7d184 --- /dev/null +++ b/syn/enum.BinOp.html @@ -0,0 +1,82 @@ +syn::BinOp - Rust

[][src]Enum syn::BinOp

pub enum BinOp {
+    Add(Add),
+    Sub(Sub),
+    Mul(Star),
+    Div(Div),
+    Rem(Rem),
+    And(AndAnd),
+    Or(OrOr),
+    BitXor(Caret),
+    BitAnd(And),
+    BitOr(Or),
+    Shl(Shl),
+    Shr(Shr),
+    Eq(EqEq),
+    Lt(Lt),
+    Le(Le),
+    Ne(Ne),
+    Ge(Ge),
+    Gt(Gt),
+    AddEq(AddEq),
+    SubEq(SubEq),
+    MulEq(MulEq),
+    DivEq(DivEq),
+    RemEq(RemEq),
+    BitXorEq(CaretEq),
+    BitAndEq(AndEq),
+    BitOrEq(OrEq),
+    ShlEq(ShlEq),
+    ShrEq(ShrEq),
+}

A binary operator: +, +=, &.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Variants

+
Add(Add)

The + operator (addition)

+
Sub(Sub)

The - operator (subtraction)

+
Mul(Star)

The * operator (multiplication)

+
Div(Div)

The / operator (division)

+
Rem(Rem)

The % operator (modulus)

+
And(AndAnd)

The && operator (logical and)

+
Or(OrOr)

The || operator (logical or)

+
BitXor(Caret)

The ^ operator (bitwise xor)

+
BitAnd(And)

The & operator (bitwise and)

+
BitOr(Or)

The | operator (bitwise or)

+
Shl(Shl)

The << operator (shift left)

+
Shr(Shr)

The >> operator (shift right)

+
Eq(EqEq)

The == operator (equality)

+
Lt(Lt)

The < operator (less than)

+
Le(Le)

The <= operator (less than or equal to)

+
Ne(Ne)

The != operator (not equal to)

+
Ge(Ge)

The >= operator (greater than or equal to)

+
Gt(Gt)

The > operator (greater than)

+
AddEq(AddEq)

The += operator

+
SubEq(SubEq)

The -= operator

+
MulEq(MulEq)

The *= operator

+
DivEq(DivEq)

The /= operator

+
RemEq(RemEq)

The %= operator

+
BitXorEq(CaretEq)

The ^= operator

+
BitAndEq(AndEq)

The &= operator

+
BitOrEq(OrEq)

The |= operator

+
ShlEq(ShlEq)

The <<= operator

+
ShrEq(ShrEq)

The >>= operator

+

Trait Implementations

impl Clone for BinOp[src]

impl Copy for BinOp[src]

impl Parse for BinOp[src]

impl ToTokens for BinOp[src]

Auto Trait Implementations

impl !RefUnwindSafe for BinOp

impl !Send for BinOp

impl !Sync for BinOp

impl Unpin for BinOp

impl UnwindSafe for BinOp

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.Data.html b/syn/enum.Data.html new file mode 100644 index 0000000..4b1ce74 --- /dev/null +++ b/syn/enum.Data.html @@ -0,0 +1,32 @@ +syn::Data - Rust

[][src]Enum syn::Data

pub enum Data {
+    Struct(DataStruct),
+    Enum(DataEnum),
+    Union(DataUnion),
+}

The storage of a struct, enum or union data structure.

+

This type is available if Syn is built with the "derive" feature.

+

Syntax tree enum

+

This type is a syntax tree enum.

+

+ Variants

+
Struct(DataStruct)

A struct input to a proc_macro_derive macro.

+
Enum(DataEnum)

An enum input to a proc_macro_derive macro.

+
Union(DataUnion)

An untagged union input to a proc_macro_derive macro.

+

Trait Implementations

impl Clone for Data[src]

impl From<DataEnum> for Data[src]

impl From<DataStruct> for Data[src]

impl From<DataUnion> for Data[src]

Auto Trait Implementations

impl !RefUnwindSafe for Data

impl !Send for Data

impl !Sync for Data

impl Unpin for Data

impl UnwindSafe for Data

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.Expr.html b/syn/enum.Expr.html new file mode 100644 index 0000000..7882f50 --- /dev/null +++ b/syn/enum.Expr.html @@ -0,0 +1,197 @@ +syn::Expr - Rust

[][src]Enum syn::Expr

pub enum Expr {
+    Array(ExprArray),
+    Assign(ExprAssign),
+    AssignOp(ExprAssignOp),
+    Async(ExprAsync),
+    Await(ExprAwait),
+    Binary(ExprBinary),
+    Block(ExprBlock),
+    Box(ExprBox),
+    Break(ExprBreak),
+    Call(ExprCall),
+    Cast(ExprCast),
+    Closure(ExprClosure),
+    Continue(ExprContinue),
+    Field(ExprField),
+    ForLoop(ExprForLoop),
+    Group(ExprGroup),
+    If(ExprIf),
+    Index(ExprIndex),
+    Let(ExprLet),
+    Lit(ExprLit),
+    Loop(ExprLoop),
+    Macro(ExprMacro),
+    Match(ExprMatch),
+    MethodCall(ExprMethodCall),
+    Paren(ExprParen),
+    Path(ExprPath),
+    Range(ExprRange),
+    Reference(ExprReference),
+    Repeat(ExprRepeat),
+    Return(ExprReturn),
+    Struct(ExprStruct),
+    Try(ExprTry),
+    TryBlock(ExprTryBlock),
+    Tuple(ExprTuple),
+    Type(ExprType),
+    Unary(ExprUnary),
+    Unsafe(ExprUnsafe),
+    Verbatim(TokenStream),
+    While(ExprWhile),
+    Yield(ExprYield),
+    // some variants omitted
+}

A Rust expression.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

Syntax tree enums

+

This type is a syntax tree enum. In Syn this and other syntax tree enums +are designed to be traversed using the following rebinding idiom.

+ +
+let expr: Expr = /* ... */;
+match expr {
+    Expr::MethodCall(expr) => {
+        /* ... */
+    }
+    Expr::Cast(expr) => {
+        /* ... */
+    }
+    Expr::If(expr) => {
+        /* ... */
+    }
+
+    /* ... */
+

We begin with a variable expr of type Expr that has no fields +(because it is an enum), and by matching on it and rebinding a variable +with the same name expr we effectively imbue our variable with all of +the data fields provided by the variant that it turned out to be. So for +example above if we ended up in the MethodCall case then we get to use +expr.receiver, expr.args etc; if we ended up in the If case we get +to use expr.cond, expr.then_branch, expr.else_branch.

+

This approach avoids repeating the variant names twice on every line.

+ +
+// Repetitive; recommend not doing this.
+match expr {
+    Expr::MethodCall(ExprMethodCall { method, args, .. }) => {
+

In general, the name to which a syntax tree enum variant is bound should +be a suitable name for the complete syntax tree enum type.

+ +
+// Binding is called `base` which is the name I would use if I were
+// assigning `*discriminant.base` without an `if let`.
+if let Expr::Tuple(base) = *discriminant.base {
+

A sign that you may not be choosing the right variable names is if you +see names getting repeated in your code, like accessing +receiver.receiver or pat.pat or cond.cond.

+

+ Variants

+
Array(ExprArray)

A slice literal expression: [a, b, c, d].

+
Assign(ExprAssign)

An assignment expression: a = compute().

+
AssignOp(ExprAssignOp)

A compound assignment expression: counter += 1.

+
Async(ExprAsync)

An async block: async { ... }.

+
Await(ExprAwait)

An await expression: fut.await.

+
Binary(ExprBinary)

A binary operation: a + b, a * b.

+
Block(ExprBlock)

A blocked scope: { ... }.

+
Box(ExprBox)

A box expression: box f.

+
Break(ExprBreak)

A break, with an optional label to break and an optional +expression.

+
Call(ExprCall)

A function call expression: invoke(a, b).

+
Cast(ExprCast)

A cast expression: foo as f64.

+
Closure(ExprClosure)

A closure expression: |a, b| a + b.

+
Continue(ExprContinue)

A continue, with an optional label.

+
Field(ExprField)

Access of a named struct field (obj.k) or unnamed tuple struct +field (obj.0).

+
ForLoop(ExprForLoop)

A for loop: for pat in expr { ... }.

+
Group(ExprGroup)

An expression contained within invisible delimiters.

+

This variant is important for faithfully representing the precedence +of expressions and is related to None-delimited spans in a +TokenStream.

+
If(ExprIf)

An if expression with an optional else block: if expr { ... } else { ... }.

+

The else branch expression may only be an If or Block +expression, not any of the other types of expression.

+
Index(ExprIndex)

A square bracketed indexing expression: vector[2].

+
Let(ExprLet)

A let guard: let Some(x) = opt.

+
Lit(ExprLit)

A literal in place of an expression: 1, "foo".

+
Loop(ExprLoop)

Conditionless loop: loop { ... }.

+
Macro(ExprMacro)

A macro invocation expression: format!("{}", q).

+
Match(ExprMatch)

A match expression: match n { Some(n) => {}, None => {} }.

+
MethodCall(ExprMethodCall)

A method call expression: x.foo::<T>(a, b).

+
Paren(ExprParen)

A parenthesized expression: (a + b).

+
Path(ExprPath)

A path like std::mem::replace possibly containing generic +parameters and a qualified self-type.

+

A plain identifier like x is a path of length 1.

+
Range(ExprRange)

A range expression: 1..2, 1.., ..2, 1..=2, ..=2.

+
Reference(ExprReference)

A referencing operation: &a or &mut a.

+
Repeat(ExprRepeat)

An array literal constructed from one repeated element: [0u8; N].

+
Return(ExprReturn)

A return, with an optional value to be returned.

+
Struct(ExprStruct)

A struct literal expression: Point { x: 1, y: 1 }.

+

The rest provides the value of the remaining fields as in S { a: 1, b: 1, ..rest }.

+
Try(ExprTry)

A try-expression: expr?.

+
TryBlock(ExprTryBlock)

A try block: try { ... }.

+
Tuple(ExprTuple)

A tuple expression: (a, b, c, d).

+
Type(ExprType)

A type ascription expression: foo: f64.

+
Unary(ExprUnary)

A unary operation: !x, *x.

+
Unsafe(ExprUnsafe)

An unsafe block: unsafe { ... }.

+
Verbatim(TokenStream)

Tokens in expression position not interpreted by Syn.

+
While(ExprWhile)

A while loop: while expr { ... }.

+
Yield(ExprYield)

A yield expression: yield expr.

+

Trait Implementations

impl Clone for Expr[src]

impl From<ExprArray> for Expr[src]

impl From<ExprAssign> for Expr[src]

impl From<ExprAssignOp> for Expr[src]

impl From<ExprAsync> for Expr[src]

impl From<ExprAwait> for Expr[src]

impl From<ExprBinary> for Expr[src]

impl From<ExprBlock> for Expr[src]

impl From<ExprBox> for Expr[src]

impl From<ExprBreak> for Expr[src]

impl From<ExprCall> for Expr[src]

impl From<ExprCast> for Expr[src]

impl From<ExprClosure> for Expr[src]

impl From<ExprContinue> for Expr[src]

impl From<ExprField> for Expr[src]

impl From<ExprForLoop> for Expr[src]

impl From<ExprGroup> for Expr[src]

impl From<ExprIf> for Expr[src]

impl From<ExprIndex> for Expr[src]

impl From<ExprLet> for Expr[src]

impl From<ExprLit> for Expr[src]

impl From<ExprLoop> for Expr[src]

impl From<ExprMacro> for Expr[src]

impl From<ExprMatch> for Expr[src]

impl From<ExprMethodCall> for Expr[src]

impl From<ExprParen> for Expr[src]

impl From<ExprPath> for Expr[src]

impl From<ExprRange> for Expr[src]

impl From<ExprReference> for Expr[src]

impl From<ExprRepeat> for Expr[src]

impl From<ExprReturn> for Expr[src]

impl From<ExprStruct> for Expr[src]

impl From<ExprTry> for Expr[src]

impl From<ExprTryBlock> for Expr[src]

impl From<ExprTuple> for Expr[src]

impl From<ExprType> for Expr[src]

impl From<ExprUnary> for Expr[src]

impl From<ExprUnsafe> for Expr[src]

impl From<ExprWhile> for Expr[src]

impl From<ExprYield> for Expr[src]

impl Parse for Expr[src]

impl ToTokens for Expr[src]

Auto Trait Implementations

impl !RefUnwindSafe for Expr

impl !Send for Expr

impl !Sync for Expr

impl Unpin for Expr

impl UnwindSafe for Expr

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.Fields.html b/syn/enum.Fields.html new file mode 100644 index 0000000..6136934 --- /dev/null +++ b/syn/enum.Fields.html @@ -0,0 +1,56 @@ +syn::Fields - Rust

[][src]Enum syn::Fields

pub enum Fields {
+    Named(FieldsNamed),
+    Unnamed(FieldsUnnamed),
+    Unit,
+}

Data stored within an enum variant or struct.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

Syntax tree enum

+

This type is a syntax tree enum.

+

+ Variants

+

Named fields of a struct or struct variant such as Point { x: f64, y: f64 }.

+
Unnamed(FieldsUnnamed)

Unnamed fields of a tuple struct or tuple variant such as Some(T).

+
Unit

Unit struct or unit variant such as None.

+

Methods

impl Fields[src]

pub fn iter(&self) -> Iter<Field>[src]

Get an iterator over the borrowed [Field] items in this object. This +iterator can be used to iterate over a named or unnamed struct or +variant's fields uniformly.

+

pub fn iter_mut(&mut self) -> IterMut<Field>[src]

Get an iterator over the mutably borrowed [Field] items in this +object. This iterator can be used to iterate over a named or unnamed +struct or variant's fields uniformly.

+

pub fn len(&self) -> usize[src]

Returns the number of fields.

+

pub fn is_empty(&self) -> bool[src]

Returns true if there are zero fields.

+

Trait Implementations

impl Clone for Fields[src]

impl From<FieldsNamed> for Fields[src]

impl From<FieldsUnnamed> for Fields[src]

impl IntoIterator for Fields[src]

type Item = Field

The type of the elements being iterated over.

+

type IntoIter = IntoIter<Field>

Which kind of iterator are we turning this into?

+

impl<'a> IntoIterator for &'a Fields[src]

type Item = &'a Field

The type of the elements being iterated over.

+

type IntoIter = Iter<'a, Field>

Which kind of iterator are we turning this into?

+

impl<'a> IntoIterator for &'a mut Fields[src]

type Item = &'a mut Field

The type of the elements being iterated over.

+

type IntoIter = IterMut<'a, Field>

Which kind of iterator are we turning this into?

+

impl ToTokens for Fields[src]

Auto Trait Implementations

impl !RefUnwindSafe for Fields

impl !Send for Fields

impl !Sync for Fields

impl Unpin for Fields

impl UnwindSafe for Fields

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

+

type IntoIter = I

Which kind of iterator are we turning this into?

+

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.GenericArgument.html b/syn/enum.GenericArgument.html new file mode 100644 index 0000000..fa548e1 --- /dev/null +++ b/syn/enum.GenericArgument.html @@ -0,0 +1,38 @@ +syn::GenericArgument - Rust

[][src]Enum syn::GenericArgument

pub enum GenericArgument {
+    Lifetime(Lifetime),
+    Type(Type),
+    Binding(Binding),
+    Constraint(Constraint),
+    Const(Expr),
+}

An individual generic argument, like 'a, T, or Item = T.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Variants

+
Lifetime(Lifetime)

A lifetime argument.

+
Type(Type)

A type argument.

+
Binding(Binding)

A binding (equality constraint) on an associated type: the Item = u8 in Iterator<Item = u8>.

+
Constraint(Constraint)

An associated type bound: Iterator<Item: Display>.

+
Const(Expr)

A const expression. Must be inside of a block.

+

NOTE: Identity expressions are represented as Type arguments, as +they are indistinguishable syntactically.

+

Trait Implementations

impl Clone for GenericArgument[src]

impl Parse for GenericArgument[src]

impl ToTokens for GenericArgument[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.GenericParam.html b/syn/enum.GenericParam.html new file mode 100644 index 0000000..d3325fe --- /dev/null +++ b/syn/enum.GenericParam.html @@ -0,0 +1,38 @@ +syn::GenericParam - Rust

[][src]Enum syn::GenericParam

pub enum GenericParam {
+    Type(TypeParam),
+    Lifetime(LifetimeDef),
+    Const(ConstParam),
+}

A generic type parameter, lifetime, or const generic: T: Into<String>, +'a: 'b, const LEN: usize.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

Syntax tree enum

+

This type is a syntax tree enum.

+

+ Variants

+
Type(TypeParam)

A generic type parameter: T: Into<String>.

+
Lifetime(LifetimeDef)

A lifetime definition: 'a: 'b + 'c + 'd.

+
Const(ConstParam)

A const generic parameter: const LENGTH: usize.

+

Trait Implementations

impl Clone for GenericParam[src]

impl From<ConstParam> for GenericParam[src]

impl From<LifetimeDef> for GenericParam[src]

impl From<TypeParam> for GenericParam[src]

impl Parse for GenericParam[src]

impl ToTokens for GenericParam[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.Lit.html b/syn/enum.Lit.html new file mode 100644 index 0000000..e1468e6 --- /dev/null +++ b/syn/enum.Lit.html @@ -0,0 +1,54 @@ +syn::Lit - Rust

[][src]Enum syn::Lit

pub enum Lit {
+    Str(LitStr),
+    ByteStr(LitByteStr),
+    Byte(LitByte),
+    Char(LitChar),
+    Int(LitInt),
+    Float(LitFloat),
+    Bool(LitBool),
+    Verbatim(Literal),
+}

A Rust literal such as a string or integer or boolean.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

Syntax tree enum

+

This type is a syntax tree enum.

+

+ Variants

+
Str(LitStr)

A UTF-8 string literal: "foo".

+
ByteStr(LitByteStr)

A byte string literal: b"foo".

+
Byte(LitByte)

A byte literal: b'f'.

+
Char(LitChar)

A character literal: 'a'.

+
Int(LitInt)

An integer literal: 1 or 1u16.

+
Float(LitFloat)

A floating point literal: 1f64 or 1.0e10f64.

+

Must be finite. May not be infinte or NaN.

+
Bool(LitBool)

A boolean literal: true or false.

+
Verbatim(Literal)

A raw token literal not interpreted by Syn.

+

Methods

impl Lit[src]

pub fn new(token: Literal) -> Self[src]

Interpret a Syn literal from a proc-macro2 literal.

+

Trait Implementations

impl Clone for Lit[src]

impl From<Lit> for NestedMeta[src]

impl From<LitBool> for Lit[src]

impl From<LitByte> for Lit[src]

impl From<LitByteStr> for Lit[src]

impl From<LitChar> for Lit[src]

impl From<LitFloat> for Lit[src]

impl From<LitInt> for Lit[src]

impl From<LitStr> for Lit[src]

impl Parse for Lit[src]

impl ToTokens for Lit[src]

impl Token for Lit[src]

Auto Trait Implementations

impl !RefUnwindSafe for Lit

impl !Send for Lit

impl !Sync for Lit

impl Unpin for Lit

impl UnwindSafe for Lit

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.MacroDelimiter.html b/syn/enum.MacroDelimiter.html new file mode 100644 index 0000000..771c373 --- /dev/null +++ b/syn/enum.MacroDelimiter.html @@ -0,0 +1,25 @@ +syn::MacroDelimiter - Rust

[][src]Enum syn::MacroDelimiter

pub enum MacroDelimiter {
+    Paren(Paren),
+    Brace(Brace),
+    Bracket(Bracket),
+}

A grouping token that surrounds a macro body: m!(...) or m!{...} or m![...].

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Variants

+
Paren(Paren)
Brace(Brace)
Bracket(Bracket)

Trait Implementations

impl Clone for MacroDelimiter[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.Member.html b/syn/enum.Member.html new file mode 100644 index 0000000..9386867 --- /dev/null +++ b/syn/enum.Member.html @@ -0,0 +1,37 @@ +syn::Member - Rust

[][src]Enum syn::Member

pub enum Member {
+    Named(Ident),
+    Unnamed(Index),
+}

A struct or tuple struct field accessed in a struct literal or field +expression.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Variants

+
Named(Ident)

A named field like self.x.

+
Unnamed(Index)

An unnamed field like self.0.

+

Trait Implementations

impl Clone for Member[src]

impl Eq for Member[src]

impl Hash for Member[src]

impl IdentFragment for Member[src]

impl Parse for Member[src]

impl PartialEq<Member> for Member[src]

impl StructuralEq for Member[src]

impl StructuralPartialEq for Member[src]

impl ToTokens for Member[src]

Auto Trait Implementations

impl !RefUnwindSafe for Member

impl !Send for Member

impl !Sync for Member

impl Unpin for Member

impl UnwindSafe for Member

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.Meta.html b/syn/enum.Meta.html new file mode 100644 index 0000000..337e320 --- /dev/null +++ b/syn/enum.Meta.html @@ -0,0 +1,46 @@ +syn::Meta - Rust

[][src]Enum syn::Meta

pub enum Meta {
+    Path(Path),
+    List(MetaList),
+    NameValue(MetaNameValue),
+}

Content of a compile-time structured attribute.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

Path

+

A meta path is like the test in #[test].

+

List

+

A meta list is like the derive(Copy) in #[derive(Copy)].

+

NameValue

+

A name-value meta is like the path = "..." in #[path = "sys/windows.rs"].

+

Syntax tree enum

+

This type is a syntax tree enum.

+

+ Variants

+
Path(Path)
List(MetaList)

A structured list within an attribute, like derive(Copy, Clone).

+
NameValue(MetaNameValue)

A name-value pair within an attribute, like feature = "nightly".

+

Methods

impl Meta[src]

pub fn path(&self) -> &Path[src]

Returns the identifier that begins this structured meta item.

+

For example this would return the test in #[test], the derive in +#[derive(Copy)], and the path in #[path = "sys/windows.rs"].

+

Trait Implementations

impl Clone for Meta[src]

impl From<Meta> for NestedMeta[src]

impl From<MetaList> for Meta[src]

impl From<MetaNameValue> for Meta[src]

impl From<Path> for Meta[src]

impl Parse for Meta[src]

impl ToTokens for Meta[src]

Auto Trait Implementations

impl !RefUnwindSafe for Meta

impl !Send for Meta

impl !Sync for Meta

impl Unpin for Meta

impl UnwindSafe for Meta

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.NestedMeta.html b/syn/enum.NestedMeta.html new file mode 100644 index 0000000..2732edc --- /dev/null +++ b/syn/enum.NestedMeta.html @@ -0,0 +1,33 @@ +syn::NestedMeta - Rust

[][src]Enum syn::NestedMeta

pub enum NestedMeta {
+    Meta(Meta),
+    Lit(Lit),
+}

Element of a compile-time attribute list.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Variants

+
Meta(Meta)

A structured meta item, like the Copy in #[derive(Copy)] which +would be a nested Meta::Path.

+
Lit(Lit)

A Rust literal, like the "new_name" in #[rename("new_name")].

+

Trait Implementations

impl Clone for NestedMeta[src]

impl From<Lit> for NestedMeta[src]

impl From<Meta> for NestedMeta[src]

impl Parse for NestedMeta[src]

impl ToTokens for NestedMeta[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.PathArguments.html b/syn/enum.PathArguments.html new file mode 100644 index 0000000..410fbb7 --- /dev/null +++ b/syn/enum.PathArguments.html @@ -0,0 +1,36 @@ +syn::PathArguments - Rust

[][src]Enum syn::PathArguments

pub enum PathArguments {
+    None,
+    AngleBracketed(AngleBracketedGenericArguments),
+    Parenthesized(ParenthesizedGenericArguments),
+}

Angle bracketed or parenthesized arguments of a path segment.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

Angle bracketed

+

The <'a, T> in std::slice::iter<'a, T>.

+

Parenthesized

+

The (A, B) -> C in Fn(A, B) -> C.

+

+ Variants

+
None

The <'a, T> in std::slice::iter<'a, T>.

+

The (A, B) -> C in Fn(A, B) -> C.

+

Methods

impl PathArguments[src]

pub fn is_empty(&self) -> bool[src]

Trait Implementations

impl Clone for PathArguments[src]

impl Default for PathArguments[src]

impl ToTokens for PathArguments[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.ReturnType.html b/syn/enum.ReturnType.html new file mode 100644 index 0000000..dacb6c1 --- /dev/null +++ b/syn/enum.ReturnType.html @@ -0,0 +1,31 @@ +syn::ReturnType - Rust

[][src]Enum syn::ReturnType

pub enum ReturnType {
+    Default,
+    Type(RArrowBox<Type>),
+}

Return type of a function signature.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Variants

+
Default

Return type is not specified.

+

Functions default to () and closures default to type inference.

+
Type(RArrowBox<Type>)

A particular type is returned.

+

Methods

impl ReturnType[src]

pub fn without_plus(input: ParseStream) -> Result<Self>[src]

pub fn parse(input: ParseStream, allow_plus: bool) -> Result<Self>[src]

Trait Implementations

impl Clone for ReturnType[src]

impl Parse for ReturnType[src]

impl ToTokens for ReturnType[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.StrStyle.html b/syn/enum.StrStyle.html new file mode 100644 index 0000000..47c43fa --- /dev/null +++ b/syn/enum.StrStyle.html @@ -0,0 +1,28 @@ +syn::StrStyle - Rust

[][src]Enum syn::StrStyle

pub enum StrStyle {
+    Cooked,
+    Raw(usize),
+}

The style of a string literal, either plain quoted or a raw string like +r##"data"##.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Variants

+
Cooked

An ordinary string like "data".

+
Raw(usize)

A raw string like r##"data"##.

+

The unsigned integer is the number of # symbols used.

+

Trait Implementations

impl Clone for StrStyle[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.TraitBoundModifier.html b/syn/enum.TraitBoundModifier.html new file mode 100644 index 0000000..8391856 --- /dev/null +++ b/syn/enum.TraitBoundModifier.html @@ -0,0 +1,29 @@ +syn::TraitBoundModifier - Rust

[][src]Enum syn::TraitBoundModifier

pub enum TraitBoundModifier {
+    None,
+    Maybe(Question),
+}

A modifier on a trait bound, currently only used for the ? in +?Sized.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Variants

+
None
Maybe(Question)

Trait Implementations

impl Clone for TraitBoundModifier[src]

impl Copy for TraitBoundModifier[src]

impl Parse for TraitBoundModifier[src]

impl ToTokens for TraitBoundModifier[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.Type.html b/syn/enum.Type.html new file mode 100644 index 0000000..415e3fa --- /dev/null +++ b/syn/enum.Type.html @@ -0,0 +1,80 @@ +syn::Type - Rust

[][src]Enum syn::Type

pub enum Type {
+    Array(TypeArray),
+    BareFn(TypeBareFn),
+    Group(TypeGroup),
+    ImplTrait(TypeImplTrait),
+    Infer(TypeInfer),
+    Macro(TypeMacro),
+    Never(TypeNever),
+    Paren(TypeParen),
+    Path(TypePath),
+    Ptr(TypePtr),
+    Reference(TypeReference),
+    Slice(TypeSlice),
+    TraitObject(TypeTraitObject),
+    Tuple(TypeTuple),
+    Verbatim(TokenStream),
+    // some variants omitted
+}

The possible types that a Rust value could have.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

Syntax tree enum

+

This type is a syntax tree enum.

+

+ Variants

+
Array(TypeArray)

A fixed size array type: [T; n].

+
BareFn(TypeBareFn)

A bare function type: fn(usize) -> bool.

+
Group(TypeGroup)

A type contained within invisible delimiters.

+
ImplTrait(TypeImplTrait)

An impl Bound1 + Bound2 + Bound3 type where Bound is a trait or +a lifetime.

+
Infer(TypeInfer)

Indication that a type should be inferred by the compiler: _.

+
Macro(TypeMacro)

A macro in the type position.

+
Never(TypeNever)

The never type: !.

+
Paren(TypeParen)

A parenthesized type equivalent to the inner type.

+
Path(TypePath)

A path like std::slice::Iter, optionally qualified with a +self-type as in <Vec<T> as SomeTrait>::Associated.

+
Ptr(TypePtr)

A raw pointer type: *const T or *mut T.

+
Reference(TypeReference)

A reference type: &'a T or &'a mut T.

+
Slice(TypeSlice)

A dynamically sized slice type: [T].

+
TraitObject(TypeTraitObject)

A trait object type Bound1 + Bound2 + Bound3 where Bound is a +trait or a lifetime.

+
Tuple(TypeTuple)

A tuple type: (A, B, C, String).

+
Verbatim(TokenStream)

Tokens in type position not interpreted by Syn.

+

Methods

impl Type[src]

pub fn without_plus(input: ParseStream) -> Result<Self>[src]

In some positions, types may not contain the + character, to +disambiguate them. For example in the expression 1 as T, T may not +contain a + character.

+

This parser does not allow a +, while the default parser does.

+

Trait Implementations

impl Clone for Type[src]

impl From<TypeArray> for Type[src]

impl From<TypeBareFn> for Type[src]

impl From<TypeGroup> for Type[src]

impl From<TypeImplTrait> for Type[src]

impl From<TypeInfer> for Type[src]

impl From<TypeMacro> for Type[src]

impl From<TypeNever> for Type[src]

impl From<TypeParen> for Type[src]

impl From<TypePath> for Type[src]

impl From<TypePtr> for Type[src]

impl From<TypeReference> for Type[src]

impl From<TypeSlice> for Type[src]

impl From<TypeTraitObject> for Type[src]

impl From<TypeTuple> for Type[src]

impl Parse for Type[src]

impl ToTokens for Type[src]

Auto Trait Implementations

impl !RefUnwindSafe for Type

impl !Send for Type

impl !Sync for Type

impl Unpin for Type

impl UnwindSafe for Type

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.TypeParamBound.html b/syn/enum.TypeParamBound.html new file mode 100644 index 0000000..5730d11 --- /dev/null +++ b/syn/enum.TypeParamBound.html @@ -0,0 +1,30 @@ +syn::TypeParamBound - Rust

[][src]Enum syn::TypeParamBound

pub enum TypeParamBound {
+    Trait(TraitBound),
+    Lifetime(Lifetime),
+}

A trait or lifetime used as a bound on a type parameter.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Variants

+
Trait(TraitBound)
Lifetime(Lifetime)

Trait Implementations

impl Clone for TypeParamBound[src]

impl From<Lifetime> for TypeParamBound[src]

impl From<TraitBound> for TypeParamBound[src]

impl Parse for TypeParamBound[src]

impl ToTokens for TypeParamBound[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.UnOp.html b/syn/enum.UnOp.html new file mode 100644 index 0000000..fc732c8 --- /dev/null +++ b/syn/enum.UnOp.html @@ -0,0 +1,32 @@ +syn::UnOp - Rust

[][src]Enum syn::UnOp

pub enum UnOp {
+    Deref(Star),
+    Not(Bang),
+    Neg(Sub),
+}

A unary operator: *, !, -.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Variants

+
Deref(Star)

The * operator for dereferencing

+
Not(Bang)

The ! operator for logical inversion

+
Neg(Sub)

The - operator for negation

+

Trait Implementations

impl Clone for UnOp[src]

impl Copy for UnOp[src]

impl Parse for UnOp[src]

impl ToTokens for UnOp[src]

Auto Trait Implementations

impl !RefUnwindSafe for UnOp

impl !Send for UnOp

impl !Sync for UnOp

impl Unpin for UnOp

impl UnwindSafe for UnOp

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.Visibility.html b/syn/enum.Visibility.html new file mode 100644 index 0000000..e1ccfbc --- /dev/null +++ b/syn/enum.Visibility.html @@ -0,0 +1,41 @@ +syn::Visibility - Rust

[][src]Enum syn::Visibility

pub enum Visibility {
+    Public(VisPublic),
+    Crate(VisCrate),
+    Restricted(VisRestricted),
+    Inherited,
+}

The visibility level of an item: inherited or pub or +pub(restricted).

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

Syntax tree enum

+

This type is a syntax tree enum.

+

+ Variants

+
Public(VisPublic)

A public visibility level: pub.

+
Crate(VisCrate)

A crate-level visibility: crate.

+
Restricted(VisRestricted)

A visibility level restricted to some path: pub(self) or +pub(super) or pub(crate) or pub(in some::module).

+
Inherited

An inherited visibility, which usually means private.

+

Trait Implementations

impl Clone for Visibility[src]

impl From<VisCrate> for Visibility[src]

impl From<VisPublic> for Visibility[src]

impl From<VisRestricted> for Visibility[src]

impl Parse for Visibility[src]

impl ToTokens for Visibility[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/enum.WherePredicate.html b/syn/enum.WherePredicate.html new file mode 100644 index 0000000..9e0607f --- /dev/null +++ b/syn/enum.WherePredicate.html @@ -0,0 +1,37 @@ +syn::WherePredicate - Rust

[][src]Enum syn::WherePredicate

pub enum WherePredicate {
+    Type(PredicateType),
+    Lifetime(PredicateLifetime),
+    Eq(PredicateEq),
+}

A single predicate in a where clause: T: Deserialize<'de>.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

Syntax tree enum

+

This type is a syntax tree enum.

+

+ Variants

+

A type predicate in a where clause: for<'c> Foo<'c>: Trait<'c>.

+

A lifetime predicate in a where clause: 'a: 'b + 'c.

+

An equality predicate in a where clause (unsupported).

+

Trait Implementations

impl Clone for WherePredicate[src]

impl From<PredicateEq> for WherePredicate[src]

impl From<PredicateLifetime> for WherePredicate[src]

impl From<PredicateType> for WherePredicate[src]

impl Parse for WherePredicate[src]

impl ToTokens for WherePredicate[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/error/struct.Error.html b/syn/error/struct.Error.html new file mode 100644 index 0000000..e172ce3 --- /dev/null +++ b/syn/error/struct.Error.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Error.html...

+ + + \ No newline at end of file diff --git a/syn/error/type.Result.html b/syn/error/type.Result.html new file mode 100644 index 0000000..b8c0cc3 --- /dev/null +++ b/syn/error/type.Result.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/parse/type.Result.html...

+ + + \ No newline at end of file diff --git a/syn/expr/enum.Expr.html b/syn/expr/enum.Expr.html new file mode 100644 index 0000000..59e4a7b --- /dev/null +++ b/syn/expr/enum.Expr.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.Expr.html...

+ + + \ No newline at end of file diff --git a/syn/expr/enum.Member.html b/syn/expr/enum.Member.html new file mode 100644 index 0000000..de882d4 --- /dev/null +++ b/syn/expr/enum.Member.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.Member.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprArray.html b/syn/expr/struct.ExprArray.html new file mode 100644 index 0000000..5853f33 --- /dev/null +++ b/syn/expr/struct.ExprArray.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprArray.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprAssign.html b/syn/expr/struct.ExprAssign.html new file mode 100644 index 0000000..212f907 --- /dev/null +++ b/syn/expr/struct.ExprAssign.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprAssign.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprAssignOp.html b/syn/expr/struct.ExprAssignOp.html new file mode 100644 index 0000000..133e865 --- /dev/null +++ b/syn/expr/struct.ExprAssignOp.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprAssignOp.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprAsync.html b/syn/expr/struct.ExprAsync.html new file mode 100644 index 0000000..ed22924 --- /dev/null +++ b/syn/expr/struct.ExprAsync.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprAsync.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprAwait.html b/syn/expr/struct.ExprAwait.html new file mode 100644 index 0000000..50f946e --- /dev/null +++ b/syn/expr/struct.ExprAwait.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprAwait.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprBinary.html b/syn/expr/struct.ExprBinary.html new file mode 100644 index 0000000..8782044 --- /dev/null +++ b/syn/expr/struct.ExprBinary.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprBinary.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprBlock.html b/syn/expr/struct.ExprBlock.html new file mode 100644 index 0000000..abd8209 --- /dev/null +++ b/syn/expr/struct.ExprBlock.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprBlock.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprBox.html b/syn/expr/struct.ExprBox.html new file mode 100644 index 0000000..8989fa3 --- /dev/null +++ b/syn/expr/struct.ExprBox.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprBox.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprBreak.html b/syn/expr/struct.ExprBreak.html new file mode 100644 index 0000000..32ec107 --- /dev/null +++ b/syn/expr/struct.ExprBreak.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprBreak.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprCall.html b/syn/expr/struct.ExprCall.html new file mode 100644 index 0000000..de0c430 --- /dev/null +++ b/syn/expr/struct.ExprCall.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprCall.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprCast.html b/syn/expr/struct.ExprCast.html new file mode 100644 index 0000000..320cc41 --- /dev/null +++ b/syn/expr/struct.ExprCast.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprCast.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprClosure.html b/syn/expr/struct.ExprClosure.html new file mode 100644 index 0000000..191ccf6 --- /dev/null +++ b/syn/expr/struct.ExprClosure.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprClosure.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprContinue.html b/syn/expr/struct.ExprContinue.html new file mode 100644 index 0000000..2de17e2 --- /dev/null +++ b/syn/expr/struct.ExprContinue.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprContinue.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprField.html b/syn/expr/struct.ExprField.html new file mode 100644 index 0000000..b803510 --- /dev/null +++ b/syn/expr/struct.ExprField.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprField.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprForLoop.html b/syn/expr/struct.ExprForLoop.html new file mode 100644 index 0000000..3a3859b --- /dev/null +++ b/syn/expr/struct.ExprForLoop.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprForLoop.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprGroup.html b/syn/expr/struct.ExprGroup.html new file mode 100644 index 0000000..f1c215a --- /dev/null +++ b/syn/expr/struct.ExprGroup.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprGroup.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprIf.html b/syn/expr/struct.ExprIf.html new file mode 100644 index 0000000..48324b6 --- /dev/null +++ b/syn/expr/struct.ExprIf.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprIf.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprIndex.html b/syn/expr/struct.ExprIndex.html new file mode 100644 index 0000000..984513d --- /dev/null +++ b/syn/expr/struct.ExprIndex.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprIndex.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprLet.html b/syn/expr/struct.ExprLet.html new file mode 100644 index 0000000..ed63d3b --- /dev/null +++ b/syn/expr/struct.ExprLet.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprLet.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprLit.html b/syn/expr/struct.ExprLit.html new file mode 100644 index 0000000..3bf8da3 --- /dev/null +++ b/syn/expr/struct.ExprLit.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprLit.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprLoop.html b/syn/expr/struct.ExprLoop.html new file mode 100644 index 0000000..71dd98a --- /dev/null +++ b/syn/expr/struct.ExprLoop.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprLoop.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprMacro.html b/syn/expr/struct.ExprMacro.html new file mode 100644 index 0000000..94de8ee --- /dev/null +++ b/syn/expr/struct.ExprMacro.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprMacro.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprMatch.html b/syn/expr/struct.ExprMatch.html new file mode 100644 index 0000000..68d6d47 --- /dev/null +++ b/syn/expr/struct.ExprMatch.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprMatch.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprMethodCall.html b/syn/expr/struct.ExprMethodCall.html new file mode 100644 index 0000000..31788a8 --- /dev/null +++ b/syn/expr/struct.ExprMethodCall.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprMethodCall.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprParen.html b/syn/expr/struct.ExprParen.html new file mode 100644 index 0000000..5625966 --- /dev/null +++ b/syn/expr/struct.ExprParen.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprParen.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprPath.html b/syn/expr/struct.ExprPath.html new file mode 100644 index 0000000..4804fac --- /dev/null +++ b/syn/expr/struct.ExprPath.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprPath.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprRange.html b/syn/expr/struct.ExprRange.html new file mode 100644 index 0000000..3e260c4 --- /dev/null +++ b/syn/expr/struct.ExprRange.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprRange.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprReference.html b/syn/expr/struct.ExprReference.html new file mode 100644 index 0000000..3ee0a2c --- /dev/null +++ b/syn/expr/struct.ExprReference.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprReference.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprRepeat.html b/syn/expr/struct.ExprRepeat.html new file mode 100644 index 0000000..a4b19b1 --- /dev/null +++ b/syn/expr/struct.ExprRepeat.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprRepeat.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprReturn.html b/syn/expr/struct.ExprReturn.html new file mode 100644 index 0000000..5599238 --- /dev/null +++ b/syn/expr/struct.ExprReturn.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprReturn.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprStruct.html b/syn/expr/struct.ExprStruct.html new file mode 100644 index 0000000..2bdbae6 --- /dev/null +++ b/syn/expr/struct.ExprStruct.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprStruct.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprTry.html b/syn/expr/struct.ExprTry.html new file mode 100644 index 0000000..90c60d8 --- /dev/null +++ b/syn/expr/struct.ExprTry.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprTry.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprTryBlock.html b/syn/expr/struct.ExprTryBlock.html new file mode 100644 index 0000000..ad60776 --- /dev/null +++ b/syn/expr/struct.ExprTryBlock.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprTryBlock.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprTuple.html b/syn/expr/struct.ExprTuple.html new file mode 100644 index 0000000..e01e4d5 --- /dev/null +++ b/syn/expr/struct.ExprTuple.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprTuple.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprType.html b/syn/expr/struct.ExprType.html new file mode 100644 index 0000000..22138ec --- /dev/null +++ b/syn/expr/struct.ExprType.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprType.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprUnary.html b/syn/expr/struct.ExprUnary.html new file mode 100644 index 0000000..c669e21 --- /dev/null +++ b/syn/expr/struct.ExprUnary.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprUnary.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprUnsafe.html b/syn/expr/struct.ExprUnsafe.html new file mode 100644 index 0000000..c258842 --- /dev/null +++ b/syn/expr/struct.ExprUnsafe.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprUnsafe.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprWhile.html b/syn/expr/struct.ExprWhile.html new file mode 100644 index 0000000..a60b937 --- /dev/null +++ b/syn/expr/struct.ExprWhile.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprWhile.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprYield.html b/syn/expr/struct.ExprYield.html new file mode 100644 index 0000000..0ee608d --- /dev/null +++ b/syn/expr/struct.ExprYield.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ExprYield.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.Index.html b/syn/expr/struct.Index.html new file mode 100644 index 0000000..54048cd --- /dev/null +++ b/syn/expr/struct.Index.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Index.html...

+ + + \ No newline at end of file diff --git a/syn/ext/index.html b/syn/ext/index.html new file mode 100644 index 0000000..3a179ce --- /dev/null +++ b/syn/ext/index.html @@ -0,0 +1,5 @@ +syn::ext - Rust

[][src]Module syn::ext

Extension traits to provide parsing methods on foreign types.

+

This module is available if Syn is built with the "parsing" feature.

+

Traits

+
IdentExt

Additional methods for Ident not provided by proc-macro2 or libproc_macro.

+
\ No newline at end of file diff --git a/syn/ext/sidebar-items.js b/syn/ext/sidebar-items.js new file mode 100644 index 0000000..dc8a477 --- /dev/null +++ b/syn/ext/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"trait":[["IdentExt","Additional methods for `Ident` not provided by proc-macro2 or libproc_macro."]]}); \ No newline at end of file diff --git a/syn/ext/trait.IdentExt.html b/syn/ext/trait.IdentExt.html new file mode 100644 index 0000000..b374b8e --- /dev/null +++ b/syn/ext/trait.IdentExt.html @@ -0,0 +1,67 @@ +syn::ext::IdentExt - Rust

[][src]Trait syn::ext::IdentExt

pub trait IdentExt: Sized + Sealed {
+    const peek_any: PeekFn;
+
+    fn parse_any(input: ParseStream) -> Result<Self>;
+
fn unraw(&self) -> Ident; +}

Additional methods for Ident not provided by proc-macro2 or libproc_macro.

+

This trait is sealed and cannot be implemented for types outside of Syn. It +is implemented only for proc_macro2::Ident.

+

This trait is available if Syn is built with the "parsing" feature.

+
+

Associated Constants

const peek_any: PeekFn

Peeks any identifier including keywords. Usage: +input.peek(Ident::peek_any)

+

This is different from input.peek(Ident) which only returns true in +the case of an ident which is not a Rust keyword.

+
Loading content... +

Required methods

fn parse_any(input: ParseStream) -> Result<Self>

Parses any identifier including keywords.

+

This is useful when parsing macro input which allows Rust keywords as +identifiers.

+

Example

+
+use syn::{Error, Ident, Result, Token};
+use syn::ext::IdentExt;
+use syn::parse::ParseStream;
+
+mod kw {
+    syn::custom_keyword!(name);
+}
+
+// Parses input that looks like `name = NAME` where `NAME` can be
+// any identifier.
+//
+// Examples:
+//
+//     name = anything
+//     name = impl
+fn parse_dsl(input: ParseStream) -> Result<Ident> {
+    input.parse::<kw::name>()?;
+    input.parse::<Token![=]>()?;
+    let name = input.call(Ident::parse_any)?;
+    Ok(name)
+}
+

fn unraw(&self) -> Ident

Strips the raw marker r#, if any, from the beginning of an ident.

+
    +
  • unraw(x) = x
  • +
  • unraw(move) = move
  • +
  • unraw(r#move) = move
  • +
+

Example

+

In the case of interop with other languages like Python that have a +different set of keywords than Rust, we might come across macro input +that involves raw identifiers to refer to ordinary variables in the +other language with a name that happens to be a Rust keyword.

+

The function below appends an identifier from the caller's input onto a +fixed prefix. Without using unraw(), this would tend to produce +invalid identifiers like __pyo3_get_r#move.

+ +
+use proc_macro2::Span;
+use syn::Ident;
+use syn::ext::IdentExt;
+
+fn ident_for_getter(variable: &Ident) -> Ident {
+    let getter = format!("__pyo3_get_{}", variable.unraw());
+    Ident::new(&getter, Span::call_site())
+}
+
Loading content... +

Implementors

impl IdentExt for Ident[src]

Loading content...
\ No newline at end of file diff --git a/syn/fn.parse.html b/syn/fn.parse.html new file mode 100644 index 0000000..2264db5 --- /dev/null +++ b/syn/fn.parse.html @@ -0,0 +1,32 @@ +syn::parse - Rust

[][src]Function syn::parse

pub fn parse<T: Parse>(tokens: TokenStream) -> Result<T>

Parse tokens of source code into the chosen syntax tree node.

+

This is preferred over parsing a string because tokens are able to preserve +information about where in the user's code they were originally written (the +"span" of the token), possibly allowing the compiler to produce better error +messages.

+

This function parses a proc_macro::TokenStream which is the type used for +interop with the compiler in a procedural macro. To parse a +proc_macro2::TokenStream, use syn::parse2 instead.

+

This function is available if Syn is built with both the "parsing" and +"proc-macro" features.

+

Examples

+
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+use quote::quote;
+use syn::DeriveInput;
+
+#[proc_macro_derive(MyMacro)]
+pub fn my_macro(input: TokenStream) -> TokenStream {
+    // Parse the tokens into a syntax tree
+    let ast: DeriveInput = syn::parse(input).unwrap();
+
+    // Build the output, possibly using quasi-quotation
+    let expanded = quote! {
+        /* ... */
+    };
+
+    // Convert into a token stream and return it
+    expanded.into()
+}
+
\ No newline at end of file diff --git a/syn/fn.parse2.html b/syn/fn.parse2.html new file mode 100644 index 0000000..66f1c62 --- /dev/null +++ b/syn/fn.parse2.html @@ -0,0 +1,8 @@ +syn::parse2 - Rust

[][src]Function syn::parse2

pub fn parse2<T: Parse>(tokens: TokenStream) -> Result<T>

Parse a proc-macro2 token stream into the chosen syntax tree node.

+

This function parses a proc_macro2::TokenStream which is commonly useful +when the input comes from a node of the Syn syntax tree, for example the +body tokens of a [Macro] node. When in a procedural macro parsing the +proc_macro::TokenStream provided by the compiler, use syn::parse +instead.

+

This function is available if Syn is built with the "parsing" feature.

+
\ No newline at end of file diff --git a/syn/fn.parse_str.html b/syn/fn.parse_str.html new file mode 100644 index 0000000..c652548 --- /dev/null +++ b/syn/fn.parse_str.html @@ -0,0 +1,16 @@ +syn::parse_str - Rust

[][src]Function syn::parse_str

pub fn parse_str<T: Parse>(s: &str) -> Result<T>

Parse a string of Rust code into the chosen syntax tree node.

+

This function is available if Syn is built with the "parsing" feature.

+

Hygiene

+

Every span in the resulting syntax tree will be set to resolve at the macro +call site.

+

Examples

+
+use syn::{Expr, Result};
+
+fn run() -> Result<()> {
+    let code = "assert_eq!(u8::max_value(), 255)";
+    let expr = syn::parse_str::<Expr>(code)?;
+    println!("{:#?}", expr);
+    Ok(())
+}
+
\ No newline at end of file diff --git a/syn/gen/visit/fn.visit_abi.html b/syn/gen/visit/fn.visit_abi.html new file mode 100644 index 0000000..125dbe1 --- /dev/null +++ b/syn/gen/visit/fn.visit_abi.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_abi.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_angle_bracketed_generic_arguments.html b/syn/gen/visit/fn.visit_angle_bracketed_generic_arguments.html new file mode 100644 index 0000000..18646a8 --- /dev/null +++ b/syn/gen/visit/fn.visit_angle_bracketed_generic_arguments.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_angle_bracketed_generic_arguments.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_attr_style.html b/syn/gen/visit/fn.visit_attr_style.html new file mode 100644 index 0000000..3f0c457 --- /dev/null +++ b/syn/gen/visit/fn.visit_attr_style.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_attr_style.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_attribute.html b/syn/gen/visit/fn.visit_attribute.html new file mode 100644 index 0000000..f11a7dd --- /dev/null +++ b/syn/gen/visit/fn.visit_attribute.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_attribute.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_bare_fn_arg.html b/syn/gen/visit/fn.visit_bare_fn_arg.html new file mode 100644 index 0000000..4a2d506 --- /dev/null +++ b/syn/gen/visit/fn.visit_bare_fn_arg.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_bare_fn_arg.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_bin_op.html b/syn/gen/visit/fn.visit_bin_op.html new file mode 100644 index 0000000..60e82c0 --- /dev/null +++ b/syn/gen/visit/fn.visit_bin_op.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_bin_op.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_binding.html b/syn/gen/visit/fn.visit_binding.html new file mode 100644 index 0000000..38eed35 --- /dev/null +++ b/syn/gen/visit/fn.visit_binding.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_binding.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_bound_lifetimes.html b/syn/gen/visit/fn.visit_bound_lifetimes.html new file mode 100644 index 0000000..648652e --- /dev/null +++ b/syn/gen/visit/fn.visit_bound_lifetimes.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_bound_lifetimes.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_const_param.html b/syn/gen/visit/fn.visit_const_param.html new file mode 100644 index 0000000..944abf3 --- /dev/null +++ b/syn/gen/visit/fn.visit_const_param.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_const_param.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_constraint.html b/syn/gen/visit/fn.visit_constraint.html new file mode 100644 index 0000000..9c2b3f7 --- /dev/null +++ b/syn/gen/visit/fn.visit_constraint.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_constraint.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_data.html b/syn/gen/visit/fn.visit_data.html new file mode 100644 index 0000000..0630316 --- /dev/null +++ b/syn/gen/visit/fn.visit_data.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_data.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_data_enum.html b/syn/gen/visit/fn.visit_data_enum.html new file mode 100644 index 0000000..5ff93aa --- /dev/null +++ b/syn/gen/visit/fn.visit_data_enum.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_data_enum.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_data_struct.html b/syn/gen/visit/fn.visit_data_struct.html new file mode 100644 index 0000000..533b2f3 --- /dev/null +++ b/syn/gen/visit/fn.visit_data_struct.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_data_struct.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_data_union.html b/syn/gen/visit/fn.visit_data_union.html new file mode 100644 index 0000000..c3c56e6 --- /dev/null +++ b/syn/gen/visit/fn.visit_data_union.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_data_union.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_derive_input.html b/syn/gen/visit/fn.visit_derive_input.html new file mode 100644 index 0000000..6f95104 --- /dev/null +++ b/syn/gen/visit/fn.visit_derive_input.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_derive_input.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_expr.html b/syn/gen/visit/fn.visit_expr.html new file mode 100644 index 0000000..88c52ea --- /dev/null +++ b/syn/gen/visit/fn.visit_expr.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_expr.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_expr_binary.html b/syn/gen/visit/fn.visit_expr_binary.html new file mode 100644 index 0000000..20886ab --- /dev/null +++ b/syn/gen/visit/fn.visit_expr_binary.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_expr_binary.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_expr_call.html b/syn/gen/visit/fn.visit_expr_call.html new file mode 100644 index 0000000..5024f59 --- /dev/null +++ b/syn/gen/visit/fn.visit_expr_call.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_expr_call.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_expr_cast.html b/syn/gen/visit/fn.visit_expr_cast.html new file mode 100644 index 0000000..5681ec4 --- /dev/null +++ b/syn/gen/visit/fn.visit_expr_cast.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_expr_cast.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_expr_field.html b/syn/gen/visit/fn.visit_expr_field.html new file mode 100644 index 0000000..7aa7129 --- /dev/null +++ b/syn/gen/visit/fn.visit_expr_field.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_expr_field.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_expr_index.html b/syn/gen/visit/fn.visit_expr_index.html new file mode 100644 index 0000000..ce7e0ba --- /dev/null +++ b/syn/gen/visit/fn.visit_expr_index.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_expr_index.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_expr_lit.html b/syn/gen/visit/fn.visit_expr_lit.html new file mode 100644 index 0000000..22607d4 --- /dev/null +++ b/syn/gen/visit/fn.visit_expr_lit.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_expr_lit.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_expr_paren.html b/syn/gen/visit/fn.visit_expr_paren.html new file mode 100644 index 0000000..7ce8dab --- /dev/null +++ b/syn/gen/visit/fn.visit_expr_paren.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_expr_paren.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_expr_path.html b/syn/gen/visit/fn.visit_expr_path.html new file mode 100644 index 0000000..9fa35eb --- /dev/null +++ b/syn/gen/visit/fn.visit_expr_path.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_expr_path.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_expr_unary.html b/syn/gen/visit/fn.visit_expr_unary.html new file mode 100644 index 0000000..43a9c7b --- /dev/null +++ b/syn/gen/visit/fn.visit_expr_unary.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_expr_unary.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_field.html b/syn/gen/visit/fn.visit_field.html new file mode 100644 index 0000000..4bd3807 --- /dev/null +++ b/syn/gen/visit/fn.visit_field.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_field.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_fields.html b/syn/gen/visit/fn.visit_fields.html new file mode 100644 index 0000000..785518a --- /dev/null +++ b/syn/gen/visit/fn.visit_fields.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_fields.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_fields_named.html b/syn/gen/visit/fn.visit_fields_named.html new file mode 100644 index 0000000..8158bc0 --- /dev/null +++ b/syn/gen/visit/fn.visit_fields_named.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_fields_named.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_fields_unnamed.html b/syn/gen/visit/fn.visit_fields_unnamed.html new file mode 100644 index 0000000..6445fd8 --- /dev/null +++ b/syn/gen/visit/fn.visit_fields_unnamed.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_fields_unnamed.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_generic_argument.html b/syn/gen/visit/fn.visit_generic_argument.html new file mode 100644 index 0000000..f1a6778 --- /dev/null +++ b/syn/gen/visit/fn.visit_generic_argument.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_generic_argument.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_generic_param.html b/syn/gen/visit/fn.visit_generic_param.html new file mode 100644 index 0000000..a9c74ce --- /dev/null +++ b/syn/gen/visit/fn.visit_generic_param.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_generic_param.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_generics.html b/syn/gen/visit/fn.visit_generics.html new file mode 100644 index 0000000..b0696b2 --- /dev/null +++ b/syn/gen/visit/fn.visit_generics.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_generics.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_ident.html b/syn/gen/visit/fn.visit_ident.html new file mode 100644 index 0000000..a0674b4 --- /dev/null +++ b/syn/gen/visit/fn.visit_ident.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_ident.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_index.html b/syn/gen/visit/fn.visit_index.html new file mode 100644 index 0000000..81dec7b --- /dev/null +++ b/syn/gen/visit/fn.visit_index.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_index.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_lifetime.html b/syn/gen/visit/fn.visit_lifetime.html new file mode 100644 index 0000000..b751a67 --- /dev/null +++ b/syn/gen/visit/fn.visit_lifetime.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_lifetime.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_lifetime_def.html b/syn/gen/visit/fn.visit_lifetime_def.html new file mode 100644 index 0000000..4a1e733 --- /dev/null +++ b/syn/gen/visit/fn.visit_lifetime_def.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_lifetime_def.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_lit.html b/syn/gen/visit/fn.visit_lit.html new file mode 100644 index 0000000..aabfd9f --- /dev/null +++ b/syn/gen/visit/fn.visit_lit.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_lit.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_lit_bool.html b/syn/gen/visit/fn.visit_lit_bool.html new file mode 100644 index 0000000..5f50962 --- /dev/null +++ b/syn/gen/visit/fn.visit_lit_bool.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_lit_bool.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_lit_byte.html b/syn/gen/visit/fn.visit_lit_byte.html new file mode 100644 index 0000000..3605311 --- /dev/null +++ b/syn/gen/visit/fn.visit_lit_byte.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_lit_byte.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_lit_byte_str.html b/syn/gen/visit/fn.visit_lit_byte_str.html new file mode 100644 index 0000000..f2d84e5 --- /dev/null +++ b/syn/gen/visit/fn.visit_lit_byte_str.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_lit_byte_str.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_lit_char.html b/syn/gen/visit/fn.visit_lit_char.html new file mode 100644 index 0000000..934cc3d --- /dev/null +++ b/syn/gen/visit/fn.visit_lit_char.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_lit_char.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_lit_float.html b/syn/gen/visit/fn.visit_lit_float.html new file mode 100644 index 0000000..29411a7 --- /dev/null +++ b/syn/gen/visit/fn.visit_lit_float.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_lit_float.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_lit_int.html b/syn/gen/visit/fn.visit_lit_int.html new file mode 100644 index 0000000..36ae81d --- /dev/null +++ b/syn/gen/visit/fn.visit_lit_int.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_lit_int.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_lit_str.html b/syn/gen/visit/fn.visit_lit_str.html new file mode 100644 index 0000000..45ab563 --- /dev/null +++ b/syn/gen/visit/fn.visit_lit_str.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_lit_str.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_macro.html b/syn/gen/visit/fn.visit_macro.html new file mode 100644 index 0000000..eb50451 --- /dev/null +++ b/syn/gen/visit/fn.visit_macro.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_macro.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_macro_delimiter.html b/syn/gen/visit/fn.visit_macro_delimiter.html new file mode 100644 index 0000000..aea7eb2 --- /dev/null +++ b/syn/gen/visit/fn.visit_macro_delimiter.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_macro_delimiter.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_member.html b/syn/gen/visit/fn.visit_member.html new file mode 100644 index 0000000..496a1ee --- /dev/null +++ b/syn/gen/visit/fn.visit_member.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_member.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_meta.html b/syn/gen/visit/fn.visit_meta.html new file mode 100644 index 0000000..b5fae79 --- /dev/null +++ b/syn/gen/visit/fn.visit_meta.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_meta.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_meta_list.html b/syn/gen/visit/fn.visit_meta_list.html new file mode 100644 index 0000000..6734d10 --- /dev/null +++ b/syn/gen/visit/fn.visit_meta_list.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_meta_list.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_meta_name_value.html b/syn/gen/visit/fn.visit_meta_name_value.html new file mode 100644 index 0000000..2d27064 --- /dev/null +++ b/syn/gen/visit/fn.visit_meta_name_value.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_meta_name_value.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_nested_meta.html b/syn/gen/visit/fn.visit_nested_meta.html new file mode 100644 index 0000000..f028df3 --- /dev/null +++ b/syn/gen/visit/fn.visit_nested_meta.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_nested_meta.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_parenthesized_generic_arguments.html b/syn/gen/visit/fn.visit_parenthesized_generic_arguments.html new file mode 100644 index 0000000..83bcdca --- /dev/null +++ b/syn/gen/visit/fn.visit_parenthesized_generic_arguments.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_parenthesized_generic_arguments.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_path.html b/syn/gen/visit/fn.visit_path.html new file mode 100644 index 0000000..2f1b2ba --- /dev/null +++ b/syn/gen/visit/fn.visit_path.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_path.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_path_arguments.html b/syn/gen/visit/fn.visit_path_arguments.html new file mode 100644 index 0000000..41e62b1 --- /dev/null +++ b/syn/gen/visit/fn.visit_path_arguments.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_path_arguments.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_path_segment.html b/syn/gen/visit/fn.visit_path_segment.html new file mode 100644 index 0000000..e4fe217 --- /dev/null +++ b/syn/gen/visit/fn.visit_path_segment.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_path_segment.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_predicate_eq.html b/syn/gen/visit/fn.visit_predicate_eq.html new file mode 100644 index 0000000..885c9af --- /dev/null +++ b/syn/gen/visit/fn.visit_predicate_eq.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_predicate_eq.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_predicate_lifetime.html b/syn/gen/visit/fn.visit_predicate_lifetime.html new file mode 100644 index 0000000..10ddfcb --- /dev/null +++ b/syn/gen/visit/fn.visit_predicate_lifetime.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_predicate_lifetime.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_predicate_type.html b/syn/gen/visit/fn.visit_predicate_type.html new file mode 100644 index 0000000..07c8016 --- /dev/null +++ b/syn/gen/visit/fn.visit_predicate_type.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_predicate_type.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_qself.html b/syn/gen/visit/fn.visit_qself.html new file mode 100644 index 0000000..ea8716e --- /dev/null +++ b/syn/gen/visit/fn.visit_qself.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_qself.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_return_type.html b/syn/gen/visit/fn.visit_return_type.html new file mode 100644 index 0000000..6a28d11 --- /dev/null +++ b/syn/gen/visit/fn.visit_return_type.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_return_type.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_span.html b/syn/gen/visit/fn.visit_span.html new file mode 100644 index 0000000..42e1150 --- /dev/null +++ b/syn/gen/visit/fn.visit_span.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_span.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_trait_bound.html b/syn/gen/visit/fn.visit_trait_bound.html new file mode 100644 index 0000000..4527bc6 --- /dev/null +++ b/syn/gen/visit/fn.visit_trait_bound.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_trait_bound.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_trait_bound_modifier.html b/syn/gen/visit/fn.visit_trait_bound_modifier.html new file mode 100644 index 0000000..f3f841f --- /dev/null +++ b/syn/gen/visit/fn.visit_trait_bound_modifier.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_trait_bound_modifier.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type.html b/syn/gen/visit/fn.visit_type.html new file mode 100644 index 0000000..d0b53a0 --- /dev/null +++ b/syn/gen/visit/fn.visit_type.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_array.html b/syn/gen/visit/fn.visit_type_array.html new file mode 100644 index 0000000..be6ef61 --- /dev/null +++ b/syn/gen/visit/fn.visit_type_array.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_array.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_bare_fn.html b/syn/gen/visit/fn.visit_type_bare_fn.html new file mode 100644 index 0000000..6d8b183 --- /dev/null +++ b/syn/gen/visit/fn.visit_type_bare_fn.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_bare_fn.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_group.html b/syn/gen/visit/fn.visit_type_group.html new file mode 100644 index 0000000..f7c11a8 --- /dev/null +++ b/syn/gen/visit/fn.visit_type_group.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_group.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_impl_trait.html b/syn/gen/visit/fn.visit_type_impl_trait.html new file mode 100644 index 0000000..98bf6eb --- /dev/null +++ b/syn/gen/visit/fn.visit_type_impl_trait.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_impl_trait.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_infer.html b/syn/gen/visit/fn.visit_type_infer.html new file mode 100644 index 0000000..dfcaeca --- /dev/null +++ b/syn/gen/visit/fn.visit_type_infer.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_infer.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_macro.html b/syn/gen/visit/fn.visit_type_macro.html new file mode 100644 index 0000000..5b580cf --- /dev/null +++ b/syn/gen/visit/fn.visit_type_macro.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_macro.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_never.html b/syn/gen/visit/fn.visit_type_never.html new file mode 100644 index 0000000..d2bb948 --- /dev/null +++ b/syn/gen/visit/fn.visit_type_never.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_never.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_param.html b/syn/gen/visit/fn.visit_type_param.html new file mode 100644 index 0000000..10f4268 --- /dev/null +++ b/syn/gen/visit/fn.visit_type_param.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_param.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_param_bound.html b/syn/gen/visit/fn.visit_type_param_bound.html new file mode 100644 index 0000000..519f0b6 --- /dev/null +++ b/syn/gen/visit/fn.visit_type_param_bound.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_param_bound.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_paren.html b/syn/gen/visit/fn.visit_type_paren.html new file mode 100644 index 0000000..6e48b05 --- /dev/null +++ b/syn/gen/visit/fn.visit_type_paren.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_paren.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_path.html b/syn/gen/visit/fn.visit_type_path.html new file mode 100644 index 0000000..af99283 --- /dev/null +++ b/syn/gen/visit/fn.visit_type_path.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_path.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_ptr.html b/syn/gen/visit/fn.visit_type_ptr.html new file mode 100644 index 0000000..5647475 --- /dev/null +++ b/syn/gen/visit/fn.visit_type_ptr.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_ptr.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_reference.html b/syn/gen/visit/fn.visit_type_reference.html new file mode 100644 index 0000000..626fd10 --- /dev/null +++ b/syn/gen/visit/fn.visit_type_reference.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_reference.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_slice.html b/syn/gen/visit/fn.visit_type_slice.html new file mode 100644 index 0000000..6ac48ab --- /dev/null +++ b/syn/gen/visit/fn.visit_type_slice.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_slice.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_trait_object.html b/syn/gen/visit/fn.visit_type_trait_object.html new file mode 100644 index 0000000..f0e0c91 --- /dev/null +++ b/syn/gen/visit/fn.visit_type_trait_object.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_trait_object.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_type_tuple.html b/syn/gen/visit/fn.visit_type_tuple.html new file mode 100644 index 0000000..383916a --- /dev/null +++ b/syn/gen/visit/fn.visit_type_tuple.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_type_tuple.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_un_op.html b/syn/gen/visit/fn.visit_un_op.html new file mode 100644 index 0000000..0abeb7d --- /dev/null +++ b/syn/gen/visit/fn.visit_un_op.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_un_op.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_variadic.html b/syn/gen/visit/fn.visit_variadic.html new file mode 100644 index 0000000..abf531e --- /dev/null +++ b/syn/gen/visit/fn.visit_variadic.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_variadic.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_variant.html b/syn/gen/visit/fn.visit_variant.html new file mode 100644 index 0000000..0760622 --- /dev/null +++ b/syn/gen/visit/fn.visit_variant.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_variant.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_vis_crate.html b/syn/gen/visit/fn.visit_vis_crate.html new file mode 100644 index 0000000..05dab2a --- /dev/null +++ b/syn/gen/visit/fn.visit_vis_crate.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_vis_crate.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_vis_public.html b/syn/gen/visit/fn.visit_vis_public.html new file mode 100644 index 0000000..4dd1713 --- /dev/null +++ b/syn/gen/visit/fn.visit_vis_public.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_vis_public.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_vis_restricted.html b/syn/gen/visit/fn.visit_vis_restricted.html new file mode 100644 index 0000000..c907bcc --- /dev/null +++ b/syn/gen/visit/fn.visit_vis_restricted.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_vis_restricted.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_visibility.html b/syn/gen/visit/fn.visit_visibility.html new file mode 100644 index 0000000..3de02aa --- /dev/null +++ b/syn/gen/visit/fn.visit_visibility.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_visibility.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_where_clause.html b/syn/gen/visit/fn.visit_where_clause.html new file mode 100644 index 0000000..37c052a --- /dev/null +++ b/syn/gen/visit/fn.visit_where_clause.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_where_clause.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/fn.visit_where_predicate.html b/syn/gen/visit/fn.visit_where_predicate.html new file mode 100644 index 0000000..ca2d214 --- /dev/null +++ b/syn/gen/visit/fn.visit_where_predicate.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/fn.visit_where_predicate.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/index.html b/syn/gen/visit/index.html new file mode 100644 index 0000000..4c90a9f --- /dev/null +++ b/syn/gen/visit/index.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/index.html...

+ + + \ No newline at end of file diff --git a/syn/gen/visit/trait.Visit.html b/syn/gen/visit/trait.Visit.html new file mode 100644 index 0000000..c6b88f1 --- /dev/null +++ b/syn/gen/visit/trait.Visit.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../../syn/visit/trait.Visit.html...

+ + + \ No newline at end of file diff --git a/syn/generics/enum.GenericParam.html b/syn/generics/enum.GenericParam.html new file mode 100644 index 0000000..466c167 --- /dev/null +++ b/syn/generics/enum.GenericParam.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.GenericParam.html...

+ + + \ No newline at end of file diff --git a/syn/generics/enum.TraitBoundModifier.html b/syn/generics/enum.TraitBoundModifier.html new file mode 100644 index 0000000..cd38f66 --- /dev/null +++ b/syn/generics/enum.TraitBoundModifier.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.TraitBoundModifier.html...

+ + + \ No newline at end of file diff --git a/syn/generics/enum.TypeParamBound.html b/syn/generics/enum.TypeParamBound.html new file mode 100644 index 0000000..6b5502a --- /dev/null +++ b/syn/generics/enum.TypeParamBound.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.TypeParamBound.html...

+ + + \ No newline at end of file diff --git a/syn/generics/enum.WherePredicate.html b/syn/generics/enum.WherePredicate.html new file mode 100644 index 0000000..8ce4f93 --- /dev/null +++ b/syn/generics/enum.WherePredicate.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.WherePredicate.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.BoundLifetimes.html b/syn/generics/struct.BoundLifetimes.html new file mode 100644 index 0000000..7b413b0 --- /dev/null +++ b/syn/generics/struct.BoundLifetimes.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.BoundLifetimes.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.ConstParam.html b/syn/generics/struct.ConstParam.html new file mode 100644 index 0000000..b2d8f15 --- /dev/null +++ b/syn/generics/struct.ConstParam.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ConstParam.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.Generics.html b/syn/generics/struct.Generics.html new file mode 100644 index 0000000..9398be3 --- /dev/null +++ b/syn/generics/struct.Generics.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Generics.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.ImplGenerics.html b/syn/generics/struct.ImplGenerics.html new file mode 100644 index 0000000..855f3e4 --- /dev/null +++ b/syn/generics/struct.ImplGenerics.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ImplGenerics.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.LifetimeDef.html b/syn/generics/struct.LifetimeDef.html new file mode 100644 index 0000000..a969ad9 --- /dev/null +++ b/syn/generics/struct.LifetimeDef.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.LifetimeDef.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.PredicateEq.html b/syn/generics/struct.PredicateEq.html new file mode 100644 index 0000000..deedd34 --- /dev/null +++ b/syn/generics/struct.PredicateEq.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.PredicateEq.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.PredicateLifetime.html b/syn/generics/struct.PredicateLifetime.html new file mode 100644 index 0000000..526b99f --- /dev/null +++ b/syn/generics/struct.PredicateLifetime.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.PredicateLifetime.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.PredicateType.html b/syn/generics/struct.PredicateType.html new file mode 100644 index 0000000..8aae6c8 --- /dev/null +++ b/syn/generics/struct.PredicateType.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.PredicateType.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.TraitBound.html b/syn/generics/struct.TraitBound.html new file mode 100644 index 0000000..a49d650 --- /dev/null +++ b/syn/generics/struct.TraitBound.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TraitBound.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.Turbofish.html b/syn/generics/struct.Turbofish.html new file mode 100644 index 0000000..08a4828 --- /dev/null +++ b/syn/generics/struct.Turbofish.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Turbofish.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.TypeGenerics.html b/syn/generics/struct.TypeGenerics.html new file mode 100644 index 0000000..c3e9d84 --- /dev/null +++ b/syn/generics/struct.TypeGenerics.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypeGenerics.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.TypeParam.html b/syn/generics/struct.TypeParam.html new file mode 100644 index 0000000..fa6ec12 --- /dev/null +++ b/syn/generics/struct.TypeParam.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypeParam.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.WhereClause.html b/syn/generics/struct.WhereClause.html new file mode 100644 index 0000000..5d9b8d1 --- /dev/null +++ b/syn/generics/struct.WhereClause.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.WhereClause.html...

+ + + \ No newline at end of file diff --git a/syn/ident/struct.Ident.html b/syn/ident/struct.Ident.html new file mode 100644 index 0000000..fc098a2 --- /dev/null +++ b/syn/ident/struct.Ident.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Ident.html...

+ + + \ No newline at end of file diff --git a/syn/index.html b/syn/index.html new file mode 100644 index 0000000..8512a01 --- /dev/null +++ b/syn/index.html @@ -0,0 +1,356 @@ +syn - Rust

[][src]Crate syn

Syn is a parsing library for parsing a stream of Rust tokens into a syntax +tree of Rust source code.

+

Currently this library is geared toward use in Rust procedural macros, but +contains some APIs that may be useful more generally.

+
    +
  • +

    Data structures — Syn provides a complete syntax tree that can +represent any valid Rust source code. The syntax tree is rooted at +syn::File which represents a full source file, but there are other +entry points that may be useful to procedural macros including +syn::Item, syn::Expr and syn::Type.

    +
  • +
  • +

    Derives — Of particular interest to derive macros is +syn::DeriveInput which is any of the three legal input items to a +derive macro. An example below shows using this type in a library that can +derive implementations of a user-defined trait.

    +
  • +
  • +

    Parsing — Parsing in Syn is built around parser functions with the +signature fn(ParseStream) -> Result<T>. Every syntax tree node defined +by Syn is individually parsable and may be used as a building block for +custom syntaxes, or you may dream up your own brand new syntax without +involving any of our syntax tree types.

    +
  • +
  • +

    Location information — Every token parsed by Syn is associated with a +Span that tracks line and column information back to the source of that +token. These spans allow a procedural macro to display detailed error +messages pointing to all the right places in the user's code. There is an +example of this below.

    +
  • +
  • +

    Feature flags — Functionality is aggressively feature gated so your +procedural macros enable only what they need, and do not pay in compile +time for all the rest.

    +
  • +
+
+

Example of a derive macro

+

The canonical derive macro using Syn looks like this. We write an ordinary +Rust function tagged with a proc_macro_derive attribute and the name of +the trait we are deriving. Any time that derive appears in the user's code, +the Rust compiler passes their data structure as tokens into our macro. We +get to execute arbitrary Rust code to figure out what to do with those +tokens, then hand some tokens back to the compiler to compile into the +user's crate.

+
[dependencies]
+syn = "1.0"
+quote = "1.0"
+
+[lib]
+proc-macro = true
+
+ +
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+use quote::quote;
+use syn::{parse_macro_input, DeriveInput};
+
+#[proc_macro_derive(MyMacro)]
+pub fn my_macro(input: TokenStream) -> TokenStream {
+    // Parse the input tokens into a syntax tree
+    let input = parse_macro_input!(input as DeriveInput);
+
+    // Build the output, possibly using quasi-quotation
+    let expanded = quote! {
+        // ...
+    };
+
+    // Hand the output tokens back to the compiler
+    TokenStream::from(expanded)
+}
+

The heapsize example directory shows a complete working implementation +of a derive macro. It works on any Rust compiler 1.31+. The example derives +a HeapSize trait which computes an estimate of the amount of heap memory +owned by a value.

+ +
+pub trait HeapSize {
+    /// Total number of bytes of heap memory owned by `self`.
+    fn heap_size_of_children(&self) -> usize;
+}
+

The derive macro allows users to write #[derive(HeapSize)] on data +structures in their program.

+ +
+#[derive(HeapSize)]
+struct Demo<'a, T: ?Sized> {
+    a: Box<T>,
+    b: u8,
+    c: &'a str,
+    d: String,
+}
+


+

Spans and error reporting

+

The token-based procedural macro API provides great control over where the +compiler's error messages are displayed in user code. Consider the error the +user sees if one of their field types does not implement HeapSize.

+ +
+#[derive(HeapSize)]
+struct Broken {
+    ok: String,
+    bad: std::thread::Thread,
+}
+

By tracking span information all the way through the expansion of a +procedural macro as shown in the heapsize example, token-based macros in +Syn are able to trigger errors that directly pinpoint the source of the +problem.

+
error[E0277]: the trait bound `std::thread::Thread: HeapSize` is not satisfied
+ --> src/main.rs:7:5
+  |
+7 |     bad: std::thread::Thread,
+  |     ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HeapSize` is not implemented for `Thread`
+
+
+

Parsing a custom syntax

+

The lazy-static example directory shows the implementation of a +functionlike!(...) procedural macro in which the input tokens are parsed +using Syn's parsing API.

+

The example reimplements the popular lazy_static crate from crates.io as a +procedural macro.

+ +
+lazy_static! {
+    static ref USERNAME: Regex = Regex::new("^[a-z0-9_-]{3,16}$").unwrap();
+}
+

The implementation shows how to trigger custom warnings and error messages +on the macro input.

+
warning: come on, pick a more creative name
+  --> src/main.rs:10:16
+   |
+10 |     static ref FOO: String = "lazy_static".to_owned();
+   |                ^^^
+
+
+

Testing

+

When testing macros, we often care not just that the macro can be used +successfully but also that when the macro is provided with invalid input it +produces maximally helpful error messages. Consider using the trybuild +crate to write tests for errors that are emitted by your macro or errors +detected by the Rust compiler in the expanded code following misuse of the +macro. Such tests help avoid regressions from later refactors that +mistakenly make an error no longer trigger or be less helpful than it used +to be.

+
+

Debugging

+

When developing a procedural macro it can be helpful to look at what the +generated code looks like. Use cargo rustc -- -Zunstable-options --pretty=expanded or the cargo expand subcommand.

+

To show the expanded code for some crate that uses your procedural macro, +run cargo expand from that crate. To show the expanded code for one of +your own test cases, run cargo expand --test the_test_case where the last +argument is the name of the test file without the .rs extension.

+

This write-up by Brandon W Maister discusses debugging in more detail: +Debugging Rust's new Custom Derive system.

+
+

Optional features

+

Syn puts a lot of functionality behind optional features in order to +optimize compile time for the most common use cases. The following features +are available.

+
    +
  • derive (enabled by default) — Data structures for representing the +possible input to a derive macro, including structs and enums and types.
  • +
  • full — Data structures for representing the syntax tree of all valid +Rust source code, including items and expressions.
  • +
  • parsing (enabled by default) — Ability to parse input tokens into +a syntax tree node of a chosen type.
  • +
  • printing (enabled by default) — Ability to print a syntax tree +node as tokens of Rust source code.
  • +
  • visit — Trait for traversing a syntax tree.
  • +
  • visit-mut — Trait for traversing and mutating in place a syntax +tree.
  • +
  • fold — Trait for transforming an owned syntax tree.
  • +
  • clone-impls (enabled by default) — Clone impls for all syntax tree +types.
  • +
  • extra-traits — Debug, Eq, PartialEq, Hash impls for all syntax tree +types.
  • +
  • proc-macro (enabled by default) — Runtime dependency on the +dynamic library libproc_macro from rustc toolchain.
  • +
+

Modules

+
buffer

A stably addressed token buffer supporting efficient traversal based on a +cheaply copyable cursor.

+
ext

Extension traits to provide parsing methods on foreign types.

+
parse

Parsing interface for parsing a token stream into a syntax tree node.

+
punctuated

A punctuated sequence of syntax tree nodes separated by punctuation.

+
spanned

A trait that can provide the Span of the complete contents of a syntax +tree node.

+
token

Tokens representing Rust punctuation, keywords, and delimiters.

+
visit

Syntax tree traversal to walk a shared borrow of a syntax tree.

+

Macros

+
Token

A type-macro that expands to the name of the Rust type representation of a +given token.

+
braced

Parse a set of curly braces and expose their content to subsequent parsers.

+
bracketed

Parse a set of square brackets and expose their content to subsequent +parsers.

+
custom_keyword

Define a type that supports parsing and printing a given identifier as if it +were a keyword.

+
custom_punctuation

Define a type that supports parsing and printing a multi-character symbol +as if it were a punctuation token.

+
parenthesized

Parse a set of parentheses and expose their content to subsequent parsers.

+
parse_macro_input

Parse the input TokenStream of a macro, triggering a compile error if the +tokens fail to parse.

+
parse_quote

Quasi-quotation macro that accepts input like the quote! macro but uses +type inference to figure out a return type for those tokens.

+

Structs

+
Abi

The binary interface of a function: extern "C".

+
AngleBracketedGenericArguments

Angle bracketed arguments of a path segment: the <K, V> in HashMap<K, V>.

+
Attribute

An attribute like #[repr(transparent)].

+
BareFnArg

An argument in a function type: the usize in fn(usize) -> bool.

+
Binding

A binding (equality constraint) on an associated type: Item = u8.

+
BoundLifetimes

A set of bound lifetimes: for<'a, 'b, 'c>.

+
ConstParam

A const generic parameter: const LENGTH: usize.

+
Constraint

An associated type bound: Iterator<Item: Display>.

+
DataEnum

An enum input to a proc_macro_derive macro.

+
DataStruct

A struct input to a proc_macro_derive macro.

+
DataUnion

An untagged union input to a proc_macro_derive macro.

+
DeriveInput

Data structure sent to a proc_macro_derive macro.

+
Error

Error returned when a Syn parser cannot parse the input tokens.

+
ExprArray

A slice literal expression: [a, b, c, d].

+
ExprAssign

An assignment expression: a = compute().

+
ExprAssignOp

A compound assignment expression: counter += 1.

+
ExprAsync

An async block: async { ... }.

+
ExprAwait

An await expression: fut.await.

+
ExprBinary

A binary operation: a + b, a * b.

+
ExprBlock

A blocked scope: { ... }.

+
ExprBox

A box expression: box f.

+
ExprBreak

A break, with an optional label to break and an optional +expression.

+
ExprCall

A function call expression: invoke(a, b).

+
ExprCast

A cast expression: foo as f64.

+
ExprClosure

A closure expression: |a, b| a + b.

+
ExprContinue

A continue, with an optional label.

+
ExprField

Access of a named struct field (obj.k) or unnamed tuple struct +field (obj.0).

+
ExprForLoop

A for loop: for pat in expr { ... }.

+
ExprGroup

An expression contained within invisible delimiters.

+
ExprIf

An if expression with an optional else block: if expr { ... } else { ... }.

+
ExprIndex

A square bracketed indexing expression: vector[2].

+
ExprLet

A let guard: let Some(x) = opt.

+
ExprLit

A literal in place of an expression: 1, "foo".

+
ExprLoop

Conditionless loop: loop { ... }.

+
ExprMacro

A macro invocation expression: format!("{}", q).

+
ExprMatch

A match expression: match n { Some(n) => {}, None => {} }.

+
ExprMethodCall

A method call expression: x.foo::<T>(a, b).

+
ExprParen

A parenthesized expression: (a + b).

+
ExprPath

A path like std::mem::replace possibly containing generic +parameters and a qualified self-type.

+
ExprRange

A range expression: 1..2, 1.., ..2, 1..=2, ..=2.

+
ExprReference

A referencing operation: &a or &mut a.

+
ExprRepeat

An array literal constructed from one repeated element: [0u8; N].

+
ExprReturn

A return, with an optional value to be returned.

+
ExprStruct

A struct literal expression: Point { x: 1, y: 1 }.

+
ExprTry

A try-expression: expr?.

+
ExprTryBlock

A try block: try { ... }.

+
ExprTuple

A tuple expression: (a, b, c, d).

+
ExprType

A type ascription expression: foo: f64.

+
ExprUnary

A unary operation: !x, *x.

+
ExprUnsafe

An unsafe block: unsafe { ... }.

+
ExprWhile

A while loop: while expr { ... }.

+
ExprYield

A yield expression: yield expr.

+
Field

A field of a struct or enum variant.

+
FieldsNamed

Named fields of a struct or struct variant such as Point { x: f64, y: f64 }.

+
FieldsUnnamed

Unnamed fields of a tuple struct or tuple variant such as Some(T).

+
Generics

Lifetimes and type parameters attached to a declaration of a function, +enum, trait, etc.

+
Ident

A word of Rust code, which may be a keyword or legal variable name.

+
ImplGenerics

Returned by Generics::split_for_impl.

+
Index

The index of an unnamed tuple struct field.

+
Lifetime

A Rust lifetime: 'a.

+
LifetimeDef

A lifetime definition: 'a: 'b + 'c + 'd.

+
LitBool

A boolean literal: true or false.

+
LitByte

A byte literal: b'f'.

+
LitByteStr

A byte string literal: b"foo".

+
LitChar

A character literal: 'a'.

+
LitFloat

A floating point literal: 1f64 or 1.0e10f64.

+
LitInt

An integer literal: 1 or 1u16.

+
LitStr

A UTF-8 string literal: "foo".

+
Macro

A macro invocation: println!("{}", mac).

+
MetaList

A structured list within an attribute, like derive(Copy, Clone).

+
MetaNameValue

A name-value pair within an attribute, like feature = "nightly".

+
ParenthesizedGenericArguments

Arguments of a function path segment: the (A, B) -> C in Fn(A,B) -> C.

+
Path

A path at which a named item is exported: std::collections::HashMap.

+
PathSegment

A segment of a path together with any path arguments on that segment.

+
PredicateEq

An equality predicate in a where clause (unsupported).

+
PredicateLifetime

A lifetime predicate in a where clause: 'a: 'b + 'c.

+
PredicateType

A type predicate in a where clause: for<'c> Foo<'c>: Trait<'c>.

+
QSelf

The explicit Self type in a qualified path: the T in <T as Display>::fmt.

+
TraitBound

A trait used as a bound on a type parameter.

+
Turbofish

Returned by TypeGenerics::as_turbofish.

+
TypeArray

A fixed size array type: [T; n].

+
TypeBareFn

A bare function type: fn(usize) -> bool.

+
TypeGenerics

Returned by Generics::split_for_impl.

+
TypeGroup

A type contained within invisible delimiters.

+
TypeImplTrait

An impl Bound1 + Bound2 + Bound3 type where Bound is a trait or +a lifetime.

+
TypeInfer

Indication that a type should be inferred by the compiler: _.

+
TypeMacro

A macro in the type position.

+
TypeNever

The never type: !.

+
TypeParam

A generic type parameter: T: Into<String>.

+
TypeParen

A parenthesized type equivalent to the inner type.

+
TypePath

A path like std::slice::Iter, optionally qualified with a +self-type as in <Vec<T> as SomeTrait>::Associated.

+
TypePtr

A raw pointer type: *const T or *mut T.

+
TypeReference

A reference type: &'a T or &'a mut T.

+
TypeSlice

A dynamically sized slice type: [T].

+
TypeTraitObject

A trait object type Bound1 + Bound2 + Bound3 where Bound is a +trait or a lifetime.

+
TypeTuple

A tuple type: (A, B, C, String).

+
Variadic

The variadic argument of a foreign function.

+
Variant

An enum variant.

+
VisCrate

A crate-level visibility: crate.

+
VisPublic

A public visibility level: pub.

+
VisRestricted

A visibility level restricted to some path: pub(self) or +pub(super) or pub(crate) or pub(in some::module).

+
WhereClause

A where clause in a definition: where T: Deserialize<'de>, D: 'static.

+

Enums

+
AttrStyle

Distinguishes between attributes that decorate an item and attributes +that are contained within an item.

+
BinOp

A binary operator: +, +=, &.

+
Data

The storage of a struct, enum or union data structure.

+
Expr

A Rust expression.

+
Fields

Data stored within an enum variant or struct.

+
GenericArgument

An individual generic argument, like 'a, T, or Item = T.

+
GenericParam

A generic type parameter, lifetime, or const generic: T: Into<String>, +'a: 'b, const LEN: usize.

+
Lit

A Rust literal such as a string or integer or boolean.

+
MacroDelimiter

A grouping token that surrounds a macro body: m!(...) or m!{...} or m![...].

+
Member

A struct or tuple struct field accessed in a struct literal or field +expression.

+
Meta

Content of a compile-time structured attribute.

+
NestedMeta

Element of a compile-time attribute list.

+
PathArguments

Angle bracketed or parenthesized arguments of a path segment.

+
ReturnType

Return type of a function signature.

+
StrStyle

The style of a string literal, either plain quoted or a raw string like +r##"data"##.

+
TraitBoundModifier

A modifier on a trait bound, currently only used for the ? in +?Sized.

+
Type

The possible types that a Rust value could have.

+
TypeParamBound

A trait or lifetime used as a bound on a type parameter.

+
UnOp

A unary operator: *, !, -.

+
Visibility

The visibility level of an item: inherited or pub or +pub(restricted).

+
WherePredicate

A single predicate in a where clause: T: Deserialize<'de>.

+

Functions

+
parse

Parse tokens of source code into the chosen syntax tree node.

+
parse2

Parse a proc-macro2 token stream into the chosen syntax tree node.

+
parse_str

Parse a string of Rust code into the chosen syntax tree node.

+

Type Definitions

+
AttributeArgs

Conventional argument type associated with an invocation of an attribute +macro.

+
Result

The result of a Syn parser.

+
\ No newline at end of file diff --git a/syn/lifetime/struct.Lifetime.html b/syn/lifetime/struct.Lifetime.html new file mode 100644 index 0000000..6f5cc0a --- /dev/null +++ b/syn/lifetime/struct.Lifetime.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Lifetime.html...

+ + + \ No newline at end of file diff --git a/syn/lit/enum.Lit.html b/syn/lit/enum.Lit.html new file mode 100644 index 0000000..5bb8db5 --- /dev/null +++ b/syn/lit/enum.Lit.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.Lit.html...

+ + + \ No newline at end of file diff --git a/syn/lit/enum.StrStyle.html b/syn/lit/enum.StrStyle.html new file mode 100644 index 0000000..48103fd --- /dev/null +++ b/syn/lit/enum.StrStyle.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.StrStyle.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitBool.html b/syn/lit/struct.LitBool.html new file mode 100644 index 0000000..ce8ed81 --- /dev/null +++ b/syn/lit/struct.LitBool.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.LitBool.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitByte.html b/syn/lit/struct.LitByte.html new file mode 100644 index 0000000..bf0392d --- /dev/null +++ b/syn/lit/struct.LitByte.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.LitByte.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitByteStr.html b/syn/lit/struct.LitByteStr.html new file mode 100644 index 0000000..1b8e61c --- /dev/null +++ b/syn/lit/struct.LitByteStr.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.LitByteStr.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitChar.html b/syn/lit/struct.LitChar.html new file mode 100644 index 0000000..0d3ff5e --- /dev/null +++ b/syn/lit/struct.LitChar.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.LitChar.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitFloat.html b/syn/lit/struct.LitFloat.html new file mode 100644 index 0000000..dbc0549 --- /dev/null +++ b/syn/lit/struct.LitFloat.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.LitFloat.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitInt.html b/syn/lit/struct.LitInt.html new file mode 100644 index 0000000..00f5e0d --- /dev/null +++ b/syn/lit/struct.LitInt.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.LitInt.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitStr.html b/syn/lit/struct.LitStr.html new file mode 100644 index 0000000..e15e832 --- /dev/null +++ b/syn/lit/struct.LitStr.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.LitStr.html...

+ + + \ No newline at end of file diff --git a/syn/lookahead/struct.Lookahead1.html b/syn/lookahead/struct.Lookahead1.html new file mode 100644 index 0000000..6e18c6b --- /dev/null +++ b/syn/lookahead/struct.Lookahead1.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/parse/struct.Lookahead1.html...

+ + + \ No newline at end of file diff --git a/syn/lookahead/trait.Peek.html b/syn/lookahead/trait.Peek.html new file mode 100644 index 0000000..f99fab4 --- /dev/null +++ b/syn/lookahead/trait.Peek.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/parse/trait.Peek.html...

+ + + \ No newline at end of file diff --git a/syn/mac/enum.MacroDelimiter.html b/syn/mac/enum.MacroDelimiter.html new file mode 100644 index 0000000..2ad435d --- /dev/null +++ b/syn/mac/enum.MacroDelimiter.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.MacroDelimiter.html...

+ + + \ No newline at end of file diff --git a/syn/mac/struct.Macro.html b/syn/mac/struct.Macro.html new file mode 100644 index 0000000..28c60f1 --- /dev/null +++ b/syn/mac/struct.Macro.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Macro.html...

+ + + \ No newline at end of file diff --git a/syn/macro.Token!.html b/syn/macro.Token!.html new file mode 100644 index 0000000..886509e --- /dev/null +++ b/syn/macro.Token!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.Token.html...

+ + + \ No newline at end of file diff --git a/syn/macro.Token.html b/syn/macro.Token.html new file mode 100644 index 0000000..8a4e0fa --- /dev/null +++ b/syn/macro.Token.html @@ -0,0 +1,106 @@ +syn::Token - Rust

[][src]Macro syn::Token

+macro_rules! Token {
+    (abstract) => { ... };
+    (as) => { ... };
+    (async) => { ... };
+    (auto) => { ... };
+    (await) => { ... };
+    (become) => { ... };
+    (box) => { ... };
+    (break) => { ... };
+    (const) => { ... };
+    (continue) => { ... };
+    (crate) => { ... };
+    (default) => { ... };
+    (do) => { ... };
+    (dyn) => { ... };
+    (else) => { ... };
+    (enum) => { ... };
+    (extern) => { ... };
+    (final) => { ... };
+    (fn) => { ... };
+    (for) => { ... };
+    (if) => { ... };
+    (impl) => { ... };
+    (in) => { ... };
+    (let) => { ... };
+    (loop) => { ... };
+    (macro) => { ... };
+    (match) => { ... };
+    (mod) => { ... };
+    (move) => { ... };
+    (mut) => { ... };
+    (override) => { ... };
+    (priv) => { ... };
+    (pub) => { ... };
+    (ref) => { ... };
+    (return) => { ... };
+    (Self) => { ... };
+    (self) => { ... };
+    (static) => { ... };
+    (struct) => { ... };
+    (super) => { ... };
+    (trait) => { ... };
+    (try) => { ... };
+    (type) => { ... };
+    (typeof) => { ... };
+    (union) => { ... };
+    (unsafe) => { ... };
+    (unsized) => { ... };
+    (use) => { ... };
+    (virtual) => { ... };
+    (where) => { ... };
+    (while) => { ... };
+    (yield) => { ... };
+    (+) => { ... };
+    (+=) => { ... };
+    (&) => { ... };
+    (&&) => { ... };
+    (&=) => { ... };
+    (@) => { ... };
+    (!) => { ... };
+    (^) => { ... };
+    (^=) => { ... };
+    (:) => { ... };
+    (::) => { ... };
+    (,) => { ... };
+    (/) => { ... };
+    (/=) => { ... };
+    ($) => { ... };
+    (.) => { ... };
+    (..) => { ... };
+    (...) => { ... };
+    (..=) => { ... };
+    (=) => { ... };
+    (==) => { ... };
+    (>=) => { ... };
+    (>) => { ... };
+    (<=) => { ... };
+    (<) => { ... };
+    (*=) => { ... };
+    (!=) => { ... };
+    (|) => { ... };
+    (|=) => { ... };
+    (||) => { ... };
+    (#) => { ... };
+    (?) => { ... };
+    (->) => { ... };
+    (<-) => { ... };
+    (%) => { ... };
+    (%=) => { ... };
+    (=>) => { ... };
+    (;) => { ... };
+    (<<) => { ... };
+    (<<=) => { ... };
+    (>>) => { ... };
+    (>>=) => { ... };
+    (*) => { ... };
+    (-) => { ... };
+    (-=) => { ... };
+    (~) => { ... };
+    (_) => { ... };
+}
+

A type-macro that expands to the name of the Rust type representation of a +given token.

+

See the token module documentation for details and examples.

+
\ No newline at end of file diff --git a/syn/macro.braced!.html b/syn/macro.braced!.html new file mode 100644 index 0000000..d421141 --- /dev/null +++ b/syn/macro.braced!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.braced.html...

+ + + \ No newline at end of file diff --git a/syn/macro.braced.html b/syn/macro.braced.html new file mode 100644 index 0000000..0ad8d0a --- /dev/null +++ b/syn/macro.braced.html @@ -0,0 +1,52 @@ +syn::braced - Rust

[][src]Macro syn::braced

+macro_rules! braced {
+    ($content:ident in $cursor:expr) => { ... };
+}
+

Parse a set of curly braces and expose their content to subsequent parsers.

+

Example

+
+use syn::{braced, token, Ident, Result, Token, Type};
+use syn::parse::{Parse, ParseStream};
+use syn::punctuated::Punctuated;
+
+// Parse a simplified struct syntax like:
+//
+//     struct S {
+//         a: A,
+//         b: B,
+//     }
+struct Struct {
+    struct_token: Token![struct],
+    ident: Ident,
+    brace_token: token::Brace,
+    fields: Punctuated<Field, Token![,]>,
+}
+
+struct Field {
+    name: Ident,
+    colon_token: Token![:],
+    ty: Type,
+}
+
+impl Parse for Struct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let content;
+        Ok(Struct {
+            struct_token: input.parse()?,
+            ident: input.parse()?,
+            brace_token: braced!(content in input),
+            fields: content.parse_terminated(Field::parse)?,
+        })
+    }
+}
+
+impl Parse for Field {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Ok(Field {
+            name: input.parse()?,
+            colon_token: input.parse()?,
+            ty: input.parse()?,
+        })
+    }
+}
+
\ No newline at end of file diff --git a/syn/macro.bracketed!.html b/syn/macro.bracketed!.html new file mode 100644 index 0000000..9db1ea7 --- /dev/null +++ b/syn/macro.bracketed!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.bracketed.html...

+ + + \ No newline at end of file diff --git a/syn/macro.bracketed.html b/syn/macro.bracketed.html new file mode 100644 index 0000000..b543677 --- /dev/null +++ b/syn/macro.bracketed.html @@ -0,0 +1,32 @@ +syn::bracketed - Rust

[][src]Macro syn::bracketed

+macro_rules! bracketed {
+    ($content:ident in $cursor:expr) => { ... };
+}
+

Parse a set of square brackets and expose their content to subsequent +parsers.

+

Example

+
+use proc_macro2::TokenStream;
+use syn::{bracketed, token, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+// Parse an outer attribute like:
+//
+//     #[repr(C, packed)]
+struct OuterAttribute {
+    pound_token: Token![#],
+    bracket_token: token::Bracket,
+    content: TokenStream,
+}
+
+impl Parse for OuterAttribute {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let content;
+        Ok(OuterAttribute {
+            pound_token: input.parse()?,
+            bracket_token: bracketed!(content in input),
+            content: content.parse()?,
+        })
+    }
+}
+
\ No newline at end of file diff --git a/syn/macro.custom_keyword!.html b/syn/macro.custom_keyword!.html new file mode 100644 index 0000000..8004313 --- /dev/null +++ b/syn/macro.custom_keyword!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.custom_keyword.html...

+ + + \ No newline at end of file diff --git a/syn/macro.custom_keyword.html b/syn/macro.custom_keyword.html new file mode 100644 index 0000000..0a418b5 --- /dev/null +++ b/syn/macro.custom_keyword.html @@ -0,0 +1,87 @@ +syn::custom_keyword - Rust

[][src]Macro syn::custom_keyword

+macro_rules! custom_keyword {
+    ($ident:ident) => { ... };
+}
+

Define a type that supports parsing and printing a given identifier as if it +were a keyword.

+

Usage

+

As a convention, it is recommended that this macro be invoked within a +module called kw or keyword and that the resulting parser be invoked +with a kw:: or keyword:: prefix.

+ +
+mod kw {
+    syn::custom_keyword!(whatever);
+}
+

The generated syntax tree node supports the following operations just like +any built-in keyword token.

+
    +
  • +

    Peekinginput.peek(kw::whatever)

    +
  • +
  • +

    Parsinginput.parse::<kw::whatever>()?

    +
  • +
  • +

    Printingquote!( ... #whatever_token ... )

    +
  • +
  • +

    Construction from a Spanlet whatever_token = kw::whatever(sp)

    +
  • +
  • +

    Field access to its span — let sp = whatever_token.span

    +
  • +
+

Example

+

This example parses input that looks like bool = true or str = "value". +The key must be either the identifier bool or the identifier str. If +bool, the value may be either true or false. If str, the value may +be any string literal.

+

The symbols bool and str are not reserved keywords in Rust so these are +not considered keywords in the syn::token module. Like any other +identifier that is not a keyword, these can be declared as custom keywords +by crates that need to use them as such.

+ +
+use syn::{LitBool, LitStr, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+mod kw {
+    syn::custom_keyword!(bool);
+    syn::custom_keyword!(str);
+}
+
+enum Argument {
+    Bool {
+        bool_token: kw::bool,
+        eq_token: Token![=],
+        value: LitBool,
+    },
+    Str {
+        str_token: kw::str,
+        eq_token: Token![=],
+        value: LitStr,
+    },
+}
+
+impl Parse for Argument {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(kw::bool) {
+            Ok(Argument::Bool {
+                bool_token: input.parse::<kw::bool>()?,
+                eq_token: input.parse()?,
+                value: input.parse()?,
+            })
+        } else if lookahead.peek(kw::str) {
+            Ok(Argument::Str {
+                str_token: input.parse::<kw::str>()?,
+                eq_token: input.parse()?,
+                value: input.parse()?,
+            })
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+
\ No newline at end of file diff --git a/syn/macro.custom_punctuation!.html b/syn/macro.custom_punctuation!.html new file mode 100644 index 0000000..c1c37c3 --- /dev/null +++ b/syn/macro.custom_punctuation!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.custom_punctuation.html...

+ + + \ No newline at end of file diff --git a/syn/macro.custom_punctuation.html b/syn/macro.custom_punctuation.html new file mode 100644 index 0000000..b240139 --- /dev/null +++ b/syn/macro.custom_punctuation.html @@ -0,0 +1,77 @@ +syn::custom_punctuation - Rust

[][src]Macro syn::custom_punctuation

+macro_rules! custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => { ... };
+}
+

Define a type that supports parsing and printing a multi-character symbol +as if it were a punctuation token.

+

Usage

+
+syn::custom_punctuation!(LeftRightArrow, <=>);
+

The generated syntax tree node supports the following operations just like +any built-in punctuation token.

+
    +
  • +

    Peekinginput.peek(LeftRightArrow)

    +
  • +
  • +

    Parsinginput.parse::<LeftRightArrow>()?

    +
  • +
  • +

    Printingquote!( ... #lrarrow ... )

    +
  • +
  • +

    Construction from a Spanlet lrarrow = LeftRightArrow(sp)

    +
  • +
  • +

    Construction from multiple Spanlet lrarrow = LeftRightArrow([sp, sp, sp])

    +
  • +
  • +

    Field access to its spans — let spans = lrarrow.spans

    +
  • +
+

Example

+
+use proc_macro2::{TokenStream, TokenTree};
+use syn::parse::{Parse, ParseStream, Peek, Result};
+use syn::punctuated::Punctuated;
+use syn::Expr;
+
+syn::custom_punctuation!(PathSeparator, </>);
+
+// expr </> expr </> expr ...
+struct PathSegments {
+    segments: Punctuated<Expr, PathSeparator>,
+}
+
+impl Parse for PathSegments {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let mut segments = Punctuated::new();
+
+        let first = parse_until(input, PathSeparator)?;
+        segments.push_value(syn::parse2(first)?);
+
+        while input.peek(PathSeparator) {
+            segments.push_punct(input.parse()?);
+
+            let next = parse_until(input, PathSeparator)?;
+            segments.push_value(syn::parse2(next)?);
+        }
+
+        Ok(PathSegments { segments })
+    }
+}
+
+fn parse_until<E: Peek>(input: ParseStream, end: E) -> Result<TokenStream> {
+    let mut tokens = TokenStream::new();
+    while !input.is_empty() && !input.peek(end) {
+        let next: TokenTree = input.parse()?;
+        tokens.extend(Some(next));
+    }
+    Ok(tokens)
+}
+
+fn main() {
+    let input = r#" a::b </> c::d::e "#;
+    let _: PathSegments = syn::parse_str(input).unwrap();
+}
+
\ No newline at end of file diff --git a/syn/macro.parenthesized!.html b/syn/macro.parenthesized!.html new file mode 100644 index 0000000..0ec176c --- /dev/null +++ b/syn/macro.parenthesized!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.parenthesized.html...

+ + + \ No newline at end of file diff --git a/syn/macro.parenthesized.html b/syn/macro.parenthesized.html new file mode 100644 index 0000000..30f66a7 --- /dev/null +++ b/syn/macro.parenthesized.html @@ -0,0 +1,35 @@ +syn::parenthesized - Rust

[][src]Macro syn::parenthesized

+macro_rules! parenthesized {
+    ($content:ident in $cursor:expr) => { ... };
+}
+

Parse a set of parentheses and expose their content to subsequent parsers.

+

Example

+
+use syn::{parenthesized, token, Ident, Result, Token, Type};
+use syn::parse::{Parse, ParseStream};
+use syn::punctuated::Punctuated;
+
+// Parse a simplified tuple struct syntax like:
+//
+//     struct S(A, B);
+struct TupleStruct {
+    struct_token: Token![struct],
+    ident: Ident,
+    paren_token: token::Paren,
+    fields: Punctuated<Type, Token![,]>,
+    semi_token: Token![;],
+}
+
+impl Parse for TupleStruct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let content;
+        Ok(TupleStruct {
+            struct_token: input.parse()?,
+            ident: input.parse()?,
+            paren_token: parenthesized!(content in input),
+            fields: content.parse_terminated(Type::parse)?,
+            semi_token: input.parse()?,
+        })
+    }
+}
+
\ No newline at end of file diff --git a/syn/macro.parse_macro_input!.html b/syn/macro.parse_macro_input!.html new file mode 100644 index 0000000..20ec691 --- /dev/null +++ b/syn/macro.parse_macro_input!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.parse_macro_input.html...

+ + + \ No newline at end of file diff --git a/syn/macro.parse_macro_input.html b/syn/macro.parse_macro_input.html new file mode 100644 index 0000000..57fa7a1 --- /dev/null +++ b/syn/macro.parse_macro_input.html @@ -0,0 +1,40 @@ +syn::parse_macro_input - Rust

[][src]Macro syn::parse_macro_input

+macro_rules! parse_macro_input {
+    ($tokenstream:ident as $ty:ty) => { ... };
+    ($tokenstream:ident) => { ... };
+}
+

Parse the input TokenStream of a macro, triggering a compile error if the +tokens fail to parse.

+

Refer to the parse module documentation for more details about parsing +in Syn.

+
+

Intended usage

+

This macro must be called from a function that returns +proc_macro::TokenStream. Usually this will be your proc macro entry point, +the function that has the #[proc_macro] / #[proc_macro_derive] / +#[proc_macro_attribute] attribute.

+ +
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+use syn::{parse_macro_input, Result};
+use syn::parse::{Parse, ParseStream};
+
+struct MyMacroInput {
+    /* ... */
+}
+
+impl Parse for MyMacroInput {
+    fn parse(input: ParseStream) -> Result<Self> {
+        /* ... */
+    }
+}
+
+#[proc_macro]
+pub fn my_macro(tokens: TokenStream) -> TokenStream {
+    let input = parse_macro_input!(tokens as MyMacroInput);
+
+    /* ... */
+}
+
\ No newline at end of file diff --git a/syn/macro.parse_quote!.html b/syn/macro.parse_quote!.html new file mode 100644 index 0000000..f33820b --- /dev/null +++ b/syn/macro.parse_quote!.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to macro.parse_quote.html...

+ + + \ No newline at end of file diff --git a/syn/macro.parse_quote.html b/syn/macro.parse_quote.html new file mode 100644 index 0000000..2dd05dd --- /dev/null +++ b/syn/macro.parse_quote.html @@ -0,0 +1,57 @@ +syn::parse_quote - Rust

[][src]Macro syn::parse_quote

+macro_rules! parse_quote {
+    ($($tt:tt)*) => { ... };
+}
+

Quasi-quotation macro that accepts input like the quote! macro but uses +type inference to figure out a return type for those tokens.

+

The return type can be any syntax tree node that implements the Parse +trait.

+ +
+use quote::quote;
+use syn::{parse_quote, Stmt};
+
+fn main() {
+    let name = quote!(v);
+    let ty = quote!(u8);
+
+    let stmt: Stmt = parse_quote! {
+        let #name: #ty = Default::default();
+    };
+
+    println!("{:#?}", stmt);
+}
+

This macro is available if Syn is built with the "parsing" feature, +although interpolation of syntax tree nodes into the quoted tokens is only +supported if Syn is built with the "printing" feature as well.

+

Example

+

The following helper function adds a bound T: HeapSize to every type +parameter T in the input generics.

+ +
+use syn::{parse_quote, Generics, GenericParam};
+
+// Add a bound `T: HeapSize` to every type parameter T.
+fn add_trait_bounds(mut generics: Generics) -> Generics {
+    for param in &mut generics.params {
+        if let GenericParam::Type(type_param) = param {
+            type_param.bounds.push(parse_quote!(HeapSize));
+        }
+    }
+    generics
+}
+

Special cases

+

This macro can parse the following additional types as a special case even +though they do not implement the Parse trait.

+
    +
  • [Attribute] — parses one attribute, allowing either outer like #[...] +or inner like #![...]
  • +
  • Punctuated<T, P> — parses zero or more T separated by punctuation +P with optional trailing punctuation
  • +
  • Vec<Stmt> — parses the same as Block::parse_within
  • +
+

Panics

+

Panics if the tokens fail to parse as the expected syntax tree type. The +caller is responsible for ensuring that the input tokens are syntactically +valid.

+
\ No newline at end of file diff --git a/syn/op/enum.BinOp.html b/syn/op/enum.BinOp.html new file mode 100644 index 0000000..560918f --- /dev/null +++ b/syn/op/enum.BinOp.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.BinOp.html...

+ + + \ No newline at end of file diff --git a/syn/op/enum.UnOp.html b/syn/op/enum.UnOp.html new file mode 100644 index 0000000..eb586a8 --- /dev/null +++ b/syn/op/enum.UnOp.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.UnOp.html...

+ + + \ No newline at end of file diff --git a/syn/parse/discouraged/index.html b/syn/parse/discouraged/index.html new file mode 100644 index 0000000..eb0231a --- /dev/null +++ b/syn/parse/discouraged/index.html @@ -0,0 +1,4 @@ +syn::parse::discouraged - Rust

[][src]Module syn::parse::discouraged

Extensions to the parsing API with niche applicability.

+

Traits

+
Speculative

Extensions to the ParseStream API to support speculative parsing.

+
\ No newline at end of file diff --git a/syn/parse/discouraged/sidebar-items.js b/syn/parse/discouraged/sidebar-items.js new file mode 100644 index 0000000..eac8c7e --- /dev/null +++ b/syn/parse/discouraged/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"trait":[["Speculative","Extensions to the `ParseStream` API to support speculative parsing."]]}); \ No newline at end of file diff --git a/syn/parse/discouraged/trait.Speculative.html b/syn/parse/discouraged/trait.Speculative.html new file mode 100644 index 0000000..a3cc782 --- /dev/null +++ b/syn/parse/discouraged/trait.Speculative.html @@ -0,0 +1,113 @@ +syn::parse::discouraged::Speculative - Rust

[][src]Trait syn::parse::discouraged::Speculative

pub trait Speculative {
+    fn advance_to(&self, fork: &Self);
+}

Extensions to the ParseStream API to support speculative parsing.

+
+

Required methods

fn advance_to(&self, fork: &Self)

Advance this parse stream to the position of a forked parse stream.

+

This is the opposite operation to ParseStream::fork. You can fork a +parse stream, perform some speculative parsing, then join the original +stream to the fork to "commit" the parsing from the fork to the main +stream.

+

If you can avoid doing this, you should, as it limits the ability to +generate useful errors. That said, it is often the only way to parse +syntax of the form A* B* for arbitrary syntax A and B. The problem +is that when the fork fails to parse an A, it's impossible to tell +whether that was because of a syntax error and the user meant to provide +an A, or that the As are finished and its time to start parsing +Bs. Use with care.

+

Also note that if A is a subset of B, A* B* can be parsed by +parsing B* and removing the leading members of A from the +repetition, bypassing the need to involve the downsides associated with +speculative parsing.

+

Example

+

There has been chatter about the possibility of making the colons in the +turbofish syntax like path::to::<T> no longer required by accepting +path::to<T> in expression position. Specifically, according to RFC +2544, PathSegment parsing should always try to consume a following +< token as the start of generic arguments, and reset to the < if +that fails (e.g. the token is acting as a less-than operator).

+

This is the exact kind of parsing behavior which requires the "fork, +try, commit" behavior that ParseStream::fork discourages. With +advance_to, we can avoid having to parse the speculatively parsed +content a second time.

+

This change in behavior can be implemented in syn by replacing just the +Parse implementation for PathSegment:

+ +
+use syn::parse::discouraged::Speculative;
+
+pub struct PathSegment {
+    pub ident: Ident,
+    pub arguments: PathArguments,
+}
+
+impl Parse for PathSegment {
+    fn parse(input: ParseStream) -> Result<Self> {
+        if input.peek(Token![super])
+            || input.peek(Token![self])
+            || input.peek(Token![Self])
+            || input.peek(Token![crate])
+            || input.peek(Token![extern])
+        {
+            let ident = input.call(Ident::parse_any)?;
+            return Ok(PathSegment::from(ident));
+        }
+
+        let ident = input.parse()?;
+        if input.peek(Token![::]) && input.peek3(Token![<]) {
+            return Ok(PathSegment {
+                ident,
+                arguments: PathArguments::AngleBracketed(input.parse()?),
+            });
+        }
+        if input.peek(Token![<]) && !input.peek(Token![<=]) {
+            let fork = input.fork();
+            if let Ok(arguments) = fork.parse() {
+                input.advance_to(&fork);
+                return Ok(PathSegment {
+                    ident,
+                    arguments: PathArguments::AngleBracketed(arguments),
+                });
+            }
+        }
+        Ok(PathSegment::from(ident))
+    }
+}
+
+

Drawbacks

+

The main drawback of this style of speculative parsing is in error +presentation. Even if the lookahead is the "correct" parse, the error +that is shown is that of the "fallback" parse. To use the same example +as the turbofish above, take the following unfinished "turbofish":

+
let _ = f<&'a fn(), for<'a> serde::>();
+
+

If this is parsed as generic arguments, we can provide the error message

+
error: expected identifier
+ --> src.rs:L:C
+  |
+L | let _ = f<&'a fn(), for<'a> serde::>();
+  |                                    ^
+
+

but if parsed using the above speculative parsing, it falls back to +assuming that the < is a less-than when it fails to parse the generic +arguments, and tries to interpret the &'a as the start of a labelled +loop, resulting in the much less helpful error

+
error: expected `:`
+ --> src.rs:L:C
+  |
+L | let _ = f<&'a fn(), for<'a> serde::>();
+  |               ^^
+
+

This can be mitigated with various heuristics (two examples: show both +forks' parse errors, or show the one that consumed more tokens), but +when you can control the grammar, sticking to something that can be +parsed LL(3) and without the LL(*) speculative parsing this makes +possible, displaying reasonable errors becomes much more simple.

+

Performance

+

This method performs a cheap fixed amount of work that does not depend +on how far apart the two streams are positioned.

+

Panics

+

The forked stream in the argument of advance_to must have been +obtained by forking self. Attempting to advance to any other stream +will cause a panic.

+
Loading content... +

Implementors

impl<'a> Speculative for ParseBuffer<'a>[src]

Loading content...
\ No newline at end of file diff --git a/syn/parse/index.html b/syn/parse/index.html new file mode 100644 index 0000000..d4521c4 --- /dev/null +++ b/syn/parse/index.html @@ -0,0 +1,143 @@ +syn::parse - Rust

[][src]Module syn::parse

Parsing interface for parsing a token stream into a syntax tree node.

+

Parsing in Syn is built on parser functions that take in a ParseStream +and produce a Result<T> where T is some syntax tree node. Underlying +these parser functions is a lower level mechanism built around the +Cursor type. Cursor is a cheaply copyable cursor over a range of +tokens in a token stream.

+

Example

+

Here is a snippet of parsing code to get a feel for the style of the +library. We define data structures for a subset of Rust syntax including +enums (not shown) and structs, then provide implementations of the Parse +trait to parse these syntax tree data structures from a token stream.

+

Once Parse impls have been defined, they can be called conveniently from a +procedural macro through parse_macro_input! as shown at the bottom of +the snippet. If the caller provides syntactically invalid input to the +procedural macro, they will receive a helpful compiler error message +pointing out the exact token that triggered the failure to parse.

+ +
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+use syn::{braced, parse_macro_input, token, Field, Ident, Result, Token};
+use syn::parse::{Parse, ParseStream};
+use syn::punctuated::Punctuated;
+
+enum Item {
+    Struct(ItemStruct),
+    Enum(ItemEnum),
+}
+
+struct ItemStruct {
+    struct_token: Token![struct],
+    ident: Ident,
+    brace_token: token::Brace,
+    fields: Punctuated<Field, Token![,]>,
+}
+
+impl Parse for Item {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(Token![struct]) {
+            input.parse().map(Item::Struct)
+        } else if lookahead.peek(Token![enum]) {
+            input.parse().map(Item::Enum)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+
+impl Parse for ItemStruct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let content;
+        Ok(ItemStruct {
+            struct_token: input.parse()?,
+            ident: input.parse()?,
+            brace_token: braced!(content in input),
+            fields: content.parse_terminated(Field::parse_named)?,
+        })
+    }
+}
+
+#[proc_macro]
+pub fn my_macro(tokens: TokenStream) -> TokenStream {
+    let input = parse_macro_input!(tokens as Item);
+
+    /* ... */
+}
+

The syn::parse* functions

+

The syn::parse, syn::parse2, and syn::parse_str functions serve +as an entry point for parsing syntax tree nodes that can be parsed in an +obvious default way. These functions can return any syntax tree node that +implements the Parse trait, which includes most types in Syn.

+ +
+use syn::Type;
+
+let t: Type = syn::parse_str("std::collections::HashMap<String, Value>")?;
+

The parse_quote! macro also uses this approach.

+

The Parser trait

+

Some types can be parsed in several ways depending on context. For example +an Attribute can be either "outer" like #[...] or "inner" like +#![...] and parsing the wrong one would be a bug. Similarly Punctuated +may or may not allow trailing punctuation, and parsing it the wrong way +would either reject valid input or accept invalid input.

+

The Parse trait is not implemented in these cases because there is no good +behavior to consider the default.

+ +
This example deliberately fails to compile
+// Can't parse `Punctuated` without knowing whether trailing punctuation
+// should be allowed in this context.
+let path: Punctuated<PathSegment, Token![::]> = syn::parse(tokens)?;
+

In these cases the types provide a choice of parser functions rather than a +single Parse implementation, and those parser functions can be invoked +through the Parser trait.

+ +
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+use syn::parse::Parser;
+use syn::punctuated::Punctuated;
+use syn::{Attribute, Expr, PathSegment, Result, Token};
+
+fn call_some_parser_methods(input: TokenStream) -> Result<()> {
+    // Parse a nonempty sequence of path segments separated by `::` punctuation
+    // with no trailing punctuation.
+    let tokens = input.clone();
+    let parser = Punctuated::<PathSegment, Token![::]>::parse_separated_nonempty;
+    let _path = parser.parse(tokens)?;
+
+    // Parse a possibly empty sequence of expressions terminated by commas with
+    // an optional trailing punctuation.
+    let tokens = input.clone();
+    let parser = Punctuated::<Expr, Token![,]>::parse_terminated;
+    let _args = parser.parse(tokens)?;
+
+    // Parse zero or more outer attributes but not inner attributes.
+    let tokens = input.clone();
+    let parser = Attribute::parse_outer;
+    let _attrs = parser.parse(tokens)?;
+
+    Ok(())
+}
+
+

This module is available if Syn is built with the "parsing" feature.

+

Modules

+
discouraged

Extensions to the parsing API with niche applicability.

+

Structs

+
Error

Error returned when a Syn parser cannot parse the input tokens.

+
Lookahead1

Support for checking the next token in a stream to decide how to parse.

+
Nothing

An empty syntax tree node that consumes no tokens when parsed.

+
ParseBuffer

Cursor position within a buffered token stream.

+
StepCursor

Cursor state associated with speculative parsing.

+

Traits

+
Parse

Parsing interface implemented by all types that can be parsed in a default +way from a token stream.

+
Parser

Parser that can parse Rust tokens into a particular syntax tree node.

+
Peek

Types that can be parsed by looking at just one token.

+

Type Definitions

+
ParseStream

Input to a Syn parser function.

+
Result

The result of a Syn parser.

+
\ No newline at end of file diff --git a/syn/parse/sidebar-items.js b/syn/parse/sidebar-items.js new file mode 100644 index 0000000..e46db30 --- /dev/null +++ b/syn/parse/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"mod":[["discouraged","Extensions to the parsing API with niche applicability."]],"struct":[["Error","Error returned when a Syn parser cannot parse the input tokens."],["Lookahead1","Support for checking the next token in a stream to decide how to parse."],["Nothing","An empty syntax tree node that consumes no tokens when parsed."],["ParseBuffer","Cursor position within a buffered token stream."],["StepCursor","Cursor state associated with speculative parsing."]],"trait":[["Parse","Parsing interface implemented by all types that can be parsed in a default way from a token stream."],["Parser","Parser that can parse Rust tokens into a particular syntax tree node."],["Peek","Types that can be parsed by looking at just one token."]],"type":[["ParseStream","Input to a Syn parser function."],["Result","The result of a Syn parser."]]}); \ No newline at end of file diff --git a/syn/parse/struct.Error.html b/syn/parse/struct.Error.html new file mode 100644 index 0000000..28eee6a --- /dev/null +++ b/syn/parse/struct.Error.html @@ -0,0 +1,114 @@ +syn::parse::Error - Rust

[][src]Struct syn::parse::Error

pub struct Error { /* fields omitted */ }

Error returned when a Syn parser cannot parse the input tokens.

+

Error reporting in proc macros

+

The correct way to report errors back to the compiler from a procedural +macro is by emitting an appropriately spanned invocation of +compile_error! in the generated code. This produces a better diagnostic +message than simply panicking the macro.

+

When parsing macro input, the [parse_macro_input!] macro handles the +conversion to compile_error! automatically.

+ +
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+use syn::{parse_macro_input, AttributeArgs, ItemFn};
+
+#[proc_macro_attribute]
+pub fn my_attr(args: TokenStream, input: TokenStream) -> TokenStream {
+    let args = parse_macro_input!(args as AttributeArgs);
+    let input = parse_macro_input!(input as ItemFn);
+
+    /* ... */
+}
+

For errors that arise later than the initial parsing stage, the +.to_compile_error() method can be used to perform an explicit conversion +to compile_error!.

+ +
+#[proc_macro_derive(MyDerive)]
+pub fn my_derive(input: TokenStream) -> TokenStream {
+    let input = parse_macro_input!(input as DeriveInput);
+
+    // fn(DeriveInput) -> syn::Result<proc_macro2::TokenStream>
+    expand::my_derive(input)
+        .unwrap_or_else(|err| err.to_compile_error())
+        .into()
+}
+

Methods

impl Error[src]

pub fn new<T: Display>(span: Span, message: T) -> Self[src]

Usually the ParseStream::error method will be used instead, which +automatically uses the correct span from the current position of the +parse stream.

+

Use Error::new when the error needs to be triggered on some span other +than where the parse stream is currently positioned.

+

Example

+
+use syn::{Error, Ident, LitStr, Result, Token};
+use syn::parse::ParseStream;
+
+// Parses input that looks like `name = "string"` where the key must be
+// the identifier `name` and the value may be any string literal.
+// Returns the string literal.
+fn parse_name(input: ParseStream) -> Result<LitStr> {
+    let name_token: Ident = input.parse()?;
+    if name_token != "name" {
+        // Trigger an error not on the current position of the stream,
+        // but on the position of the unexpected identifier.
+        return Err(Error::new(name_token.span(), "expected `name`"));
+    }
+    input.parse::<Token![=]>()?;
+    let s: LitStr = input.parse()?;
+    Ok(s)
+}
+

pub fn new_spanned<T: ToTokens, U: Display>(tokens: T, message: U) -> Self[src]

Creates an error with the specified message spanning the given syntax +tree node.

+

Unlike the Error::new constructor, this constructor takes an argument +tokens which is a syntax tree node. This allows the resulting Error +to attempt to span all tokens inside of tokens. While you would +typically be able to use the Spanned trait with the above Error::new +constructor, implementation limitations today mean that +Error::new_spanned may provide a higher-quality error message on +stable Rust.

+

When in doubt it's recommended to stick to Error::new (or +ParseStream::error)!

+

pub fn span(&self) -> Span[src]

The source location of the error.

+

Spans are not thread-safe so this function returns Span::call_site() +if called from a different thread than the one on which the Error was +originally created.

+

pub fn to_compile_error(&self) -> TokenStream[src]

Render the error as an invocation of compile_error!.

+

The [parse_macro_input!] macro provides a convenient way to invoke +this method correctly in a procedural macro.

+

pub fn combine(&mut self, another: Error)[src]

Add another error message to self such that when to_compile_error() is +called, both errors will be emitted together.

+

Trait Implementations

impl Clone for Error[src]

impl Debug for Error[src]

impl Display for Error[src]

impl Error for Error[src]

impl From<LexError> for Error[src]

impl IntoIterator for Error[src]

type Item = Error

The type of the elements being iterated over.

+

type IntoIter = IntoIter

Which kind of iterator are we turning this into?

+

impl<'a> IntoIterator for &'a Error[src]

type Item = Error

The type of the elements being iterated over.

+

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?

+

Auto Trait Implementations

impl !RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl UnwindSafe for Error

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

+

type IntoIter = I

Which kind of iterator are we turning this into?

+

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/parse/struct.Lookahead1.html b/syn/parse/struct.Lookahead1.html new file mode 100644 index 0000000..f46428e --- /dev/null +++ b/syn/parse/struct.Lookahead1.html @@ -0,0 +1,68 @@ +syn::parse::Lookahead1 - Rust

[][src]Struct syn::parse::Lookahead1

pub struct Lookahead1<'a> { /* fields omitted */ }

Support for checking the next token in a stream to decide how to parse.

+

An important advantage over ParseStream::peek is that here we +automatically construct an appropriate error message based on the token +alternatives that get peeked. If you are producing your own error message, +go ahead and use ParseStream::peek instead.

+

Use ParseStream::lookahead1 to construct this object.

+

Example

+
+use syn::{ConstParam, Ident, Lifetime, LifetimeDef, Result, Token, TypeParam};
+use syn::parse::{Parse, ParseStream};
+
+// A generic parameter, a single one of the comma-separated elements inside
+// angle brackets in:
+//
+//     fn f<T: Clone, 'a, 'b: 'a, const N: usize>() { ... }
+//
+// On invalid input, lookahead gives us a reasonable error message.
+//
+//     error: expected one of: identifier, lifetime, `const`
+//       |
+//     5 |     fn f<!Sized>() {}
+//       |          ^
+enum GenericParam {
+    Type(TypeParam),
+    Lifetime(LifetimeDef),
+    Const(ConstParam),
+}
+
+impl Parse for GenericParam {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(Ident) {
+            input.parse().map(GenericParam::Type)
+        } else if lookahead.peek(Lifetime) {
+            input.parse().map(GenericParam::Lifetime)
+        } else if lookahead.peek(Token![const]) {
+            input.parse().map(GenericParam::Const)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+

Methods

impl<'a> Lookahead1<'a>[src]

pub fn peek<T: Peek>(&self, token: T) -> bool[src]

Looks at the next token in the parse stream to determine whether it +matches the requested type of token.

+

Syntax

+

Note that this method does not use turbofish syntax. Pass the peek type +inside of parentheses.

+
    +
  • input.peek(Token![struct])
  • +
  • input.peek(Token![==])
  • +
  • input.peek(Ident)(does not accept keywords)
  • +
  • input.peek(Ident::peek_any)
  • +
  • input.peek(Lifetime)
  • +
  • input.peek(token::Brace)
  • +
+

pub fn error(self) -> Error[src]

Triggers an error at the current position of the parse stream.

+

The error message will identify all of the expected token types that +have been peeked against this lookahead instance.

+

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Lookahead1<'a>

impl<'a> !Send for Lookahead1<'a>

impl<'a> !Sync for Lookahead1<'a>

impl<'a> Unpin for Lookahead1<'a>

impl<'a> !UnwindSafe for Lookahead1<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/parse/struct.Nothing.html b/syn/parse/struct.Nothing.html new file mode 100644 index 0000000..2d72db2 --- /dev/null +++ b/syn/parse/struct.Nothing.html @@ -0,0 +1,33 @@ +syn::parse::Nothing - Rust

[][src]Struct syn::parse::Nothing

pub struct Nothing;

An empty syntax tree node that consumes no tokens when parsed.

+

This is useful for attribute macros that want to ensure they are not +provided any attribute args.

+ +
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+use syn::parse_macro_input;
+use syn::parse::Nothing;
+
+#[proc_macro_attribute]
+pub fn my_attr(args: TokenStream, input: TokenStream) -> TokenStream {
+    parse_macro_input!(args as Nothing);
+
+    /* ... */
+}
+
error: unexpected token
+ --> src/main.rs:3:19
+  |
+3 | #[my_attr(asdf)]
+  |           ^^^^
+
+

Trait Implementations

impl Parse for Nothing[src]

Auto Trait Implementations

impl RefUnwindSafe for Nothing

impl Send for Nothing

impl Sync for Nothing

impl Unpin for Nothing

impl UnwindSafe for Nothing

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/parse/struct.ParseBuffer.html b/syn/parse/struct.ParseBuffer.html new file mode 100644 index 0000000..b6588d2 --- /dev/null +++ b/syn/parse/struct.ParseBuffer.html @@ -0,0 +1,423 @@ +syn::parse::ParseBuffer - Rust

[][src]Struct syn::parse::ParseBuffer

pub struct ParseBuffer<'a> { /* fields omitted */ }

Cursor position within a buffered token stream.

+

This type is more commonly used through the type alias [ParseStream] which +is an alias for &ParseBuffer.

+

ParseStream is the input type for all parser functions in Syn. They have +the signature fn(ParseStream) -> Result<T>.

+

Calling a parser function

+

There is no public way to construct a ParseBuffer. Instead, if you are +looking to invoke a parser function that requires ParseStream as input, +you will need to go through one of the public parsing entry points.

+
    +
  • The [parse_macro_input!] macro if parsing input of a procedural macro;
  • +
  • One of the syn::parse* functions; or
  • +
  • A method of the [Parser] trait.
  • +
+

Methods

impl<'a> ParseBuffer<'a>[src]

pub fn parse<T: Parse>(&self) -> Result<T>[src]

Parses a syntax tree node of type T, advancing the position of our +parse stream past it.

+

pub fn call<T>(&self, function: fn(_: ParseStream) -> Result<T>) -> Result<T>[src]

Calls the given parser function to parse a syntax tree node of type T +from this stream.

+

Example

+

The parser below invokes Attribute::parse_outer to parse a vector of +zero or more outer attributes.

+ +
+use syn::{Attribute, Ident, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+// Parses a unit struct with attributes.
+//
+//     #[path = "s.tmpl"]
+//     struct S;
+struct UnitStruct {
+    attrs: Vec<Attribute>,
+    struct_token: Token![struct],
+    name: Ident,
+    semi_token: Token![;],
+}
+
+impl Parse for UnitStruct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Ok(UnitStruct {
+            attrs: input.call(Attribute::parse_outer)?,
+            struct_token: input.parse()?,
+            name: input.parse()?,
+            semi_token: input.parse()?,
+        })
+    }
+}
+

pub fn peek<T: Peek>(&self, token: T) -> bool[src]

Looks at the next token in the parse stream to determine whether it +matches the requested type of token.

+

Does not advance the position of the parse stream.

+

Syntax

+

Note that this method does not use turbofish syntax. Pass the peek type +inside of parentheses.

+
    +
  • input.peek(Token![struct])
  • +
  • input.peek(Token![==])
  • +
  • input.peek(Ident)(does not accept keywords)
  • +
  • input.peek(Ident::peek_any)
  • +
  • input.peek(Lifetime)
  • +
  • input.peek(token::Brace)
  • +
+

Example

+

In this example we finish parsing the list of supertraits when the next +token in the input is either where or an opening curly brace.

+ +
+use syn::{braced, token, Generics, Ident, Result, Token, TypeParamBound};
+use syn::parse::{Parse, ParseStream};
+use syn::punctuated::Punctuated;
+
+// Parses a trait definition containing no associated items.
+//
+//     trait Marker<'de, T>: A + B<'de> where Box<T>: Clone {}
+struct MarkerTrait {
+    trait_token: Token![trait],
+    ident: Ident,
+    generics: Generics,
+    colon_token: Option<Token![:]>,
+    supertraits: Punctuated<TypeParamBound, Token![+]>,
+    brace_token: token::Brace,
+}
+
+impl Parse for MarkerTrait {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let trait_token: Token![trait] = input.parse()?;
+        let ident: Ident = input.parse()?;
+        let mut generics: Generics = input.parse()?;
+        let colon_token: Option<Token![:]> = input.parse()?;
+
+        let mut supertraits = Punctuated::new();
+        if colon_token.is_some() {
+            loop {
+                supertraits.push_value(input.parse()?);
+                if input.peek(Token![where]) || input.peek(token::Brace) {
+                    break;
+                }
+                supertraits.push_punct(input.parse()?);
+            }
+        }
+
+        generics.where_clause = input.parse()?;
+        let content;
+        let empty_brace_token = braced!(content in input);
+
+        Ok(MarkerTrait {
+            trait_token,
+            ident,
+            generics,
+            colon_token,
+            supertraits,
+            brace_token: empty_brace_token,
+        })
+    }
+}
+

pub fn peek2<T: Peek>(&self, token: T) -> bool[src]

Looks at the second-next token in the parse stream.

+

This is commonly useful as a way to implement contextual keywords.

+

Example

+

This example needs to use peek2 because the symbol union is not a +keyword in Rust. We can't use just peek and decide to parse a union if +the very next token is union, because someone is free to write a mod union and a macro invocation that looks like union::some_macro! { ... }. In other words union is a contextual keyword.

+ +
+use syn::{Ident, ItemUnion, Macro, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+// Parses either a union or a macro invocation.
+enum UnionOrMacro {
+    // union MaybeUninit<T> { uninit: (), value: T }
+    Union(ItemUnion),
+    // lazy_static! { ... }
+    Macro(Macro),
+}
+
+impl Parse for UnionOrMacro {
+    fn parse(input: ParseStream) -> Result<Self> {
+        if input.peek(Token![union]) && input.peek2(Ident) {
+            input.parse().map(UnionOrMacro::Union)
+        } else {
+            input.parse().map(UnionOrMacro::Macro)
+        }
+    }
+}
+

pub fn peek3<T: Peek>(&self, token: T) -> bool[src]

Looks at the third-next token in the parse stream.

+

pub fn parse_terminated<T, P: Parse>(
    &self,
    parser: fn(_: ParseStream) -> Result<T>
) -> Result<Punctuated<T, P>>
[src]

Parses zero or more occurrences of T separated by punctuation of type +P, with optional trailing punctuation.

+

Parsing continues until the end of this parse stream. The entire content +of this parse stream must consist of T and P.

+

Example

+
+use syn::{parenthesized, token, Ident, Result, Token, Type};
+use syn::parse::{Parse, ParseStream};
+use syn::punctuated::Punctuated;
+
+// Parse a simplified tuple struct syntax like:
+//
+//     struct S(A, B);
+struct TupleStruct {
+    struct_token: Token![struct],
+    ident: Ident,
+    paren_token: token::Paren,
+    fields: Punctuated<Type, Token![,]>,
+    semi_token: Token![;],
+}
+
+impl Parse for TupleStruct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let content;
+        Ok(TupleStruct {
+            struct_token: input.parse()?,
+            ident: input.parse()?,
+            paren_token: parenthesized!(content in input),
+            fields: content.parse_terminated(Type::parse)?,
+            semi_token: input.parse()?,
+        })
+    }
+}
+

pub fn is_empty(&self) -> bool[src]

Returns whether there are tokens remaining in this stream.

+

This method returns true at the end of the content of a set of +delimiters, as well as at the very end of the complete macro input.

+

Example

+
+use syn::{braced, token, Ident, Item, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+// Parses a Rust `mod m { ... }` containing zero or more items.
+struct Mod {
+    mod_token: Token![mod],
+    name: Ident,
+    brace_token: token::Brace,
+    items: Vec<Item>,
+}
+
+impl Parse for Mod {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let content;
+        Ok(Mod {
+            mod_token: input.parse()?,
+            name: input.parse()?,
+            brace_token: braced!(content in input),
+            items: {
+                let mut items = Vec::new();
+                while !content.is_empty() {
+                    items.push(content.parse()?);
+                }
+                items
+            },
+        })
+    }
+}
+

pub fn lookahead1(&self) -> Lookahead1<'a>[src]

Constructs a helper for peeking at the next token in this stream and +building an error message if it is not one of a set of expected tokens.

+

Example

+
+use syn::{ConstParam, Ident, Lifetime, LifetimeDef, Result, Token, TypeParam};
+use syn::parse::{Parse, ParseStream};
+
+// A generic parameter, a single one of the comma-separated elements inside
+// angle brackets in:
+//
+//     fn f<T: Clone, 'a, 'b: 'a, const N: usize>() { ... }
+//
+// On invalid input, lookahead gives us a reasonable error message.
+//
+//     error: expected one of: identifier, lifetime, `const`
+//       |
+//     5 |     fn f<!Sized>() {}
+//       |          ^
+enum GenericParam {
+    Type(TypeParam),
+    Lifetime(LifetimeDef),
+    Const(ConstParam),
+}
+
+impl Parse for GenericParam {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(Ident) {
+            input.parse().map(GenericParam::Type)
+        } else if lookahead.peek(Lifetime) {
+            input.parse().map(GenericParam::Lifetime)
+        } else if lookahead.peek(Token![const]) {
+            input.parse().map(GenericParam::Const)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+

pub fn fork(&self) -> Self[src]

Forks a parse stream so that parsing tokens out of either the original +or the fork does not advance the position of the other.

+

Performance

+

Forking a parse stream is a cheap fixed amount of work and does not +involve copying token buffers. Where you might hit performance problems +is if your macro ends up parsing a large amount of content more than +once.

+ +
+// Do not do this.
+if input.fork().parse::<Expr>().is_ok() {
+    return input.parse::<Expr>();
+}
+

As a rule, avoid parsing an unbounded amount of tokens out of a forked +parse stream. Only use a fork when the amount of work performed against +the fork is small and bounded.

+

When complex speculative parsing against the forked stream is +unavoidable, use parse::discouraged::Speculative to advance the +original stream once the fork's parse is determined to have been +successful.

+

For a lower level way to perform speculative parsing at the token level, +consider using ParseStream::step instead.

+

Example

+

The parse implementation shown here parses possibly restricted pub +visibilities.

+
    +
  • pub
  • +
  • pub(crate)
  • +
  • pub(self)
  • +
  • pub(super)
  • +
  • pub(in some::path)
  • +
+

To handle the case of visibilities inside of tuple structs, the parser +needs to distinguish parentheses that specify visibility restrictions +from parentheses that form part of a tuple type.

+ +
+struct S(pub(crate) A, pub (B, C));
+

In this example input the first tuple struct element of S has +pub(crate) visibility while the second tuple struct element has pub +visibility; the parentheses around (B, C) are part of the type rather +than part of a visibility restriction.

+

The parser uses a forked parse stream to check the first token inside of +parentheses after the pub keyword. This is a small bounded amount of +work performed against the forked parse stream.

+ +
+use syn::{parenthesized, token, Ident, Path, Result, Token};
+use syn::ext::IdentExt;
+use syn::parse::{Parse, ParseStream};
+
+struct PubVisibility {
+    pub_token: Token![pub],
+    restricted: Option<Restricted>,
+}
+
+struct Restricted {
+    paren_token: token::Paren,
+    in_token: Option<Token![in]>,
+    path: Path,
+}
+
+impl Parse for PubVisibility {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let pub_token: Token![pub] = input.parse()?;
+
+        if input.peek(token::Paren) {
+            let ahead = input.fork();
+            let mut content;
+            parenthesized!(content in ahead);
+
+            if content.peek(Token![crate])
+                || content.peek(Token![self])
+                || content.peek(Token![super])
+            {
+                return Ok(PubVisibility {
+                    pub_token,
+                    restricted: Some(Restricted {
+                        paren_token: parenthesized!(content in input),
+                        in_token: None,
+                        path: Path::from(content.call(Ident::parse_any)?),
+                    }),
+                });
+            } else if content.peek(Token![in]) {
+                return Ok(PubVisibility {
+                    pub_token,
+                    restricted: Some(Restricted {
+                        paren_token: parenthesized!(content in input),
+                        in_token: Some(content.parse()?),
+                        path: content.call(Path::parse_mod_style)?,
+                    }),
+                });
+            }
+        }
+
+        Ok(PubVisibility {
+            pub_token,
+            restricted: None,
+        })
+    }
+}
+

pub fn error<T: Display>(&self, message: T) -> Error[src]

Triggers an error at the current position of the parse stream.

+

Example

+
+use syn::{Expr, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+// Some kind of loop: `while` or `for` or `loop`.
+struct Loop {
+    expr: Expr,
+}
+
+impl Parse for Loop {
+    fn parse(input: ParseStream) -> Result<Self> {
+        if input.peek(Token![while])
+            || input.peek(Token![for])
+            || input.peek(Token![loop])
+        {
+            Ok(Loop {
+                expr: input.parse()?,
+            })
+        } else {
+            Err(input.error("expected some kind of loop"))
+        }
+    }
+}
+

pub fn step<F, R>(&self, function: F) -> Result<R> where
    F: for<'c> FnOnce(StepCursor<'c, 'a>) -> Result<(R, Cursor<'c>)>, 
[src]

Speculatively parses tokens from this parse stream, advancing the +position of this stream only if parsing succeeds.

+

This is a powerful low-level API used for defining the Parse impls of +the basic built-in token types. It is not something that will be used +widely outside of the Syn codebase.

+

Example

+
+use proc_macro2::TokenTree;
+use syn::Result;
+use syn::parse::ParseStream;
+
+// This function advances the stream past the next occurrence of `@`. If
+// no `@` is present in the stream, the stream position is unchanged and
+// an error is returned.
+fn skip_past_next_at(input: ParseStream) -> Result<()> {
+    input.step(|cursor| {
+        let mut rest = *cursor;
+        while let Some((tt, next)) = rest.token_tree() {
+            match &tt {
+                TokenTree::Punct(punct) if punct.as_char() == '@' => {
+                    return Ok(((), next));
+                }
+                _ => rest = next,
+            }
+        }
+        Err(cursor.error("no `@` was found after this point"))
+    })
+}
+

pub fn span(&self) -> Span[src]

Returns the Span of the next token in the parse stream, or +Span::call_site() if this parse stream has completely exhausted its +input TokenStream.

+

pub fn cursor(&self) -> Cursor<'a>[src]

Provides low-level access to the token representation underlying this +parse stream.

+

Cursors are immutable so no operations you perform against the cursor +will affect the state of this parse stream.

+

Trait Implementations

impl<'a> Debug for ParseBuffer<'a>[src]

impl<'a> Display for ParseBuffer<'a>[src]

impl<'a> Drop for ParseBuffer<'a>[src]

impl<'a> Speculative for ParseBuffer<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for ParseBuffer<'a>

impl<'a> !Send for ParseBuffer<'a>

impl<'a> !Sync for ParseBuffer<'a>

impl<'a> Unpin for ParseBuffer<'a>

impl<'a> !UnwindSafe for ParseBuffer<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/parse/struct.StepCursor.html b/syn/parse/struct.StepCursor.html new file mode 100644 index 0000000..28dbc01 --- /dev/null +++ b/syn/parse/struct.StepCursor.html @@ -0,0 +1,46 @@ +syn::parse::StepCursor - Rust

[][src]Struct syn::parse::StepCursor

pub struct StepCursor<'c, 'a> { /* fields omitted */ }

Cursor state associated with speculative parsing.

+

This type is the input of the closure provided to ParseStream::step.

+

Example

+
+use proc_macro2::TokenTree;
+use syn::Result;
+use syn::parse::ParseStream;
+
+// This function advances the stream past the next occurrence of `@`. If
+// no `@` is present in the stream, the stream position is unchanged and
+// an error is returned.
+fn skip_past_next_at(input: ParseStream) -> Result<()> {
+    input.step(|cursor| {
+        let mut rest = *cursor;
+        while let Some((tt, next)) = rest.token_tree() {
+            match &tt {
+                TokenTree::Punct(punct) if punct.as_char() == '@' => {
+                    return Ok(((), next));
+                }
+                _ => rest = next,
+            }
+        }
+        Err(cursor.error("no `@` was found after this point"))
+    })
+}
+

Methods

impl<'c, 'a> StepCursor<'c, 'a>[src]

pub fn error<T: Display>(self, message: T) -> Error[src]

Triggers an error at the current position of the parse stream.

+

The ParseStream::step invocation will return this same error without +advancing the stream state.

+

Methods from Deref<Target = Cursor<'c>>

Trait Implementations

impl<'c, 'a> Clone for StepCursor<'c, 'a>[src]

impl<'c, 'a> Copy for StepCursor<'c, 'a>[src]

impl<'c, 'a> Deref for StepCursor<'c, 'a>[src]

type Target = Cursor<'c>

The resulting type after dereferencing.

+

Auto Trait Implementations

impl<'c, 'a> !RefUnwindSafe for StepCursor<'c, 'a>

impl<'c, 'a> !Send for StepCursor<'c, 'a>

impl<'c, 'a> !Sync for StepCursor<'c, 'a>

impl<'c, 'a> Unpin for StepCursor<'c, 'a>

impl<'c, 'a> !UnwindSafe for StepCursor<'c, 'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/parse/trait.Parse.html b/syn/parse/trait.Parse.html new file mode 100644 index 0000000..05b2d79 --- /dev/null +++ b/syn/parse/trait.Parse.html @@ -0,0 +1,8 @@ +syn::parse::Parse - Rust

[][src]Trait syn::parse::Parse

pub trait Parse: Sized {
+    fn parse(input: ParseStream) -> Result<Self>;
+}

Parsing interface implemented by all types that can be parsed in a default +way from a token stream.

+
+

Required methods

fn parse(input: ParseStream) -> Result<Self>

Loading content... +

Implementations on Foreign Types

impl Parse for Option<BoundLifetimes>[src]

impl Parse for Option<WhereClause>[src]

impl Parse for Option<Abi>[src]

impl<T: Parse> Parse for Box<T>[src]

impl<T: Parse + Token> Parse for Option<T>[src]

impl Parse for TokenStream[src]

impl Parse for TokenTree[src]

impl Parse for Group[src]

impl Parse for Punct[src]

impl Parse for Literal[src]

Loading content... +

Implementors

impl Parse for BinOp[src]

impl Parse for Expr[src]

impl Parse for GenericArgument[src]

impl Parse for GenericParam[src]

impl Parse for Lit[src]

impl Parse for Member[src]

impl Parse for Meta[src]

impl Parse for NestedMeta[src]

impl Parse for ReturnType[src]

impl Parse for TraitBoundModifier[src]

impl Parse for syn::Type[src]

impl Parse for TypeParamBound[src]

impl Parse for UnOp[src]

impl Parse for Visibility[src]

impl Parse for WherePredicate[src]

impl Parse for Nothing[src]

impl Parse for Abi[src]

impl Parse for AngleBracketedGenericArguments[src]

impl Parse for BareFnArg[src]

impl Parse for Binding[src]

impl Parse for BoundLifetimes[src]

impl Parse for ConstParam[src]

impl Parse for DeriveInput[src]

impl Parse for ExprLit[src]

impl Parse for ExprPath[src]

impl Parse for FieldsNamed[src]

impl Parse for FieldsUnnamed[src]

impl Parse for Generics[src]

impl Parse for Ident[src]

impl Parse for Index[src]

impl Parse for Lifetime[src]

impl Parse for LifetimeDef[src]

impl Parse for LitBool[src]

impl Parse for LitByte[src]

impl Parse for LitByteStr[src]

impl Parse for LitChar[src]

impl Parse for LitFloat[src]

impl Parse for LitInt[src]

impl Parse for LitStr[src]

impl Parse for syn::Macro[src]

impl Parse for MetaList[src]

impl Parse for MetaNameValue[src]

impl Parse for ParenthesizedGenericArguments[src]

impl Parse for Path[src]

impl Parse for PathSegment[src]

impl Parse for TraitBound[src]

impl Parse for TypeArray[src]

impl Parse for TypeBareFn[src]

impl Parse for TypeGroup[src]

impl Parse for TypeImplTrait[src]

impl Parse for TypeInfer[src]

impl Parse for TypeMacro[src]

impl Parse for TypeNever[src]

impl Parse for TypeParam[src]

impl Parse for TypeParen[src]

impl Parse for TypePath[src]

impl Parse for TypePtr[src]

impl Parse for TypeReference[src]

impl Parse for TypeSlice[src]

impl Parse for TypeTraitObject[src]

impl Parse for TypeTuple[src]

impl Parse for Variant[src]

impl Parse for WhereClause[src]

impl Parse for Abstract[src]

impl Parse for Add[src]

impl Parse for AddEq[src]

impl Parse for And[src]

impl Parse for AndAnd[src]

impl Parse for AndEq[src]

impl Parse for As[src]

impl Parse for Async[src]

impl Parse for At[src]

impl Parse for Auto[src]

impl Parse for Await[src]

impl Parse for Bang[src]

impl Parse for Become[src]

impl Parse for syn::token::Box[src]

impl Parse for Break[src]

impl Parse for Caret[src]

impl Parse for CaretEq[src]

impl Parse for Colon[src]

impl Parse for Colon2[src]

impl Parse for Comma[src]

impl Parse for Const[src]

impl Parse for Continue[src]

impl Parse for Crate[src]

impl Parse for Default[src]

impl Parse for Div[src]

impl Parse for DivEq[src]

impl Parse for Do[src]

impl Parse for Dollar[src]

impl Parse for Dot[src]

impl Parse for Dot2[src]

impl Parse for Dot3[src]

impl Parse for DotDotEq[src]

impl Parse for Dyn[src]

impl Parse for Else[src]

impl Parse for Enum[src]

impl Parse for Eq[src]

impl Parse for EqEq[src]

impl Parse for Extern[src]

impl Parse for FatArrow[src]

impl Parse for Final[src]

impl Parse for Fn[src]

impl Parse for For[src]

impl Parse for Ge[src]

impl Parse for Gt[src]

impl Parse for If[src]

impl Parse for Impl[src]

impl Parse for In[src]

impl Parse for LArrow[src]

impl Parse for Le[src]

impl Parse for Let[src]

impl Parse for Loop[src]

impl Parse for Lt[src]

impl Parse for syn::token::Macro[src]

impl Parse for Match[src]

impl Parse for Mod[src]

impl Parse for Move[src]

impl Parse for MulEq[src]

impl Parse for Mut[src]

impl Parse for Ne[src]

impl Parse for Or[src]

impl Parse for OrEq[src]

impl Parse for OrOr[src]

impl Parse for Override[src]

impl Parse for Pound[src]

impl Parse for Priv[src]

impl Parse for Pub[src]

impl Parse for Question[src]

impl Parse for RArrow[src]

impl Parse for Ref[src]

impl Parse for Rem[src]

impl Parse for RemEq[src]

impl Parse for Return[src]

impl Parse for SelfType[src]

impl Parse for SelfValue[src]

impl Parse for Semi[src]

impl Parse for Shl[src]

impl Parse for ShlEq[src]

impl Parse for Shr[src]

impl Parse for ShrEq[src]

impl Parse for Star[src]

impl Parse for Static[src]

impl Parse for Struct[src]

impl Parse for Sub[src]

impl Parse for SubEq[src]

impl Parse for Super[src]

impl Parse for Tilde[src]

impl Parse for Trait[src]

impl Parse for Try[src]

impl Parse for syn::token::Type[src]

impl Parse for Typeof[src]

impl Parse for Underscore[src]

impl Parse for Union[src]

impl Parse for Unsafe[src]

impl Parse for Unsized[src]

impl Parse for Use[src]

impl Parse for Virtual[src]

impl Parse for Where[src]

impl Parse for While[src]

impl Parse for Yield[src]

Loading content...
\ No newline at end of file diff --git a/syn/parse/trait.Parser.html b/syn/parse/trait.Parser.html new file mode 100644 index 0000000..14f6b30 --- /dev/null +++ b/syn/parse/trait.Parser.html @@ -0,0 +1,28 @@ +syn::parse::Parser - Rust

[][src]Trait syn::parse::Parser

pub trait Parser: Sized {
+    type Output;
+    fn parse2(self, tokens: TokenStream) -> Result<Self::Output>;
+
+    fn parse(self, tokens: TokenStream) -> Result<Self::Output> { ... }
+
fn parse_str(self, s: &str) -> Result<Self::Output> { ... } +}

Parser that can parse Rust tokens into a particular syntax tree node.

+

Refer to the module documentation for details about parsing in Syn.

+

This trait is available if Syn is built with the "parsing" feature.

+
+

Associated Types

type Output

Loading content... +

Required methods

fn parse2(self, tokens: TokenStream) -> Result<Self::Output>

Parse a proc-macro2 token stream into the chosen syntax tree node.

+

This function will check that the input is fully parsed. If there are +any unparsed tokens at the end of the stream, an error is returned.

+
Loading content... +

Provided methods

fn parse(self, tokens: TokenStream) -> Result<Self::Output>

Parse tokens of source code into the chosen syntax tree node.

+

This function will check that the input is fully parsed. If there are +any unparsed tokens at the end of the stream, an error is returned.

+

This method is available if Syn is built with both the "parsing" and +"proc-macro" features.

+

fn parse_str(self, s: &str) -> Result<Self::Output>

Parse a string of Rust code into the chosen syntax tree node.

+

This function will check that the input is fully parsed. If there are +any unparsed tokens at the end of the string, an error is returned.

+

Hygiene

+

Every span in the resulting syntax tree will be set to resolve at the +macro call site.

+
Loading content... +

Implementors

impl<F, T> Parser for F where
    F: FnOnce(ParseStream) -> Result<T>, 
[src]

type Output = T

Loading content...
\ No newline at end of file diff --git a/syn/parse/trait.Peek.html b/syn/parse/trait.Peek.html new file mode 100644 index 0000000..2ad8eb4 --- /dev/null +++ b/syn/parse/trait.Peek.html @@ -0,0 +1,6 @@ +syn::parse::Peek - Rust

[][src]Trait syn::parse::Peek

pub trait Peek: Sealed { }

Types that can be parsed by looking at just one token.

+

Use ParseStream::peek to peek one of these types in a parse stream +without consuming it from the stream.

+

This trait is sealed and cannot be implemented for types outside of Syn.

+
+

Implementors

impl<F: Copy + FnOnce(TokenMarker) -> T, T: Token> Peek for F[src]

type Token = T

Loading content...
\ No newline at end of file diff --git a/syn/parse/type.ParseStream.html b/syn/parse/type.ParseStream.html new file mode 100644 index 0000000..156cc48 --- /dev/null +++ b/syn/parse/type.ParseStream.html @@ -0,0 +1,4 @@ +syn::parse::ParseStream - Rust

[][src]Type Definition syn::parse::ParseStream

type ParseStream<'a> = &'a ParseBuffer<'a>;

Input to a Syn parser function.

+

See the methods of this type under the documentation of [ParseBuffer]. For +an overview of parsing in Syn, refer to the module documentation.

+
\ No newline at end of file diff --git a/syn/parse/type.Result.html b/syn/parse/type.Result.html new file mode 100644 index 0000000..a979755 --- /dev/null +++ b/syn/parse/type.Result.html @@ -0,0 +1,2 @@ +syn::parse::Result - Rust

[][src]Type Definition syn::parse::Result

type Result<T> = Result<T, Error>;

The result of a Syn parser.

+
\ No newline at end of file diff --git a/syn/path/enum.GenericArgument.html b/syn/path/enum.GenericArgument.html new file mode 100644 index 0000000..8f3d42c --- /dev/null +++ b/syn/path/enum.GenericArgument.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.GenericArgument.html...

+ + + \ No newline at end of file diff --git a/syn/path/enum.PathArguments.html b/syn/path/enum.PathArguments.html new file mode 100644 index 0000000..c2abe3e --- /dev/null +++ b/syn/path/enum.PathArguments.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.PathArguments.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.AngleBracketedGenericArguments.html b/syn/path/struct.AngleBracketedGenericArguments.html new file mode 100644 index 0000000..3f99cec --- /dev/null +++ b/syn/path/struct.AngleBracketedGenericArguments.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.AngleBracketedGenericArguments.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.Binding.html b/syn/path/struct.Binding.html new file mode 100644 index 0000000..fd50675 --- /dev/null +++ b/syn/path/struct.Binding.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Binding.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.Constraint.html b/syn/path/struct.Constraint.html new file mode 100644 index 0000000..3261617 --- /dev/null +++ b/syn/path/struct.Constraint.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Constraint.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.ParenthesizedGenericArguments.html b/syn/path/struct.ParenthesizedGenericArguments.html new file mode 100644 index 0000000..eb8b2d4 --- /dev/null +++ b/syn/path/struct.ParenthesizedGenericArguments.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.ParenthesizedGenericArguments.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.Path.html b/syn/path/struct.Path.html new file mode 100644 index 0000000..566af84 --- /dev/null +++ b/syn/path/struct.Path.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Path.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.PathSegment.html b/syn/path/struct.PathSegment.html new file mode 100644 index 0000000..8c6c56b --- /dev/null +++ b/syn/path/struct.PathSegment.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.PathSegment.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.QSelf.html b/syn/path/struct.QSelf.html new file mode 100644 index 0000000..5c7aedc --- /dev/null +++ b/syn/path/struct.QSelf.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.QSelf.html...

+ + + \ No newline at end of file diff --git a/syn/punctuated/enum.Pair.html b/syn/punctuated/enum.Pair.html new file mode 100644 index 0000000..11fc09e --- /dev/null +++ b/syn/punctuated/enum.Pair.html @@ -0,0 +1,40 @@ +syn::punctuated::Pair - Rust

[][src]Enum syn::punctuated::Pair

pub enum Pair<T, P> {
+    Punctuated(T, P),
+    End(T),
+}

A single syntax tree node of type T followed by its trailing punctuation +of type P if any.

+

Refer to the module documentation for details about punctuated sequences.

+

+ Variants

+
Punctuated(T, P)
End(T)

Methods

impl<T, P> Pair<T, P>[src]

pub fn into_value(self) -> T[src]

Extracts the syntax tree node from this punctuated pair, discarding the +following punctuation.

+

pub fn value(&self) -> &T[src]

Borrows the syntax tree node from this punctuated pair.

+

pub fn value_mut(&mut self) -> &mut T[src]

Mutably borrows the syntax tree node from this punctuated pair.

+

pub fn punct(&self) -> Option<&P>[src]

Borrows the punctuation from this punctuated pair, unless this pair is +the final one and there is no trailing punctuation.

+

pub fn new(t: T, d: Option<P>) -> Self[src]

Creates a punctuated pair out of a syntax tree node and an optional +following punctuation.

+

pub fn into_tuple(self) -> (T, Option<P>)[src]

Produces this punctuated pair as a tuple of syntax tree node and +optional following punctuation.

+

Trait Implementations

impl<T: Clone, P: Clone> Clone for Pair<T, P>[src]

impl<T, P> Extend<Pair<T, P>> for Punctuated<T, P>[src]

impl<T, P> FromIterator<Pair<T, P>> for Punctuated<T, P>[src]

impl<T, P> ToTokens for Pair<T, P> where
    T: ToTokens,
    P: ToTokens
[src]

Auto Trait Implementations

impl<T, P> RefUnwindSafe for Pair<T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, P> Send for Pair<T, P> where
    P: Send,
    T: Send

impl<T, P> Sync for Pair<T, P> where
    P: Sync,
    T: Sync

impl<T, P> Unpin for Pair<T, P> where
    P: Unpin,
    T: Unpin

impl<T, P> UnwindSafe for Pair<T, P> where
    P: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/punctuated/index.html b/syn/punctuated/index.html new file mode 100644 index 0000000..968b74d --- /dev/null +++ b/syn/punctuated/index.html @@ -0,0 +1,28 @@ +syn::punctuated - Rust

[][src]Module syn::punctuated

A punctuated sequence of syntax tree nodes separated by punctuation.

+

Lots of things in Rust are punctuated sequences.

+
    +
  • The fields of a struct are Punctuated<Field, Token![,]>.
  • +
  • The segments of a path are Punctuated<PathSegment, Token![::]>.
  • +
  • The bounds on a generic parameter are Punctuated<TypeParamBound, Token![+]>.
  • +
  • The arguments to a function call are Punctuated<Expr, Token![,]>.
  • +
+

This module provides a common representation for these punctuated sequences +in the form of the Punctuated<T, P> type. We store a vector of pairs of +syntax tree node + punctuation, where every node in the sequence is followed +by punctuation except for possibly the final one.

+
a_function_call(arg1, arg2, arg3);
+                ~~~~^ ~~~~^ ~~~~
+
+

Structs

+
IntoIter

An iterator over owned values of type T.

+
IntoPairs

An iterator over owned pairs of type Pair<T, P>.

+
Iter

An iterator over borrowed values of type &T.

+
IterMut

An iterator over mutably borrowed values of type &mut T.

+
Pairs

An iterator over borrowed pairs of type Pair<&T, &P>.

+
PairsMut

An iterator over mutably borrowed pairs of type Pair<&mut T, &mut P>.

+
Punctuated

A punctuated sequence of syntax tree nodes of type T separated by +punctuation of type P.

+

Enums

+
Pair

A single syntax tree node of type T followed by its trailing punctuation +of type P if any.

+
\ No newline at end of file diff --git a/syn/punctuated/sidebar-items.js b/syn/punctuated/sidebar-items.js new file mode 100644 index 0000000..aceaded --- /dev/null +++ b/syn/punctuated/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["Pair","A single syntax tree node of type `T` followed by its trailing punctuation of type `P` if any."]],"struct":[["IntoIter","An iterator over owned values of type `T`."],["IntoPairs","An iterator over owned pairs of type `Pair`."],["Iter","An iterator over borrowed values of type `&T`."],["IterMut","An iterator over mutably borrowed values of type `&mut T`."],["Pairs","An iterator over borrowed pairs of type `Pair<&T, &P>`."],["PairsMut","An iterator over mutably borrowed pairs of type `Pair<&mut T, &mut P>`."],["Punctuated","A punctuated sequence of syntax tree nodes of type `T` separated by punctuation of type `P`."]]}); \ No newline at end of file diff --git a/syn/punctuated/struct.IntoIter.html b/syn/punctuated/struct.IntoIter.html new file mode 100644 index 0000000..a375bc9 --- /dev/null +++ b/syn/punctuated/struct.IntoIter.html @@ -0,0 +1,103 @@ +syn::punctuated::IntoIter - Rust

[][src]Struct syn::punctuated::IntoIter

pub struct IntoIter<T> { /* fields omitted */ }

An iterator over owned values of type T.

+

Refer to the module documentation for details about punctuated sequences.

+

Trait Implementations

impl<T: Clone> Clone for IntoIter<T>[src]

impl<T> DoubleEndedIterator for IntoIter<T>[src]

impl<T> ExactSizeIterator for IntoIter<T>[src]

impl<T> Iterator for IntoIter<T>[src]

type Item = T

The type of the elements being iterated over.

+

Auto Trait Implementations

impl<T> RefUnwindSafe for IntoIter<T> where
    T: RefUnwindSafe

impl<T> Send for IntoIter<T> where
    T: Send

impl<T> Sync for IntoIter<T> where
    T: Sync

impl<T> Unpin for IntoIter<T> where
    T: Unpin

impl<T> UnwindSafe for IntoIter<T> where
    T: RefUnwindSafe + UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

+

type IntoIter = I

Which kind of iterator are we turning this into?

+

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/punctuated/struct.IntoPairs.html b/syn/punctuated/struct.IntoPairs.html new file mode 100644 index 0000000..d4544dd --- /dev/null +++ b/syn/punctuated/struct.IntoPairs.html @@ -0,0 +1,103 @@ +syn::punctuated::IntoPairs - Rust

[][src]Struct syn::punctuated::IntoPairs

pub struct IntoPairs<T, P> { /* fields omitted */ }

An iterator over owned pairs of type Pair<T, P>.

+

Refer to the module documentation for details about punctuated sequences.

+

Trait Implementations

impl<T: Clone, P: Clone> Clone for IntoPairs<T, P>[src]

impl<T, P> DoubleEndedIterator for IntoPairs<T, P>[src]

impl<T, P> ExactSizeIterator for IntoPairs<T, P>[src]

impl<T, P> Iterator for IntoPairs<T, P>[src]

type Item = Pair<T, P>

The type of the elements being iterated over.

+

Auto Trait Implementations

impl<T, P> RefUnwindSafe for IntoPairs<T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, P> Send for IntoPairs<T, P> where
    P: Send,
    T: Send

impl<T, P> Sync for IntoPairs<T, P> where
    P: Sync,
    T: Sync

impl<T, P> Unpin for IntoPairs<T, P> where
    P: Unpin,
    T: Unpin

impl<T, P> UnwindSafe for IntoPairs<T, P> where
    P: RefUnwindSafe + UnwindSafe,
    T: RefUnwindSafe + UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

+

type IntoIter = I

Which kind of iterator are we turning this into?

+

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/punctuated/struct.Iter.html b/syn/punctuated/struct.Iter.html new file mode 100644 index 0000000..713b946 --- /dev/null +++ b/syn/punctuated/struct.Iter.html @@ -0,0 +1,103 @@ +syn::punctuated::Iter - Rust

[][src]Struct syn::punctuated::Iter

pub struct Iter<'a, T: 'a> { /* fields omitted */ }

An iterator over borrowed values of type &T.

+

Refer to the module documentation for details about punctuated sequences.

+

Trait Implementations

impl<'a, T> Clone for Iter<'a, T>[src]

impl<'a, T> DoubleEndedIterator for Iter<'a, T>[src]

impl<'a, T> ExactSizeIterator for Iter<'a, T>[src]

impl<'a, T> Iterator for Iter<'a, T>[src]

type Item = &'a T

The type of the elements being iterated over.

+

Auto Trait Implementations

impl<'a, T> !RefUnwindSafe for Iter<'a, T>

impl<'a, T> !Send for Iter<'a, T>

impl<'a, T> !Sync for Iter<'a, T>

impl<'a, T> Unpin for Iter<'a, T>

impl<'a, T> !UnwindSafe for Iter<'a, T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

+

type IntoIter = I

Which kind of iterator are we turning this into?

+

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/punctuated/struct.IterMut.html b/syn/punctuated/struct.IterMut.html new file mode 100644 index 0000000..7f1376a --- /dev/null +++ b/syn/punctuated/struct.IterMut.html @@ -0,0 +1,97 @@ +syn::punctuated::IterMut - Rust

[][src]Struct syn::punctuated::IterMut

pub struct IterMut<'a, T: 'a> { /* fields omitted */ }

An iterator over mutably borrowed values of type &mut T.

+

Refer to the module documentation for details about punctuated sequences.

+

Trait Implementations

impl<'a, T> DoubleEndedIterator for IterMut<'a, T>[src]

impl<'a, T> ExactSizeIterator for IterMut<'a, T>[src]

impl<'a, T> Iterator for IterMut<'a, T>[src]

type Item = &'a mut T

The type of the elements being iterated over.

+

Auto Trait Implementations

impl<'a, T> !RefUnwindSafe for IterMut<'a, T>

impl<'a, T> !Send for IterMut<'a, T>

impl<'a, T> !Sync for IterMut<'a, T>

impl<'a, T> Unpin for IterMut<'a, T>

impl<'a, T> !UnwindSafe for IterMut<'a, T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

+

type IntoIter = I

Which kind of iterator are we turning this into?

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/punctuated/struct.Pairs.html b/syn/punctuated/struct.Pairs.html new file mode 100644 index 0000000..1cc32a6 --- /dev/null +++ b/syn/punctuated/struct.Pairs.html @@ -0,0 +1,103 @@ +syn::punctuated::Pairs - Rust

[][src]Struct syn::punctuated::Pairs

pub struct Pairs<'a, T: 'a, P: 'a> { /* fields omitted */ }

An iterator over borrowed pairs of type Pair<&T, &P>.

+

Refer to the module documentation for details about punctuated sequences.

+

Trait Implementations

impl<'a, T, P> Clone for Pairs<'a, T, P>[src]

impl<'a, T, P> DoubleEndedIterator for Pairs<'a, T, P>[src]

impl<'a, T, P> ExactSizeIterator for Pairs<'a, T, P>[src]

impl<'a, T, P> Iterator for Pairs<'a, T, P>[src]

type Item = Pair<&'a T, &'a P>

The type of the elements being iterated over.

+

Auto Trait Implementations

impl<'a, T, P> RefUnwindSafe for Pairs<'a, T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe

impl<'a, T, P> Send for Pairs<'a, T, P> where
    P: Sync,
    T: Sync

impl<'a, T, P> Sync for Pairs<'a, T, P> where
    P: Sync,
    T: Sync

impl<'a, T, P> Unpin for Pairs<'a, T, P>

impl<'a, T, P> UnwindSafe for Pairs<'a, T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

+

type IntoIter = I

Which kind of iterator are we turning this into?

+

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/punctuated/struct.PairsMut.html b/syn/punctuated/struct.PairsMut.html new file mode 100644 index 0000000..339807c --- /dev/null +++ b/syn/punctuated/struct.PairsMut.html @@ -0,0 +1,97 @@ +syn::punctuated::PairsMut - Rust

[][src]Struct syn::punctuated::PairsMut

pub struct PairsMut<'a, T: 'a, P: 'a> { /* fields omitted */ }

An iterator over mutably borrowed pairs of type Pair<&mut T, &mut P>.

+

Refer to the module documentation for details about punctuated sequences.

+

Trait Implementations

impl<'a, T, P> DoubleEndedIterator for PairsMut<'a, T, P>[src]

impl<'a, T, P> ExactSizeIterator for PairsMut<'a, T, P>[src]

impl<'a, T, P> Iterator for PairsMut<'a, T, P>[src]

type Item = Pair<&'a mut T, &'a mut P>

The type of the elements being iterated over.

+

Auto Trait Implementations

impl<'a, T, P> RefUnwindSafe for PairsMut<'a, T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe

impl<'a, T, P> Send for PairsMut<'a, T, P> where
    P: Send,
    T: Send

impl<'a, T, P> Sync for PairsMut<'a, T, P> where
    P: Sync,
    T: Sync

impl<'a, T, P> Unpin for PairsMut<'a, T, P>

impl<'a, T, P> !UnwindSafe for PairsMut<'a, T, P>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

+

type IntoIter = I

Which kind of iterator are we turning this into?

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/punctuated/struct.Punctuated.html b/syn/punctuated/struct.Punctuated.html new file mode 100644 index 0000000..e7d0ba2 --- /dev/null +++ b/syn/punctuated/struct.Punctuated.html @@ -0,0 +1,116 @@ +syn::punctuated::Punctuated - Rust

[][src]Struct syn::punctuated::Punctuated

pub struct Punctuated<T, P> { /* fields omitted */ }

A punctuated sequence of syntax tree nodes of type T separated by +punctuation of type P.

+

Refer to the module documentation for details about punctuated sequences.

+

Methods

impl<T, P> Punctuated<T, P>[src]

pub fn new() -> Punctuated<T, P>[src]

Creates an empty punctuated sequence.

+

pub fn is_empty(&self) -> bool[src]

Determines whether this punctuated sequence is empty, meaning it +contains no syntax tree nodes or punctuation.

+

pub fn len(&self) -> usize[src]

Returns the number of syntax tree nodes in this punctuated sequence.

+

This is the number of nodes of type T, not counting the punctuation of +type P.

+

pub fn first(&self) -> Option<&T>[src]

Borrows the first element in this sequence.

+

pub fn last(&self) -> Option<&T>[src]

Borrows the last element in this sequence.

+

pub fn last_mut(&mut self) -> Option<&mut T>[src]

Mutably borrows the last element in this sequence.

+

pub fn iter(&self) -> Iter<T>[src]

Returns an iterator over borrowed syntax tree nodes of type &T.

+

pub fn iter_mut(&mut self) -> IterMut<T>[src]

Returns an iterator over mutably borrowed syntax tree nodes of type +&mut T.

+

pub fn pairs(&self) -> Pairs<T, P>[src]

Returns an iterator over the contents of this sequence as borrowed +punctuated pairs.

+

pub fn pairs_mut(&mut self) -> PairsMut<T, P>[src]

Returns an iterator over the contents of this sequence as mutably +borrowed punctuated pairs.

+

pub fn into_pairs(self) -> IntoPairs<T, P>[src]

Returns an iterator over the contents of this sequence as owned +punctuated pairs.

+

pub fn push_value(&mut self, value: T)[src]

Appends a syntax tree node onto the end of this punctuated sequence. The +sequence must previously have a trailing punctuation.

+

Use push instead if the punctuated sequence may or may not already +have trailing punctuation.

+

Panics

+

Panics if the sequence does not already have a trailing punctuation when +this method is called.

+

pub fn push_punct(&mut self, punctuation: P)[src]

Appends a trailing punctuation onto the end of this punctuated sequence. +The sequence must be non-empty and must not already have trailing +punctuation.

+

Panics

+

Panics if the sequence is empty or already has a trailing punctuation.

+

pub fn pop(&mut self) -> Option<Pair<T, P>>[src]

Removes the last punctuated pair from this sequence, or None if the +sequence is empty.

+

pub fn trailing_punct(&self) -> bool[src]

Determines whether this punctuated sequence ends with a trailing +punctuation.

+

pub fn empty_or_trailing(&self) -> bool[src]

Returns true if either this Punctuated is empty, or it has a trailing +punctuation.

+

Equivalent to punctuated.is_empty() || punctuated.trailing_punct().

+

pub fn push(&mut self, value: T) where
    P: Default
[src]

Appends a syntax tree node onto the end of this punctuated sequence.

+

If there is not a trailing punctuation in this sequence when this method +is called, the default value of punctuation type P is inserted before +the given value of type T.

+

pub fn insert(&mut self, index: usize, value: T) where
    P: Default
[src]

Inserts an element at position index.

+

Panics

+

Panics if index is greater than the number of elements previously in +this punctuated sequence.

+

pub fn parse_terminated(input: ParseStream) -> Result<Self> where
    T: Parse,
    P: Parse
[src]

Parses zero or more occurrences of T separated by punctuation of type +P, with optional trailing punctuation.

+

Parsing continues until the end of this parse stream. The entire content +of this parse stream must consist of T and P.

+

This function is available if Syn is built with the "parsing" +feature.

+

pub fn parse_terminated_with(
    input: ParseStream,
    parser: fn(_: ParseStream) -> Result<T>
) -> Result<Self> where
    P: Parse
[src]

Parses zero or more occurrences of T using the given parse function, +separated by punctuation of type P, with optional trailing +punctuation.

+

Like parse_terminated, the entire content of this stream is expected +to be parsed.

+

This function is available if Syn is built with the "parsing" +feature.

+

pub fn parse_separated_nonempty(input: ParseStream) -> Result<Self> where
    T: Parse,
    P: Token + Parse
[src]

Parses one or more occurrences of T separated by punctuation of type +P, not accepting trailing punctuation.

+

Parsing continues as long as punctuation P is present at the head of +the stream. This method returns upon parsing a T and observing that it +is not followed by a P, even if there are remaining tokens in the +stream.

+

This function is available if Syn is built with the "parsing" +feature.

+

pub fn parse_separated_nonempty_with(
    input: ParseStream,
    parser: fn(_: ParseStream) -> Result<T>
) -> Result<Self> where
    P: Token + Parse
[src]

Parses one or more occurrences of T using the given parse function, +separated by punctuation of type P, not accepting trailing +punctuation.

+

Like parse_separated_nonempty, may complete early without parsing +the entire content of this stream.

+

This function is available if Syn is built with the "parsing" +feature.

+

Trait Implementations

impl<T: Clone, P: Clone> Clone for Punctuated<T, P>[src]

impl<T, P> Default for Punctuated<T, P>[src]

impl<T, P> Extend<Pair<T, P>> for Punctuated<T, P>[src]

impl<T, P> Extend<T> for Punctuated<T, P> where
    P: Default
[src]

impl<T, P> FromIterator<Pair<T, P>> for Punctuated<T, P>[src]

impl<T, P> FromIterator<T> for Punctuated<T, P> where
    P: Default
[src]

impl<T, P> Index<usize> for Punctuated<T, P>[src]

type Output = T

The returned type after indexing.

+

impl<T, P> IndexMut<usize> for Punctuated<T, P>[src]

impl<T, P> IntoIterator for Punctuated<T, P>[src]

type Item = T

The type of the elements being iterated over.

+

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?

+

impl<'a, T, P> IntoIterator for &'a Punctuated<T, P>[src]

type Item = &'a T

The type of the elements being iterated over.

+

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?

+

impl<'a, T, P> IntoIterator for &'a mut Punctuated<T, P>[src]

type Item = &'a mut T

The type of the elements being iterated over.

+

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?

+

impl<T, P> ToTokens for Punctuated<T, P> where
    T: ToTokens,
    P: ToTokens
[src]

Auto Trait Implementations

impl<T, P> RefUnwindSafe for Punctuated<T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, P> Send for Punctuated<T, P> where
    P: Send,
    T: Send

impl<T, P> Sync for Punctuated<T, P> where
    P: Sync,
    T: Sync

impl<T, P> Unpin for Punctuated<T, P> where
    P: Unpin,
    T: Unpin

impl<T, P> UnwindSafe for Punctuated<T, P> where
    P: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

+

type IntoIter = I

Which kind of iterator are we turning this into?

+

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/sidebar-items.js b/syn/sidebar-items.js new file mode 100644 index 0000000..72cceee --- /dev/null +++ b/syn/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["AttrStyle","Distinguishes between attributes that decorate an item and attributes that are contained within an item."],["BinOp","A binary operator: `+`, `+=`, `&`."],["Data","The storage of a struct, enum or union data structure."],["Expr","A Rust expression."],["Fields","Data stored within an enum variant or struct."],["GenericArgument","An individual generic argument, like `'a`, `T`, or `Item = T`."],["GenericParam","A generic type parameter, lifetime, or const generic: `T: Into`, `'a: 'b`, `const LEN: usize`."],["Lit","A Rust literal such as a string or integer or boolean."],["MacroDelimiter","A grouping token that surrounds a macro body: `m!(...)` or `m!{...}` or `m![...]`."],["Member","A struct or tuple struct field accessed in a struct literal or field expression."],["Meta","Content of a compile-time structured attribute."],["NestedMeta","Element of a compile-time attribute list."],["PathArguments","Angle bracketed or parenthesized arguments of a path segment."],["ReturnType","Return type of a function signature."],["StrStyle","The style of a string literal, either plain quoted or a raw string like `r##\"data\"##`."],["TraitBoundModifier","A modifier on a trait bound, currently only used for the `?` in `?Sized`."],["Type","The possible types that a Rust value could have."],["TypeParamBound","A trait or lifetime used as a bound on a type parameter."],["UnOp","A unary operator: `*`, `!`, `-`."],["Visibility","The visibility level of an item: inherited or `pub` or `pub(restricted)`."],["WherePredicate","A single predicate in a `where` clause: `T: Deserialize<'de>`."]],"fn":[["parse","Parse tokens of source code into the chosen syntax tree node."],["parse2","Parse a proc-macro2 token stream into the chosen syntax tree node."],["parse_str","Parse a string of Rust code into the chosen syntax tree node."]],"macro":[["Token","A type-macro that expands to the name of the Rust type representation of a given token."],["braced","Parse a set of curly braces and expose their content to subsequent parsers."],["bracketed","Parse a set of square brackets and expose their content to subsequent parsers."],["custom_keyword","Define a type that supports parsing and printing a given identifier as if it were a keyword."],["custom_punctuation","Define a type that supports parsing and printing a multi-character symbol as if it were a punctuation token."],["parenthesized","Parse a set of parentheses and expose their content to subsequent parsers."],["parse_macro_input","Parse the input TokenStream of a macro, triggering a compile error if the tokens fail to parse."],["parse_quote","Quasi-quotation macro that accepts input like the [`quote!`] macro but uses type inference to figure out a return type for those tokens."]],"mod":[["buffer","A stably addressed token buffer supporting efficient traversal based on a cheaply copyable cursor."],["ext","Extension traits to provide parsing methods on foreign types."],["parse","Parsing interface for parsing a token stream into a syntax tree node."],["punctuated","A punctuated sequence of syntax tree nodes separated by punctuation."],["spanned","A trait that can provide the `Span` of the complete contents of a syntax tree node."],["token","Tokens representing Rust punctuation, keywords, and delimiters."],["visit","Syntax tree traversal to walk a shared borrow of a syntax tree."]],"struct":[["Abi","The binary interface of a function: `extern \"C\"`."],["AngleBracketedGenericArguments","Angle bracketed arguments of a path segment: the `` in `HashMap`."],["Attribute","An attribute like `#[repr(transparent)]`."],["BareFnArg","An argument in a function type: the `usize` in `fn(usize) -> bool`."],["Binding","A binding (equality constraint) on an associated type: `Item = u8`."],["BoundLifetimes","A set of bound lifetimes: `for<'a, 'b, 'c>`."],["ConstParam","A const generic parameter: `const LENGTH: usize`."],["Constraint","An associated type bound: `Iterator`."],["DataEnum","An enum input to a `proc_macro_derive` macro."],["DataStruct","A struct input to a `proc_macro_derive` macro."],["DataUnion","An untagged union input to a `proc_macro_derive` macro."],["DeriveInput","Data structure sent to a `proc_macro_derive` macro."],["Error","Error returned when a Syn parser cannot parse the input tokens."],["ExprArray","A slice literal expression: `[a, b, c, d]`."],["ExprAssign","An assignment expression: `a = compute()`."],["ExprAssignOp","A compound assignment expression: `counter += 1`."],["ExprAsync","An async block: `async { ... }`."],["ExprAwait","An await expression: `fut.await`."],["ExprBinary","A binary operation: `a + b`, `a * b`."],["ExprBlock","A blocked scope: `{ ... }`."],["ExprBox","A box expression: `box f`."],["ExprBreak","A `break`, with an optional label to break and an optional expression."],["ExprCall","A function call expression: `invoke(a, b)`."],["ExprCast","A cast expression: `foo as f64`."],["ExprClosure","A closure expression: `|a, b| a + b`."],["ExprContinue","A `continue`, with an optional label."],["ExprField","Access of a named struct field (`obj.k`) or unnamed tuple struct field (`obj.0`)."],["ExprForLoop","A for loop: `for pat in expr { ... }`."],["ExprGroup","An expression contained within invisible delimiters."],["ExprIf","An `if` expression with an optional `else` block: `if expr { ... } else { ... }`."],["ExprIndex","A square bracketed indexing expression: `vector[2]`."],["ExprLet","A `let` guard: `let Some(x) = opt`."],["ExprLit","A literal in place of an expression: `1`, `\"foo\"`."],["ExprLoop","Conditionless loop: `loop { ... }`."],["ExprMacro","A macro invocation expression: `format!(\"{}\", q)`."],["ExprMatch","A `match` expression: `match n { Some(n) => {}, None => {} }`."],["ExprMethodCall","A method call expression: `x.foo::(a, b)`."],["ExprParen","A parenthesized expression: `(a + b)`."],["ExprPath","A path like `std::mem::replace` possibly containing generic parameters and a qualified self-type."],["ExprRange","A range expression: `1..2`, `1..`, `..2`, `1..=2`, `..=2`."],["ExprReference","A referencing operation: `&a` or `&mut a`."],["ExprRepeat","An array literal constructed from one repeated element: `[0u8; N]`."],["ExprReturn","A `return`, with an optional value to be returned."],["ExprStruct","A struct literal expression: `Point { x: 1, y: 1 }`."],["ExprTry","A try-expression: `expr?`."],["ExprTryBlock","A try block: `try { ... }`."],["ExprTuple","A tuple expression: `(a, b, c, d)`."],["ExprType","A type ascription expression: `foo: f64`."],["ExprUnary","A unary operation: `!x`, `*x`."],["ExprUnsafe","An unsafe block: `unsafe { ... }`."],["ExprWhile","A while loop: `while expr { ... }`."],["ExprYield","A yield expression: `yield expr`."],["Field","A field of a struct or enum variant."],["FieldsNamed","Named fields of a struct or struct variant such as `Point { x: f64, y: f64 }`."],["FieldsUnnamed","Unnamed fields of a tuple struct or tuple variant such as `Some(T)`."],["Generics","Lifetimes and type parameters attached to a declaration of a function, enum, trait, etc."],["Ident","A word of Rust code, which may be a keyword or legal variable name."],["ImplGenerics","Returned by `Generics::split_for_impl`."],["Index","The index of an unnamed tuple struct field."],["Lifetime","A Rust lifetime: `'a`."],["LifetimeDef","A lifetime definition: `'a: 'b + 'c + 'd`."],["LitBool","A boolean literal: `true` or `false`."],["LitByte","A byte literal: `b'f'`."],["LitByteStr","A byte string literal: `b\"foo\"`."],["LitChar","A character literal: `'a'`."],["LitFloat","A floating point literal: `1f64` or `1.0e10f64`."],["LitInt","An integer literal: `1` or `1u16`."],["LitStr","A UTF-8 string literal: `\"foo\"`."],["Macro","A macro invocation: `println!(\"{}\", mac)`."],["MetaList","A structured list within an attribute, like `derive(Copy, Clone)`."],["MetaNameValue","A name-value pair within an attribute, like `feature = \"nightly\"`."],["ParenthesizedGenericArguments","Arguments of a function path segment: the `(A, B) -> C` in `Fn(A,B) -> C`."],["Path","A path at which a named item is exported: `std::collections::HashMap`."],["PathSegment","A segment of a path together with any path arguments on that segment."],["PredicateEq","An equality predicate in a `where` clause (unsupported)."],["PredicateLifetime","A lifetime predicate in a `where` clause: `'a: 'b + 'c`."],["PredicateType","A type predicate in a `where` clause: `for<'c> Foo<'c>: Trait<'c>`."],["QSelf","The explicit Self type in a qualified path: the `T` in `::fmt`."],["TraitBound","A trait used as a bound on a type parameter."],["Turbofish","Returned by `TypeGenerics::as_turbofish`."],["TypeArray","A fixed size array type: `[T; n]`."],["TypeBareFn","A bare function type: `fn(usize) -> bool`."],["TypeGenerics","Returned by `Generics::split_for_impl`."],["TypeGroup","A type contained within invisible delimiters."],["TypeImplTrait","An `impl Bound1 + Bound2 + Bound3` type where `Bound` is a trait or a lifetime."],["TypeInfer","Indication that a type should be inferred by the compiler: `_`."],["TypeMacro","A macro in the type position."],["TypeNever","The never type: `!`."],["TypeParam","A generic type parameter: `T: Into`."],["TypeParen","A parenthesized type equivalent to the inner type."],["TypePath","A path like `std::slice::Iter`, optionally qualified with a self-type as in ` as SomeTrait>::Associated`."],["TypePtr","A raw pointer type: `*const T` or `*mut T`."],["TypeReference","A reference type: `&'a T` or `&'a mut T`."],["TypeSlice","A dynamically sized slice type: `[T]`."],["TypeTraitObject","A trait object type `Bound1 + Bound2 + Bound3` where `Bound` is a trait or a lifetime."],["TypeTuple","A tuple type: `(A, B, C, String)`."],["Variadic","The variadic argument of a foreign function."],["Variant","An enum variant."],["VisCrate","A crate-level visibility: `crate`."],["VisPublic","A public visibility level: `pub`."],["VisRestricted","A visibility level restricted to some path: `pub(self)` or `pub(super)` or `pub(crate)` or `pub(in some::module)`."],["WhereClause","A `where` clause in a definition: `where T: Deserialize<'de>, D: 'static`."]],"type":[["AttributeArgs","Conventional argument type associated with an invocation of an attribute macro."],["Result","The result of a Syn parser."]]}); \ No newline at end of file diff --git a/syn/spanned/index.html b/syn/spanned/index.html new file mode 100644 index 0000000..2ab619a --- /dev/null +++ b/syn/spanned/index.html @@ -0,0 +1,57 @@ +syn::spanned - Rust

[][src]Module syn::spanned

A trait that can provide the Span of the complete contents of a syntax +tree node.

+

This module is available if Syn is built with both the "parsing" and +"printing" features.

+
+

Example

+

Suppose in a procedural macro we have a Type that we want to assert +implements the Sync trait. Maybe this is the type of one of the fields +of a struct for which we are deriving a trait implementation, and we need to +be able to pass a reference to one of those fields across threads.

+

If the field type does not implement Sync as required, we want the +compiler to report an error pointing out exactly which type it was.

+

The following macro code takes a variable ty of type Type and produces a +static assertion that Sync is implemented for that type.

+ +
+use proc_macro::TokenStream;
+use proc_macro2::Span;
+use quote::quote_spanned;
+use syn::Type;
+use syn::spanned::Spanned;
+
+#[proc_macro_derive(MyMacro)]
+pub fn my_macro(input: TokenStream) -> TokenStream {
+    /* ... */
+
+    let assert_sync = quote_spanned! {ty.span()=>
+        struct _AssertSync where #ty: Sync;
+    };
+
+    /* ... */
+}
+

By inserting this assert_sync fragment into the output code generated by +our macro, the user's code will fail to compile if ty does not implement +Sync. The errors they would see look like the following.

+
error[E0277]: the trait bound `*const i32: std::marker::Sync` is not satisfied
+  --> src/main.rs:10:21
+   |
+10 |     bad_field: *const i32,
+   |                ^^^^^^^^^^ `*const i32` cannot be shared between threads safely
+
+

In this technique, using the Type's span for the error message makes the +error appear in the correct place underlining the right type.

+
+

Limitations

+

The underlying [proc_macro::Span::join] method is nightly-only. When +called from within a procedural macro in a nightly compiler, Spanned will +use join to produce the intended span. When not using a nightly compiler, +only the span of the first token of the syntax tree node is returned.

+

In the common case of wanting to use the joined span as the span of a +syn::Error, consider instead using syn::Error::new_spanned which is +able to span the error correctly under the complete syntax tree node without +needing the unstable join.

+

Traits

+
Spanned

A trait that can provide the Span of the complete contents of a syntax +tree node.

+
\ No newline at end of file diff --git a/syn/spanned/sidebar-items.js b/syn/spanned/sidebar-items.js new file mode 100644 index 0000000..e5f99e7 --- /dev/null +++ b/syn/spanned/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"trait":[["Spanned","A trait that can provide the `Span` of the complete contents of a syntax tree node."]]}); \ No newline at end of file diff --git a/syn/spanned/trait.Spanned.html b/syn/spanned/trait.Spanned.html new file mode 100644 index 0000000..a9dc9ae --- /dev/null +++ b/syn/spanned/trait.Spanned.html @@ -0,0 +1,14 @@ +syn::spanned::Spanned - Rust

[][src]Trait syn::spanned::Spanned

pub trait Spanned {
+    fn span(&self) -> Span;
+}

A trait that can provide the Span of the complete contents of a syntax +tree node.

+

This trait is automatically implemented for all types that implement +ToTokens from the quote crate, as well as for Span itself.

+

See the module documentation for an example.

+

This trait is available if Syn is built with both the "parsing" and +"printing" features.

+
+

Required methods

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.

+
Loading content... +

Implementors

impl<T: ?Sized + ToTokens> Spanned for T[src]

Loading content...
\ No newline at end of file diff --git a/syn/struct.Abi.html b/syn/struct.Abi.html new file mode 100644 index 0000000..bf307bc --- /dev/null +++ b/syn/struct.Abi.html @@ -0,0 +1,27 @@ +syn::Abi - Rust

[][src]Struct syn::Abi

pub struct Abi {
+    pub extern_token: Extern,
+    pub name: Option<LitStr>,
+}

The binary interface of a function: extern "C".

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

extern_token: Externname: Option<LitStr>

Trait Implementations

impl Clone for Abi[src]

impl Parse for Abi[src]

impl ToTokens for Abi[src]

Auto Trait Implementations

impl !RefUnwindSafe for Abi

impl !Send for Abi

impl !Sync for Abi

impl Unpin for Abi

impl UnwindSafe for Abi

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.AngleBracketedGenericArguments.html b/syn/struct.AngleBracketedGenericArguments.html new file mode 100644 index 0000000..4e06747 --- /dev/null +++ b/syn/struct.AngleBracketedGenericArguments.html @@ -0,0 +1,29 @@ +syn::AngleBracketedGenericArguments - Rust

[][src]Struct syn::AngleBracketedGenericArguments

pub struct AngleBracketedGenericArguments {
+    pub colon2_token: Option<Colon2>,
+    pub lt_token: Lt,
+    pub args: Punctuated<GenericArgument, Comma>,
+    pub gt_token: Gt,
+}

Angle bracketed arguments of a path segment: the <K, V> in HashMap<K, V>.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

colon2_token: Option<Colon2>lt_token: Ltargs: Punctuated<GenericArgument, Comma>gt_token: Gt

Trait Implementations

impl Clone for AngleBracketedGenericArguments[src]

impl Parse for AngleBracketedGenericArguments[src]

impl ToTokens for AngleBracketedGenericArguments[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.Attribute.html b/syn/struct.Attribute.html new file mode 100644 index 0000000..4413404 --- /dev/null +++ b/syn/struct.Attribute.html @@ -0,0 +1,156 @@ +syn::Attribute - Rust

[][src]Struct syn::Attribute

pub struct Attribute {
+    pub pound_token: Pound,
+    pub style: AttrStyle,
+    pub bracket_token: Bracket,
+    pub path: Path,
+    pub tokens: TokenStream,
+}

An attribute like #[repr(transparent)].

+

This type is available if Syn is built with the "derive" or "full" +feature.

+
+

Syntax

+

Rust has six types of attributes.

+
    +
  • Outer attributes like #[repr(transparent)]. These appear outside or +in front of the item they describe.
  • +
  • Inner attributes like #![feature(proc_macro)]. These appear inside +of the item they describe, usually a module.
  • +
  • Outer doc comments like /// # Example.
  • +
  • Inner doc comments like //! Please file an issue.
  • +
  • Outer block comments /** # Example */.
  • +
  • Inner block comments /*! Please file an issue */.
  • +
+

The style field of type AttrStyle distinguishes whether an attribute +is outer or inner. Doc comments and block comments are promoted to +attributes, as this is how they are processed by the compiler and by +macro_rules! macros.

+

The path field gives the possibly colon-delimited path against which +the attribute is resolved. It is equal to "doc" for desugared doc +comments. The tokens field contains the rest of the attribute body as +tokens.

+
#[derive(Copy)]      #[crate::precondition x < 5]
+  ^^^^^^~~~~~~         ^^^^^^^^^^^^^^^^^^^ ~~~~~
+  path  tokens                 path        tokens
+
+
+

Parsing from tokens to Attribute

+

This type does not implement the Parse trait and thus cannot be +parsed directly by ParseStream::parse. Instead use +ParseStream::call with one of the two parser functions +[Attribute::parse_outer] or [Attribute::parse_inner] depending on +which you intend to parse.

+ +
+use syn::{Attribute, Ident, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+// Parses a unit struct with attributes.
+//
+//     #[path = "s.tmpl"]
+//     struct S;
+struct UnitStruct {
+    attrs: Vec<Attribute>,
+    struct_token: Token![struct],
+    name: Ident,
+    semi_token: Token![;],
+}
+
+impl Parse for UnitStruct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Ok(UnitStruct {
+            attrs: input.call(Attribute::parse_outer)?,
+            struct_token: input.parse()?,
+            name: input.parse()?,
+            semi_token: input.parse()?,
+        })
+    }
+}
+


+

Parsing from Attribute to structured arguments

+

The grammar of attributes in Rust is very flexible, which makes the +syntax tree not that useful on its own. In particular, arguments of the +attribute are held in an arbitrary tokens: TokenStream. Macros are +expected to check the path of the attribute, decide whether they +recognize it, and then parse the remaining tokens according to whatever +grammar they wish to require for that kind of attribute.

+

If the attribute you are parsing is expected to conform to the +conventional structured form of attribute, use parse_meta() to +obtain that structured representation. If the attribute follows some +other grammar of its own, use parse_args() to parse that into the +expected data structure.

+


+

Doc comments

+

The compiler transforms doc comments, such as /// comment and /*! comment */, into attributes before macros are expanded. Each comment is +expanded into an attribute of the form #[doc = r"comment"].

+

As an example, the following mod items are expanded identically:

+ +
+let doc: ItemMod = parse_quote! {
+    /// Single line doc comments
+    /// We write so many!
+    /**
+     * Multi-line comments...
+     * May span many lines
+     */
+    mod example {
+        //! Of course, they can be inner too
+        /*! And fit in a single line */
+    }
+};
+let attr: ItemMod = parse_quote! {
+    #[doc = r" Single line doc comments"]
+    #[doc = r" We write so many!"]
+    #[doc = r" Multi-line comments...
+ May span many lines"]
+    mod example {
+        #![doc = r" Of course, they can be inner too"]
+        #![doc = r" And fit in a single line "]
+    }
+};
+assert_eq!(doc, attr);
+

+ Fields

pound_token: Poundstyle: AttrStylebracket_token: Bracketpath: Pathtokens: TokenStream

Methods

impl Attribute[src]

pub fn parse_meta(&self) -> Result<Meta>[src]

Parses the content of the attribute, consisting of the path and tokens, +as a [Meta] if possible.

+

This function is available if Syn is built with the "parsing" +feature.

+

pub fn parse_args<T: Parse>(&self) -> Result<T>[src]

Parse the arguments to the attribute as a syntax tree.

+

This is similar to syn::parse2::<T>(attr.tokens) except that:

+
    +
  • the surrounding delimiters are not included in the input to the +parser; and
  • +
  • the error message has a more useful span when tokens is empty.
  • +
+
#[my_attr(value < 5)]
+          ^^^^^^^^^ what gets parsed
+
+

This function is available if Syn is built with the "parsing" +feature.

+

pub fn parse_args_with<F: Parser>(&self, parser: F) -> Result<F::Output>[src]

Parse the arguments to the attribute using the given parser.

+

This function is available if Syn is built with the "parsing" +feature.

+

pub fn parse_outer(input: ParseStream) -> Result<Vec<Self>>[src]

Parses zero or more outer attributes from the stream.

+

This function is available if Syn is built with the "parsing" +feature.

+

pub fn parse_inner(input: ParseStream) -> Result<Vec<Self>>[src]

Parses zero or more inner attributes from the stream.

+

This function is available if Syn is built with the "parsing" +feature.

+

Trait Implementations

impl Clone for Attribute[src]

impl ToTokens for Attribute[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.BareFnArg.html b/syn/struct.BareFnArg.html new file mode 100644 index 0000000..5cd1112 --- /dev/null +++ b/syn/struct.BareFnArg.html @@ -0,0 +1,28 @@ +syn::BareFnArg - Rust

[][src]Struct syn::BareFnArg

pub struct BareFnArg {
+    pub attrs: Vec<Attribute>,
+    pub name: Option<(Ident, Colon)>,
+    pub ty: Type,
+}

An argument in a function type: the usize in fn(usize) -> bool.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

attrs: Vec<Attribute>name: Option<(Ident, Colon)>ty: Type

Trait Implementations

impl Clone for BareFnArg[src]

impl Parse for BareFnArg[src]

impl ToTokens for BareFnArg[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.Binding.html b/syn/struct.Binding.html new file mode 100644 index 0000000..151a982 --- /dev/null +++ b/syn/struct.Binding.html @@ -0,0 +1,28 @@ +syn::Binding - Rust

[][src]Struct syn::Binding

pub struct Binding {
+    pub ident: Ident,
+    pub eq_token: Eq,
+    pub ty: Type,
+}

A binding (equality constraint) on an associated type: Item = u8.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

ident: Identeq_token: Eqty: Type

Trait Implementations

impl Clone for Binding[src]

impl Parse for Binding[src]

impl ToTokens for Binding[src]

Auto Trait Implementations

impl !RefUnwindSafe for Binding

impl !Send for Binding

impl !Sync for Binding

impl Unpin for Binding

impl UnwindSafe for Binding

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.BoundLifetimes.html b/syn/struct.BoundLifetimes.html new file mode 100644 index 0000000..58c7707 --- /dev/null +++ b/syn/struct.BoundLifetimes.html @@ -0,0 +1,30 @@ +syn::BoundLifetimes - Rust

[][src]Struct syn::BoundLifetimes

pub struct BoundLifetimes {
+    pub for_token: For,
+    pub lt_token: Lt,
+    pub lifetimes: Punctuated<LifetimeDef, Comma>,
+    pub gt_token: Gt,
+}

A set of bound lifetimes: for<'a, 'b, 'c>.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

for_token: Forlt_token: Ltlifetimes: Punctuated<LifetimeDef, Comma>gt_token: Gt

Trait Implementations

impl Clone for BoundLifetimes[src]

impl Default for BoundLifetimes[src]

impl Parse for BoundLifetimes[src]

impl ToTokens for BoundLifetimes[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ConstParam.html b/syn/struct.ConstParam.html new file mode 100644 index 0000000..611786d --- /dev/null +++ b/syn/struct.ConstParam.html @@ -0,0 +1,33 @@ +syn::ConstParam - Rust

[][src]Struct syn::ConstParam

pub struct ConstParam {
+    pub attrs: Vec<Attribute>,
+    pub const_token: Const,
+    pub ident: Ident,
+    pub colon_token: Colon,
+    pub ty: Type,
+    pub eq_token: Option<Eq>,
+    pub default: Option<Expr>,
+}

A const generic parameter: const LENGTH: usize.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

attrs: Vec<Attribute>const_token: Constident: Identcolon_token: Colonty: Typeeq_token: Option<Eq>default: Option<Expr>

Trait Implementations

impl Clone for ConstParam[src]

impl From<ConstParam> for GenericParam[src]

impl Parse for ConstParam[src]

impl ToTokens for ConstParam[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.Constraint.html b/syn/struct.Constraint.html new file mode 100644 index 0000000..9855b41 --- /dev/null +++ b/syn/struct.Constraint.html @@ -0,0 +1,28 @@ +syn::Constraint - Rust

[][src]Struct syn::Constraint

pub struct Constraint {
+    pub ident: Ident,
+    pub colon_token: Colon,
+    pub bounds: Punctuated<TypeParamBound, Add>,
+}

An associated type bound: Iterator<Item: Display>.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

ident: Identcolon_token: Colonbounds: Punctuated<TypeParamBound, Add>

Trait Implementations

impl Clone for Constraint[src]

impl ToTokens for Constraint[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.DataEnum.html b/syn/struct.DataEnum.html new file mode 100644 index 0000000..043a6ed --- /dev/null +++ b/syn/struct.DataEnum.html @@ -0,0 +1,25 @@ +syn::DataEnum - Rust

[][src]Struct syn::DataEnum

pub struct DataEnum {
+    pub enum_token: Enum,
+    pub brace_token: Brace,
+    pub variants: Punctuated<Variant, Comma>,
+}

An enum input to a proc_macro_derive macro.

+

This type is available if Syn is built with the "derive" +feature.

+

+ Fields

enum_token: Enumbrace_token: Bracevariants: Punctuated<Variant, Comma>

Trait Implementations

impl Clone for DataEnum[src]

impl From<DataEnum> for Data[src]

Auto Trait Implementations

impl !RefUnwindSafe for DataEnum

impl !Send for DataEnum

impl !Sync for DataEnum

impl Unpin for DataEnum

impl UnwindSafe for DataEnum

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.DataStruct.html b/syn/struct.DataStruct.html new file mode 100644 index 0000000..0418bb5 --- /dev/null +++ b/syn/struct.DataStruct.html @@ -0,0 +1,25 @@ +syn::DataStruct - Rust

[][src]Struct syn::DataStruct

pub struct DataStruct {
+    pub struct_token: Struct,
+    pub fields: Fields,
+    pub semi_token: Option<Semi>,
+}

A struct input to a proc_macro_derive macro.

+

This type is available if Syn is built with the "derive" +feature.

+

+ Fields

struct_token: Structfields: Fieldssemi_token: Option<Semi>

Trait Implementations

impl Clone for DataStruct[src]

impl From<DataStruct> for Data[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.DataUnion.html b/syn/struct.DataUnion.html new file mode 100644 index 0000000..353ec8b --- /dev/null +++ b/syn/struct.DataUnion.html @@ -0,0 +1,24 @@ +syn::DataUnion - Rust

[][src]Struct syn::DataUnion

pub struct DataUnion {
+    pub union_token: Union,
+    pub fields: FieldsNamed,
+}

An untagged union input to a proc_macro_derive macro.

+

This type is available if Syn is built with the "derive" +feature.

+

+ Fields

union_token: Unionfields: FieldsNamed

Trait Implementations

impl Clone for DataUnion[src]

impl From<DataUnion> for Data[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.DeriveInput.html b/syn/struct.DeriveInput.html new file mode 100644 index 0000000..c28b1fa --- /dev/null +++ b/syn/struct.DeriveInput.html @@ -0,0 +1,34 @@ +syn::DeriveInput - Rust

[][src]Struct syn::DeriveInput

pub struct DeriveInput {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub data: Data,
+}

Data structure sent to a proc_macro_derive macro.

+

This type is available if Syn is built with the "derive" feature.

+

+ Fields

attrs: Vec<Attribute>

Attributes tagged on the whole struct or enum.

+
vis: Visibility

Visibility of the struct or enum.

+
ident: Ident

Name of the struct or enum.

+
generics: Generics

Generics required to complete the definition.

+
data: Data

Data within the struct or enum.

+

Trait Implementations

impl Clone for DeriveInput[src]

impl Parse for DeriveInput[src]

impl ToTokens for DeriveInput[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.Error.html b/syn/struct.Error.html new file mode 100644 index 0000000..92a03bd --- /dev/null +++ b/syn/struct.Error.html @@ -0,0 +1,114 @@ +syn::Error - Rust

[][src]Struct syn::Error

pub struct Error { /* fields omitted */ }

Error returned when a Syn parser cannot parse the input tokens.

+

Error reporting in proc macros

+

The correct way to report errors back to the compiler from a procedural +macro is by emitting an appropriately spanned invocation of +compile_error! in the generated code. This produces a better diagnostic +message than simply panicking the macro.

+

When parsing macro input, the [parse_macro_input!] macro handles the +conversion to compile_error! automatically.

+ +
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+use syn::{parse_macro_input, AttributeArgs, ItemFn};
+
+#[proc_macro_attribute]
+pub fn my_attr(args: TokenStream, input: TokenStream) -> TokenStream {
+    let args = parse_macro_input!(args as AttributeArgs);
+    let input = parse_macro_input!(input as ItemFn);
+
+    /* ... */
+}
+

For errors that arise later than the initial parsing stage, the +.to_compile_error() method can be used to perform an explicit conversion +to compile_error!.

+ +
+#[proc_macro_derive(MyDerive)]
+pub fn my_derive(input: TokenStream) -> TokenStream {
+    let input = parse_macro_input!(input as DeriveInput);
+
+    // fn(DeriveInput) -> syn::Result<proc_macro2::TokenStream>
+    expand::my_derive(input)
+        .unwrap_or_else(|err| err.to_compile_error())
+        .into()
+}
+

Methods

impl Error[src]

pub fn new<T: Display>(span: Span, message: T) -> Self[src]

Usually the ParseStream::error method will be used instead, which +automatically uses the correct span from the current position of the +parse stream.

+

Use Error::new when the error needs to be triggered on some span other +than where the parse stream is currently positioned.

+

Example

+
+use syn::{Error, Ident, LitStr, Result, Token};
+use syn::parse::ParseStream;
+
+// Parses input that looks like `name = "string"` where the key must be
+// the identifier `name` and the value may be any string literal.
+// Returns the string literal.
+fn parse_name(input: ParseStream) -> Result<LitStr> {
+    let name_token: Ident = input.parse()?;
+    if name_token != "name" {
+        // Trigger an error not on the current position of the stream,
+        // but on the position of the unexpected identifier.
+        return Err(Error::new(name_token.span(), "expected `name`"));
+    }
+    input.parse::<Token![=]>()?;
+    let s: LitStr = input.parse()?;
+    Ok(s)
+}
+

pub fn new_spanned<T: ToTokens, U: Display>(tokens: T, message: U) -> Self[src]

Creates an error with the specified message spanning the given syntax +tree node.

+

Unlike the Error::new constructor, this constructor takes an argument +tokens which is a syntax tree node. This allows the resulting Error +to attempt to span all tokens inside of tokens. While you would +typically be able to use the Spanned trait with the above Error::new +constructor, implementation limitations today mean that +Error::new_spanned may provide a higher-quality error message on +stable Rust.

+

When in doubt it's recommended to stick to Error::new (or +ParseStream::error)!

+

pub fn span(&self) -> Span[src]

The source location of the error.

+

Spans are not thread-safe so this function returns Span::call_site() +if called from a different thread than the one on which the Error was +originally created.

+

pub fn to_compile_error(&self) -> TokenStream[src]

Render the error as an invocation of compile_error!.

+

The [parse_macro_input!] macro provides a convenient way to invoke +this method correctly in a procedural macro.

+

pub fn combine(&mut self, another: Error)[src]

Add another error message to self such that when to_compile_error() is +called, both errors will be emitted together.

+

Trait Implementations

impl Clone for Error[src]

impl Debug for Error[src]

impl Display for Error[src]

impl Error for Error[src]

impl From<LexError> for Error[src]

impl IntoIterator for Error[src]

type Item = Error

The type of the elements being iterated over.

+

type IntoIter = IntoIter

Which kind of iterator are we turning this into?

+

impl<'a> IntoIterator for &'a Error[src]

type Item = Error

The type of the elements being iterated over.

+

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?

+

Auto Trait Implementations

impl !RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl UnwindSafe for Error

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

+

type IntoIter = I

Which kind of iterator are we turning this into?

+

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprArray.html b/syn/struct.ExprArray.html new file mode 100644 index 0000000..5d7daa4 --- /dev/null +++ b/syn/struct.ExprArray.html @@ -0,0 +1,23 @@ +syn::ExprArray - Rust

[][src]Struct syn::ExprArray

pub struct ExprArray { /* fields omitted */ }

A slice literal expression: [a, b, c, d].

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprArray[src]

impl From<ExprArray> for Expr[src]

impl ToTokens for ExprArray[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprAssign.html b/syn/struct.ExprAssign.html new file mode 100644 index 0000000..3e14e3e --- /dev/null +++ b/syn/struct.ExprAssign.html @@ -0,0 +1,23 @@ +syn::ExprAssign - Rust

[][src]Struct syn::ExprAssign

pub struct ExprAssign { /* fields omitted */ }

An assignment expression: a = compute().

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprAssign[src]

impl From<ExprAssign> for Expr[src]

impl ToTokens for ExprAssign[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprAssignOp.html b/syn/struct.ExprAssignOp.html new file mode 100644 index 0000000..6fafdf3 --- /dev/null +++ b/syn/struct.ExprAssignOp.html @@ -0,0 +1,23 @@ +syn::ExprAssignOp - Rust

[][src]Struct syn::ExprAssignOp

pub struct ExprAssignOp { /* fields omitted */ }

A compound assignment expression: counter += 1.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprAssignOp[src]

impl From<ExprAssignOp> for Expr[src]

impl ToTokens for ExprAssignOp[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprAsync.html b/syn/struct.ExprAsync.html new file mode 100644 index 0000000..71cc420 --- /dev/null +++ b/syn/struct.ExprAsync.html @@ -0,0 +1,23 @@ +syn::ExprAsync - Rust

[][src]Struct syn::ExprAsync

pub struct ExprAsync { /* fields omitted */ }

An async block: async { ... }.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprAsync[src]

impl From<ExprAsync> for Expr[src]

impl ToTokens for ExprAsync[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprAwait.html b/syn/struct.ExprAwait.html new file mode 100644 index 0000000..2350421 --- /dev/null +++ b/syn/struct.ExprAwait.html @@ -0,0 +1,23 @@ +syn::ExprAwait - Rust

[][src]Struct syn::ExprAwait

pub struct ExprAwait { /* fields omitted */ }

An await expression: fut.await.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprAwait[src]

impl From<ExprAwait> for Expr[src]

impl ToTokens for ExprAwait[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprBinary.html b/syn/struct.ExprBinary.html new file mode 100644 index 0000000..8b10c7f --- /dev/null +++ b/syn/struct.ExprBinary.html @@ -0,0 +1,30 @@ +syn::ExprBinary - Rust

[][src]Struct syn::ExprBinary

pub struct ExprBinary {
+    pub attrs: Vec<Attribute>,
+    pub left: Box<Expr>,
+    pub op: BinOp,
+    pub right: Box<Expr>,
+}

A binary operation: a + b, a * b.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

attrs: Vec<Attribute>left: Box<Expr>op: BinOpright: Box<Expr>

Trait Implementations

impl Clone for ExprBinary[src]

impl From<ExprBinary> for Expr[src]

impl ToTokens for ExprBinary[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprBlock.html b/syn/struct.ExprBlock.html new file mode 100644 index 0000000..1024f3f --- /dev/null +++ b/syn/struct.ExprBlock.html @@ -0,0 +1,23 @@ +syn::ExprBlock - Rust

[][src]Struct syn::ExprBlock

pub struct ExprBlock { /* fields omitted */ }

A blocked scope: { ... }.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprBlock[src]

impl From<ExprBlock> for Expr[src]

impl ToTokens for ExprBlock[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprBox.html b/syn/struct.ExprBox.html new file mode 100644 index 0000000..4157644 --- /dev/null +++ b/syn/struct.ExprBox.html @@ -0,0 +1,23 @@ +syn::ExprBox - Rust

[][src]Struct syn::ExprBox

pub struct ExprBox { /* fields omitted */ }

A box expression: box f.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprBox[src]

impl From<ExprBox> for Expr[src]

impl ToTokens for ExprBox[src]

Auto Trait Implementations

impl RefUnwindSafe for ExprBox

impl Send for ExprBox

impl Sync for ExprBox

impl Unpin for ExprBox

impl UnwindSafe for ExprBox

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprBreak.html b/syn/struct.ExprBreak.html new file mode 100644 index 0000000..c987589 --- /dev/null +++ b/syn/struct.ExprBreak.html @@ -0,0 +1,24 @@ +syn::ExprBreak - Rust

[][src]Struct syn::ExprBreak

pub struct ExprBreak { /* fields omitted */ }

A break, with an optional label to break and an optional +expression.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprBreak[src]

impl From<ExprBreak> for Expr[src]

impl ToTokens for ExprBreak[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprCall.html b/syn/struct.ExprCall.html new file mode 100644 index 0000000..dc6019c --- /dev/null +++ b/syn/struct.ExprCall.html @@ -0,0 +1,30 @@ +syn::ExprCall - Rust

[][src]Struct syn::ExprCall

pub struct ExprCall {
+    pub attrs: Vec<Attribute>,
+    pub func: Box<Expr>,
+    pub paren_token: Paren,
+    pub args: Punctuated<Expr, Comma>,
+}

A function call expression: invoke(a, b).

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

attrs: Vec<Attribute>func: Box<Expr>paren_token: Parenargs: Punctuated<Expr, Comma>

Trait Implementations

impl Clone for ExprCall[src]

impl From<ExprCall> for Expr[src]

impl ToTokens for ExprCall[src]

Auto Trait Implementations

impl !RefUnwindSafe for ExprCall

impl !Send for ExprCall

impl !Sync for ExprCall

impl Unpin for ExprCall

impl UnwindSafe for ExprCall

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprCast.html b/syn/struct.ExprCast.html new file mode 100644 index 0000000..244ee04 --- /dev/null +++ b/syn/struct.ExprCast.html @@ -0,0 +1,30 @@ +syn::ExprCast - Rust

[][src]Struct syn::ExprCast

pub struct ExprCast {
+    pub attrs: Vec<Attribute>,
+    pub expr: Box<Expr>,
+    pub as_token: As,
+    pub ty: Box<Type>,
+}

A cast expression: foo as f64.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

attrs: Vec<Attribute>expr: Box<Expr>as_token: Asty: Box<Type>

Trait Implementations

impl Clone for ExprCast[src]

impl From<ExprCast> for Expr[src]

impl ToTokens for ExprCast[src]

Auto Trait Implementations

impl !RefUnwindSafe for ExprCast

impl !Send for ExprCast

impl !Sync for ExprCast

impl Unpin for ExprCast

impl UnwindSafe for ExprCast

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprClosure.html b/syn/struct.ExprClosure.html new file mode 100644 index 0000000..7270309 --- /dev/null +++ b/syn/struct.ExprClosure.html @@ -0,0 +1,23 @@ +syn::ExprClosure - Rust

[][src]Struct syn::ExprClosure

pub struct ExprClosure { /* fields omitted */ }

A closure expression: |a, b| a + b.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprClosure[src]

impl From<ExprClosure> for Expr[src]

impl ToTokens for ExprClosure[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprContinue.html b/syn/struct.ExprContinue.html new file mode 100644 index 0000000..12f297a --- /dev/null +++ b/syn/struct.ExprContinue.html @@ -0,0 +1,23 @@ +syn::ExprContinue - Rust

[][src]Struct syn::ExprContinue

pub struct ExprContinue { /* fields omitted */ }

A continue, with an optional label.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprContinue[src]

impl From<ExprContinue> for Expr[src]

impl ToTokens for ExprContinue[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprField.html b/syn/struct.ExprField.html new file mode 100644 index 0000000..386729a --- /dev/null +++ b/syn/struct.ExprField.html @@ -0,0 +1,30 @@ +syn::ExprField - Rust

[][src]Struct syn::ExprField

pub struct ExprField {
+    pub attrs: Vec<Attribute>,
+    pub base: Box<Expr>,
+    pub dot_token: Dot,
+    pub member: Member,
+}

Access of a named struct field (obj.k) or unnamed tuple struct +field (obj.0).

+

This type is available if Syn is built with the "full" feature.

+

+ Fields

attrs: Vec<Attribute>base: Box<Expr>dot_token: Dotmember: Member

Trait Implementations

impl Clone for ExprField[src]

impl From<ExprField> for Expr[src]

impl ToTokens for ExprField[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprForLoop.html b/syn/struct.ExprForLoop.html new file mode 100644 index 0000000..d986633 --- /dev/null +++ b/syn/struct.ExprForLoop.html @@ -0,0 +1,23 @@ +syn::ExprForLoop - Rust

[][src]Struct syn::ExprForLoop

pub struct ExprForLoop { /* fields omitted */ }

A for loop: for pat in expr { ... }.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprForLoop[src]

impl From<ExprForLoop> for Expr[src]

impl ToTokens for ExprForLoop[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprGroup.html b/syn/struct.ExprGroup.html new file mode 100644 index 0000000..15fc352 --- /dev/null +++ b/syn/struct.ExprGroup.html @@ -0,0 +1,26 @@ +syn::ExprGroup - Rust

[][src]Struct syn::ExprGroup

pub struct ExprGroup { /* fields omitted */ }

An expression contained within invisible delimiters.

+

This variant is important for faithfully representing the precedence +of expressions and is related to None-delimited spans in a +TokenStream.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprGroup[src]

impl From<ExprGroup> for Expr[src]

impl ToTokens for ExprGroup[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprIf.html b/syn/struct.ExprIf.html new file mode 100644 index 0000000..fd7991c --- /dev/null +++ b/syn/struct.ExprIf.html @@ -0,0 +1,25 @@ +syn::ExprIf - Rust

[][src]Struct syn::ExprIf

pub struct ExprIf { /* fields omitted */ }

An if expression with an optional else block: if expr { ... } else { ... }.

+

The else branch expression may only be an If or Block +expression, not any of the other types of expression.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprIf[src]

impl From<ExprIf> for Expr[src]

impl ToTokens for ExprIf[src]

Auto Trait Implementations

impl RefUnwindSafe for ExprIf

impl Send for ExprIf

impl Sync for ExprIf

impl Unpin for ExprIf

impl UnwindSafe for ExprIf

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprIndex.html b/syn/struct.ExprIndex.html new file mode 100644 index 0000000..2e8f2e9 --- /dev/null +++ b/syn/struct.ExprIndex.html @@ -0,0 +1,30 @@ +syn::ExprIndex - Rust

[][src]Struct syn::ExprIndex

pub struct ExprIndex {
+    pub attrs: Vec<Attribute>,
+    pub expr: Box<Expr>,
+    pub bracket_token: Bracket,
+    pub index: Box<Expr>,
+}

A square bracketed indexing expression: vector[2].

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

attrs: Vec<Attribute>expr: Box<Expr>bracket_token: Bracketindex: Box<Expr>

Trait Implementations

impl Clone for ExprIndex[src]

impl From<ExprIndex> for Expr[src]

impl ToTokens for ExprIndex[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprLet.html b/syn/struct.ExprLet.html new file mode 100644 index 0000000..d80e1f3 --- /dev/null +++ b/syn/struct.ExprLet.html @@ -0,0 +1,23 @@ +syn::ExprLet - Rust

[][src]Struct syn::ExprLet

pub struct ExprLet { /* fields omitted */ }

A let guard: let Some(x) = opt.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprLet[src]

impl From<ExprLet> for Expr[src]

impl ToTokens for ExprLet[src]

Auto Trait Implementations

impl RefUnwindSafe for ExprLet

impl Send for ExprLet

impl Sync for ExprLet

impl Unpin for ExprLet

impl UnwindSafe for ExprLet

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprLit.html b/syn/struct.ExprLit.html new file mode 100644 index 0000000..7f9f4d4 --- /dev/null +++ b/syn/struct.ExprLit.html @@ -0,0 +1,28 @@ +syn::ExprLit - Rust

[][src]Struct syn::ExprLit

pub struct ExprLit {
+    pub attrs: Vec<Attribute>,
+    pub lit: Lit,
+}

A literal in place of an expression: 1, "foo".

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

attrs: Vec<Attribute>lit: Lit

Trait Implementations

impl Clone for ExprLit[src]

impl From<ExprLit> for Expr[src]

impl Parse for ExprLit[src]

impl ToTokens for ExprLit[src]

Auto Trait Implementations

impl !RefUnwindSafe for ExprLit

impl !Send for ExprLit

impl !Sync for ExprLit

impl Unpin for ExprLit

impl UnwindSafe for ExprLit

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprLoop.html b/syn/struct.ExprLoop.html new file mode 100644 index 0000000..40a7e57 --- /dev/null +++ b/syn/struct.ExprLoop.html @@ -0,0 +1,23 @@ +syn::ExprLoop - Rust

[][src]Struct syn::ExprLoop

pub struct ExprLoop { /* fields omitted */ }

Conditionless loop: loop { ... }.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprLoop[src]

impl From<ExprLoop> for Expr[src]

impl ToTokens for ExprLoop[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprMacro.html b/syn/struct.ExprMacro.html new file mode 100644 index 0000000..81d4ec8 --- /dev/null +++ b/syn/struct.ExprMacro.html @@ -0,0 +1,23 @@ +syn::ExprMacro - Rust

[][src]Struct syn::ExprMacro

pub struct ExprMacro { /* fields omitted */ }

A macro invocation expression: format!("{}", q).

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprMacro[src]

impl From<ExprMacro> for Expr[src]

impl ToTokens for ExprMacro[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprMatch.html b/syn/struct.ExprMatch.html new file mode 100644 index 0000000..30130f1 --- /dev/null +++ b/syn/struct.ExprMatch.html @@ -0,0 +1,23 @@ +syn::ExprMatch - Rust

[][src]Struct syn::ExprMatch

pub struct ExprMatch { /* fields omitted */ }

A match expression: match n { Some(n) => {}, None => {} }.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprMatch[src]

impl From<ExprMatch> for Expr[src]

impl ToTokens for ExprMatch[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprMethodCall.html b/syn/struct.ExprMethodCall.html new file mode 100644 index 0000000..70a8f04 --- /dev/null +++ b/syn/struct.ExprMethodCall.html @@ -0,0 +1,23 @@ +syn::ExprMethodCall - Rust

[][src]Struct syn::ExprMethodCall

pub struct ExprMethodCall { /* fields omitted */ }

A method call expression: x.foo::<T>(a, b).

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprMethodCall[src]

impl From<ExprMethodCall> for Expr[src]

impl ToTokens for ExprMethodCall[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprParen.html b/syn/struct.ExprParen.html new file mode 100644 index 0000000..a62897a --- /dev/null +++ b/syn/struct.ExprParen.html @@ -0,0 +1,28 @@ +syn::ExprParen - Rust

[][src]Struct syn::ExprParen

pub struct ExprParen {
+    pub attrs: Vec<Attribute>,
+    pub paren_token: Paren,
+    pub expr: Box<Expr>,
+}

A parenthesized expression: (a + b).

+

This type is available if Syn is built with the "full" feature.

+

+ Fields

attrs: Vec<Attribute>paren_token: Parenexpr: Box<Expr>

Trait Implementations

impl Clone for ExprParen[src]

impl From<ExprParen> for Expr[src]

impl ToTokens for ExprParen[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprPath.html b/syn/struct.ExprPath.html new file mode 100644 index 0000000..f14c4e1 --- /dev/null +++ b/syn/struct.ExprPath.html @@ -0,0 +1,31 @@ +syn::ExprPath - Rust

[][src]Struct syn::ExprPath

pub struct ExprPath {
+    pub attrs: Vec<Attribute>,
+    pub qself: Option<QSelf>,
+    pub path: Path,
+}

A path like std::mem::replace possibly containing generic +parameters and a qualified self-type.

+

A plain identifier like x is a path of length 1.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

attrs: Vec<Attribute>qself: Option<QSelf>path: Path

Trait Implementations

impl Clone for ExprPath[src]

impl From<ExprPath> for Expr[src]

impl Parse for ExprPath[src]

impl ToTokens for ExprPath[src]

Auto Trait Implementations

impl !RefUnwindSafe for ExprPath

impl !Send for ExprPath

impl !Sync for ExprPath

impl Unpin for ExprPath

impl UnwindSafe for ExprPath

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprRange.html b/syn/struct.ExprRange.html new file mode 100644 index 0000000..40c637a --- /dev/null +++ b/syn/struct.ExprRange.html @@ -0,0 +1,23 @@ +syn::ExprRange - Rust

[][src]Struct syn::ExprRange

pub struct ExprRange { /* fields omitted */ }

A range expression: 1..2, 1.., ..2, 1..=2, ..=2.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprRange[src]

impl From<ExprRange> for Expr[src]

impl ToTokens for ExprRange[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprReference.html b/syn/struct.ExprReference.html new file mode 100644 index 0000000..10e2059 --- /dev/null +++ b/syn/struct.ExprReference.html @@ -0,0 +1,23 @@ +syn::ExprReference - Rust

[][src]Struct syn::ExprReference

pub struct ExprReference { /* fields omitted */ }

A referencing operation: &a or &mut a.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprReference[src]

impl From<ExprReference> for Expr[src]

impl ToTokens for ExprReference[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprRepeat.html b/syn/struct.ExprRepeat.html new file mode 100644 index 0000000..18cc263 --- /dev/null +++ b/syn/struct.ExprRepeat.html @@ -0,0 +1,23 @@ +syn::ExprRepeat - Rust

[][src]Struct syn::ExprRepeat

pub struct ExprRepeat { /* fields omitted */ }

An array literal constructed from one repeated element: [0u8; N].

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprRepeat[src]

impl From<ExprRepeat> for Expr[src]

impl ToTokens for ExprRepeat[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprReturn.html b/syn/struct.ExprReturn.html new file mode 100644 index 0000000..5fe4860 --- /dev/null +++ b/syn/struct.ExprReturn.html @@ -0,0 +1,23 @@ +syn::ExprReturn - Rust

[][src]Struct syn::ExprReturn

pub struct ExprReturn { /* fields omitted */ }

A return, with an optional value to be returned.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprReturn[src]

impl From<ExprReturn> for Expr[src]

impl ToTokens for ExprReturn[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprStruct.html b/syn/struct.ExprStruct.html new file mode 100644 index 0000000..02c5e02 --- /dev/null +++ b/syn/struct.ExprStruct.html @@ -0,0 +1,24 @@ +syn::ExprStruct - Rust

[][src]Struct syn::ExprStruct

pub struct ExprStruct { /* fields omitted */ }

A struct literal expression: Point { x: 1, y: 1 }.

+

The rest provides the value of the remaining fields as in S { a: 1, b: 1, ..rest }.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprStruct[src]

impl From<ExprStruct> for Expr[src]

impl ToTokens for ExprStruct[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprTry.html b/syn/struct.ExprTry.html new file mode 100644 index 0000000..1bdd680 --- /dev/null +++ b/syn/struct.ExprTry.html @@ -0,0 +1,23 @@ +syn::ExprTry - Rust

[][src]Struct syn::ExprTry

pub struct ExprTry { /* fields omitted */ }

A try-expression: expr?.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprTry[src]

impl From<ExprTry> for Expr[src]

impl ToTokens for ExprTry[src]

Auto Trait Implementations

impl RefUnwindSafe for ExprTry

impl Send for ExprTry

impl Sync for ExprTry

impl Unpin for ExprTry

impl UnwindSafe for ExprTry

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprTryBlock.html b/syn/struct.ExprTryBlock.html new file mode 100644 index 0000000..854fb87 --- /dev/null +++ b/syn/struct.ExprTryBlock.html @@ -0,0 +1,23 @@ +syn::ExprTryBlock - Rust

[][src]Struct syn::ExprTryBlock

pub struct ExprTryBlock { /* fields omitted */ }

A try block: try { ... }.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprTryBlock[src]

impl From<ExprTryBlock> for Expr[src]

impl ToTokens for ExprTryBlock[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprTuple.html b/syn/struct.ExprTuple.html new file mode 100644 index 0000000..fb74780 --- /dev/null +++ b/syn/struct.ExprTuple.html @@ -0,0 +1,23 @@ +syn::ExprTuple - Rust

[][src]Struct syn::ExprTuple

pub struct ExprTuple { /* fields omitted */ }

A tuple expression: (a, b, c, d).

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprTuple[src]

impl From<ExprTuple> for Expr[src]

impl ToTokens for ExprTuple[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprType.html b/syn/struct.ExprType.html new file mode 100644 index 0000000..7f55e55 --- /dev/null +++ b/syn/struct.ExprType.html @@ -0,0 +1,23 @@ +syn::ExprType - Rust

[][src]Struct syn::ExprType

pub struct ExprType { /* fields omitted */ }

A type ascription expression: foo: f64.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprType[src]

impl From<ExprType> for Expr[src]

impl ToTokens for ExprType[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprUnary.html b/syn/struct.ExprUnary.html new file mode 100644 index 0000000..5298d37 --- /dev/null +++ b/syn/struct.ExprUnary.html @@ -0,0 +1,29 @@ +syn::ExprUnary - Rust

[][src]Struct syn::ExprUnary

pub struct ExprUnary {
+    pub attrs: Vec<Attribute>,
+    pub op: UnOp,
+    pub expr: Box<Expr>,
+}

A unary operation: !x, *x.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

attrs: Vec<Attribute>op: UnOpexpr: Box<Expr>

Trait Implementations

impl Clone for ExprUnary[src]

impl From<ExprUnary> for Expr[src]

impl ToTokens for ExprUnary[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprUnsafe.html b/syn/struct.ExprUnsafe.html new file mode 100644 index 0000000..4c2dbc1 --- /dev/null +++ b/syn/struct.ExprUnsafe.html @@ -0,0 +1,23 @@ +syn::ExprUnsafe - Rust

[][src]Struct syn::ExprUnsafe

pub struct ExprUnsafe { /* fields omitted */ }

An unsafe block: unsafe { ... }.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprUnsafe[src]

impl From<ExprUnsafe> for Expr[src]

impl ToTokens for ExprUnsafe[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprWhile.html b/syn/struct.ExprWhile.html new file mode 100644 index 0000000..e345de7 --- /dev/null +++ b/syn/struct.ExprWhile.html @@ -0,0 +1,23 @@ +syn::ExprWhile - Rust

[][src]Struct syn::ExprWhile

pub struct ExprWhile { /* fields omitted */ }

A while loop: while expr { ... }.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprWhile[src]

impl From<ExprWhile> for Expr[src]

impl ToTokens for ExprWhile[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ExprYield.html b/syn/struct.ExprYield.html new file mode 100644 index 0000000..b39b462 --- /dev/null +++ b/syn/struct.ExprYield.html @@ -0,0 +1,23 @@ +syn::ExprYield - Rust

[][src]Struct syn::ExprYield

pub struct ExprYield { /* fields omitted */ }

A yield expression: yield expr.

+

This type is available if Syn is built with the "full" feature.

+

Trait Implementations

impl Clone for ExprYield[src]

impl From<ExprYield> for Expr[src]

impl ToTokens for ExprYield[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.Field.html b/syn/struct.Field.html new file mode 100644 index 0000000..250c74b --- /dev/null +++ b/syn/struct.Field.html @@ -0,0 +1,37 @@ +syn::Field - Rust

[][src]Struct syn::Field

pub struct Field {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub ident: Option<Ident>,
+    pub colon_token: Option<Colon>,
+    pub ty: Type,
+}

A field of a struct or enum variant.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

attrs: Vec<Attribute>

Attributes tagged on the field.

+
vis: Visibility

Visibility of the field.

+
ident: Option<Ident>

Name of the field, if any.

+

Fields of tuple structs have no names.

+
colon_token: Option<Colon>ty: Type

Type of the field.

+

Methods

impl Field[src]

pub fn parse_named(input: ParseStream) -> Result<Self>[src]

Parses a named (braced struct) field.

+

pub fn parse_unnamed(input: ParseStream) -> Result<Self>[src]

Parses an unnamed (tuple struct) field.

+

Trait Implementations

impl Clone for Field[src]

impl ToTokens for Field[src]

Auto Trait Implementations

impl !RefUnwindSafe for Field

impl !Send for Field

impl !Sync for Field

impl Unpin for Field

impl UnwindSafe for Field

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.FieldsNamed.html b/syn/struct.FieldsNamed.html new file mode 100644 index 0000000..d8cc78a --- /dev/null +++ b/syn/struct.FieldsNamed.html @@ -0,0 +1,28 @@ +syn::FieldsNamed - Rust

[][src]Struct syn::FieldsNamed

pub struct FieldsNamed {
+    pub brace_token: Brace,
+    pub named: Punctuated<Field, Comma>,
+}

Named fields of a struct or struct variant such as Point { x: f64, y: f64 }.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

brace_token: Bracenamed: Punctuated<Field, Comma>

Trait Implementations

impl Clone for FieldsNamed[src]

impl From<FieldsNamed> for Fields[src]

impl Parse for FieldsNamed[src]

impl ToTokens for FieldsNamed[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.FieldsUnnamed.html b/syn/struct.FieldsUnnamed.html new file mode 100644 index 0000000..7747274 --- /dev/null +++ b/syn/struct.FieldsUnnamed.html @@ -0,0 +1,28 @@ +syn::FieldsUnnamed - Rust

[][src]Struct syn::FieldsUnnamed

pub struct FieldsUnnamed {
+    pub paren_token: Paren,
+    pub unnamed: Punctuated<Field, Comma>,
+}

Unnamed fields of a tuple struct or tuple variant such as Some(T).

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

paren_token: Parenunnamed: Punctuated<Field, Comma>

Trait Implementations

impl Clone for FieldsUnnamed[src]

impl From<FieldsUnnamed> for Fields[src]

impl Parse for FieldsUnnamed[src]

impl ToTokens for FieldsUnnamed[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.Generics.html b/syn/struct.Generics.html new file mode 100644 index 0000000..8833e57 --- /dev/null +++ b/syn/struct.Generics.html @@ -0,0 +1,86 @@ +syn::Generics - Rust

[][src]Struct syn::Generics

pub struct Generics {
+    pub lt_token: Option<Lt>,
+    pub params: Punctuated<GenericParam, Comma>,
+    pub gt_token: Option<Gt>,
+    pub where_clause: Option<WhereClause>,
+}

Lifetimes and type parameters attached to a declaration of a function, +enum, trait, etc.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

lt_token: Option<Lt>params: Punctuated<GenericParam, Comma>gt_token: Option<Gt>where_clause: Option<WhereClause>

Methods

impl Generics[src]

pub fn type_params(&self) -> TypeParams[src]

Returns an +Iterator<Item = &TypeParam> +over the type parameters in self.params.

+

pub fn type_params_mut(&mut self) -> TypeParamsMut[src]

Returns an +Iterator<Item = &mut TypeParam> +over the type parameters in self.params.

+

pub fn lifetimes(&self) -> Lifetimes[src]

Returns an +Iterator<Item = &LifetimeDef> +over the lifetime parameters in self.params.

+

pub fn lifetimes_mut(&mut self) -> LifetimesMut[src]

Returns an +Iterator<Item = &mut LifetimeDef> +over the lifetime parameters in self.params.

+

pub fn const_params(&self) -> ConstParams[src]

Returns an +Iterator<Item = &ConstParam> +over the constant parameters in self.params.

+

pub fn const_params_mut(&mut self) -> ConstParamsMut[src]

Returns an +Iterator<Item = &mut ConstParam> +over the constant parameters in self.params.

+

pub fn make_where_clause(&mut self) -> &mut WhereClause[src]

Initializes an empty where-clause if there is not one present already.

+

impl Generics[src]

pub fn split_for_impl(
    &self
) -> (ImplGenerics, TypeGenerics, Option<&WhereClause>)
[src]

Split a type's generics into the pieces required for impl'ing a trait +for that type.

+ +
+let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
+quote! {
+    impl #impl_generics MyTrait for #name #ty_generics #where_clause {
+        // ...
+    }
+}
+

This method is available if Syn is built with the "derive" or +"full" feature and the "printing" feature.

+

Trait Implementations

impl Clone for Generics[src]

impl Default for Generics[src]

impl Parse for Generics[src]

impl ToTokens for Generics[src]

Auto Trait Implementations

impl !RefUnwindSafe for Generics

impl !Send for Generics

impl !Sync for Generics

impl Unpin for Generics

impl UnwindSafe for Generics

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.Ident.html b/syn/struct.Ident.html new file mode 100644 index 0000000..0100c25 --- /dev/null +++ b/syn/struct.Ident.html @@ -0,0 +1,139 @@ +syn::Ident - Rust

[][src]Struct syn::Ident

pub struct Ident { /* fields omitted */ }

A word of Rust code, which may be a keyword or legal variable name.

+

An identifier consists of at least one Unicode code point, the first of +which has the XID_Start property and the rest of which have the XID_Continue +property.

+
    +
  • The empty string is not an identifier. Use Option<Ident>.
  • +
  • A lifetime is not an identifier. Use syn::Lifetime instead.
  • +
+

An identifier constructed with Ident::new is permitted to be a Rust +keyword, though parsing one through its Parse implementation rejects +Rust keywords. Use input.call(Ident::parse_any) when parsing to match the +behaviour of Ident::new.

+

Examples

+

A new ident can be created from a string using the Ident::new function. +A span must be provided explicitly which governs the name resolution +behavior of the resulting identifier.

+ +
+use proc_macro2::{Ident, Span};
+
+fn main() {
+    let call_ident = Ident::new("calligraphy", Span::call_site());
+
+    println!("{}", call_ident);
+}
+

An ident can be interpolated into a token stream using the quote! macro.

+ +
+use proc_macro2::{Ident, Span};
+use quote::quote;
+
+fn main() {
+    let ident = Ident::new("demo", Span::call_site());
+
+    // Create a variable binding whose name is this ident.
+    let expanded = quote! { let #ident = 10; };
+
+    // Create a variable binding with a slightly different name.
+    let temp_ident = Ident::new(&format!("new_{}", ident), Span::call_site());
+    let expanded = quote! { let #temp_ident = 10; };
+}
+

A string representation of the ident is available through the to_string() +method.

+ +
+// Examine the ident as a string.
+let ident_string = ident.to_string();
+if ident_string.len() > 60 {
+    println!("Very long identifier: {}", ident_string)
+}
+

Methods

impl Ident[src]

pub fn new(string: &str, span: Span) -> Ident[src]

Creates a new Ident with the given string as well as the specified +span.

+

The string argument must be a valid identifier permitted by the +language, otherwise the function will panic.

+

Note that span, currently in rustc, configures the hygiene information +for this identifier.

+

As of this time Span::call_site() explicitly opts-in to "call-site" +hygiene meaning that identifiers created with this span will be resolved +as if they were written directly at the location of the macro call, and +other code at the macro call site will be able to refer to them as well.

+

Later spans like Span::def_site() will allow to opt-in to +"definition-site" hygiene meaning that identifiers created with this +span will be resolved at the location of the macro definition and other +code at the macro call site will not be able to refer to them.

+

Due to the current importance of hygiene this constructor, unlike other +tokens, requires a Span to be specified at construction.

+

Panics

+

Panics if the input string is neither a keyword nor a legal variable +name. If you are not sure whether the string contains an identifier and +need to handle an error case, use +syn::parse_str::<Ident> +rather than Ident::new.

+

pub fn span(&self) -> Span[src]

Returns the span of this Ident.

+

pub fn set_span(&mut self, span: Span)[src]

Configures the span of this Ident, possibly changing its hygiene +context.

+

Trait Implementations

impl Clone for Ident[src]

impl Debug for Ident[src]

impl Display for Ident[src]

Prints the identifier as a string that should be losslessly convertible back +into the same identifier.

+

impl Eq for Ident[src]

impl From<Crate> for Ident[src]

impl From<Extern> for Ident[src]

impl From<Ident> for TokenTree[src]

impl From<Ident> for TypeParam[src]

impl From<SelfType> for Ident[src]

impl From<SelfValue> for Ident[src]

impl From<Super> for Ident[src]

impl From<Underscore> for Ident[src]

impl Hash for Ident[src]

impl IdentExt for Ident[src]

impl IdentFragment for Ident[src]

impl Ord for Ident[src]

impl Parse for Ident[src]

impl PartialEq<Ident> for Ident[src]

impl<T> PartialEq<T> for Ident where
    T: AsRef<str> + ?Sized
[src]

impl PartialOrd<Ident> for Ident[src]

impl ToTokens for Ident[src]

impl Token for Ident[src]

Auto Trait Implementations

impl !RefUnwindSafe for Ident

impl !Send for Ident

impl !Sync for Ident

impl Unpin for Ident

impl UnwindSafe for Ident

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ImplGenerics.html b/syn/struct.ImplGenerics.html new file mode 100644 index 0000000..164c54c --- /dev/null +++ b/syn/struct.ImplGenerics.html @@ -0,0 +1,23 @@ +syn::ImplGenerics - Rust

[][src]Struct syn::ImplGenerics

pub struct ImplGenerics<'a>(_);

Returned by Generics::split_for_impl.

+

This type is available if Syn is built with the "derive" or "full" +feature and the "printing" feature.

+

Trait Implementations

impl<'a> Clone for ImplGenerics<'a>[src]

impl<'a> ToTokens for ImplGenerics<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for ImplGenerics<'a>

impl<'a> !Send for ImplGenerics<'a>

impl<'a> !Sync for ImplGenerics<'a>

impl<'a> Unpin for ImplGenerics<'a>

impl<'a> !UnwindSafe for ImplGenerics<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.Index.html b/syn/struct.Index.html new file mode 100644 index 0000000..91b7271 --- /dev/null +++ b/syn/struct.Index.html @@ -0,0 +1,35 @@ +syn::Index - Rust

[][src]Struct syn::Index

pub struct Index {
+    pub index: u32,
+    pub span: Span,
+}

The index of an unnamed tuple struct field.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

index: u32span: Span

Trait Implementations

impl Clone for Index[src]

impl Eq for Index[src]

impl From<usize> for Index[src]

impl Hash for Index[src]

impl IdentFragment for Index[src]

impl Parse for Index[src]

impl PartialEq<Index> for Index[src]

impl ToTokens for Index[src]

Auto Trait Implementations

impl !RefUnwindSafe for Index

impl !Send for Index

impl !Sync for Index

impl Unpin for Index

impl UnwindSafe for Index

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.Lifetime.html b/syn/struct.Lifetime.html new file mode 100644 index 0000000..48482f5 --- /dev/null +++ b/syn/struct.Lifetime.html @@ -0,0 +1,65 @@ +syn::Lifetime - Rust

[][src]Struct syn::Lifetime

pub struct Lifetime {
+    pub apostrophe: Span,
+    pub ident: Ident,
+}

A Rust lifetime: 'a.

+

Lifetime names must conform to the following rules:

+
    +
  • Must start with an apostrophe.
  • +
  • Must not consist of just an apostrophe: '.
  • +
  • Character after the apostrophe must be _ or a Unicode code point with +the XID_Start property.
  • +
  • All following characters must be Unicode code points with the XID_Continue +property.
  • +
+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

apostrophe: Spanident: Ident

Methods

impl Lifetime[src]

pub fn new(symbol: &str, span: Span) -> Self[src]

Panics

+

Panics if the lifetime does not conform to the bulleted rules above.

+

Invocation

+
+Lifetime::new("'a", Span::call_site())
+

Trait Implementations

impl Clone for Lifetime[src]

impl Display for Lifetime[src]

impl Eq for Lifetime[src]

impl From<Lifetime> for TypeParamBound[src]

impl Hash for Lifetime[src]

impl Ord for Lifetime[src]

impl Parse for Lifetime[src]

impl PartialEq<Lifetime> for Lifetime[src]

impl PartialOrd<Lifetime> for Lifetime[src]

impl ToTokens for Lifetime[src]

impl Token for Lifetime[src]

Auto Trait Implementations

impl !RefUnwindSafe for Lifetime

impl !Send for Lifetime

impl !Sync for Lifetime

impl Unpin for Lifetime

impl UnwindSafe for Lifetime

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.LifetimeDef.html b/syn/struct.LifetimeDef.html new file mode 100644 index 0000000..2569e7e --- /dev/null +++ b/syn/struct.LifetimeDef.html @@ -0,0 +1,30 @@ +syn::LifetimeDef - Rust

[][src]Struct syn::LifetimeDef

pub struct LifetimeDef {
+    pub attrs: Vec<Attribute>,
+    pub lifetime: Lifetime,
+    pub colon_token: Option<Colon>,
+    pub bounds: Punctuated<Lifetime, Add>,
+}

A lifetime definition: 'a: 'b + 'c + 'd.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

attrs: Vec<Attribute>lifetime: Lifetimecolon_token: Option<Colon>bounds: Punctuated<Lifetime, Add>

Methods

impl LifetimeDef[src]

pub fn new(lifetime: Lifetime) -> Self[src]

Trait Implementations

impl Clone for LifetimeDef[src]

impl From<LifetimeDef> for GenericParam[src]

impl Parse for LifetimeDef[src]

impl ToTokens for LifetimeDef[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.LitBool.html b/syn/struct.LitBool.html new file mode 100644 index 0000000..798f018 --- /dev/null +++ b/syn/struct.LitBool.html @@ -0,0 +1,28 @@ +syn::LitBool - Rust

[][src]Struct syn::LitBool

pub struct LitBool {
+    pub value: bool,
+    pub span: Span,
+}

A boolean literal: true or false.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

value: boolspan: Span

Trait Implementations

impl Clone for LitBool[src]

impl From<LitBool> for Lit[src]

impl Parse for LitBool[src]

impl ToTokens for LitBool[src]

impl Token for LitBool[src]

Auto Trait Implementations

impl !RefUnwindSafe for LitBool

impl !Send for LitBool

impl !Sync for LitBool

impl Unpin for LitBool

impl UnwindSafe for LitBool

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.LitByte.html b/syn/struct.LitByte.html new file mode 100644 index 0000000..986016d --- /dev/null +++ b/syn/struct.LitByte.html @@ -0,0 +1,24 @@ +syn::LitByte - Rust

[][src]Struct syn::LitByte

pub struct LitByte { /* fields omitted */ }

A byte literal: b'f'.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

Methods

impl LitByte[src]

pub fn new(value: u8, span: Span) -> Self[src]

pub fn value(&self) -> u8[src]

pub fn span(&self) -> Span[src]

pub fn set_span(&mut self, span: Span)[src]

Trait Implementations

impl Clone for LitByte[src]

impl From<LitByte> for Lit[src]

impl Parse for LitByte[src]

impl ToTokens for LitByte[src]

impl Token for LitByte[src]

Auto Trait Implementations

impl !RefUnwindSafe for LitByte

impl !Send for LitByte

impl !Sync for LitByte

impl Unpin for LitByte

impl UnwindSafe for LitByte

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.LitByteStr.html b/syn/struct.LitByteStr.html new file mode 100644 index 0000000..605643d --- /dev/null +++ b/syn/struct.LitByteStr.html @@ -0,0 +1,24 @@ +syn::LitByteStr - Rust

[][src]Struct syn::LitByteStr

pub struct LitByteStr { /* fields omitted */ }

A byte string literal: b"foo".

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

Methods

impl LitByteStr[src]

pub fn new(value: &[u8], span: Span) -> Self[src]

pub fn value(&self) -> Vec<u8>[src]

pub fn span(&self) -> Span[src]

pub fn set_span(&mut self, span: Span)[src]

Trait Implementations

impl Clone for LitByteStr[src]

impl From<LitByteStr> for Lit[src]

impl Parse for LitByteStr[src]

impl ToTokens for LitByteStr[src]

impl Token for LitByteStr[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.LitChar.html b/syn/struct.LitChar.html new file mode 100644 index 0000000..6c0f330 --- /dev/null +++ b/syn/struct.LitChar.html @@ -0,0 +1,24 @@ +syn::LitChar - Rust

[][src]Struct syn::LitChar

pub struct LitChar { /* fields omitted */ }

A character literal: 'a'.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

Methods

impl LitChar[src]

pub fn new(value: char, span: Span) -> Self[src]

pub fn value(&self) -> char[src]

pub fn span(&self) -> Span[src]

pub fn set_span(&mut self, span: Span)[src]

Trait Implementations

impl Clone for LitChar[src]

impl From<LitChar> for Lit[src]

impl Parse for LitChar[src]

impl ToTokens for LitChar[src]

impl Token for LitChar[src]

Auto Trait Implementations

impl !RefUnwindSafe for LitChar

impl !Send for LitChar

impl !Sync for LitChar

impl Unpin for LitChar

impl UnwindSafe for LitChar

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.LitFloat.html b/syn/struct.LitFloat.html new file mode 100644 index 0000000..c44fc69 --- /dev/null +++ b/syn/struct.LitFloat.html @@ -0,0 +1,28 @@ +syn::LitFloat - Rust

[][src]Struct syn::LitFloat

pub struct LitFloat { /* fields omitted */ }

A floating point literal: 1f64 or 1.0e10f64.

+

Must be finite. May not be infinte or NaN.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

Methods

impl LitFloat[src]

pub fn new(repr: &str, span: Span) -> Self[src]

pub fn base10_digits(&self) -> &str[src]

pub fn base10_parse<N>(&self) -> Result<N> where
    N: FromStr,
    N::Err: Display
[src]

pub fn suffix(&self) -> &str[src]

pub fn span(&self) -> Span[src]

pub fn set_span(&mut self, span: Span)[src]

Trait Implementations

impl Clone for LitFloat[src]

impl Display for LitFloat[src]

impl From<LitFloat> for Lit[src]

impl From<Literal> for LitFloat[src]

impl Parse for LitFloat[src]

impl ToTokens for LitFloat[src]

impl Token for LitFloat[src]

Auto Trait Implementations

impl !RefUnwindSafe for LitFloat

impl !Send for LitFloat

impl !Sync for LitFloat

impl Unpin for LitFloat

impl UnwindSafe for LitFloat

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.LitInt.html b/syn/struct.LitInt.html new file mode 100644 index 0000000..6a4cf38 --- /dev/null +++ b/syn/struct.LitInt.html @@ -0,0 +1,47 @@ +syn::LitInt - Rust

[][src]Struct syn::LitInt

pub struct LitInt { /* fields omitted */ }

An integer literal: 1 or 1u16.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

Methods

impl LitInt[src]

pub fn new(repr: &str, span: Span) -> Self[src]

pub fn base10_digits(&self) -> &str[src]

pub fn base10_parse<N>(&self) -> Result<N> where
    N: FromStr,
    N::Err: Display
[src]

Parses the literal into a selected number type.

+

This is equivalent to lit.base10_digits().parse() except that the +resulting errors will be correctly spanned to point to the literal token +in the macro input.

+ +
+use syn::LitInt;
+use syn::parse::{Parse, ParseStream, Result};
+
+struct Port {
+    value: u16,
+}
+
+impl Parse for Port {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let lit: LitInt = input.parse()?;
+        let value = lit.base10_parse::<u16>()?;
+        Ok(Port { value })
+    }
+}
+

pub fn suffix(&self) -> &str[src]

pub fn span(&self) -> Span[src]

pub fn set_span(&mut self, span: Span)[src]

Trait Implementations

impl Clone for LitInt[src]

impl Display for LitInt[src]

impl From<LitInt> for Lit[src]

impl From<Literal> for LitInt[src]

impl Parse for LitInt[src]

impl ToTokens for LitInt[src]

impl Token for LitInt[src]

Auto Trait Implementations

impl !RefUnwindSafe for LitInt

impl !Send for LitInt

impl !Sync for LitInt

impl Unpin for LitInt

impl UnwindSafe for LitInt

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.LitStr.html b/syn/struct.LitStr.html new file mode 100644 index 0000000..a7a46fc --- /dev/null +++ b/syn/struct.LitStr.html @@ -0,0 +1,60 @@ +syn::LitStr - Rust

[][src]Struct syn::LitStr

pub struct LitStr { /* fields omitted */ }

A UTF-8 string literal: "foo".

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

Methods

impl LitStr[src]

pub fn new(value: &str, span: Span) -> Self[src]

pub fn value(&self) -> String[src]

pub fn parse<T: Parse>(&self) -> Result<T>[src]

Parse a syntax tree node from the content of this string literal.

+

All spans in the syntax tree will point to the span of this LitStr.

+

Example

+
+use proc_macro2::Span;
+use syn::{Attribute, Error, Ident, Lit, Meta, MetaNameValue, Path, Result};
+
+// Parses the path from an attribute that looks like:
+//
+//     #[path = "a::b::c"]
+//
+// or returns `None` if the input is some other attribute.
+fn get_path(attr: &Attribute) -> Result<Option<Path>> {
+    if !attr.path.is_ident("path") {
+        return Ok(None);
+    }
+
+    match attr.parse_meta()? {
+        Meta::NameValue(MetaNameValue { lit: Lit::Str(lit_str), .. }) => {
+            lit_str.parse().map(Some)
+        }
+        _ => {
+            let message = "expected #[path = \"...\"]";
+            Err(Error::new_spanned(attr, message))
+        }
+    }
+}
+

pub fn parse_with<F: Parser>(&self, parser: F) -> Result<F::Output>[src]

Invoke parser on the content of this string literal.

+

All spans in the syntax tree will point to the span of this LitStr.

+

Example

+
+let lit_str: LitStr = /* ... */;
+
+// Parse a string literal like "a::b::c" into a Path, not allowing
+// generic arguments on any of the path segments.
+let basic_path = lit_str.parse_with(syn::Path::parse_mod_style)?;
+

pub fn span(&self) -> Span[src]

pub fn set_span(&mut self, span: Span)[src]

pub fn suffix(&self) -> &str[src]

Trait Implementations

impl Clone for LitStr[src]

impl From<LitStr> for Lit[src]

impl Parse for LitStr[src]

impl ToTokens for LitStr[src]

impl Token for LitStr[src]

Auto Trait Implementations

impl !RefUnwindSafe for LitStr

impl !Send for LitStr

impl !Sync for LitStr

impl Unpin for LitStr

impl UnwindSafe for LitStr

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.Macro.html b/syn/struct.Macro.html new file mode 100644 index 0000000..7ac7c80 --- /dev/null +++ b/syn/struct.Macro.html @@ -0,0 +1,109 @@ +syn::Macro - Rust

[][src]Struct syn::Macro

pub struct Macro {
+    pub path: Path,
+    pub bang_token: Bang,
+    pub delimiter: MacroDelimiter,
+    pub tokens: TokenStream,
+}

A macro invocation: println!("{}", mac).

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

path: Pathbang_token: Bangdelimiter: MacroDelimitertokens: TokenStream

Methods

impl Macro[src]

pub fn parse_body<T: Parse>(&self) -> Result<T>[src]

Parse the tokens within the macro invocation's delimiters into a syntax +tree.

+

This is equivalent to syn::parse2::<T>(mac.tokens) except that it +produces a more useful span when tokens is empty.

+

Example

+
+use syn::{parse_quote, Expr, ExprLit, Ident, Lit, LitStr, Macro, Token};
+use syn::ext::IdentExt;
+use syn::parse::{Error, Parse, ParseStream, Result};
+use syn::punctuated::Punctuated;
+
+// The arguments expected by libcore's format_args macro, and as a
+// result most other formatting and printing macros like println.
+//
+//     println!("{} is {number:.prec$}", "x", prec=5, number=0.01)
+struct FormatArgs {
+    format_string: Expr,
+    positional_args: Vec<Expr>,
+    named_args: Vec<(Ident, Expr)>,
+}
+
+impl Parse for FormatArgs {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let format_string: Expr;
+        let mut positional_args = Vec::new();
+        let mut named_args = Vec::new();
+
+        format_string = input.parse()?;
+        while !input.is_empty() {
+            input.parse::<Token![,]>()?;
+            if input.is_empty() {
+                break;
+            }
+            if input.peek(Ident::peek_any) && input.peek2(Token![=]) {
+                while !input.is_empty() {
+                    let name: Ident = input.call(Ident::parse_any)?;
+                    input.parse::<Token![=]>()?;
+                    let value: Expr = input.parse()?;
+                    named_args.push((name, value));
+                    if input.is_empty() {
+                        break;
+                    }
+                    input.parse::<Token![,]>()?;
+                }
+                break;
+            }
+            positional_args.push(input.parse()?);
+        }
+
+        Ok(FormatArgs {
+            format_string,
+            positional_args,
+            named_args,
+        })
+    }
+}
+
+// Extract the first argument, the format string literal, from an
+// invocation of a formatting or printing macro.
+fn get_format_string(m: &Macro) -> Result<LitStr> {
+    let args: FormatArgs = m.parse_body()?;
+    match args.format_string {
+        Expr::Lit(ExprLit { lit: Lit::Str(lit), .. }) => Ok(lit),
+        other => {
+            // First argument was not a string literal expression.
+            // Maybe something like: println!(concat!(...), ...)
+            Err(Error::new_spanned(other, "format string must be a string literal"))
+        }
+    }
+}
+
+fn main() {
+    let invocation = parse_quote! {
+        println!("{:?}", Instant::now())
+    };
+    let lit = get_format_string(&invocation).unwrap();
+    assert_eq!(lit.value(), "{:?}");
+}
+

pub fn parse_body_with<F: Parser>(&self, parser: F) -> Result<F::Output>[src]

Parse the tokens within the macro invocation's delimiters using the +given parser.

+

Trait Implementations

impl Clone for Macro[src]

impl Parse for Macro[src]

impl ToTokens for Macro[src]

Auto Trait Implementations

impl !RefUnwindSafe for Macro

impl !Send for Macro

impl !Sync for Macro

impl Unpin for Macro

impl UnwindSafe for Macro

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.MetaList.html b/syn/struct.MetaList.html new file mode 100644 index 0000000..f26276f --- /dev/null +++ b/syn/struct.MetaList.html @@ -0,0 +1,29 @@ +syn::MetaList - Rust

[][src]Struct syn::MetaList

pub struct MetaList {
+    pub path: Path,
+    pub paren_token: Paren,
+    pub nested: Punctuated<NestedMeta, Comma>,
+}

A structured list within an attribute, like derive(Copy, Clone).

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

path: Pathparen_token: Parennested: Punctuated<NestedMeta, Comma>

Trait Implementations

impl Clone for MetaList[src]

impl From<MetaList> for Meta[src]

impl Parse for MetaList[src]

impl ToTokens for MetaList[src]

Auto Trait Implementations

impl !RefUnwindSafe for MetaList

impl !Send for MetaList

impl !Sync for MetaList

impl Unpin for MetaList

impl UnwindSafe for MetaList

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.MetaNameValue.html b/syn/struct.MetaNameValue.html new file mode 100644 index 0000000..3f83d93 --- /dev/null +++ b/syn/struct.MetaNameValue.html @@ -0,0 +1,29 @@ +syn::MetaNameValue - Rust

[][src]Struct syn::MetaNameValue

pub struct MetaNameValue {
+    pub path: Path,
+    pub eq_token: Eq,
+    pub lit: Lit,
+}

A name-value pair within an attribute, like feature = "nightly".

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

path: Patheq_token: Eqlit: Lit

Trait Implementations

impl Clone for MetaNameValue[src]

impl From<MetaNameValue> for Meta[src]

impl Parse for MetaNameValue[src]

impl ToTokens for MetaNameValue[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.ParenthesizedGenericArguments.html b/syn/struct.ParenthesizedGenericArguments.html new file mode 100644 index 0000000..4f34fda --- /dev/null +++ b/syn/struct.ParenthesizedGenericArguments.html @@ -0,0 +1,30 @@ +syn::ParenthesizedGenericArguments - Rust

[][src]Struct syn::ParenthesizedGenericArguments

pub struct ParenthesizedGenericArguments {
+    pub paren_token: Paren,
+    pub inputs: Punctuated<Type, Comma>,
+    pub output: ReturnType,
+}

Arguments of a function path segment: the (A, B) -> C in Fn(A,B) -> C.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

paren_token: Pareninputs: Punctuated<Type, Comma>

(A, B)

+
output: ReturnType

C

+

Trait Implementations

impl Clone for ParenthesizedGenericArguments[src]

impl Parse for ParenthesizedGenericArguments[src]

impl ToTokens for ParenthesizedGenericArguments[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.Path.html b/syn/struct.Path.html new file mode 100644 index 0000000..68dadd4 --- /dev/null +++ b/syn/struct.Path.html @@ -0,0 +1,94 @@ +syn::Path - Rust

[][src]Struct syn::Path

pub struct Path {
+    pub leading_colon: Option<Colon2>,
+    pub segments: Punctuated<PathSegment, Colon2>,
+}

A path at which a named item is exported: std::collections::HashMap.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

leading_colon: Option<Colon2>segments: Punctuated<PathSegment, Colon2>

Methods

impl Path[src]

pub fn parse_mod_style(input: ParseStream) -> Result<Self>[src]

Parse a Path containing no path arguments on any of its segments.

+

This function is available if Syn is built with the "parsing" +feature.

+

Example

+
+use syn::{Path, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+// A simplified single `use` statement like:
+//
+//     use std::collections::HashMap;
+//
+// Note that generic parameters are not allowed in a `use` statement
+// so the following must not be accepted.
+//
+//     use a::<b>::c;
+struct SingleUse {
+    use_token: Token![use],
+    path: Path,
+}
+
+impl Parse for SingleUse {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Ok(SingleUse {
+            use_token: input.parse()?,
+            path: input.call(Path::parse_mod_style)?,
+        })
+    }
+}
+

pub fn is_ident<I: ?Sized>(&self, ident: &I) -> bool where
    Ident: PartialEq<I>, 
[src]

Determines whether this is a path of length 1 equal to the given +ident.

+

For them to compare equal, it must be the case that:

+
    +
  • the path has no leading colon,
  • +
  • the number of path segments is 1,
  • +
  • the first path segment has no angle bracketed or parenthesized +path arguments, and
  • +
  • the ident of the first path segment is equal to the given one.
  • +
+

This function is available if Syn is built with the "parsing" +feature.

+

Example

+
+use syn::{Attribute, Error, Meta, NestedMeta, Result};
+
+fn get_serde_meta_items(attr: &Attribute) -> Result<Vec<NestedMeta>> {
+    if attr.path.is_ident("serde") {
+        match attr.parse_meta()? {
+            Meta::List(meta) => Ok(Vec::from_iter(meta.nested)),
+            bad => Err(Error::new_spanned(bad, "unrecognized attribute")),
+        }
+    } else {
+        Ok(Vec::new())
+    }
+}
+

pub fn get_ident(&self) -> Option<&Ident>[src]

If this path consists of a single ident, returns the ident.

+

A path is considered an ident if:

+
    +
  • the path has no leading colon,
  • +
  • the number of path segments is 1, and
  • +
  • the first path segment has no angle bracketed or parenthesized +path arguments.
  • +
+

This function is available if Syn is built with the "parsing" +feature.

+

Trait Implementations

impl Clone for Path[src]

impl From<Path> for Meta[src]

impl<T> From<T> for Path where
    T: Into<PathSegment>, 
[src]

impl Parse for Path[src]

impl ToTokens for Path[src]

Auto Trait Implementations

impl !RefUnwindSafe for Path

impl !Send for Path

impl !Sync for Path

impl Unpin for Path

impl UnwindSafe for Path

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.PathSegment.html b/syn/struct.PathSegment.html new file mode 100644 index 0000000..69b7828 --- /dev/null +++ b/syn/struct.PathSegment.html @@ -0,0 +1,28 @@ +syn::PathSegment - Rust

[][src]Struct syn::PathSegment

pub struct PathSegment {
+    pub ident: Ident,
+    pub arguments: PathArguments,
+}

A segment of a path together with any path arguments on that segment.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

ident: Identarguments: PathArguments

Trait Implementations

impl Clone for PathSegment[src]

impl<T> From<T> for PathSegment where
    T: Into<Ident>, 
[src]

impl Parse for PathSegment[src]

impl ToTokens for PathSegment[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.PredicateEq.html b/syn/struct.PredicateEq.html new file mode 100644 index 0000000..b021c4b --- /dev/null +++ b/syn/struct.PredicateEq.html @@ -0,0 +1,29 @@ +syn::PredicateEq - Rust

[][src]Struct syn::PredicateEq

pub struct PredicateEq {
+    pub lhs_ty: Type,
+    pub eq_token: Eq,
+    pub rhs_ty: Type,
+}

An equality predicate in a where clause (unsupported).

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

lhs_ty: Typeeq_token: Eqrhs_ty: Type

Trait Implementations

impl Clone for PredicateEq[src]

impl From<PredicateEq> for WherePredicate[src]

impl ToTokens for PredicateEq[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.PredicateLifetime.html b/syn/struct.PredicateLifetime.html new file mode 100644 index 0000000..8238559 --- /dev/null +++ b/syn/struct.PredicateLifetime.html @@ -0,0 +1,29 @@ +syn::PredicateLifetime - Rust

[][src]Struct syn::PredicateLifetime

pub struct PredicateLifetime {
+    pub lifetime: Lifetime,
+    pub colon_token: Colon,
+    pub bounds: Punctuated<Lifetime, Add>,
+}

A lifetime predicate in a where clause: 'a: 'b + 'c.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

lifetime: Lifetimecolon_token: Colonbounds: Punctuated<Lifetime, Add>

Trait Implementations

impl Clone for PredicateLifetime[src]

impl From<PredicateLifetime> for WherePredicate[src]

impl ToTokens for PredicateLifetime[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.PredicateType.html b/syn/struct.PredicateType.html new file mode 100644 index 0000000..d6ff49b --- /dev/null +++ b/syn/struct.PredicateType.html @@ -0,0 +1,33 @@ +syn::PredicateType - Rust

[][src]Struct syn::PredicateType

pub struct PredicateType {
+    pub lifetimes: Option<BoundLifetimes>,
+    pub bounded_ty: Type,
+    pub colon_token: Colon,
+    pub bounds: Punctuated<TypeParamBound, Add>,
+}

A type predicate in a where clause: for<'c> Foo<'c>: Trait<'c>.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

lifetimes: Option<BoundLifetimes>

Any lifetimes from a for binding

+
bounded_ty: Type

The type being bounded

+
colon_token: Colonbounds: Punctuated<TypeParamBound, Add>

Trait and lifetime bounds (Clone+Send+'static)

+

Trait Implementations

impl Clone for PredicateType[src]

impl From<PredicateType> for WherePredicate[src]

impl ToTokens for PredicateType[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.QSelf.html b/syn/struct.QSelf.html new file mode 100644 index 0000000..aa9a28c --- /dev/null +++ b/syn/struct.QSelf.html @@ -0,0 +1,37 @@ +syn::QSelf - Rust

[][src]Struct syn::QSelf

pub struct QSelf {
+    pub lt_token: Lt,
+    pub ty: Box<Type>,
+    pub position: usize,
+    pub as_token: Option<As>,
+    pub gt_token: Gt,
+}

The explicit Self type in a qualified path: the T in <T as Display>::fmt.

+

The actual path, including the trait and the associated item, is stored +separately. The position field represents the index of the associated +item qualified with this Self type.

+
<Vec<T> as a::b::Trait>::AssociatedItem
+ ^~~~~~    ~~~~~~~~~~~~~~^
+ ty        position = 3
+
+<Vec<T>>::AssociatedItem
+ ^~~~~~   ^
+ ty       position = 0
+
+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

lt_token: Ltty: Box<Type>position: usizeas_token: Option<As>gt_token: Gt

Trait Implementations

impl Clone for QSelf[src]

Auto Trait Implementations

impl !RefUnwindSafe for QSelf

impl !Send for QSelf

impl !Sync for QSelf

impl Unpin for QSelf

impl UnwindSafe for QSelf

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TraitBound.html b/syn/struct.TraitBound.html new file mode 100644 index 0000000..9a3ba2c --- /dev/null +++ b/syn/struct.TraitBound.html @@ -0,0 +1,32 @@ +syn::TraitBound - Rust

[][src]Struct syn::TraitBound

pub struct TraitBound {
+    pub paren_token: Option<Paren>,
+    pub modifier: TraitBoundModifier,
+    pub lifetimes: Option<BoundLifetimes>,
+    pub path: Path,
+}

A trait used as a bound on a type parameter.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

paren_token: Option<Paren>modifier: TraitBoundModifierlifetimes: Option<BoundLifetimes>

The for<'a> in for<'a> Foo<&'a T>

+
path: Path

The Foo<&'a T> in for<'a> Foo<&'a T>

+

Trait Implementations

impl Clone for TraitBound[src]

impl From<TraitBound> for TypeParamBound[src]

impl Parse for TraitBound[src]

impl ToTokens for TraitBound[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.Turbofish.html b/syn/struct.Turbofish.html new file mode 100644 index 0000000..ca5b879 --- /dev/null +++ b/syn/struct.Turbofish.html @@ -0,0 +1,23 @@ +syn::Turbofish - Rust

[][src]Struct syn::Turbofish

pub struct Turbofish<'a>(_);

Returned by TypeGenerics::as_turbofish.

+

This type is available if Syn is built with the "derive" or "full" +feature and the "printing" feature.

+

Trait Implementations

impl<'a> Clone for Turbofish<'a>[src]

impl<'a> ToTokens for Turbofish<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Turbofish<'a>

impl<'a> !Send for Turbofish<'a>

impl<'a> !Sync for Turbofish<'a>

impl<'a> Unpin for Turbofish<'a>

impl<'a> !UnwindSafe for Turbofish<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypeArray.html b/syn/struct.TypeArray.html new file mode 100644 index 0000000..b062865 --- /dev/null +++ b/syn/struct.TypeArray.html @@ -0,0 +1,30 @@ +syn::TypeArray - Rust

[][src]Struct syn::TypeArray

pub struct TypeArray {
+    pub bracket_token: Bracket,
+    pub elem: Box<Type>,
+    pub semi_token: Semi,
+    pub len: Expr,
+}

A fixed size array type: [T; n].

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

bracket_token: Bracketelem: Box<Type>semi_token: Semilen: Expr

Trait Implementations

impl Clone for TypeArray[src]

impl From<TypeArray> for Type[src]

impl Parse for TypeArray[src]

impl ToTokens for TypeArray[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypeBareFn.html b/syn/struct.TypeBareFn.html new file mode 100644 index 0000000..d8f03fe --- /dev/null +++ b/syn/struct.TypeBareFn.html @@ -0,0 +1,34 @@ +syn::TypeBareFn - Rust

[][src]Struct syn::TypeBareFn

pub struct TypeBareFn {
+    pub lifetimes: Option<BoundLifetimes>,
+    pub unsafety: Option<Unsafe>,
+    pub abi: Option<Abi>,
+    pub fn_token: Fn,
+    pub paren_token: Paren,
+    pub inputs: Punctuated<BareFnArg, Comma>,
+    pub variadic: Option<Variadic>,
+    pub output: ReturnType,
+}

A bare function type: fn(usize) -> bool.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

lifetimes: Option<BoundLifetimes>unsafety: Option<Unsafe>abi: Option<Abi>fn_token: Fnparen_token: Pareninputs: Punctuated<BareFnArg, Comma>variadic: Option<Variadic>output: ReturnType

Trait Implementations

impl Clone for TypeBareFn[src]

impl From<TypeBareFn> for Type[src]

impl Parse for TypeBareFn[src]

impl ToTokens for TypeBareFn[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypeGenerics.html b/syn/struct.TypeGenerics.html new file mode 100644 index 0000000..074f498 --- /dev/null +++ b/syn/struct.TypeGenerics.html @@ -0,0 +1,26 @@ +syn::TypeGenerics - Rust

[][src]Struct syn::TypeGenerics

pub struct TypeGenerics<'a>(_);

Returned by Generics::split_for_impl.

+

This type is available if Syn is built with the "derive" or "full" +feature and the "printing" feature.

+

Methods

impl<'a> TypeGenerics<'a>[src]

pub fn as_turbofish(&self) -> Turbofish[src]

Turn a type's generics like <X, Y> into a turbofish like ::<X, Y>.

+

This method is available if Syn is built with the "derive" or +"full" feature and the "printing" feature.

+

Trait Implementations

impl<'a> Clone for TypeGenerics<'a>[src]

impl<'a> ToTokens for TypeGenerics<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for TypeGenerics<'a>

impl<'a> !Send for TypeGenerics<'a>

impl<'a> !Sync for TypeGenerics<'a>

impl<'a> Unpin for TypeGenerics<'a>

impl<'a> !UnwindSafe for TypeGenerics<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypeGroup.html b/syn/struct.TypeGroup.html new file mode 100644 index 0000000..d934567 --- /dev/null +++ b/syn/struct.TypeGroup.html @@ -0,0 +1,28 @@ +syn::TypeGroup - Rust

[][src]Struct syn::TypeGroup

pub struct TypeGroup {
+    pub group_token: Group,
+    pub elem: Box<Type>,
+}

A type contained within invisible delimiters.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

group_token: Groupelem: Box<Type>

Trait Implementations

impl Clone for TypeGroup[src]

impl From<TypeGroup> for Type[src]

impl Parse for TypeGroup[src]

impl ToTokens for TypeGroup[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypeImplTrait.html b/syn/struct.TypeImplTrait.html new file mode 100644 index 0000000..c7e80d6 --- /dev/null +++ b/syn/struct.TypeImplTrait.html @@ -0,0 +1,29 @@ +syn::TypeImplTrait - Rust

[][src]Struct syn::TypeImplTrait

pub struct TypeImplTrait {
+    pub impl_token: Impl,
+    pub bounds: Punctuated<TypeParamBound, Add>,
+}

An impl Bound1 + Bound2 + Bound3 type where Bound is a trait or +a lifetime.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

impl_token: Implbounds: Punctuated<TypeParamBound, Add>

Trait Implementations

impl Clone for TypeImplTrait[src]

impl From<TypeImplTrait> for Type[src]

impl Parse for TypeImplTrait[src]

impl ToTokens for TypeImplTrait[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypeInfer.html b/syn/struct.TypeInfer.html new file mode 100644 index 0000000..39eb138 --- /dev/null +++ b/syn/struct.TypeInfer.html @@ -0,0 +1,27 @@ +syn::TypeInfer - Rust

[][src]Struct syn::TypeInfer

pub struct TypeInfer {
+    pub underscore_token: Underscore,
+}

Indication that a type should be inferred by the compiler: _.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

underscore_token: Underscore

Trait Implementations

impl Clone for TypeInfer[src]

impl From<TypeInfer> for Type[src]

impl Parse for TypeInfer[src]

impl ToTokens for TypeInfer[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypeMacro.html b/syn/struct.TypeMacro.html new file mode 100644 index 0000000..4c2aae8 --- /dev/null +++ b/syn/struct.TypeMacro.html @@ -0,0 +1,27 @@ +syn::TypeMacro - Rust

[][src]Struct syn::TypeMacro

pub struct TypeMacro {
+    pub mac: Macro,
+}

A macro in the type position.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

mac: Macro

Trait Implementations

impl Clone for TypeMacro[src]

impl From<TypeMacro> for Type[src]

impl Parse for TypeMacro[src]

impl ToTokens for TypeMacro[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypeNever.html b/syn/struct.TypeNever.html new file mode 100644 index 0000000..0b2b633 --- /dev/null +++ b/syn/struct.TypeNever.html @@ -0,0 +1,27 @@ +syn::TypeNever - Rust

[][src]Struct syn::TypeNever

pub struct TypeNever {
+    pub bang_token: Bang,
+}

The never type: !.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

bang_token: Bang

Trait Implementations

impl Clone for TypeNever[src]

impl From<TypeNever> for Type[src]

impl Parse for TypeNever[src]

impl ToTokens for TypeNever[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypeParam.html b/syn/struct.TypeParam.html new file mode 100644 index 0000000..3ac7ad7 --- /dev/null +++ b/syn/struct.TypeParam.html @@ -0,0 +1,33 @@ +syn::TypeParam - Rust

[][src]Struct syn::TypeParam

pub struct TypeParam {
+    pub attrs: Vec<Attribute>,
+    pub ident: Ident,
+    pub colon_token: Option<Colon>,
+    pub bounds: Punctuated<TypeParamBound, Add>,
+    pub eq_token: Option<Eq>,
+    pub default: Option<Type>,
+}

A generic type parameter: T: Into<String>.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

attrs: Vec<Attribute>ident: Identcolon_token: Option<Colon>bounds: Punctuated<TypeParamBound, Add>eq_token: Option<Eq>default: Option<Type>

Trait Implementations

impl Clone for TypeParam[src]

impl From<Ident> for TypeParam[src]

impl From<TypeParam> for GenericParam[src]

impl Parse for TypeParam[src]

impl ToTokens for TypeParam[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypeParen.html b/syn/struct.TypeParen.html new file mode 100644 index 0000000..39ce8eb --- /dev/null +++ b/syn/struct.TypeParen.html @@ -0,0 +1,28 @@ +syn::TypeParen - Rust

[][src]Struct syn::TypeParen

pub struct TypeParen {
+    pub paren_token: Paren,
+    pub elem: Box<Type>,
+}

A parenthesized type equivalent to the inner type.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

paren_token: Parenelem: Box<Type>

Trait Implementations

impl Clone for TypeParen[src]

impl From<TypeParen> for Type[src]

impl Parse for TypeParen[src]

impl ToTokens for TypeParen[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypePath.html b/syn/struct.TypePath.html new file mode 100644 index 0000000..cb27cbf --- /dev/null +++ b/syn/struct.TypePath.html @@ -0,0 +1,29 @@ +syn::TypePath - Rust

[][src]Struct syn::TypePath

pub struct TypePath {
+    pub qself: Option<QSelf>,
+    pub path: Path,
+}

A path like std::slice::Iter, optionally qualified with a +self-type as in <Vec<T> as SomeTrait>::Associated.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

qself: Option<QSelf>path: Path

Trait Implementations

impl Clone for TypePath[src]

impl From<TypePath> for Type[src]

impl Parse for TypePath[src]

impl ToTokens for TypePath[src]

Auto Trait Implementations

impl !RefUnwindSafe for TypePath

impl !Send for TypePath

impl !Sync for TypePath

impl Unpin for TypePath

impl UnwindSafe for TypePath

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypePtr.html b/syn/struct.TypePtr.html new file mode 100644 index 0000000..a0b25eb --- /dev/null +++ b/syn/struct.TypePtr.html @@ -0,0 +1,30 @@ +syn::TypePtr - Rust

[][src]Struct syn::TypePtr

pub struct TypePtr {
+    pub star_token: Star,
+    pub const_token: Option<Const>,
+    pub mutability: Option<Mut>,
+    pub elem: Box<Type>,
+}

A raw pointer type: *const T or *mut T.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

star_token: Starconst_token: Option<Const>mutability: Option<Mut>elem: Box<Type>

Trait Implementations

impl Clone for TypePtr[src]

impl From<TypePtr> for Type[src]

impl Parse for TypePtr[src]

impl ToTokens for TypePtr[src]

Auto Trait Implementations

impl !RefUnwindSafe for TypePtr

impl !Send for TypePtr

impl !Sync for TypePtr

impl Unpin for TypePtr

impl UnwindSafe for TypePtr

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypeReference.html b/syn/struct.TypeReference.html new file mode 100644 index 0000000..33f17aa --- /dev/null +++ b/syn/struct.TypeReference.html @@ -0,0 +1,30 @@ +syn::TypeReference - Rust

[][src]Struct syn::TypeReference

pub struct TypeReference {
+    pub and_token: And,
+    pub lifetime: Option<Lifetime>,
+    pub mutability: Option<Mut>,
+    pub elem: Box<Type>,
+}

A reference type: &'a T or &'a mut T.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

and_token: Andlifetime: Option<Lifetime>mutability: Option<Mut>elem: Box<Type>

Trait Implementations

impl Clone for TypeReference[src]

impl From<TypeReference> for Type[src]

impl Parse for TypeReference[src]

impl ToTokens for TypeReference[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypeSlice.html b/syn/struct.TypeSlice.html new file mode 100644 index 0000000..6a70be2 --- /dev/null +++ b/syn/struct.TypeSlice.html @@ -0,0 +1,28 @@ +syn::TypeSlice - Rust

[][src]Struct syn::TypeSlice

pub struct TypeSlice {
+    pub bracket_token: Bracket,
+    pub elem: Box<Type>,
+}

A dynamically sized slice type: [T].

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

bracket_token: Bracketelem: Box<Type>

Trait Implementations

impl Clone for TypeSlice[src]

impl From<TypeSlice> for Type[src]

impl Parse for TypeSlice[src]

impl ToTokens for TypeSlice[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypeTraitObject.html b/syn/struct.TypeTraitObject.html new file mode 100644 index 0000000..aeb0f96 --- /dev/null +++ b/syn/struct.TypeTraitObject.html @@ -0,0 +1,29 @@ +syn::TypeTraitObject - Rust

[][src]Struct syn::TypeTraitObject

pub struct TypeTraitObject {
+    pub dyn_token: Option<Dyn>,
+    pub bounds: Punctuated<TypeParamBound, Add>,
+}

A trait object type Bound1 + Bound2 + Bound3 where Bound is a +trait or a lifetime.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

dyn_token: Option<Dyn>bounds: Punctuated<TypeParamBound, Add>

Methods

impl TypeTraitObject[src]

pub fn without_plus(input: ParseStream) -> Result<Self>[src]

pub fn parse(input: ParseStream, allow_plus: bool) -> Result<Self>[src]

Trait Implementations

impl Clone for TypeTraitObject[src]

impl From<TypeTraitObject> for Type[src]

impl Parse for TypeTraitObject[src]

impl ToTokens for TypeTraitObject[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.TypeTuple.html b/syn/struct.TypeTuple.html new file mode 100644 index 0000000..cb079b1 --- /dev/null +++ b/syn/struct.TypeTuple.html @@ -0,0 +1,28 @@ +syn::TypeTuple - Rust

[][src]Struct syn::TypeTuple

pub struct TypeTuple {
+    pub paren_token: Paren,
+    pub elems: Punctuated<Type, Comma>,
+}

A tuple type: (A, B, C, String).

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

paren_token: Parenelems: Punctuated<Type, Comma>

Trait Implementations

impl Clone for TypeTuple[src]

impl From<TypeTuple> for Type[src]

impl Parse for TypeTuple[src]

impl ToTokens for TypeTuple[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.Variadic.html b/syn/struct.Variadic.html new file mode 100644 index 0000000..ac7f1b2 --- /dev/null +++ b/syn/struct.Variadic.html @@ -0,0 +1,33 @@ +syn::Variadic - Rust

[][src]Struct syn::Variadic

pub struct Variadic {
+    pub attrs: Vec<Attribute>,
+    pub dots: Dot3,
+}

The variadic argument of a foreign function.

+ +
+extern "C" {
+    fn printf(format: *const c_char, ...) -> c_int;
+    //                               ^^^
+}
+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

attrs: Vec<Attribute>dots: Dot3

Trait Implementations

impl Clone for Variadic[src]

impl ToTokens for Variadic[src]

Auto Trait Implementations

impl !RefUnwindSafe for Variadic

impl !Send for Variadic

impl !Sync for Variadic

impl Unpin for Variadic

impl UnwindSafe for Variadic

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.Variant.html b/syn/struct.Variant.html new file mode 100644 index 0000000..f9cd4a8 --- /dev/null +++ b/syn/struct.Variant.html @@ -0,0 +1,33 @@ +syn::Variant - Rust

[][src]Struct syn::Variant

pub struct Variant {
+    pub attrs: Vec<Attribute>,
+    pub ident: Ident,
+    pub fields: Fields,
+    pub discriminant: Option<(Eq, Expr)>,
+}

An enum variant.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

attrs: Vec<Attribute>

Attributes tagged on the variant.

+
ident: Ident

Name of the variant.

+
fields: Fields

Content stored in the variant.

+
discriminant: Option<(Eq, Expr)>

Explicit discriminant: Variant = 1

+

Trait Implementations

impl Clone for Variant[src]

impl Parse for Variant[src]

impl ToTokens for Variant[src]

Auto Trait Implementations

impl !RefUnwindSafe for Variant

impl !Send for Variant

impl !Sync for Variant

impl Unpin for Variant

impl UnwindSafe for Variant

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.VisCrate.html b/syn/struct.VisCrate.html new file mode 100644 index 0000000..ee5151d --- /dev/null +++ b/syn/struct.VisCrate.html @@ -0,0 +1,27 @@ +syn::VisCrate - Rust

[][src]Struct syn::VisCrate

pub struct VisCrate {
+    pub crate_token: Crate,
+}

A crate-level visibility: crate.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

crate_token: Crate

Trait Implementations

impl Clone for VisCrate[src]

impl From<VisCrate> for Visibility[src]

impl ToTokens for VisCrate[src]

Auto Trait Implementations

impl !RefUnwindSafe for VisCrate

impl !Send for VisCrate

impl !Sync for VisCrate

impl Unpin for VisCrate

impl UnwindSafe for VisCrate

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.VisPublic.html b/syn/struct.VisPublic.html new file mode 100644 index 0000000..7d34edd --- /dev/null +++ b/syn/struct.VisPublic.html @@ -0,0 +1,27 @@ +syn::VisPublic - Rust

[][src]Struct syn::VisPublic

pub struct VisPublic {
+    pub pub_token: Pub,
+}

A public visibility level: pub.

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

pub_token: Pub

Trait Implementations

impl Clone for VisPublic[src]

impl From<VisPublic> for Visibility[src]

impl ToTokens for VisPublic[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.VisRestricted.html b/syn/struct.VisRestricted.html new file mode 100644 index 0000000..3e8b4e3 --- /dev/null +++ b/syn/struct.VisRestricted.html @@ -0,0 +1,31 @@ +syn::VisRestricted - Rust

[][src]Struct syn::VisRestricted

pub struct VisRestricted {
+    pub pub_token: Pub,
+    pub paren_token: Paren,
+    pub in_token: Option<In>,
+    pub path: Box<Path>,
+}

A visibility level restricted to some path: pub(self) or +pub(super) or pub(crate) or pub(in some::module).

+

This type is available if Syn is built with the "derive" or +"full" feature.

+

+ Fields

pub_token: Pubparen_token: Parenin_token: Option<In>path: Box<Path>

Trait Implementations

impl Clone for VisRestricted[src]

impl From<VisRestricted> for Visibility[src]

impl ToTokens for VisRestricted[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/struct.WhereClause.html b/syn/struct.WhereClause.html new file mode 100644 index 0000000..ea450c2 --- /dev/null +++ b/syn/struct.WhereClause.html @@ -0,0 +1,27 @@ +syn::WhereClause - Rust

[][src]Struct syn::WhereClause

pub struct WhereClause {
+    pub where_token: Where,
+    pub predicates: Punctuated<WherePredicate, Comma>,
+}

A where clause in a definition: where T: Deserialize<'de>, D: 'static.

+

This type is available if Syn is built with the "derive" or "full" +feature.

+

+ Fields

where_token: Wherepredicates: Punctuated<WherePredicate, Comma>

Trait Implementations

impl Clone for WhereClause[src]

impl Parse for WhereClause[src]

impl ToTokens for WhereClause[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/index.html b/syn/token/index.html new file mode 100644 index 0000000..df79d8a --- /dev/null +++ b/syn/token/index.html @@ -0,0 +1,172 @@ +syn::token - Rust

[][src]Module syn::token

Tokens representing Rust punctuation, keywords, and delimiters.

+

The type names in this module can be difficult to keep straight, so we +prefer to use the Token! macro instead. This is a type-macro that +expands to the token type of the given token.

+

Example

+

The ItemStatic syntax tree node is defined like this.

+ +
+pub struct ItemStatic {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub static_token: Token![static],
+    pub mutability: Option<Token![mut]>,
+    pub ident: Ident,
+    pub colon_token: Token![:],
+    pub ty: Box<Type>,
+    pub eq_token: Token![=],
+    pub expr: Box<Expr>,
+    pub semi_token: Token![;],
+}
+

Parsing

+

Keywords and punctuation can be parsed through the ParseStream::parse +method. Delimiter tokens are parsed using the parenthesized!, +bracketed! and braced! macros.

+ +
+use syn::{Attribute, Result};
+use syn::parse::{Parse, ParseStream};
+
+// Parse the ItemStatic struct shown above.
+impl Parse for ItemStatic {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Ok(ItemStatic {
+            attrs: input.call(Attribute::parse_outer)?,
+            vis: input.parse()?,
+            static_token: input.parse()?,
+            mutability: input.parse()?,
+            ident: input.parse()?,
+            colon_token: input.parse()?,
+            ty: input.parse()?,
+            eq_token: input.parse()?,
+            expr: input.parse()?,
+            semi_token: input.parse()?,
+        })
+    }
+}
+

Other operations

+

Every keyword and punctuation token supports the following operations.

+
    +
  • +

    Peekinginput.peek(Token![...])

    +
  • +
  • +

    Parsinginput.parse::<Token![...]>()?

    +
  • +
  • +

    Printingquote!( ... #the_token ... )

    +
  • +
  • +

    Construction from a Spanlet the_token = Token![...](sp)

    +
  • +
  • +

    Field access to its span — let sp = the_token.span

    +
  • +
+

Structs

+
Abstract

abstract

+
Add

+

+
AddEq

+=

+
And

&

+
AndAnd

&&

+
AndEq

&=

+
As

as

+
Async

async

+
At

@

+
Auto

auto

+
Await

await

+
Bang

!

+
Become

become

+
Box

box

+
Brace

{...}

+
Bracket

[...]

+
Break

break

+
Caret

^

+
CaretEq

^=

+
Colon

:

+
Colon2

::

+
Comma

,

+
Const

const

+
Continue

continue

+
Crate

crate

+
Default

default

+
Div

/

+
DivEq

/=

+
Do

do

+
Dollar

$

+
Dot

.

+
Dot2

..

+
Dot3

...

+
DotDotEq

..=

+
Dyn

dyn

+
Else

else

+
Enum

enum

+
Eq

=

+
EqEq

==

+
Extern

extern

+
FatArrow

=>

+
Final

final

+
Fn

fn

+
For

for

+
Ge

>=

+
Group

None-delimited group

+
Gt

>

+
If

if

+
Impl

impl

+
In

in

+
LArrow

<-

+
Le

<=

+
Let

let

+
Loop

loop

+
Lt

<

+
Macro

macro

+
Match

match

+
Mod

mod

+
Move

move

+
MulEq

*=

+
Mut

mut

+
Ne

!=

+
Or

|

+
OrEq

|=

+
OrOr

||

+
Override

override

+
Paren

(...)

+
Pound

#

+
Priv

priv

+
Pub

pub

+
Question

?

+
RArrow

->

+
Ref

ref

+
Rem

%

+
RemEq

%=

+
Return

return

+
SelfType

Self

+
SelfValue

self

+
Semi

;

+
Shl

<<

+
ShlEq

<<=

+
Shr

>>

+
ShrEq

>>=

+
Star

*

+
Static

static

+
Struct

struct

+
Sub

-

+
SubEq

-=

+
Super

super

+
Tilde

~

+
Trait

trait

+
Try

try

+
Type

type

+
Typeof

typeof

+
Underscore

_

+
Union

union

+
Unsafe

unsafe

+
Unsized

unsized

+
Use

use

+
Virtual

virtual

+
Where

where

+
While

while

+
Yield

yield

+

Traits

+
Token

Marker trait for types that represent single tokens.

+
\ No newline at end of file diff --git a/syn/token/sidebar-items.js b/syn/token/sidebar-items.js new file mode 100644 index 0000000..060f701 --- /dev/null +++ b/syn/token/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"struct":[["Abstract","`abstract`"],["Add","`+`"],["AddEq","`+=`"],["And","`&`"],["AndAnd","`&&`"],["AndEq","`&=`"],["As","`as`"],["Async","`async`"],["At","`@`"],["Auto","`auto`"],["Await","`await`"],["Bang","`!`"],["Become","`become`"],["Box","`box`"],["Brace","`{...}`"],["Bracket","`[...]`"],["Break","`break`"],["Caret","`^`"],["CaretEq","`^=`"],["Colon","`:`"],["Colon2","`::`"],["Comma","`,`"],["Const","`const`"],["Continue","`continue`"],["Crate","`crate`"],["Default","`default`"],["Div","`/`"],["DivEq","`/=`"],["Do","`do`"],["Dollar","`$`"],["Dot","`.`"],["Dot2","`..`"],["Dot3","`...`"],["DotDotEq","`..=`"],["Dyn","`dyn`"],["Else","`else`"],["Enum","`enum`"],["Eq","`=`"],["EqEq","`==`"],["Extern","`extern`"],["FatArrow","`=>`"],["Final","`final`"],["Fn","`fn`"],["For","`for`"],["Ge","`>=`"],["Group","None-delimited group"],["Gt","`>`"],["If","`if`"],["Impl","`impl`"],["In","`in`"],["LArrow","`<-`"],["Le","`<=`"],["Let","`let`"],["Loop","`loop`"],["Lt","`<`"],["Macro","`macro`"],["Match","`match`"],["Mod","`mod`"],["Move","`move`"],["MulEq","`*=`"],["Mut","`mut`"],["Ne","`!=`"],["Or","`|`"],["OrEq","`|=`"],["OrOr","`||`"],["Override","`override`"],["Paren","`(...)`"],["Pound","`#`"],["Priv","`priv`"],["Pub","`pub`"],["Question","`?`"],["RArrow","`->`"],["Ref","`ref`"],["Rem","`%`"],["RemEq","`%=`"],["Return","`return`"],["SelfType","`Self`"],["SelfValue","`self`"],["Semi","`;`"],["Shl","`<<`"],["ShlEq","`<<=`"],["Shr","`>>`"],["ShrEq","`>>=`"],["Star","`*`"],["Static","`static`"],["Struct","`struct`"],["Sub","`-`"],["SubEq","`-=`"],["Super","`super`"],["Tilde","`~`"],["Trait","`trait`"],["Try","`try`"],["Type","`type`"],["Typeof","`typeof`"],["Underscore","`_`"],["Union","`union`"],["Unsafe","`unsafe`"],["Unsized","`unsized`"],["Use","`use`"],["Virtual","`virtual`"],["Where","`where`"],["While","`while`"],["Yield","`yield`"]],"trait":[["Token","Marker trait for types that represent single tokens."]]}); \ No newline at end of file diff --git a/syn/token/struct.Abstract.html b/syn/token/struct.Abstract.html new file mode 100644 index 0000000..5e09f21 --- /dev/null +++ b/syn/token/struct.Abstract.html @@ -0,0 +1,27 @@ +syn::token::Abstract - Rust

[][src]Struct syn::token::Abstract

pub struct Abstract {
+    pub span: Span,
+}

abstract

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Abstract[src]

impl Copy for Abstract[src]

impl Default for Abstract[src]

impl Parse for Abstract[src]

impl ToTokens for Abstract[src]

impl Token for Abstract[src]

Auto Trait Implementations

impl !RefUnwindSafe for Abstract

impl !Send for Abstract

impl !Sync for Abstract

impl Unpin for Abstract

impl UnwindSafe for Abstract

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Add.html b/syn/token/struct.Add.html new file mode 100644 index 0000000..b9ed1fa --- /dev/null +++ b/syn/token/struct.Add.html @@ -0,0 +1,31 @@ +syn::token::Add - Rust

[][src]Struct syn::token::Add

#[repr(C)]
+pub struct Add {
+    pub spans: [Span; 1],
+}

+

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Add[src]

impl Copy for Add[src]

impl Default for Add[src]

impl Deref for Add[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Add[src]

impl Parse for Add[src]

impl ToTokens for Add[src]

impl Token for Add[src]

Auto Trait Implementations

impl !RefUnwindSafe for Add

impl !Send for Add

impl !Sync for Add

impl Unpin for Add

impl UnwindSafe for Add

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.AddEq.html b/syn/token/struct.AddEq.html new file mode 100644 index 0000000..75271a1 --- /dev/null +++ b/syn/token/struct.AddEq.html @@ -0,0 +1,28 @@ +syn::token::AddEq - Rust

[][src]Struct syn::token::AddEq

#[repr(C)]
+pub struct AddEq {
+    pub spans: [Span; 2],
+}

+=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for AddEq[src]

impl Copy for AddEq[src]

impl Default for AddEq[src]

impl Parse for AddEq[src]

impl ToTokens for AddEq[src]

impl Token for AddEq[src]

Auto Trait Implementations

impl !RefUnwindSafe for AddEq

impl !Send for AddEq

impl !Sync for AddEq

impl Unpin for AddEq

impl UnwindSafe for AddEq

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.And.html b/syn/token/struct.And.html new file mode 100644 index 0000000..bdb7e8e --- /dev/null +++ b/syn/token/struct.And.html @@ -0,0 +1,31 @@ +syn::token::And - Rust

[][src]Struct syn::token::And

#[repr(C)]
+pub struct And {
+    pub spans: [Span; 1],
+}

&

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for And[src]

impl Copy for And[src]

impl Default for And[src]

impl Deref for And[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for And[src]

impl Parse for And[src]

impl ToTokens for And[src]

impl Token for And[src]

Auto Trait Implementations

impl !RefUnwindSafe for And

impl !Send for And

impl !Sync for And

impl Unpin for And

impl UnwindSafe for And

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.AndAnd.html b/syn/token/struct.AndAnd.html new file mode 100644 index 0000000..f514a84 --- /dev/null +++ b/syn/token/struct.AndAnd.html @@ -0,0 +1,28 @@ +syn::token::AndAnd - Rust

[][src]Struct syn::token::AndAnd

#[repr(C)]
+pub struct AndAnd {
+    pub spans: [Span; 2],
+}

&&

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for AndAnd[src]

impl Copy for AndAnd[src]

impl Default for AndAnd[src]

impl Parse for AndAnd[src]

impl ToTokens for AndAnd[src]

impl Token for AndAnd[src]

Auto Trait Implementations

impl !RefUnwindSafe for AndAnd

impl !Send for AndAnd

impl !Sync for AndAnd

impl Unpin for AndAnd

impl UnwindSafe for AndAnd

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.AndEq.html b/syn/token/struct.AndEq.html new file mode 100644 index 0000000..dc6aedb --- /dev/null +++ b/syn/token/struct.AndEq.html @@ -0,0 +1,28 @@ +syn::token::AndEq - Rust

[][src]Struct syn::token::AndEq

#[repr(C)]
+pub struct AndEq {
+    pub spans: [Span; 2],
+}

&=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for AndEq[src]

impl Copy for AndEq[src]

impl Default for AndEq[src]

impl Parse for AndEq[src]

impl ToTokens for AndEq[src]

impl Token for AndEq[src]

Auto Trait Implementations

impl !RefUnwindSafe for AndEq

impl !Send for AndEq

impl !Sync for AndEq

impl Unpin for AndEq

impl UnwindSafe for AndEq

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.As.html b/syn/token/struct.As.html new file mode 100644 index 0000000..e8b2115 --- /dev/null +++ b/syn/token/struct.As.html @@ -0,0 +1,27 @@ +syn::token::As - Rust

[][src]Struct syn::token::As

pub struct As {
+    pub span: Span,
+}

as

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for As[src]

impl Copy for As[src]

impl Default for As[src]

impl Parse for As[src]

impl ToTokens for As[src]

impl Token for As[src]

Auto Trait Implementations

impl !RefUnwindSafe for As

impl !Send for As

impl !Sync for As

impl Unpin for As

impl UnwindSafe for As

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Async.html b/syn/token/struct.Async.html new file mode 100644 index 0000000..73a7b92 --- /dev/null +++ b/syn/token/struct.Async.html @@ -0,0 +1,27 @@ +syn::token::Async - Rust

[][src]Struct syn::token::Async

pub struct Async {
+    pub span: Span,
+}

async

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Async[src]

impl Copy for Async[src]

impl Default for Async[src]

impl Parse for Async[src]

impl ToTokens for Async[src]

impl Token for Async[src]

Auto Trait Implementations

impl !RefUnwindSafe for Async

impl !Send for Async

impl !Sync for Async

impl Unpin for Async

impl UnwindSafe for Async

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.At.html b/syn/token/struct.At.html new file mode 100644 index 0000000..bf04453 --- /dev/null +++ b/syn/token/struct.At.html @@ -0,0 +1,31 @@ +syn::token::At - Rust

[][src]Struct syn::token::At

#[repr(C)]
+pub struct At {
+    pub spans: [Span; 1],
+}

@

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for At[src]

impl Copy for At[src]

impl Default for At[src]

impl Deref for At[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for At[src]

impl Parse for At[src]

impl ToTokens for At[src]

impl Token for At[src]

Auto Trait Implementations

impl !RefUnwindSafe for At

impl !Send for At

impl !Sync for At

impl Unpin for At

impl UnwindSafe for At

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Auto.html b/syn/token/struct.Auto.html new file mode 100644 index 0000000..49aa083 --- /dev/null +++ b/syn/token/struct.Auto.html @@ -0,0 +1,27 @@ +syn::token::Auto - Rust

[][src]Struct syn::token::Auto

pub struct Auto {
+    pub span: Span,
+}

auto

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Auto[src]

impl Copy for Auto[src]

impl Default for Auto[src]

impl Parse for Auto[src]

impl ToTokens for Auto[src]

impl Token for Auto[src]

Auto Trait Implementations

impl !RefUnwindSafe for Auto

impl !Send for Auto

impl !Sync for Auto

impl Unpin for Auto

impl UnwindSafe for Auto

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Await.html b/syn/token/struct.Await.html new file mode 100644 index 0000000..043cf37 --- /dev/null +++ b/syn/token/struct.Await.html @@ -0,0 +1,27 @@ +syn::token::Await - Rust

[][src]Struct syn::token::Await

pub struct Await {
+    pub span: Span,
+}

await

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Await[src]

impl Copy for Await[src]

impl Default for Await[src]

impl Parse for Await[src]

impl ToTokens for Await[src]

impl Token for Await[src]

Auto Trait Implementations

impl !RefUnwindSafe for Await

impl !Send for Await

impl !Sync for Await

impl Unpin for Await

impl UnwindSafe for Await

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Bang.html b/syn/token/struct.Bang.html new file mode 100644 index 0000000..ed2a8a6 --- /dev/null +++ b/syn/token/struct.Bang.html @@ -0,0 +1,31 @@ +syn::token::Bang - Rust

[][src]Struct syn::token::Bang

#[repr(C)]
+pub struct Bang {
+    pub spans: [Span; 1],
+}

!

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Bang[src]

impl Copy for Bang[src]

impl Default for Bang[src]

impl Deref for Bang[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Bang[src]

impl Parse for Bang[src]

impl ToTokens for Bang[src]

impl Token for Bang[src]

Auto Trait Implementations

impl !RefUnwindSafe for Bang

impl !Send for Bang

impl !Sync for Bang

impl Unpin for Bang

impl UnwindSafe for Bang

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Become.html b/syn/token/struct.Become.html new file mode 100644 index 0000000..7ba869c --- /dev/null +++ b/syn/token/struct.Become.html @@ -0,0 +1,27 @@ +syn::token::Become - Rust

[][src]Struct syn::token::Become

pub struct Become {
+    pub span: Span,
+}

become

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Become[src]

impl Copy for Become[src]

impl Default for Become[src]

impl Parse for Become[src]

impl ToTokens for Become[src]

impl Token for Become[src]

Auto Trait Implementations

impl !RefUnwindSafe for Become

impl !Send for Become

impl !Sync for Become

impl Unpin for Become

impl UnwindSafe for Become

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Box.html b/syn/token/struct.Box.html new file mode 100644 index 0000000..12a715e --- /dev/null +++ b/syn/token/struct.Box.html @@ -0,0 +1,27 @@ +syn::token::Box - Rust

[][src]Struct syn::token::Box

pub struct Box {
+    pub span: Span,
+}

box

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Box[src]

impl Copy for Box[src]

impl Default for Box[src]

impl Parse for Box[src]

impl ToTokens for Box[src]

impl Token for Box[src]

Auto Trait Implementations

impl !RefUnwindSafe for Box

impl !Send for Box

impl !Sync for Box

impl Unpin for Box

impl UnwindSafe for Box

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Brace.html b/syn/token/struct.Brace.html new file mode 100644 index 0000000..94ba0b3 --- /dev/null +++ b/syn/token/struct.Brace.html @@ -0,0 +1,21 @@ +syn::token::Brace - Rust

[][src]Struct syn::token::Brace

pub struct Brace {
+    pub span: Span,
+}

{...}

+

+ Fields

span: Span

Methods

impl Brace[src]

pub fn surround<F>(&self, tokens: &mut TokenStream, f: F) where
    F: FnOnce(&mut TokenStream), 
[src]

Trait Implementations

impl Clone for Brace[src]

impl Copy for Brace[src]

impl Default for Brace[src]

impl Token for Brace[src]

Auto Trait Implementations

impl !RefUnwindSafe for Brace

impl !Send for Brace

impl !Sync for Brace

impl Unpin for Brace

impl UnwindSafe for Brace

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Bracket.html b/syn/token/struct.Bracket.html new file mode 100644 index 0000000..56e4200 --- /dev/null +++ b/syn/token/struct.Bracket.html @@ -0,0 +1,21 @@ +syn::token::Bracket - Rust

[][src]Struct syn::token::Bracket

pub struct Bracket {
+    pub span: Span,
+}

[...]

+

+ Fields

span: Span

Methods

impl Bracket[src]

pub fn surround<F>(&self, tokens: &mut TokenStream, f: F) where
    F: FnOnce(&mut TokenStream), 
[src]

Trait Implementations

impl Clone for Bracket[src]

impl Copy for Bracket[src]

impl Default for Bracket[src]

impl Token for Bracket[src]

Auto Trait Implementations

impl !RefUnwindSafe for Bracket

impl !Send for Bracket

impl !Sync for Bracket

impl Unpin for Bracket

impl UnwindSafe for Bracket

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Break.html b/syn/token/struct.Break.html new file mode 100644 index 0000000..b456329 --- /dev/null +++ b/syn/token/struct.Break.html @@ -0,0 +1,27 @@ +syn::token::Break - Rust

[][src]Struct syn::token::Break

pub struct Break {
+    pub span: Span,
+}

break

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Break[src]

impl Copy for Break[src]

impl Default for Break[src]

impl Parse for Break[src]

impl ToTokens for Break[src]

impl Token for Break[src]

Auto Trait Implementations

impl !RefUnwindSafe for Break

impl !Send for Break

impl !Sync for Break

impl Unpin for Break

impl UnwindSafe for Break

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Caret.html b/syn/token/struct.Caret.html new file mode 100644 index 0000000..a50d908 --- /dev/null +++ b/syn/token/struct.Caret.html @@ -0,0 +1,31 @@ +syn::token::Caret - Rust

[][src]Struct syn::token::Caret

#[repr(C)]
+pub struct Caret {
+    pub spans: [Span; 1],
+}

^

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Caret[src]

impl Copy for Caret[src]

impl Default for Caret[src]

impl Deref for Caret[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Caret[src]

impl Parse for Caret[src]

impl ToTokens for Caret[src]

impl Token for Caret[src]

Auto Trait Implementations

impl !RefUnwindSafe for Caret

impl !Send for Caret

impl !Sync for Caret

impl Unpin for Caret

impl UnwindSafe for Caret

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.CaretEq.html b/syn/token/struct.CaretEq.html new file mode 100644 index 0000000..1643d68 --- /dev/null +++ b/syn/token/struct.CaretEq.html @@ -0,0 +1,28 @@ +syn::token::CaretEq - Rust

[][src]Struct syn::token::CaretEq

#[repr(C)]
+pub struct CaretEq {
+    pub spans: [Span; 2],
+}

^=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for CaretEq[src]

impl Copy for CaretEq[src]

impl Default for CaretEq[src]

impl Parse for CaretEq[src]

impl ToTokens for CaretEq[src]

impl Token for CaretEq[src]

Auto Trait Implementations

impl !RefUnwindSafe for CaretEq

impl !Send for CaretEq

impl !Sync for CaretEq

impl Unpin for CaretEq

impl UnwindSafe for CaretEq

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Colon.html b/syn/token/struct.Colon.html new file mode 100644 index 0000000..031f041 --- /dev/null +++ b/syn/token/struct.Colon.html @@ -0,0 +1,31 @@ +syn::token::Colon - Rust

[][src]Struct syn::token::Colon

#[repr(C)]
+pub struct Colon {
+    pub spans: [Span; 1],
+}

:

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Colon[src]

impl Copy for Colon[src]

impl Default for Colon[src]

impl Deref for Colon[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Colon[src]

impl Parse for Colon[src]

impl ToTokens for Colon[src]

impl Token for Colon[src]

Auto Trait Implementations

impl !RefUnwindSafe for Colon

impl !Send for Colon

impl !Sync for Colon

impl Unpin for Colon

impl UnwindSafe for Colon

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Colon2.html b/syn/token/struct.Colon2.html new file mode 100644 index 0000000..467c4e2 --- /dev/null +++ b/syn/token/struct.Colon2.html @@ -0,0 +1,28 @@ +syn::token::Colon2 - Rust

[][src]Struct syn::token::Colon2

#[repr(C)]
+pub struct Colon2 {
+    pub spans: [Span; 2],
+}

::

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for Colon2[src]

impl Copy for Colon2[src]

impl Default for Colon2[src]

impl Parse for Colon2[src]

impl ToTokens for Colon2[src]

impl Token for Colon2[src]

Auto Trait Implementations

impl !RefUnwindSafe for Colon2

impl !Send for Colon2

impl !Sync for Colon2

impl Unpin for Colon2

impl UnwindSafe for Colon2

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Comma.html b/syn/token/struct.Comma.html new file mode 100644 index 0000000..d032770 --- /dev/null +++ b/syn/token/struct.Comma.html @@ -0,0 +1,31 @@ +syn::token::Comma - Rust

[][src]Struct syn::token::Comma

#[repr(C)]
+pub struct Comma {
+    pub spans: [Span; 1],
+}

,

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Comma[src]

impl Copy for Comma[src]

impl Default for Comma[src]

impl Deref for Comma[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Comma[src]

impl Parse for Comma[src]

impl ToTokens for Comma[src]

impl Token for Comma[src]

Auto Trait Implementations

impl !RefUnwindSafe for Comma

impl !Send for Comma

impl !Sync for Comma

impl Unpin for Comma

impl UnwindSafe for Comma

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Const.html b/syn/token/struct.Const.html new file mode 100644 index 0000000..2c7fcc0 --- /dev/null +++ b/syn/token/struct.Const.html @@ -0,0 +1,27 @@ +syn::token::Const - Rust

[][src]Struct syn::token::Const

pub struct Const {
+    pub span: Span,
+}

const

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Const[src]

impl Copy for Const[src]

impl Default for Const[src]

impl Parse for Const[src]

impl ToTokens for Const[src]

impl Token for Const[src]

Auto Trait Implementations

impl !RefUnwindSafe for Const

impl !Send for Const

impl !Sync for Const

impl Unpin for Const

impl UnwindSafe for Const

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Continue.html b/syn/token/struct.Continue.html new file mode 100644 index 0000000..6772a54 --- /dev/null +++ b/syn/token/struct.Continue.html @@ -0,0 +1,27 @@ +syn::token::Continue - Rust

[][src]Struct syn::token::Continue

pub struct Continue {
+    pub span: Span,
+}

continue

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Continue[src]

impl Copy for Continue[src]

impl Default for Continue[src]

impl Parse for Continue[src]

impl ToTokens for Continue[src]

impl Token for Continue[src]

Auto Trait Implementations

impl !RefUnwindSafe for Continue

impl !Send for Continue

impl !Sync for Continue

impl Unpin for Continue

impl UnwindSafe for Continue

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Crate.html b/syn/token/struct.Crate.html new file mode 100644 index 0000000..9b0a09d --- /dev/null +++ b/syn/token/struct.Crate.html @@ -0,0 +1,28 @@ +syn::token::Crate - Rust

[][src]Struct syn::token::Crate

pub struct Crate {
+    pub span: Span,
+}

crate

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Crate[src]

impl Copy for Crate[src]

impl Default for Crate[src]

impl From<Crate> for Ident[src]

impl Parse for Crate[src]

impl ToTokens for Crate[src]

impl Token for Crate[src]

Auto Trait Implementations

impl !RefUnwindSafe for Crate

impl !Send for Crate

impl !Sync for Crate

impl Unpin for Crate

impl UnwindSafe for Crate

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Default.html b/syn/token/struct.Default.html new file mode 100644 index 0000000..641a7e3 --- /dev/null +++ b/syn/token/struct.Default.html @@ -0,0 +1,27 @@ +syn::token::Default - Rust

[][src]Struct syn::token::Default

pub struct Default {
+    pub span: Span,
+}

default

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Default[src]

impl Copy for Default[src]

impl Default for Default[src]

impl Parse for Default[src]

impl ToTokens for Default[src]

impl Token for Default[src]

Auto Trait Implementations

impl !RefUnwindSafe for Default

impl !Send for Default

impl !Sync for Default

impl Unpin for Default

impl UnwindSafe for Default

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Div.html b/syn/token/struct.Div.html new file mode 100644 index 0000000..93f32c2 --- /dev/null +++ b/syn/token/struct.Div.html @@ -0,0 +1,31 @@ +syn::token::Div - Rust

[][src]Struct syn::token::Div

#[repr(C)]
+pub struct Div {
+    pub spans: [Span; 1],
+}

/

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Div[src]

impl Copy for Div[src]

impl Default for Div[src]

impl Deref for Div[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Div[src]

impl Parse for Div[src]

impl ToTokens for Div[src]

impl Token for Div[src]

Auto Trait Implementations

impl !RefUnwindSafe for Div

impl !Send for Div

impl !Sync for Div

impl Unpin for Div

impl UnwindSafe for Div

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.DivEq.html b/syn/token/struct.DivEq.html new file mode 100644 index 0000000..14f4a4b --- /dev/null +++ b/syn/token/struct.DivEq.html @@ -0,0 +1,28 @@ +syn::token::DivEq - Rust

[][src]Struct syn::token::DivEq

#[repr(C)]
+pub struct DivEq {
+    pub spans: [Span; 2],
+}

/=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for DivEq[src]

impl Copy for DivEq[src]

impl Default for DivEq[src]

impl Parse for DivEq[src]

impl ToTokens for DivEq[src]

impl Token for DivEq[src]

Auto Trait Implementations

impl !RefUnwindSafe for DivEq

impl !Send for DivEq

impl !Sync for DivEq

impl Unpin for DivEq

impl UnwindSafe for DivEq

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Do.html b/syn/token/struct.Do.html new file mode 100644 index 0000000..f695986 --- /dev/null +++ b/syn/token/struct.Do.html @@ -0,0 +1,27 @@ +syn::token::Do - Rust

[][src]Struct syn::token::Do

pub struct Do {
+    pub span: Span,
+}

do

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Do[src]

impl Copy for Do[src]

impl Default for Do[src]

impl Parse for Do[src]

impl ToTokens for Do[src]

impl Token for Do[src]

Auto Trait Implementations

impl !RefUnwindSafe for Do

impl !Send for Do

impl !Sync for Do

impl Unpin for Do

impl UnwindSafe for Do

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Dollar.html b/syn/token/struct.Dollar.html new file mode 100644 index 0000000..3b8550c --- /dev/null +++ b/syn/token/struct.Dollar.html @@ -0,0 +1,31 @@ +syn::token::Dollar - Rust

[][src]Struct syn::token::Dollar

#[repr(C)]
+pub struct Dollar {
+    pub spans: [Span; 1],
+}

$

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Dollar[src]

impl Copy for Dollar[src]

impl Default for Dollar[src]

impl Deref for Dollar[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Dollar[src]

impl Parse for Dollar[src]

impl ToTokens for Dollar[src]

impl Token for Dollar[src]

Auto Trait Implementations

impl !RefUnwindSafe for Dollar

impl !Send for Dollar

impl !Sync for Dollar

impl Unpin for Dollar

impl UnwindSafe for Dollar

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Dot.html b/syn/token/struct.Dot.html new file mode 100644 index 0000000..7735b1e --- /dev/null +++ b/syn/token/struct.Dot.html @@ -0,0 +1,31 @@ +syn::token::Dot - Rust

[][src]Struct syn::token::Dot

#[repr(C)]
+pub struct Dot {
+    pub spans: [Span; 1],
+}

.

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Dot[src]

impl Copy for Dot[src]

impl Default for Dot[src]

impl Deref for Dot[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Dot[src]

impl Parse for Dot[src]

impl ToTokens for Dot[src]

impl Token for Dot[src]

Auto Trait Implementations

impl !RefUnwindSafe for Dot

impl !Send for Dot

impl !Sync for Dot

impl Unpin for Dot

impl UnwindSafe for Dot

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Dot2.html b/syn/token/struct.Dot2.html new file mode 100644 index 0000000..672acfb --- /dev/null +++ b/syn/token/struct.Dot2.html @@ -0,0 +1,28 @@ +syn::token::Dot2 - Rust

[][src]Struct syn::token::Dot2

#[repr(C)]
+pub struct Dot2 {
+    pub spans: [Span; 2],
+}

..

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for Dot2[src]

impl Copy for Dot2[src]

impl Default for Dot2[src]

impl Parse for Dot2[src]

impl ToTokens for Dot2[src]

impl Token for Dot2[src]

Auto Trait Implementations

impl !RefUnwindSafe for Dot2

impl !Send for Dot2

impl !Sync for Dot2

impl Unpin for Dot2

impl UnwindSafe for Dot2

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Dot3.html b/syn/token/struct.Dot3.html new file mode 100644 index 0000000..97befff --- /dev/null +++ b/syn/token/struct.Dot3.html @@ -0,0 +1,28 @@ +syn::token::Dot3 - Rust

[][src]Struct syn::token::Dot3

#[repr(C)]
+pub struct Dot3 {
+    pub spans: [Span; 3],
+}

...

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 3]

Trait Implementations

impl Clone for Dot3[src]

impl Copy for Dot3[src]

impl Default for Dot3[src]

impl Parse for Dot3[src]

impl ToTokens for Dot3[src]

impl Token for Dot3[src]

Auto Trait Implementations

impl !RefUnwindSafe for Dot3

impl !Send for Dot3

impl !Sync for Dot3

impl Unpin for Dot3

impl UnwindSafe for Dot3

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.DotDotEq.html b/syn/token/struct.DotDotEq.html new file mode 100644 index 0000000..573cdc7 --- /dev/null +++ b/syn/token/struct.DotDotEq.html @@ -0,0 +1,28 @@ +syn::token::DotDotEq - Rust

[][src]Struct syn::token::DotDotEq

#[repr(C)]
+pub struct DotDotEq {
+    pub spans: [Span; 3],
+}

..=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 3]

Trait Implementations

impl Clone for DotDotEq[src]

impl Copy for DotDotEq[src]

impl Default for DotDotEq[src]

impl Parse for DotDotEq[src]

impl ToTokens for DotDotEq[src]

impl Token for DotDotEq[src]

Auto Trait Implementations

impl !RefUnwindSafe for DotDotEq

impl !Send for DotDotEq

impl !Sync for DotDotEq

impl Unpin for DotDotEq

impl UnwindSafe for DotDotEq

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Dyn.html b/syn/token/struct.Dyn.html new file mode 100644 index 0000000..79cd969 --- /dev/null +++ b/syn/token/struct.Dyn.html @@ -0,0 +1,27 @@ +syn::token::Dyn - Rust

[][src]Struct syn::token::Dyn

pub struct Dyn {
+    pub span: Span,
+}

dyn

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Dyn[src]

impl Copy for Dyn[src]

impl Default for Dyn[src]

impl Parse for Dyn[src]

impl ToTokens for Dyn[src]

impl Token for Dyn[src]

Auto Trait Implementations

impl !RefUnwindSafe for Dyn

impl !Send for Dyn

impl !Sync for Dyn

impl Unpin for Dyn

impl UnwindSafe for Dyn

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Else.html b/syn/token/struct.Else.html new file mode 100644 index 0000000..ad63b48 --- /dev/null +++ b/syn/token/struct.Else.html @@ -0,0 +1,27 @@ +syn::token::Else - Rust

[][src]Struct syn::token::Else

pub struct Else {
+    pub span: Span,
+}

else

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Else[src]

impl Copy for Else[src]

impl Default for Else[src]

impl Parse for Else[src]

impl ToTokens for Else[src]

impl Token for Else[src]

Auto Trait Implementations

impl !RefUnwindSafe for Else

impl !Send for Else

impl !Sync for Else

impl Unpin for Else

impl UnwindSafe for Else

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Enum.html b/syn/token/struct.Enum.html new file mode 100644 index 0000000..329d34c --- /dev/null +++ b/syn/token/struct.Enum.html @@ -0,0 +1,27 @@ +syn::token::Enum - Rust

[][src]Struct syn::token::Enum

pub struct Enum {
+    pub span: Span,
+}

enum

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Enum[src]

impl Copy for Enum[src]

impl Default for Enum[src]

impl Parse for Enum[src]

impl ToTokens for Enum[src]

impl Token for Enum[src]

Auto Trait Implementations

impl !RefUnwindSafe for Enum

impl !Send for Enum

impl !Sync for Enum

impl Unpin for Enum

impl UnwindSafe for Enum

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Eq.html b/syn/token/struct.Eq.html new file mode 100644 index 0000000..06a76a5 --- /dev/null +++ b/syn/token/struct.Eq.html @@ -0,0 +1,31 @@ +syn::token::Eq - Rust

[][src]Struct syn::token::Eq

#[repr(C)]
+pub struct Eq {
+    pub spans: [Span; 1],
+}

=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Eq[src]

impl Copy for Eq[src]

impl Default for Eq[src]

impl Deref for Eq[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Eq[src]

impl Parse for Eq[src]

impl ToTokens for Eq[src]

impl Token for Eq[src]

Auto Trait Implementations

impl !RefUnwindSafe for Eq

impl !Send for Eq

impl !Sync for Eq

impl Unpin for Eq

impl UnwindSafe for Eq

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.EqEq.html b/syn/token/struct.EqEq.html new file mode 100644 index 0000000..13ea72f --- /dev/null +++ b/syn/token/struct.EqEq.html @@ -0,0 +1,28 @@ +syn::token::EqEq - Rust

[][src]Struct syn::token::EqEq

#[repr(C)]
+pub struct EqEq {
+    pub spans: [Span; 2],
+}

==

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for EqEq[src]

impl Copy for EqEq[src]

impl Default for EqEq[src]

impl Parse for EqEq[src]

impl ToTokens for EqEq[src]

impl Token for EqEq[src]

Auto Trait Implementations

impl !RefUnwindSafe for EqEq

impl !Send for EqEq

impl !Sync for EqEq

impl Unpin for EqEq

impl UnwindSafe for EqEq

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Extern.html b/syn/token/struct.Extern.html new file mode 100644 index 0000000..7f3c00a --- /dev/null +++ b/syn/token/struct.Extern.html @@ -0,0 +1,28 @@ +syn::token::Extern - Rust

[][src]Struct syn::token::Extern

pub struct Extern {
+    pub span: Span,
+}

extern

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Extern[src]

impl Copy for Extern[src]

impl Default for Extern[src]

impl From<Extern> for Ident[src]

impl Parse for Extern[src]

impl ToTokens for Extern[src]

impl Token for Extern[src]

Auto Trait Implementations

impl !RefUnwindSafe for Extern

impl !Send for Extern

impl !Sync for Extern

impl Unpin for Extern

impl UnwindSafe for Extern

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.FatArrow.html b/syn/token/struct.FatArrow.html new file mode 100644 index 0000000..bf88718 --- /dev/null +++ b/syn/token/struct.FatArrow.html @@ -0,0 +1,28 @@ +syn::token::FatArrow - Rust

[][src]Struct syn::token::FatArrow

#[repr(C)]
+pub struct FatArrow {
+    pub spans: [Span; 2],
+}

=>

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for FatArrow[src]

impl Copy for FatArrow[src]

impl Default for FatArrow[src]

impl Parse for FatArrow[src]

impl ToTokens for FatArrow[src]

impl Token for FatArrow[src]

Auto Trait Implementations

impl !RefUnwindSafe for FatArrow

impl !Send for FatArrow

impl !Sync for FatArrow

impl Unpin for FatArrow

impl UnwindSafe for FatArrow

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Final.html b/syn/token/struct.Final.html new file mode 100644 index 0000000..83079e4 --- /dev/null +++ b/syn/token/struct.Final.html @@ -0,0 +1,27 @@ +syn::token::Final - Rust

[][src]Struct syn::token::Final

pub struct Final {
+    pub span: Span,
+}

final

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Final[src]

impl Copy for Final[src]

impl Default for Final[src]

impl Parse for Final[src]

impl ToTokens for Final[src]

impl Token for Final[src]

Auto Trait Implementations

impl !RefUnwindSafe for Final

impl !Send for Final

impl !Sync for Final

impl Unpin for Final

impl UnwindSafe for Final

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Fn.html b/syn/token/struct.Fn.html new file mode 100644 index 0000000..93ac9fe --- /dev/null +++ b/syn/token/struct.Fn.html @@ -0,0 +1,27 @@ +syn::token::Fn - Rust

[][src]Struct syn::token::Fn

pub struct Fn {
+    pub span: Span,
+}

fn

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Fn[src]

impl Copy for Fn[src]

impl Default for Fn[src]

impl Parse for Fn[src]

impl ToTokens for Fn[src]

impl Token for Fn[src]

Auto Trait Implementations

impl !RefUnwindSafe for Fn

impl !Send for Fn

impl !Sync for Fn

impl Unpin for Fn

impl UnwindSafe for Fn

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.For.html b/syn/token/struct.For.html new file mode 100644 index 0000000..57973c4 --- /dev/null +++ b/syn/token/struct.For.html @@ -0,0 +1,27 @@ +syn::token::For - Rust

[][src]Struct syn::token::For

pub struct For {
+    pub span: Span,
+}

for

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for For[src]

impl Copy for For[src]

impl Default for For[src]

impl Parse for For[src]

impl ToTokens for For[src]

impl Token for For[src]

Auto Trait Implementations

impl !RefUnwindSafe for For

impl !Send for For

impl !Sync for For

impl Unpin for For

impl UnwindSafe for For

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Ge.html b/syn/token/struct.Ge.html new file mode 100644 index 0000000..251f2ba --- /dev/null +++ b/syn/token/struct.Ge.html @@ -0,0 +1,28 @@ +syn::token::Ge - Rust

[][src]Struct syn::token::Ge

#[repr(C)]
+pub struct Ge {
+    pub spans: [Span; 2],
+}

>=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for Ge[src]

impl Copy for Ge[src]

impl Default for Ge[src]

impl Parse for Ge[src]

impl ToTokens for Ge[src]

impl Token for Ge[src]

Auto Trait Implementations

impl !RefUnwindSafe for Ge

impl !Send for Ge

impl !Sync for Ge

impl Unpin for Ge

impl UnwindSafe for Ge

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Group.html b/syn/token/struct.Group.html new file mode 100644 index 0000000..690ddb5 --- /dev/null +++ b/syn/token/struct.Group.html @@ -0,0 +1,21 @@ +syn::token::Group - Rust

[][src]Struct syn::token::Group

pub struct Group {
+    pub span: Span,
+}

None-delimited group

+

+ Fields

span: Span

Methods

impl Group[src]

pub fn surround<F>(&self, tokens: &mut TokenStream, f: F) where
    F: FnOnce(&mut TokenStream), 
[src]

Trait Implementations

impl Clone for Group[src]

impl Copy for Group[src]

impl Default for Group[src]

impl Token for Group[src]

Auto Trait Implementations

impl !RefUnwindSafe for Group

impl !Send for Group

impl !Sync for Group

impl Unpin for Group

impl UnwindSafe for Group

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Gt.html b/syn/token/struct.Gt.html new file mode 100644 index 0000000..46c9bd7 --- /dev/null +++ b/syn/token/struct.Gt.html @@ -0,0 +1,31 @@ +syn::token::Gt - Rust

[][src]Struct syn::token::Gt

#[repr(C)]
+pub struct Gt {
+    pub spans: [Span; 1],
+}

>

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Gt[src]

impl Copy for Gt[src]

impl Default for Gt[src]

impl Deref for Gt[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Gt[src]

impl Parse for Gt[src]

impl ToTokens for Gt[src]

impl Token for Gt[src]

Auto Trait Implementations

impl !RefUnwindSafe for Gt

impl !Send for Gt

impl !Sync for Gt

impl Unpin for Gt

impl UnwindSafe for Gt

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.If.html b/syn/token/struct.If.html new file mode 100644 index 0000000..42f83b1 --- /dev/null +++ b/syn/token/struct.If.html @@ -0,0 +1,27 @@ +syn::token::If - Rust

[][src]Struct syn::token::If

pub struct If {
+    pub span: Span,
+}

if

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for If[src]

impl Copy for If[src]

impl Default for If[src]

impl Parse for If[src]

impl ToTokens for If[src]

impl Token for If[src]

Auto Trait Implementations

impl !RefUnwindSafe for If

impl !Send for If

impl !Sync for If

impl Unpin for If

impl UnwindSafe for If

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Impl.html b/syn/token/struct.Impl.html new file mode 100644 index 0000000..fd6b48a --- /dev/null +++ b/syn/token/struct.Impl.html @@ -0,0 +1,27 @@ +syn::token::Impl - Rust

[][src]Struct syn::token::Impl

pub struct Impl {
+    pub span: Span,
+}

impl

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Impl[src]

impl Copy for Impl[src]

impl Default for Impl[src]

impl Parse for Impl[src]

impl ToTokens for Impl[src]

impl Token for Impl[src]

Auto Trait Implementations

impl !RefUnwindSafe for Impl

impl !Send for Impl

impl !Sync for Impl

impl Unpin for Impl

impl UnwindSafe for Impl

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.In.html b/syn/token/struct.In.html new file mode 100644 index 0000000..87fee18 --- /dev/null +++ b/syn/token/struct.In.html @@ -0,0 +1,27 @@ +syn::token::In - Rust

[][src]Struct syn::token::In

pub struct In {
+    pub span: Span,
+}

in

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for In[src]

impl Copy for In[src]

impl Default for In[src]

impl Parse for In[src]

impl ToTokens for In[src]

impl Token for In[src]

Auto Trait Implementations

impl !RefUnwindSafe for In

impl !Send for In

impl !Sync for In

impl Unpin for In

impl UnwindSafe for In

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.LArrow.html b/syn/token/struct.LArrow.html new file mode 100644 index 0000000..3be476c --- /dev/null +++ b/syn/token/struct.LArrow.html @@ -0,0 +1,28 @@ +syn::token::LArrow - Rust

[][src]Struct syn::token::LArrow

#[repr(C)]
+pub struct LArrow {
+    pub spans: [Span; 2],
+}

<-

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for LArrow[src]

impl Copy for LArrow[src]

impl Default for LArrow[src]

impl Parse for LArrow[src]

impl ToTokens for LArrow[src]

impl Token for LArrow[src]

Auto Trait Implementations

impl !RefUnwindSafe for LArrow

impl !Send for LArrow

impl !Sync for LArrow

impl Unpin for LArrow

impl UnwindSafe for LArrow

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Le.html b/syn/token/struct.Le.html new file mode 100644 index 0000000..2e223e7 --- /dev/null +++ b/syn/token/struct.Le.html @@ -0,0 +1,28 @@ +syn::token::Le - Rust

[][src]Struct syn::token::Le

#[repr(C)]
+pub struct Le {
+    pub spans: [Span; 2],
+}

<=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for Le[src]

impl Copy for Le[src]

impl Default for Le[src]

impl Parse for Le[src]

impl ToTokens for Le[src]

impl Token for Le[src]

Auto Trait Implementations

impl !RefUnwindSafe for Le

impl !Send for Le

impl !Sync for Le

impl Unpin for Le

impl UnwindSafe for Le

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Let.html b/syn/token/struct.Let.html new file mode 100644 index 0000000..7d7c1ad --- /dev/null +++ b/syn/token/struct.Let.html @@ -0,0 +1,27 @@ +syn::token::Let - Rust

[][src]Struct syn::token::Let

pub struct Let {
+    pub span: Span,
+}

let

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Let[src]

impl Copy for Let[src]

impl Default for Let[src]

impl Parse for Let[src]

impl ToTokens for Let[src]

impl Token for Let[src]

Auto Trait Implementations

impl !RefUnwindSafe for Let

impl !Send for Let

impl !Sync for Let

impl Unpin for Let

impl UnwindSafe for Let

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Loop.html b/syn/token/struct.Loop.html new file mode 100644 index 0000000..7bf5bbc --- /dev/null +++ b/syn/token/struct.Loop.html @@ -0,0 +1,27 @@ +syn::token::Loop - Rust

[][src]Struct syn::token::Loop

pub struct Loop {
+    pub span: Span,
+}

loop

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Loop[src]

impl Copy for Loop[src]

impl Default for Loop[src]

impl Parse for Loop[src]

impl ToTokens for Loop[src]

impl Token for Loop[src]

Auto Trait Implementations

impl !RefUnwindSafe for Loop

impl !Send for Loop

impl !Sync for Loop

impl Unpin for Loop

impl UnwindSafe for Loop

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Lt.html b/syn/token/struct.Lt.html new file mode 100644 index 0000000..5a94dae --- /dev/null +++ b/syn/token/struct.Lt.html @@ -0,0 +1,31 @@ +syn::token::Lt - Rust

[][src]Struct syn::token::Lt

#[repr(C)]
+pub struct Lt {
+    pub spans: [Span; 1],
+}

<

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Lt[src]

impl Copy for Lt[src]

impl Default for Lt[src]

impl Deref for Lt[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Lt[src]

impl Parse for Lt[src]

impl ToTokens for Lt[src]

impl Token for Lt[src]

Auto Trait Implementations

impl !RefUnwindSafe for Lt

impl !Send for Lt

impl !Sync for Lt

impl Unpin for Lt

impl UnwindSafe for Lt

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Macro.html b/syn/token/struct.Macro.html new file mode 100644 index 0000000..bd389c9 --- /dev/null +++ b/syn/token/struct.Macro.html @@ -0,0 +1,27 @@ +syn::token::Macro - Rust

[][src]Struct syn::token::Macro

pub struct Macro {
+    pub span: Span,
+}

macro

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Macro[src]

impl Copy for Macro[src]

impl Default for Macro[src]

impl Parse for Macro[src]

impl ToTokens for Macro[src]

impl Token for Macro[src]

Auto Trait Implementations

impl !RefUnwindSafe for Macro

impl !Send for Macro

impl !Sync for Macro

impl Unpin for Macro

impl UnwindSafe for Macro

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Match.html b/syn/token/struct.Match.html new file mode 100644 index 0000000..78eea5f --- /dev/null +++ b/syn/token/struct.Match.html @@ -0,0 +1,27 @@ +syn::token::Match - Rust

[][src]Struct syn::token::Match

pub struct Match {
+    pub span: Span,
+}

match

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Match[src]

impl Copy for Match[src]

impl Default for Match[src]

impl Parse for Match[src]

impl ToTokens for Match[src]

impl Token for Match[src]

Auto Trait Implementations

impl !RefUnwindSafe for Match

impl !Send for Match

impl !Sync for Match

impl Unpin for Match

impl UnwindSafe for Match

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Mod.html b/syn/token/struct.Mod.html new file mode 100644 index 0000000..6844ca0 --- /dev/null +++ b/syn/token/struct.Mod.html @@ -0,0 +1,27 @@ +syn::token::Mod - Rust

[][src]Struct syn::token::Mod

pub struct Mod {
+    pub span: Span,
+}

mod

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Mod[src]

impl Copy for Mod[src]

impl Default for Mod[src]

impl Parse for Mod[src]

impl ToTokens for Mod[src]

impl Token for Mod[src]

Auto Trait Implementations

impl !RefUnwindSafe for Mod

impl !Send for Mod

impl !Sync for Mod

impl Unpin for Mod

impl UnwindSafe for Mod

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Move.html b/syn/token/struct.Move.html new file mode 100644 index 0000000..3fdd003 --- /dev/null +++ b/syn/token/struct.Move.html @@ -0,0 +1,27 @@ +syn::token::Move - Rust

[][src]Struct syn::token::Move

pub struct Move {
+    pub span: Span,
+}

move

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Move[src]

impl Copy for Move[src]

impl Default for Move[src]

impl Parse for Move[src]

impl ToTokens for Move[src]

impl Token for Move[src]

Auto Trait Implementations

impl !RefUnwindSafe for Move

impl !Send for Move

impl !Sync for Move

impl Unpin for Move

impl UnwindSafe for Move

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.MulEq.html b/syn/token/struct.MulEq.html new file mode 100644 index 0000000..251048b --- /dev/null +++ b/syn/token/struct.MulEq.html @@ -0,0 +1,28 @@ +syn::token::MulEq - Rust

[][src]Struct syn::token::MulEq

#[repr(C)]
+pub struct MulEq {
+    pub spans: [Span; 2],
+}

*=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for MulEq[src]

impl Copy for MulEq[src]

impl Default for MulEq[src]

impl Parse for MulEq[src]

impl ToTokens for MulEq[src]

impl Token for MulEq[src]

Auto Trait Implementations

impl !RefUnwindSafe for MulEq

impl !Send for MulEq

impl !Sync for MulEq

impl Unpin for MulEq

impl UnwindSafe for MulEq

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Mut.html b/syn/token/struct.Mut.html new file mode 100644 index 0000000..3a0fa04 --- /dev/null +++ b/syn/token/struct.Mut.html @@ -0,0 +1,27 @@ +syn::token::Mut - Rust

[][src]Struct syn::token::Mut

pub struct Mut {
+    pub span: Span,
+}

mut

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Mut[src]

impl Copy for Mut[src]

impl Default for Mut[src]

impl Parse for Mut[src]

impl ToTokens for Mut[src]

impl Token for Mut[src]

Auto Trait Implementations

impl !RefUnwindSafe for Mut

impl !Send for Mut

impl !Sync for Mut

impl Unpin for Mut

impl UnwindSafe for Mut

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Ne.html b/syn/token/struct.Ne.html new file mode 100644 index 0000000..ea0f195 --- /dev/null +++ b/syn/token/struct.Ne.html @@ -0,0 +1,28 @@ +syn::token::Ne - Rust

[][src]Struct syn::token::Ne

#[repr(C)]
+pub struct Ne {
+    pub spans: [Span; 2],
+}

!=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for Ne[src]

impl Copy for Ne[src]

impl Default for Ne[src]

impl Parse for Ne[src]

impl ToTokens for Ne[src]

impl Token for Ne[src]

Auto Trait Implementations

impl !RefUnwindSafe for Ne

impl !Send for Ne

impl !Sync for Ne

impl Unpin for Ne

impl UnwindSafe for Ne

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Or.html b/syn/token/struct.Or.html new file mode 100644 index 0000000..9ef6918 --- /dev/null +++ b/syn/token/struct.Or.html @@ -0,0 +1,31 @@ +syn::token::Or - Rust

[][src]Struct syn::token::Or

#[repr(C)]
+pub struct Or {
+    pub spans: [Span; 1],
+}

|

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Or[src]

impl Copy for Or[src]

impl Default for Or[src]

impl Deref for Or[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Or[src]

impl Parse for Or[src]

impl ToTokens for Or[src]

impl Token for Or[src]

Auto Trait Implementations

impl !RefUnwindSafe for Or

impl !Send for Or

impl !Sync for Or

impl Unpin for Or

impl UnwindSafe for Or

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.OrEq.html b/syn/token/struct.OrEq.html new file mode 100644 index 0000000..7d00d94 --- /dev/null +++ b/syn/token/struct.OrEq.html @@ -0,0 +1,28 @@ +syn::token::OrEq - Rust

[][src]Struct syn::token::OrEq

#[repr(C)]
+pub struct OrEq {
+    pub spans: [Span; 2],
+}

|=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for OrEq[src]

impl Copy for OrEq[src]

impl Default for OrEq[src]

impl Parse for OrEq[src]

impl ToTokens for OrEq[src]

impl Token for OrEq[src]

Auto Trait Implementations

impl !RefUnwindSafe for OrEq

impl !Send for OrEq

impl !Sync for OrEq

impl Unpin for OrEq

impl UnwindSafe for OrEq

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.OrOr.html b/syn/token/struct.OrOr.html new file mode 100644 index 0000000..97359fc --- /dev/null +++ b/syn/token/struct.OrOr.html @@ -0,0 +1,28 @@ +syn::token::OrOr - Rust

[][src]Struct syn::token::OrOr

#[repr(C)]
+pub struct OrOr {
+    pub spans: [Span; 2],
+}

||

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for OrOr[src]

impl Copy for OrOr[src]

impl Default for OrOr[src]

impl Parse for OrOr[src]

impl ToTokens for OrOr[src]

impl Token for OrOr[src]

Auto Trait Implementations

impl !RefUnwindSafe for OrOr

impl !Send for OrOr

impl !Sync for OrOr

impl Unpin for OrOr

impl UnwindSafe for OrOr

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Override.html b/syn/token/struct.Override.html new file mode 100644 index 0000000..6d190d9 --- /dev/null +++ b/syn/token/struct.Override.html @@ -0,0 +1,27 @@ +syn::token::Override - Rust

[][src]Struct syn::token::Override

pub struct Override {
+    pub span: Span,
+}

override

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Override[src]

impl Copy for Override[src]

impl Default for Override[src]

impl Parse for Override[src]

impl ToTokens for Override[src]

impl Token for Override[src]

Auto Trait Implementations

impl !RefUnwindSafe for Override

impl !Send for Override

impl !Sync for Override

impl Unpin for Override

impl UnwindSafe for Override

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Paren.html b/syn/token/struct.Paren.html new file mode 100644 index 0000000..e690bba --- /dev/null +++ b/syn/token/struct.Paren.html @@ -0,0 +1,21 @@ +syn::token::Paren - Rust

[][src]Struct syn::token::Paren

pub struct Paren {
+    pub span: Span,
+}

(...)

+

+ Fields

span: Span

Methods

impl Paren[src]

pub fn surround<F>(&self, tokens: &mut TokenStream, f: F) where
    F: FnOnce(&mut TokenStream), 
[src]

Trait Implementations

impl Clone for Paren[src]

impl Copy for Paren[src]

impl Default for Paren[src]

impl Token for Paren[src]

Auto Trait Implementations

impl !RefUnwindSafe for Paren

impl !Send for Paren

impl !Sync for Paren

impl Unpin for Paren

impl UnwindSafe for Paren

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Pound.html b/syn/token/struct.Pound.html new file mode 100644 index 0000000..d048951 --- /dev/null +++ b/syn/token/struct.Pound.html @@ -0,0 +1,31 @@ +syn::token::Pound - Rust

[][src]Struct syn::token::Pound

#[repr(C)]
+pub struct Pound {
+    pub spans: [Span; 1],
+}

#

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Pound[src]

impl Copy for Pound[src]

impl Default for Pound[src]

impl Deref for Pound[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Pound[src]

impl Parse for Pound[src]

impl ToTokens for Pound[src]

impl Token for Pound[src]

Auto Trait Implementations

impl !RefUnwindSafe for Pound

impl !Send for Pound

impl !Sync for Pound

impl Unpin for Pound

impl UnwindSafe for Pound

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Priv.html b/syn/token/struct.Priv.html new file mode 100644 index 0000000..70071a0 --- /dev/null +++ b/syn/token/struct.Priv.html @@ -0,0 +1,27 @@ +syn::token::Priv - Rust

[][src]Struct syn::token::Priv

pub struct Priv {
+    pub span: Span,
+}

priv

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Priv[src]

impl Copy for Priv[src]

impl Default for Priv[src]

impl Parse for Priv[src]

impl ToTokens for Priv[src]

impl Token for Priv[src]

Auto Trait Implementations

impl !RefUnwindSafe for Priv

impl !Send for Priv

impl !Sync for Priv

impl Unpin for Priv

impl UnwindSafe for Priv

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Pub.html b/syn/token/struct.Pub.html new file mode 100644 index 0000000..cc4fb07 --- /dev/null +++ b/syn/token/struct.Pub.html @@ -0,0 +1,27 @@ +syn::token::Pub - Rust

[][src]Struct syn::token::Pub

pub struct Pub {
+    pub span: Span,
+}

pub

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Pub[src]

impl Copy for Pub[src]

impl Default for Pub[src]

impl Parse for Pub[src]

impl ToTokens for Pub[src]

impl Token for Pub[src]

Auto Trait Implementations

impl !RefUnwindSafe for Pub

impl !Send for Pub

impl !Sync for Pub

impl Unpin for Pub

impl UnwindSafe for Pub

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Question.html b/syn/token/struct.Question.html new file mode 100644 index 0000000..1a74a27 --- /dev/null +++ b/syn/token/struct.Question.html @@ -0,0 +1,31 @@ +syn::token::Question - Rust

[][src]Struct syn::token::Question

#[repr(C)]
+pub struct Question {
+    pub spans: [Span; 1],
+}

?

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Question[src]

impl Copy for Question[src]

impl Default for Question[src]

impl Deref for Question[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Question[src]

impl Parse for Question[src]

impl ToTokens for Question[src]

impl Token for Question[src]

Auto Trait Implementations

impl !RefUnwindSafe for Question

impl !Send for Question

impl !Sync for Question

impl Unpin for Question

impl UnwindSafe for Question

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.RArrow.html b/syn/token/struct.RArrow.html new file mode 100644 index 0000000..d8bcd41 --- /dev/null +++ b/syn/token/struct.RArrow.html @@ -0,0 +1,28 @@ +syn::token::RArrow - Rust

[][src]Struct syn::token::RArrow

#[repr(C)]
+pub struct RArrow {
+    pub spans: [Span; 2],
+}

->

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for RArrow[src]

impl Copy for RArrow[src]

impl Default for RArrow[src]

impl Parse for RArrow[src]

impl ToTokens for RArrow[src]

impl Token for RArrow[src]

Auto Trait Implementations

impl !RefUnwindSafe for RArrow

impl !Send for RArrow

impl !Sync for RArrow

impl Unpin for RArrow

impl UnwindSafe for RArrow

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Ref.html b/syn/token/struct.Ref.html new file mode 100644 index 0000000..d151ed9 --- /dev/null +++ b/syn/token/struct.Ref.html @@ -0,0 +1,27 @@ +syn::token::Ref - Rust

[][src]Struct syn::token::Ref

pub struct Ref {
+    pub span: Span,
+}

ref

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Ref[src]

impl Copy for Ref[src]

impl Default for Ref[src]

impl Parse for Ref[src]

impl ToTokens for Ref[src]

impl Token for Ref[src]

Auto Trait Implementations

impl !RefUnwindSafe for Ref

impl !Send for Ref

impl !Sync for Ref

impl Unpin for Ref

impl UnwindSafe for Ref

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Rem.html b/syn/token/struct.Rem.html new file mode 100644 index 0000000..fa03bdd --- /dev/null +++ b/syn/token/struct.Rem.html @@ -0,0 +1,31 @@ +syn::token::Rem - Rust

[][src]Struct syn::token::Rem

#[repr(C)]
+pub struct Rem {
+    pub spans: [Span; 1],
+}

%

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Rem[src]

impl Copy for Rem[src]

impl Default for Rem[src]

impl Deref for Rem[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Rem[src]

impl Parse for Rem[src]

impl ToTokens for Rem[src]

impl Token for Rem[src]

Auto Trait Implementations

impl !RefUnwindSafe for Rem

impl !Send for Rem

impl !Sync for Rem

impl Unpin for Rem

impl UnwindSafe for Rem

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.RemEq.html b/syn/token/struct.RemEq.html new file mode 100644 index 0000000..5697e0a --- /dev/null +++ b/syn/token/struct.RemEq.html @@ -0,0 +1,28 @@ +syn::token::RemEq - Rust

[][src]Struct syn::token::RemEq

#[repr(C)]
+pub struct RemEq {
+    pub spans: [Span; 2],
+}

%=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for RemEq[src]

impl Copy for RemEq[src]

impl Default for RemEq[src]

impl Parse for RemEq[src]

impl ToTokens for RemEq[src]

impl Token for RemEq[src]

Auto Trait Implementations

impl !RefUnwindSafe for RemEq

impl !Send for RemEq

impl !Sync for RemEq

impl Unpin for RemEq

impl UnwindSafe for RemEq

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Return.html b/syn/token/struct.Return.html new file mode 100644 index 0000000..c108b9f --- /dev/null +++ b/syn/token/struct.Return.html @@ -0,0 +1,27 @@ +syn::token::Return - Rust

[][src]Struct syn::token::Return

pub struct Return {
+    pub span: Span,
+}

return

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Return[src]

impl Copy for Return[src]

impl Default for Return[src]

impl Parse for Return[src]

impl ToTokens for Return[src]

impl Token for Return[src]

Auto Trait Implementations

impl !RefUnwindSafe for Return

impl !Send for Return

impl !Sync for Return

impl Unpin for Return

impl UnwindSafe for Return

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.SelfType.html b/syn/token/struct.SelfType.html new file mode 100644 index 0000000..3491bea --- /dev/null +++ b/syn/token/struct.SelfType.html @@ -0,0 +1,28 @@ +syn::token::SelfType - Rust

[][src]Struct syn::token::SelfType

pub struct SelfType {
+    pub span: Span,
+}

Self

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for SelfType[src]

impl Copy for SelfType[src]

impl Default for SelfType[src]

impl From<SelfType> for Ident[src]

impl Parse for SelfType[src]

impl ToTokens for SelfType[src]

impl Token for SelfType[src]

Auto Trait Implementations

impl !RefUnwindSafe for SelfType

impl !Send for SelfType

impl !Sync for SelfType

impl Unpin for SelfType

impl UnwindSafe for SelfType

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.SelfValue.html b/syn/token/struct.SelfValue.html new file mode 100644 index 0000000..0d45020 --- /dev/null +++ b/syn/token/struct.SelfValue.html @@ -0,0 +1,28 @@ +syn::token::SelfValue - Rust

[][src]Struct syn::token::SelfValue

pub struct SelfValue {
+    pub span: Span,
+}

self

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for SelfValue[src]

impl Copy for SelfValue[src]

impl Default for SelfValue[src]

impl From<SelfValue> for Ident[src]

impl Parse for SelfValue[src]

impl ToTokens for SelfValue[src]

impl Token for SelfValue[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Semi.html b/syn/token/struct.Semi.html new file mode 100644 index 0000000..8919255 --- /dev/null +++ b/syn/token/struct.Semi.html @@ -0,0 +1,31 @@ +syn::token::Semi - Rust

[][src]Struct syn::token::Semi

#[repr(C)]
+pub struct Semi {
+    pub spans: [Span; 1],
+}

;

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Semi[src]

impl Copy for Semi[src]

impl Default for Semi[src]

impl Deref for Semi[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Semi[src]

impl Parse for Semi[src]

impl ToTokens for Semi[src]

impl Token for Semi[src]

Auto Trait Implementations

impl !RefUnwindSafe for Semi

impl !Send for Semi

impl !Sync for Semi

impl Unpin for Semi

impl UnwindSafe for Semi

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Shl.html b/syn/token/struct.Shl.html new file mode 100644 index 0000000..702f0af --- /dev/null +++ b/syn/token/struct.Shl.html @@ -0,0 +1,28 @@ +syn::token::Shl - Rust

[][src]Struct syn::token::Shl

#[repr(C)]
+pub struct Shl {
+    pub spans: [Span; 2],
+}

<<

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for Shl[src]

impl Copy for Shl[src]

impl Default for Shl[src]

impl Parse for Shl[src]

impl ToTokens for Shl[src]

impl Token for Shl[src]

Auto Trait Implementations

impl !RefUnwindSafe for Shl

impl !Send for Shl

impl !Sync for Shl

impl Unpin for Shl

impl UnwindSafe for Shl

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.ShlEq.html b/syn/token/struct.ShlEq.html new file mode 100644 index 0000000..51a7e1d --- /dev/null +++ b/syn/token/struct.ShlEq.html @@ -0,0 +1,28 @@ +syn::token::ShlEq - Rust

[][src]Struct syn::token::ShlEq

#[repr(C)]
+pub struct ShlEq {
+    pub spans: [Span; 3],
+}

<<=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 3]

Trait Implementations

impl Clone for ShlEq[src]

impl Copy for ShlEq[src]

impl Default for ShlEq[src]

impl Parse for ShlEq[src]

impl ToTokens for ShlEq[src]

impl Token for ShlEq[src]

Auto Trait Implementations

impl !RefUnwindSafe for ShlEq

impl !Send for ShlEq

impl !Sync for ShlEq

impl Unpin for ShlEq

impl UnwindSafe for ShlEq

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Shr.html b/syn/token/struct.Shr.html new file mode 100644 index 0000000..37ee68a --- /dev/null +++ b/syn/token/struct.Shr.html @@ -0,0 +1,28 @@ +syn::token::Shr - Rust

[][src]Struct syn::token::Shr

#[repr(C)]
+pub struct Shr {
+    pub spans: [Span; 2],
+}

>>

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for Shr[src]

impl Copy for Shr[src]

impl Default for Shr[src]

impl Parse for Shr[src]

impl ToTokens for Shr[src]

impl Token for Shr[src]

Auto Trait Implementations

impl !RefUnwindSafe for Shr

impl !Send for Shr

impl !Sync for Shr

impl Unpin for Shr

impl UnwindSafe for Shr

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.ShrEq.html b/syn/token/struct.ShrEq.html new file mode 100644 index 0000000..e0f932d --- /dev/null +++ b/syn/token/struct.ShrEq.html @@ -0,0 +1,28 @@ +syn::token::ShrEq - Rust

[][src]Struct syn::token::ShrEq

#[repr(C)]
+pub struct ShrEq {
+    pub spans: [Span; 3],
+}

>>=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 3]

Trait Implementations

impl Clone for ShrEq[src]

impl Copy for ShrEq[src]

impl Default for ShrEq[src]

impl Parse for ShrEq[src]

impl ToTokens for ShrEq[src]

impl Token for ShrEq[src]

Auto Trait Implementations

impl !RefUnwindSafe for ShrEq

impl !Send for ShrEq

impl !Sync for ShrEq

impl Unpin for ShrEq

impl UnwindSafe for ShrEq

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Star.html b/syn/token/struct.Star.html new file mode 100644 index 0000000..e034a6a --- /dev/null +++ b/syn/token/struct.Star.html @@ -0,0 +1,31 @@ +syn::token::Star - Rust

[][src]Struct syn::token::Star

#[repr(C)]
+pub struct Star {
+    pub spans: [Span; 1],
+}

*

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Star[src]

impl Copy for Star[src]

impl Default for Star[src]

impl Deref for Star[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Star[src]

impl Parse for Star[src]

impl ToTokens for Star[src]

impl Token for Star[src]

Auto Trait Implementations

impl !RefUnwindSafe for Star

impl !Send for Star

impl !Sync for Star

impl Unpin for Star

impl UnwindSafe for Star

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Static.html b/syn/token/struct.Static.html new file mode 100644 index 0000000..c8e32f6 --- /dev/null +++ b/syn/token/struct.Static.html @@ -0,0 +1,27 @@ +syn::token::Static - Rust

[][src]Struct syn::token::Static

pub struct Static {
+    pub span: Span,
+}

static

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Static[src]

impl Copy for Static[src]

impl Default for Static[src]

impl Parse for Static[src]

impl ToTokens for Static[src]

impl Token for Static[src]

Auto Trait Implementations

impl !RefUnwindSafe for Static

impl !Send for Static

impl !Sync for Static

impl Unpin for Static

impl UnwindSafe for Static

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Struct.html b/syn/token/struct.Struct.html new file mode 100644 index 0000000..af1b3c7 --- /dev/null +++ b/syn/token/struct.Struct.html @@ -0,0 +1,27 @@ +syn::token::Struct - Rust

[][src]Struct syn::token::Struct

pub struct Struct {
+    pub span: Span,
+}

struct

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Struct[src]

impl Copy for Struct[src]

impl Default for Struct[src]

impl Parse for Struct[src]

impl ToTokens for Struct[src]

impl Token for Struct[src]

Auto Trait Implementations

impl !RefUnwindSafe for Struct

impl !Send for Struct

impl !Sync for Struct

impl Unpin for Struct

impl UnwindSafe for Struct

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Sub.html b/syn/token/struct.Sub.html new file mode 100644 index 0000000..cdd0cf4 --- /dev/null +++ b/syn/token/struct.Sub.html @@ -0,0 +1,31 @@ +syn::token::Sub - Rust

[][src]Struct syn::token::Sub

#[repr(C)]
+pub struct Sub {
+    pub spans: [Span; 1],
+}

-

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Sub[src]

impl Copy for Sub[src]

impl Default for Sub[src]

impl Deref for Sub[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Sub[src]

impl Parse for Sub[src]

impl ToTokens for Sub[src]

impl Token for Sub[src]

Auto Trait Implementations

impl !RefUnwindSafe for Sub

impl !Send for Sub

impl !Sync for Sub

impl Unpin for Sub

impl UnwindSafe for Sub

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.SubEq.html b/syn/token/struct.SubEq.html new file mode 100644 index 0000000..2956806 --- /dev/null +++ b/syn/token/struct.SubEq.html @@ -0,0 +1,28 @@ +syn::token::SubEq - Rust

[][src]Struct syn::token::SubEq

#[repr(C)]
+pub struct SubEq {
+    pub spans: [Span; 2],
+}

-=

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 2]

Trait Implementations

impl Clone for SubEq[src]

impl Copy for SubEq[src]

impl Default for SubEq[src]

impl Parse for SubEq[src]

impl ToTokens for SubEq[src]

impl Token for SubEq[src]

Auto Trait Implementations

impl !RefUnwindSafe for SubEq

impl !Send for SubEq

impl !Sync for SubEq

impl Unpin for SubEq

impl UnwindSafe for SubEq

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Super.html b/syn/token/struct.Super.html new file mode 100644 index 0000000..07b5c17 --- /dev/null +++ b/syn/token/struct.Super.html @@ -0,0 +1,28 @@ +syn::token::Super - Rust

[][src]Struct syn::token::Super

pub struct Super {
+    pub span: Span,
+}

super

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Super[src]

impl Copy for Super[src]

impl Default for Super[src]

impl From<Super> for Ident[src]

impl Parse for Super[src]

impl ToTokens for Super[src]

impl Token for Super[src]

Auto Trait Implementations

impl !RefUnwindSafe for Super

impl !Send for Super

impl !Sync for Super

impl Unpin for Super

impl UnwindSafe for Super

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Tilde.html b/syn/token/struct.Tilde.html new file mode 100644 index 0000000..ef05e49 --- /dev/null +++ b/syn/token/struct.Tilde.html @@ -0,0 +1,31 @@ +syn::token::Tilde - Rust

[][src]Struct syn::token::Tilde

#[repr(C)]
+pub struct Tilde {
+    pub spans: [Span; 1],
+}

~

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Tilde[src]

impl Copy for Tilde[src]

impl Default for Tilde[src]

impl Deref for Tilde[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Tilde[src]

impl Parse for Tilde[src]

impl ToTokens for Tilde[src]

impl Token for Tilde[src]

Auto Trait Implementations

impl !RefUnwindSafe for Tilde

impl !Send for Tilde

impl !Sync for Tilde

impl Unpin for Tilde

impl UnwindSafe for Tilde

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Trait.html b/syn/token/struct.Trait.html new file mode 100644 index 0000000..64de66f --- /dev/null +++ b/syn/token/struct.Trait.html @@ -0,0 +1,27 @@ +syn::token::Trait - Rust

[][src]Struct syn::token::Trait

pub struct Trait {
+    pub span: Span,
+}

trait

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Trait[src]

impl Copy for Trait[src]

impl Default for Trait[src]

impl Parse for Trait[src]

impl ToTokens for Trait[src]

impl Token for Trait[src]

Auto Trait Implementations

impl !RefUnwindSafe for Trait

impl !Send for Trait

impl !Sync for Trait

impl Unpin for Trait

impl UnwindSafe for Trait

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Try.html b/syn/token/struct.Try.html new file mode 100644 index 0000000..4b72538 --- /dev/null +++ b/syn/token/struct.Try.html @@ -0,0 +1,27 @@ +syn::token::Try - Rust

[][src]Struct syn::token::Try

pub struct Try {
+    pub span: Span,
+}

try

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Try[src]

impl Copy for Try[src]

impl Default for Try[src]

impl Parse for Try[src]

impl ToTokens for Try[src]

impl Token for Try[src]

Auto Trait Implementations

impl !RefUnwindSafe for Try

impl !Send for Try

impl !Sync for Try

impl Unpin for Try

impl UnwindSafe for Try

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Type.html b/syn/token/struct.Type.html new file mode 100644 index 0000000..bc2e61e --- /dev/null +++ b/syn/token/struct.Type.html @@ -0,0 +1,27 @@ +syn::token::Type - Rust

[][src]Struct syn::token::Type

pub struct Type {
+    pub span: Span,
+}

type

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Type[src]

impl Copy for Type[src]

impl Default for Type[src]

impl Parse for Type[src]

impl ToTokens for Type[src]

impl Token for Type[src]

Auto Trait Implementations

impl !RefUnwindSafe for Type

impl !Send for Type

impl !Sync for Type

impl Unpin for Type

impl UnwindSafe for Type

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Typeof.html b/syn/token/struct.Typeof.html new file mode 100644 index 0000000..51e0318 --- /dev/null +++ b/syn/token/struct.Typeof.html @@ -0,0 +1,27 @@ +syn::token::Typeof - Rust

[][src]Struct syn::token::Typeof

pub struct Typeof {
+    pub span: Span,
+}

typeof

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Typeof[src]

impl Copy for Typeof[src]

impl Default for Typeof[src]

impl Parse for Typeof[src]

impl ToTokens for Typeof[src]

impl Token for Typeof[src]

Auto Trait Implementations

impl !RefUnwindSafe for Typeof

impl !Send for Typeof

impl !Sync for Typeof

impl Unpin for Typeof

impl UnwindSafe for Typeof

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Underscore.html b/syn/token/struct.Underscore.html new file mode 100644 index 0000000..d38be39 --- /dev/null +++ b/syn/token/struct.Underscore.html @@ -0,0 +1,32 @@ +syn::token::Underscore - Rust

[][src]Struct syn::token::Underscore

#[repr(C)]
+pub struct Underscore {
+    pub spans: [Span; 1],
+}

_

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

spans: [Span; 1]

Trait Implementations

impl Clone for Underscore[src]

impl Copy for Underscore[src]

impl Default for Underscore[src]

impl Deref for Underscore[src]

type Target = WithSpan

The resulting type after dereferencing.

+

impl DerefMut for Underscore[src]

impl From<Underscore> for Ident[src]

impl Parse for Underscore[src]

impl ToTokens for Underscore[src]

impl Token for Underscore[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Union.html b/syn/token/struct.Union.html new file mode 100644 index 0000000..489feba --- /dev/null +++ b/syn/token/struct.Union.html @@ -0,0 +1,27 @@ +syn::token::Union - Rust

[][src]Struct syn::token::Union

pub struct Union {
+    pub span: Span,
+}

union

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Union[src]

impl Copy for Union[src]

impl Default for Union[src]

impl Parse for Union[src]

impl ToTokens for Union[src]

impl Token for Union[src]

Auto Trait Implementations

impl !RefUnwindSafe for Union

impl !Send for Union

impl !Sync for Union

impl Unpin for Union

impl UnwindSafe for Union

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Unsafe.html b/syn/token/struct.Unsafe.html new file mode 100644 index 0000000..beb5016 --- /dev/null +++ b/syn/token/struct.Unsafe.html @@ -0,0 +1,27 @@ +syn::token::Unsafe - Rust

[][src]Struct syn::token::Unsafe

pub struct Unsafe {
+    pub span: Span,
+}

unsafe

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Unsafe[src]

impl Copy for Unsafe[src]

impl Default for Unsafe[src]

impl Parse for Unsafe[src]

impl ToTokens for Unsafe[src]

impl Token for Unsafe[src]

Auto Trait Implementations

impl !RefUnwindSafe for Unsafe

impl !Send for Unsafe

impl !Sync for Unsafe

impl Unpin for Unsafe

impl UnwindSafe for Unsafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Unsized.html b/syn/token/struct.Unsized.html new file mode 100644 index 0000000..0f60454 --- /dev/null +++ b/syn/token/struct.Unsized.html @@ -0,0 +1,27 @@ +syn::token::Unsized - Rust

[][src]Struct syn::token::Unsized

pub struct Unsized {
+    pub span: Span,
+}

unsized

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Unsized[src]

impl Copy for Unsized[src]

impl Default for Unsized[src]

impl Parse for Unsized[src]

impl ToTokens for Unsized[src]

impl Token for Unsized[src]

Auto Trait Implementations

impl !RefUnwindSafe for Unsized

impl !Send for Unsized

impl !Sync for Unsized

impl Unpin for Unsized

impl UnwindSafe for Unsized

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Use.html b/syn/token/struct.Use.html new file mode 100644 index 0000000..eb63d0b --- /dev/null +++ b/syn/token/struct.Use.html @@ -0,0 +1,27 @@ +syn::token::Use - Rust

[][src]Struct syn::token::Use

pub struct Use {
+    pub span: Span,
+}

use

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Use[src]

impl Copy for Use[src]

impl Default for Use[src]

impl Parse for Use[src]

impl ToTokens for Use[src]

impl Token for Use[src]

Auto Trait Implementations

impl !RefUnwindSafe for Use

impl !Send for Use

impl !Sync for Use

impl Unpin for Use

impl UnwindSafe for Use

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Virtual.html b/syn/token/struct.Virtual.html new file mode 100644 index 0000000..43f1427 --- /dev/null +++ b/syn/token/struct.Virtual.html @@ -0,0 +1,27 @@ +syn::token::Virtual - Rust

[][src]Struct syn::token::Virtual

pub struct Virtual {
+    pub span: Span,
+}

virtual

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Virtual[src]

impl Copy for Virtual[src]

impl Default for Virtual[src]

impl Parse for Virtual[src]

impl ToTokens for Virtual[src]

impl Token for Virtual[src]

Auto Trait Implementations

impl !RefUnwindSafe for Virtual

impl !Send for Virtual

impl !Sync for Virtual

impl Unpin for Virtual

impl UnwindSafe for Virtual

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Where.html b/syn/token/struct.Where.html new file mode 100644 index 0000000..adb2f30 --- /dev/null +++ b/syn/token/struct.Where.html @@ -0,0 +1,27 @@ +syn::token::Where - Rust

[][src]Struct syn::token::Where

pub struct Where {
+    pub span: Span,
+}

where

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Where[src]

impl Copy for Where[src]

impl Default for Where[src]

impl Parse for Where[src]

impl ToTokens for Where[src]

impl Token for Where[src]

Auto Trait Implementations

impl !RefUnwindSafe for Where

impl !Send for Where

impl !Sync for Where

impl Unpin for Where

impl UnwindSafe for Where

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.While.html b/syn/token/struct.While.html new file mode 100644 index 0000000..da51130 --- /dev/null +++ b/syn/token/struct.While.html @@ -0,0 +1,27 @@ +syn::token::While - Rust

[][src]Struct syn::token::While

pub struct While {
+    pub span: Span,
+}

while

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for While[src]

impl Copy for While[src]

impl Default for While[src]

impl Parse for While[src]

impl ToTokens for While[src]

impl Token for While[src]

Auto Trait Implementations

impl !RefUnwindSafe for While

impl !Send for While

impl !Sync for While

impl Unpin for While

impl UnwindSafe for While

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/struct.Yield.html b/syn/token/struct.Yield.html new file mode 100644 index 0000000..2963271 --- /dev/null +++ b/syn/token/struct.Yield.html @@ -0,0 +1,27 @@ +syn::token::Yield - Rust

[][src]Struct syn::token::Yield

pub struct Yield {
+    pub span: Span,
+}

yield

+

Don't try to remember the name of this type — use the +Token! macro instead.

+

+ Fields

span: Span

Trait Implementations

impl Clone for Yield[src]

impl Copy for Yield[src]

impl Default for Yield[src]

impl Parse for Yield[src]

impl ToTokens for Yield[src]

impl Token for Yield[src]

Auto Trait Implementations

impl !RefUnwindSafe for Yield

impl !Send for Yield

impl !Sync for Yield

impl Unpin for Yield

impl UnwindSafe for Yield

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

+

impl<T> Token for T where
    T: CustomToken, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

+

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

+
\ No newline at end of file diff --git a/syn/token/trait.Token.html b/syn/token/trait.Token.html new file mode 100644 index 0000000..7da19a7 --- /dev/null +++ b/syn/token/trait.Token.html @@ -0,0 +1,4 @@ +syn::token::Token - Rust

[][src]Trait syn::token::Token

pub trait Token: Sealed { }

Marker trait for types that represent single tokens.

+

This trait is sealed and cannot be implemented for types outside of Syn.

+
+

Implementors

impl Token for Lit[src]

impl Token for Ident[src]

impl Token for Lifetime[src]

impl Token for LitBool[src]

impl Token for LitByte[src]

impl Token for LitByteStr[src]

impl Token for LitChar[src]

impl Token for LitFloat[src]

impl Token for LitInt[src]

impl Token for LitStr[src]

impl Token for Abstract[src]

impl Token for Add[src]

impl Token for AddEq[src]

impl Token for And[src]

impl Token for AndAnd[src]

impl Token for AndEq[src]

impl Token for As[src]

impl Token for Async[src]

impl Token for At[src]

impl Token for Auto[src]

impl Token for Await[src]

impl Token for Bang[src]

impl Token for Become[src]

impl Token for Box[src]

impl Token for Brace[src]

impl Token for Bracket[src]

impl Token for Break[src]

impl Token for Caret[src]

impl Token for CaretEq[src]

impl Token for Colon[src]

impl Token for Colon2[src]

impl Token for Comma[src]

impl Token for Const[src]

impl Token for Continue[src]

impl Token for Crate[src]

impl Token for Default[src]

impl Token for Div[src]

impl Token for DivEq[src]

impl Token for Do[src]

impl Token for Dollar[src]

impl Token for Dot[src]

impl Token for Dot2[src]

impl Token for Dot3[src]

impl Token for DotDotEq[src]

impl Token for Dyn[src]

impl Token for Else[src]

impl Token for Enum[src]

impl Token for Eq[src]

impl Token for EqEq[src]

impl Token for Extern[src]

impl Token for FatArrow[src]

impl Token for Final[src]

impl Token for Fn[src]

impl Token for For[src]

impl Token for Ge[src]

impl Token for Group[src]

impl Token for Gt[src]

impl Token for If[src]

impl Token for Impl[src]

impl Token for In[src]

impl Token for LArrow[src]

impl Token for Le[src]

impl Token for Let[src]

impl Token for Loop[src]

impl Token for Lt[src]

impl Token for Macro[src]

impl Token for Match[src]

impl Token for Mod[src]

impl Token for Move[src]

impl Token for MulEq[src]

impl Token for Mut[src]

impl Token for Ne[src]

impl Token for Or[src]

impl Token for OrEq[src]

impl Token for OrOr[src]

impl Token for Override[src]

impl Token for Paren[src]

impl Token for Pound[src]

impl Token for Priv[src]

impl Token for Pub[src]

impl Token for Question[src]

impl Token for RArrow[src]

impl Token for Ref[src]

impl Token for Rem[src]

impl Token for RemEq[src]

impl Token for Return[src]

impl Token for SelfType[src]

impl Token for SelfValue[src]

impl Token for Semi[src]

impl Token for Shl[src]

impl Token for ShlEq[src]

impl Token for Shr[src]

impl Token for ShrEq[src]

impl Token for Star[src]

impl Token for Static[src]

impl Token for Struct[src]

impl Token for Sub[src]

impl Token for SubEq[src]

impl Token for Super[src]

impl Token for Tilde[src]

impl Token for Trait[src]

impl Token for Try[src]

impl Token for Type[src]

impl Token for Typeof[src]

impl Token for Underscore[src]

impl Token for Union[src]

impl Token for Unsafe[src]

impl Token for Unsized[src]

impl Token for Use[src]

impl Token for Virtual[src]

impl Token for Where[src]

impl Token for While[src]

impl Token for Yield[src]

impl<T: CustomToken> Token for T[src]

Loading content...
\ No newline at end of file diff --git a/syn/ty/enum.ReturnType.html b/syn/ty/enum.ReturnType.html new file mode 100644 index 0000000..ff197f3 --- /dev/null +++ b/syn/ty/enum.ReturnType.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.ReturnType.html...

+ + + \ No newline at end of file diff --git a/syn/ty/enum.Type.html b/syn/ty/enum.Type.html new file mode 100644 index 0000000..47f6871 --- /dev/null +++ b/syn/ty/enum.Type.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/enum.Type.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.Abi.html b/syn/ty/struct.Abi.html new file mode 100644 index 0000000..92b3ab9 --- /dev/null +++ b/syn/ty/struct.Abi.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Abi.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.BareFnArg.html b/syn/ty/struct.BareFnArg.html new file mode 100644 index 0000000..b0b1db0 --- /dev/null +++ b/syn/ty/struct.BareFnArg.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.BareFnArg.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeArray.html b/syn/ty/struct.TypeArray.html new file mode 100644 index 0000000..e99dfcc --- /dev/null +++ b/syn/ty/struct.TypeArray.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypeArray.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeBareFn.html b/syn/ty/struct.TypeBareFn.html new file mode 100644 index 0000000..59142cf --- /dev/null +++ b/syn/ty/struct.TypeBareFn.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypeBareFn.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeGroup.html b/syn/ty/struct.TypeGroup.html new file mode 100644 index 0000000..f0dd3a7 --- /dev/null +++ b/syn/ty/struct.TypeGroup.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypeGroup.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeImplTrait.html b/syn/ty/struct.TypeImplTrait.html new file mode 100644 index 0000000..8e02aae --- /dev/null +++ b/syn/ty/struct.TypeImplTrait.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypeImplTrait.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeInfer.html b/syn/ty/struct.TypeInfer.html new file mode 100644 index 0000000..e71eef6 --- /dev/null +++ b/syn/ty/struct.TypeInfer.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypeInfer.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeMacro.html b/syn/ty/struct.TypeMacro.html new file mode 100644 index 0000000..087a397 --- /dev/null +++ b/syn/ty/struct.TypeMacro.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypeMacro.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeNever.html b/syn/ty/struct.TypeNever.html new file mode 100644 index 0000000..8583d0b --- /dev/null +++ b/syn/ty/struct.TypeNever.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypeNever.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeParen.html b/syn/ty/struct.TypeParen.html new file mode 100644 index 0000000..12cd63f --- /dev/null +++ b/syn/ty/struct.TypeParen.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypeParen.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypePath.html b/syn/ty/struct.TypePath.html new file mode 100644 index 0000000..1f5934a --- /dev/null +++ b/syn/ty/struct.TypePath.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypePath.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypePtr.html b/syn/ty/struct.TypePtr.html new file mode 100644 index 0000000..3c38853 --- /dev/null +++ b/syn/ty/struct.TypePtr.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypePtr.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeReference.html b/syn/ty/struct.TypeReference.html new file mode 100644 index 0000000..8a4be3f --- /dev/null +++ b/syn/ty/struct.TypeReference.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypeReference.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeSlice.html b/syn/ty/struct.TypeSlice.html new file mode 100644 index 0000000..4667a88 --- /dev/null +++ b/syn/ty/struct.TypeSlice.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypeSlice.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeTraitObject.html b/syn/ty/struct.TypeTraitObject.html new file mode 100644 index 0000000..61a97c5 --- /dev/null +++ b/syn/ty/struct.TypeTraitObject.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypeTraitObject.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeTuple.html b/syn/ty/struct.TypeTuple.html new file mode 100644 index 0000000..f3a297b --- /dev/null +++ b/syn/ty/struct.TypeTuple.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.TypeTuple.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.Variadic.html b/syn/ty/struct.Variadic.html new file mode 100644 index 0000000..508b214 --- /dev/null +++ b/syn/ty/struct.Variadic.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../syn/struct.Variadic.html...

+ + + \ No newline at end of file diff --git a/syn/type.AttributeArgs.html b/syn/type.AttributeArgs.html new file mode 100644 index 0000000..32d699d --- /dev/null +++ b/syn/type.AttributeArgs.html @@ -0,0 +1,27 @@ +syn::AttributeArgs - Rust

[][src]Type Definition syn::AttributeArgs

type AttributeArgs = Vec<NestedMeta>;

Conventional argument type associated with an invocation of an attribute +macro.

+

For example if we are developing an attribute macro that is intended to be +invoked on function items as follows:

+ +
+#[my_attribute(path = "/v1/refresh")]
+pub fn refresh() {
+    /* ... */
+}
+

The implementation of this macro would want to parse its attribute arguments +as type AttributeArgs.

+ +
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+use syn::{parse_macro_input, AttributeArgs, ItemFn};
+
+#[proc_macro_attribute]
+pub fn my_attribute(args: TokenStream, input: TokenStream) -> TokenStream {
+    let args = parse_macro_input!(args as AttributeArgs);
+    let input = parse_macro_input!(input as ItemFn);
+
+    /* ... */
+}
+
\ No newline at end of file diff --git a/syn/type.Result.html b/syn/type.Result.html new file mode 100644 index 0000000..e67eb35 --- /dev/null +++ b/syn/type.Result.html @@ -0,0 +1,2 @@ +syn::Result - Rust

[][src]Type Definition syn::Result

type Result<T> = Result<T, Error>;

The result of a Syn parser.

+
\ No newline at end of file diff --git a/syn/visit/fn.visit_abi.html b/syn/visit/fn.visit_abi.html new file mode 100644 index 0000000..2e69131 --- /dev/null +++ b/syn/visit/fn.visit_abi.html @@ -0,0 +1 @@ +syn::visit::visit_abi - Rust

[][src]Function syn::visit::visit_abi

pub fn visit_abi<'ast, V: ?Sized>(v: &mut V, node: &'ast Abi) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_angle_bracketed_generic_arguments.html b/syn/visit/fn.visit_angle_bracketed_generic_arguments.html new file mode 100644 index 0000000..1606d89 --- /dev/null +++ b/syn/visit/fn.visit_angle_bracketed_generic_arguments.html @@ -0,0 +1 @@ +syn::visit::visit_angle_bracketed_generic_arguments - Rust

[][src]Function syn::visit::visit_angle_bracketed_generic_arguments

pub fn visit_angle_bracketed_generic_arguments<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast AngleBracketedGenericArguments
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_attr_style.html b/syn/visit/fn.visit_attr_style.html new file mode 100644 index 0000000..6cac108 --- /dev/null +++ b/syn/visit/fn.visit_attr_style.html @@ -0,0 +1 @@ +syn::visit::visit_attr_style - Rust

[][src]Function syn::visit::visit_attr_style

pub fn visit_attr_style<'ast, V: ?Sized>(v: &mut V, node: &'ast AttrStyle) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_attribute.html b/syn/visit/fn.visit_attribute.html new file mode 100644 index 0000000..5e40416 --- /dev/null +++ b/syn/visit/fn.visit_attribute.html @@ -0,0 +1 @@ +syn::visit::visit_attribute - Rust

[][src]Function syn::visit::visit_attribute

pub fn visit_attribute<'ast, V: ?Sized>(v: &mut V, node: &'ast Attribute) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_bare_fn_arg.html b/syn/visit/fn.visit_bare_fn_arg.html new file mode 100644 index 0000000..874e8ee --- /dev/null +++ b/syn/visit/fn.visit_bare_fn_arg.html @@ -0,0 +1 @@ +syn::visit::visit_bare_fn_arg - Rust

[][src]Function syn::visit::visit_bare_fn_arg

pub fn visit_bare_fn_arg<'ast, V: ?Sized>(v: &mut V, node: &'ast BareFnArg) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_bin_op.html b/syn/visit/fn.visit_bin_op.html new file mode 100644 index 0000000..f139ee9 --- /dev/null +++ b/syn/visit/fn.visit_bin_op.html @@ -0,0 +1 @@ +syn::visit::visit_bin_op - Rust

[][src]Function syn::visit::visit_bin_op

pub fn visit_bin_op<'ast, V: ?Sized>(v: &mut V, node: &'ast BinOp) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_binding.html b/syn/visit/fn.visit_binding.html new file mode 100644 index 0000000..2e6c0b8 --- /dev/null +++ b/syn/visit/fn.visit_binding.html @@ -0,0 +1 @@ +syn::visit::visit_binding - Rust

[][src]Function syn::visit::visit_binding

pub fn visit_binding<'ast, V: ?Sized>(v: &mut V, node: &'ast Binding) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_bound_lifetimes.html b/syn/visit/fn.visit_bound_lifetimes.html new file mode 100644 index 0000000..a191bda --- /dev/null +++ b/syn/visit/fn.visit_bound_lifetimes.html @@ -0,0 +1 @@ +syn::visit::visit_bound_lifetimes - Rust

[][src]Function syn::visit::visit_bound_lifetimes

pub fn visit_bound_lifetimes<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast BoundLifetimes
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_const_param.html b/syn/visit/fn.visit_const_param.html new file mode 100644 index 0000000..878779d --- /dev/null +++ b/syn/visit/fn.visit_const_param.html @@ -0,0 +1 @@ +syn::visit::visit_const_param - Rust

[][src]Function syn::visit::visit_const_param

pub fn visit_const_param<'ast, V: ?Sized>(v: &mut V, node: &'ast ConstParam) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_constraint.html b/syn/visit/fn.visit_constraint.html new file mode 100644 index 0000000..7afd6e2 --- /dev/null +++ b/syn/visit/fn.visit_constraint.html @@ -0,0 +1 @@ +syn::visit::visit_constraint - Rust

[][src]Function syn::visit::visit_constraint

pub fn visit_constraint<'ast, V: ?Sized>(v: &mut V, node: &'ast Constraint) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_data.html b/syn/visit/fn.visit_data.html new file mode 100644 index 0000000..fa56672 --- /dev/null +++ b/syn/visit/fn.visit_data.html @@ -0,0 +1 @@ +syn::visit::visit_data - Rust

[][src]Function syn::visit::visit_data

pub fn visit_data<'ast, V: ?Sized>(v: &mut V, node: &'ast Data) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_data_enum.html b/syn/visit/fn.visit_data_enum.html new file mode 100644 index 0000000..f03f617 --- /dev/null +++ b/syn/visit/fn.visit_data_enum.html @@ -0,0 +1 @@ +syn::visit::visit_data_enum - Rust

[][src]Function syn::visit::visit_data_enum

pub fn visit_data_enum<'ast, V: ?Sized>(v: &mut V, node: &'ast DataEnum) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_data_struct.html b/syn/visit/fn.visit_data_struct.html new file mode 100644 index 0000000..81d3b7b --- /dev/null +++ b/syn/visit/fn.visit_data_struct.html @@ -0,0 +1 @@ +syn::visit::visit_data_struct - Rust

[][src]Function syn::visit::visit_data_struct

pub fn visit_data_struct<'ast, V: ?Sized>(v: &mut V, node: &'ast DataStruct) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_data_union.html b/syn/visit/fn.visit_data_union.html new file mode 100644 index 0000000..36e0837 --- /dev/null +++ b/syn/visit/fn.visit_data_union.html @@ -0,0 +1 @@ +syn::visit::visit_data_union - Rust

[][src]Function syn::visit::visit_data_union

pub fn visit_data_union<'ast, V: ?Sized>(v: &mut V, node: &'ast DataUnion) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_derive_input.html b/syn/visit/fn.visit_derive_input.html new file mode 100644 index 0000000..63b4072 --- /dev/null +++ b/syn/visit/fn.visit_derive_input.html @@ -0,0 +1 @@ +syn::visit::visit_derive_input - Rust

[][src]Function syn::visit::visit_derive_input

pub fn visit_derive_input<'ast, V: ?Sized>(v: &mut V, node: &'ast DeriveInput) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_expr.html b/syn/visit/fn.visit_expr.html new file mode 100644 index 0000000..6ed5436 --- /dev/null +++ b/syn/visit/fn.visit_expr.html @@ -0,0 +1 @@ +syn::visit::visit_expr - Rust

[][src]Function syn::visit::visit_expr

pub fn visit_expr<'ast, V: ?Sized>(v: &mut V, node: &'ast Expr) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_expr_binary.html b/syn/visit/fn.visit_expr_binary.html new file mode 100644 index 0000000..51c72d0 --- /dev/null +++ b/syn/visit/fn.visit_expr_binary.html @@ -0,0 +1 @@ +syn::visit::visit_expr_binary - Rust

[][src]Function syn::visit::visit_expr_binary

pub fn visit_expr_binary<'ast, V: ?Sized>(v: &mut V, node: &'ast ExprBinary) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_expr_call.html b/syn/visit/fn.visit_expr_call.html new file mode 100644 index 0000000..3c01127 --- /dev/null +++ b/syn/visit/fn.visit_expr_call.html @@ -0,0 +1 @@ +syn::visit::visit_expr_call - Rust

[][src]Function syn::visit::visit_expr_call

pub fn visit_expr_call<'ast, V: ?Sized>(v: &mut V, node: &'ast ExprCall) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_expr_cast.html b/syn/visit/fn.visit_expr_cast.html new file mode 100644 index 0000000..4ca4512 --- /dev/null +++ b/syn/visit/fn.visit_expr_cast.html @@ -0,0 +1 @@ +syn::visit::visit_expr_cast - Rust

[][src]Function syn::visit::visit_expr_cast

pub fn visit_expr_cast<'ast, V: ?Sized>(v: &mut V, node: &'ast ExprCast) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_expr_field.html b/syn/visit/fn.visit_expr_field.html new file mode 100644 index 0000000..a925c04 --- /dev/null +++ b/syn/visit/fn.visit_expr_field.html @@ -0,0 +1 @@ +syn::visit::visit_expr_field - Rust

[][src]Function syn::visit::visit_expr_field

pub fn visit_expr_field<'ast, V: ?Sized>(v: &mut V, node: &'ast ExprField) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_expr_index.html b/syn/visit/fn.visit_expr_index.html new file mode 100644 index 0000000..7eb1f98 --- /dev/null +++ b/syn/visit/fn.visit_expr_index.html @@ -0,0 +1 @@ +syn::visit::visit_expr_index - Rust

[][src]Function syn::visit::visit_expr_index

pub fn visit_expr_index<'ast, V: ?Sized>(v: &mut V, node: &'ast ExprIndex) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_expr_lit.html b/syn/visit/fn.visit_expr_lit.html new file mode 100644 index 0000000..c2449d0 --- /dev/null +++ b/syn/visit/fn.visit_expr_lit.html @@ -0,0 +1 @@ +syn::visit::visit_expr_lit - Rust

[][src]Function syn::visit::visit_expr_lit

pub fn visit_expr_lit<'ast, V: ?Sized>(v: &mut V, node: &'ast ExprLit) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_expr_paren.html b/syn/visit/fn.visit_expr_paren.html new file mode 100644 index 0000000..a11c103 --- /dev/null +++ b/syn/visit/fn.visit_expr_paren.html @@ -0,0 +1 @@ +syn::visit::visit_expr_paren - Rust

[][src]Function syn::visit::visit_expr_paren

pub fn visit_expr_paren<'ast, V: ?Sized>(v: &mut V, node: &'ast ExprParen) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_expr_path.html b/syn/visit/fn.visit_expr_path.html new file mode 100644 index 0000000..59271fd --- /dev/null +++ b/syn/visit/fn.visit_expr_path.html @@ -0,0 +1 @@ +syn::visit::visit_expr_path - Rust

[][src]Function syn::visit::visit_expr_path

pub fn visit_expr_path<'ast, V: ?Sized>(v: &mut V, node: &'ast ExprPath) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_expr_unary.html b/syn/visit/fn.visit_expr_unary.html new file mode 100644 index 0000000..f9ff173 --- /dev/null +++ b/syn/visit/fn.visit_expr_unary.html @@ -0,0 +1 @@ +syn::visit::visit_expr_unary - Rust

[][src]Function syn::visit::visit_expr_unary

pub fn visit_expr_unary<'ast, V: ?Sized>(v: &mut V, node: &'ast ExprUnary) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_field.html b/syn/visit/fn.visit_field.html new file mode 100644 index 0000000..43c3fcb --- /dev/null +++ b/syn/visit/fn.visit_field.html @@ -0,0 +1 @@ +syn::visit::visit_field - Rust

[][src]Function syn::visit::visit_field

pub fn visit_field<'ast, V: ?Sized>(v: &mut V, node: &'ast Field) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_fields.html b/syn/visit/fn.visit_fields.html new file mode 100644 index 0000000..c8f1187 --- /dev/null +++ b/syn/visit/fn.visit_fields.html @@ -0,0 +1 @@ +syn::visit::visit_fields - Rust

[][src]Function syn::visit::visit_fields

pub fn visit_fields<'ast, V: ?Sized>(v: &mut V, node: &'ast Fields) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_fields_named.html b/syn/visit/fn.visit_fields_named.html new file mode 100644 index 0000000..00ad8f5 --- /dev/null +++ b/syn/visit/fn.visit_fields_named.html @@ -0,0 +1 @@ +syn::visit::visit_fields_named - Rust

[][src]Function syn::visit::visit_fields_named

pub fn visit_fields_named<'ast, V: ?Sized>(v: &mut V, node: &'ast FieldsNamed) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_fields_unnamed.html b/syn/visit/fn.visit_fields_unnamed.html new file mode 100644 index 0000000..aa66cb9 --- /dev/null +++ b/syn/visit/fn.visit_fields_unnamed.html @@ -0,0 +1 @@ +syn::visit::visit_fields_unnamed - Rust

[][src]Function syn::visit::visit_fields_unnamed

pub fn visit_fields_unnamed<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast FieldsUnnamed
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_generic_argument.html b/syn/visit/fn.visit_generic_argument.html new file mode 100644 index 0000000..b52c683 --- /dev/null +++ b/syn/visit/fn.visit_generic_argument.html @@ -0,0 +1 @@ +syn::visit::visit_generic_argument - Rust

[][src]Function syn::visit::visit_generic_argument

pub fn visit_generic_argument<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast GenericArgument
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_generic_param.html b/syn/visit/fn.visit_generic_param.html new file mode 100644 index 0000000..3062dbf --- /dev/null +++ b/syn/visit/fn.visit_generic_param.html @@ -0,0 +1 @@ +syn::visit::visit_generic_param - Rust

[][src]Function syn::visit::visit_generic_param

pub fn visit_generic_param<'ast, V: ?Sized>(v: &mut V, node: &'ast GenericParam) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_generics.html b/syn/visit/fn.visit_generics.html new file mode 100644 index 0000000..090476d --- /dev/null +++ b/syn/visit/fn.visit_generics.html @@ -0,0 +1 @@ +syn::visit::visit_generics - Rust

[][src]Function syn::visit::visit_generics

pub fn visit_generics<'ast, V: ?Sized>(v: &mut V, node: &'ast Generics) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_ident.html b/syn/visit/fn.visit_ident.html new file mode 100644 index 0000000..f6d43f9 --- /dev/null +++ b/syn/visit/fn.visit_ident.html @@ -0,0 +1 @@ +syn::visit::visit_ident - Rust

[][src]Function syn::visit::visit_ident

pub fn visit_ident<'ast, V: ?Sized>(v: &mut V, node: &'ast Ident) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_index.html b/syn/visit/fn.visit_index.html new file mode 100644 index 0000000..7e8ebd0 --- /dev/null +++ b/syn/visit/fn.visit_index.html @@ -0,0 +1 @@ +syn::visit::visit_index - Rust

[][src]Function syn::visit::visit_index

pub fn visit_index<'ast, V: ?Sized>(v: &mut V, node: &'ast Index) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_lifetime.html b/syn/visit/fn.visit_lifetime.html new file mode 100644 index 0000000..d86e2d1 --- /dev/null +++ b/syn/visit/fn.visit_lifetime.html @@ -0,0 +1 @@ +syn::visit::visit_lifetime - Rust

[][src]Function syn::visit::visit_lifetime

pub fn visit_lifetime<'ast, V: ?Sized>(v: &mut V, node: &'ast Lifetime) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_lifetime_def.html b/syn/visit/fn.visit_lifetime_def.html new file mode 100644 index 0000000..d7fdbd0 --- /dev/null +++ b/syn/visit/fn.visit_lifetime_def.html @@ -0,0 +1 @@ +syn::visit::visit_lifetime_def - Rust

[][src]Function syn::visit::visit_lifetime_def

pub fn visit_lifetime_def<'ast, V: ?Sized>(v: &mut V, node: &'ast LifetimeDef) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_lit.html b/syn/visit/fn.visit_lit.html new file mode 100644 index 0000000..a8a2dea --- /dev/null +++ b/syn/visit/fn.visit_lit.html @@ -0,0 +1 @@ +syn::visit::visit_lit - Rust

[][src]Function syn::visit::visit_lit

pub fn visit_lit<'ast, V: ?Sized>(v: &mut V, node: &'ast Lit) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_lit_bool.html b/syn/visit/fn.visit_lit_bool.html new file mode 100644 index 0000000..7ccc72a --- /dev/null +++ b/syn/visit/fn.visit_lit_bool.html @@ -0,0 +1 @@ +syn::visit::visit_lit_bool - Rust

[][src]Function syn::visit::visit_lit_bool

pub fn visit_lit_bool<'ast, V: ?Sized>(v: &mut V, node: &'ast LitBool) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_lit_byte.html b/syn/visit/fn.visit_lit_byte.html new file mode 100644 index 0000000..743f55a --- /dev/null +++ b/syn/visit/fn.visit_lit_byte.html @@ -0,0 +1 @@ +syn::visit::visit_lit_byte - Rust

[][src]Function syn::visit::visit_lit_byte

pub fn visit_lit_byte<'ast, V: ?Sized>(v: &mut V, node: &'ast LitByte) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_lit_byte_str.html b/syn/visit/fn.visit_lit_byte_str.html new file mode 100644 index 0000000..1d114de --- /dev/null +++ b/syn/visit/fn.visit_lit_byte_str.html @@ -0,0 +1 @@ +syn::visit::visit_lit_byte_str - Rust

[][src]Function syn::visit::visit_lit_byte_str

pub fn visit_lit_byte_str<'ast, V: ?Sized>(v: &mut V, node: &'ast LitByteStr) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_lit_char.html b/syn/visit/fn.visit_lit_char.html new file mode 100644 index 0000000..85030ea --- /dev/null +++ b/syn/visit/fn.visit_lit_char.html @@ -0,0 +1 @@ +syn::visit::visit_lit_char - Rust

[][src]Function syn::visit::visit_lit_char

pub fn visit_lit_char<'ast, V: ?Sized>(v: &mut V, node: &'ast LitChar) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_lit_float.html b/syn/visit/fn.visit_lit_float.html new file mode 100644 index 0000000..8bd83e8 --- /dev/null +++ b/syn/visit/fn.visit_lit_float.html @@ -0,0 +1 @@ +syn::visit::visit_lit_float - Rust

[][src]Function syn::visit::visit_lit_float

pub fn visit_lit_float<'ast, V: ?Sized>(v: &mut V, node: &'ast LitFloat) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_lit_int.html b/syn/visit/fn.visit_lit_int.html new file mode 100644 index 0000000..e88ae8c --- /dev/null +++ b/syn/visit/fn.visit_lit_int.html @@ -0,0 +1 @@ +syn::visit::visit_lit_int - Rust

[][src]Function syn::visit::visit_lit_int

pub fn visit_lit_int<'ast, V: ?Sized>(v: &mut V, node: &'ast LitInt) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_lit_str.html b/syn/visit/fn.visit_lit_str.html new file mode 100644 index 0000000..ec2f636 --- /dev/null +++ b/syn/visit/fn.visit_lit_str.html @@ -0,0 +1 @@ +syn::visit::visit_lit_str - Rust

[][src]Function syn::visit::visit_lit_str

pub fn visit_lit_str<'ast, V: ?Sized>(v: &mut V, node: &'ast LitStr) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_macro.html b/syn/visit/fn.visit_macro.html new file mode 100644 index 0000000..76c1396 --- /dev/null +++ b/syn/visit/fn.visit_macro.html @@ -0,0 +1 @@ +syn::visit::visit_macro - Rust

[][src]Function syn::visit::visit_macro

pub fn visit_macro<'ast, V: ?Sized>(v: &mut V, node: &'ast Macro) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_macro_delimiter.html b/syn/visit/fn.visit_macro_delimiter.html new file mode 100644 index 0000000..41b81ef --- /dev/null +++ b/syn/visit/fn.visit_macro_delimiter.html @@ -0,0 +1 @@ +syn::visit::visit_macro_delimiter - Rust

[][src]Function syn::visit::visit_macro_delimiter

pub fn visit_macro_delimiter<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast MacroDelimiter
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_member.html b/syn/visit/fn.visit_member.html new file mode 100644 index 0000000..589b1c0 --- /dev/null +++ b/syn/visit/fn.visit_member.html @@ -0,0 +1 @@ +syn::visit::visit_member - Rust

[][src]Function syn::visit::visit_member

pub fn visit_member<'ast, V: ?Sized>(v: &mut V, node: &'ast Member) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_meta.html b/syn/visit/fn.visit_meta.html new file mode 100644 index 0000000..f376fc5 --- /dev/null +++ b/syn/visit/fn.visit_meta.html @@ -0,0 +1 @@ +syn::visit::visit_meta - Rust

[][src]Function syn::visit::visit_meta

pub fn visit_meta<'ast, V: ?Sized>(v: &mut V, node: &'ast Meta) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_meta_list.html b/syn/visit/fn.visit_meta_list.html new file mode 100644 index 0000000..442fca2 --- /dev/null +++ b/syn/visit/fn.visit_meta_list.html @@ -0,0 +1 @@ +syn::visit::visit_meta_list - Rust

[][src]Function syn::visit::visit_meta_list

pub fn visit_meta_list<'ast, V: ?Sized>(v: &mut V, node: &'ast MetaList) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_meta_name_value.html b/syn/visit/fn.visit_meta_name_value.html new file mode 100644 index 0000000..e0439d8 --- /dev/null +++ b/syn/visit/fn.visit_meta_name_value.html @@ -0,0 +1 @@ +syn::visit::visit_meta_name_value - Rust

[][src]Function syn::visit::visit_meta_name_value

pub fn visit_meta_name_value<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast MetaNameValue
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_nested_meta.html b/syn/visit/fn.visit_nested_meta.html new file mode 100644 index 0000000..9997e1c --- /dev/null +++ b/syn/visit/fn.visit_nested_meta.html @@ -0,0 +1 @@ +syn::visit::visit_nested_meta - Rust

[][src]Function syn::visit::visit_nested_meta

pub fn visit_nested_meta<'ast, V: ?Sized>(v: &mut V, node: &'ast NestedMeta) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_parenthesized_generic_arguments.html b/syn/visit/fn.visit_parenthesized_generic_arguments.html new file mode 100644 index 0000000..11a730a --- /dev/null +++ b/syn/visit/fn.visit_parenthesized_generic_arguments.html @@ -0,0 +1 @@ +syn::visit::visit_parenthesized_generic_arguments - Rust

[][src]Function syn::visit::visit_parenthesized_generic_arguments

pub fn visit_parenthesized_generic_arguments<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast ParenthesizedGenericArguments
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_path.html b/syn/visit/fn.visit_path.html new file mode 100644 index 0000000..833ce99 --- /dev/null +++ b/syn/visit/fn.visit_path.html @@ -0,0 +1 @@ +syn::visit::visit_path - Rust

[][src]Function syn::visit::visit_path

pub fn visit_path<'ast, V: ?Sized>(v: &mut V, node: &'ast Path) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_path_arguments.html b/syn/visit/fn.visit_path_arguments.html new file mode 100644 index 0000000..5e83f58 --- /dev/null +++ b/syn/visit/fn.visit_path_arguments.html @@ -0,0 +1 @@ +syn::visit::visit_path_arguments - Rust

[][src]Function syn::visit::visit_path_arguments

pub fn visit_path_arguments<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast PathArguments
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_path_segment.html b/syn/visit/fn.visit_path_segment.html new file mode 100644 index 0000000..e3f3173 --- /dev/null +++ b/syn/visit/fn.visit_path_segment.html @@ -0,0 +1 @@ +syn::visit::visit_path_segment - Rust

[][src]Function syn::visit::visit_path_segment

pub fn visit_path_segment<'ast, V: ?Sized>(v: &mut V, node: &'ast PathSegment) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_predicate_eq.html b/syn/visit/fn.visit_predicate_eq.html new file mode 100644 index 0000000..591a2f0 --- /dev/null +++ b/syn/visit/fn.visit_predicate_eq.html @@ -0,0 +1 @@ +syn::visit::visit_predicate_eq - Rust

[][src]Function syn::visit::visit_predicate_eq

pub fn visit_predicate_eq<'ast, V: ?Sized>(v: &mut V, node: &'ast PredicateEq) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_predicate_lifetime.html b/syn/visit/fn.visit_predicate_lifetime.html new file mode 100644 index 0000000..aef0c1e --- /dev/null +++ b/syn/visit/fn.visit_predicate_lifetime.html @@ -0,0 +1 @@ +syn::visit::visit_predicate_lifetime - Rust

[][src]Function syn::visit::visit_predicate_lifetime

pub fn visit_predicate_lifetime<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast PredicateLifetime
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_predicate_type.html b/syn/visit/fn.visit_predicate_type.html new file mode 100644 index 0000000..a678022 --- /dev/null +++ b/syn/visit/fn.visit_predicate_type.html @@ -0,0 +1 @@ +syn::visit::visit_predicate_type - Rust

[][src]Function syn::visit::visit_predicate_type

pub fn visit_predicate_type<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast PredicateType
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_qself.html b/syn/visit/fn.visit_qself.html new file mode 100644 index 0000000..597e088 --- /dev/null +++ b/syn/visit/fn.visit_qself.html @@ -0,0 +1 @@ +syn::visit::visit_qself - Rust

[][src]Function syn::visit::visit_qself

pub fn visit_qself<'ast, V: ?Sized>(v: &mut V, node: &'ast QSelf) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_return_type.html b/syn/visit/fn.visit_return_type.html new file mode 100644 index 0000000..149bda5 --- /dev/null +++ b/syn/visit/fn.visit_return_type.html @@ -0,0 +1 @@ +syn::visit::visit_return_type - Rust

[][src]Function syn::visit::visit_return_type

pub fn visit_return_type<'ast, V: ?Sized>(v: &mut V, node: &'ast ReturnType) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_span.html b/syn/visit/fn.visit_span.html new file mode 100644 index 0000000..5242ca8 --- /dev/null +++ b/syn/visit/fn.visit_span.html @@ -0,0 +1 @@ +syn::visit::visit_span - Rust

[][src]Function syn::visit::visit_span

pub fn visit_span<'ast, V: ?Sized>(v: &mut V, node: &Span) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_trait_bound.html b/syn/visit/fn.visit_trait_bound.html new file mode 100644 index 0000000..3b84f84 --- /dev/null +++ b/syn/visit/fn.visit_trait_bound.html @@ -0,0 +1 @@ +syn::visit::visit_trait_bound - Rust

[][src]Function syn::visit::visit_trait_bound

pub fn visit_trait_bound<'ast, V: ?Sized>(v: &mut V, node: &'ast TraitBound) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_trait_bound_modifier.html b/syn/visit/fn.visit_trait_bound_modifier.html new file mode 100644 index 0000000..63e3fd2 --- /dev/null +++ b/syn/visit/fn.visit_trait_bound_modifier.html @@ -0,0 +1 @@ +syn::visit::visit_trait_bound_modifier - Rust

[][src]Function syn::visit::visit_trait_bound_modifier

pub fn visit_trait_bound_modifier<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast TraitBoundModifier
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type.html b/syn/visit/fn.visit_type.html new file mode 100644 index 0000000..a52cf67 --- /dev/null +++ b/syn/visit/fn.visit_type.html @@ -0,0 +1 @@ +syn::visit::visit_type - Rust

[][src]Function syn::visit::visit_type

pub fn visit_type<'ast, V: ?Sized>(v: &mut V, node: &'ast Type) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_array.html b/syn/visit/fn.visit_type_array.html new file mode 100644 index 0000000..7c324dc --- /dev/null +++ b/syn/visit/fn.visit_type_array.html @@ -0,0 +1 @@ +syn::visit::visit_type_array - Rust

[][src]Function syn::visit::visit_type_array

pub fn visit_type_array<'ast, V: ?Sized>(v: &mut V, node: &'ast TypeArray) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_bare_fn.html b/syn/visit/fn.visit_type_bare_fn.html new file mode 100644 index 0000000..9f195f8 --- /dev/null +++ b/syn/visit/fn.visit_type_bare_fn.html @@ -0,0 +1 @@ +syn::visit::visit_type_bare_fn - Rust

[][src]Function syn::visit::visit_type_bare_fn

pub fn visit_type_bare_fn<'ast, V: ?Sized>(v: &mut V, node: &'ast TypeBareFn) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_group.html b/syn/visit/fn.visit_type_group.html new file mode 100644 index 0000000..ff39b06 --- /dev/null +++ b/syn/visit/fn.visit_type_group.html @@ -0,0 +1 @@ +syn::visit::visit_type_group - Rust

[][src]Function syn::visit::visit_type_group

pub fn visit_type_group<'ast, V: ?Sized>(v: &mut V, node: &'ast TypeGroup) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_impl_trait.html b/syn/visit/fn.visit_type_impl_trait.html new file mode 100644 index 0000000..155ab6b --- /dev/null +++ b/syn/visit/fn.visit_type_impl_trait.html @@ -0,0 +1 @@ +syn::visit::visit_type_impl_trait - Rust

[][src]Function syn::visit::visit_type_impl_trait

pub fn visit_type_impl_trait<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast TypeImplTrait
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_infer.html b/syn/visit/fn.visit_type_infer.html new file mode 100644 index 0000000..f93b555 --- /dev/null +++ b/syn/visit/fn.visit_type_infer.html @@ -0,0 +1 @@ +syn::visit::visit_type_infer - Rust

[][src]Function syn::visit::visit_type_infer

pub fn visit_type_infer<'ast, V: ?Sized>(v: &mut V, node: &'ast TypeInfer) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_macro.html b/syn/visit/fn.visit_type_macro.html new file mode 100644 index 0000000..e179a50 --- /dev/null +++ b/syn/visit/fn.visit_type_macro.html @@ -0,0 +1 @@ +syn::visit::visit_type_macro - Rust

[][src]Function syn::visit::visit_type_macro

pub fn visit_type_macro<'ast, V: ?Sized>(v: &mut V, node: &'ast TypeMacro) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_never.html b/syn/visit/fn.visit_type_never.html new file mode 100644 index 0000000..0c5f18b --- /dev/null +++ b/syn/visit/fn.visit_type_never.html @@ -0,0 +1 @@ +syn::visit::visit_type_never - Rust

[][src]Function syn::visit::visit_type_never

pub fn visit_type_never<'ast, V: ?Sized>(v: &mut V, node: &'ast TypeNever) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_param.html b/syn/visit/fn.visit_type_param.html new file mode 100644 index 0000000..d7ce662 --- /dev/null +++ b/syn/visit/fn.visit_type_param.html @@ -0,0 +1 @@ +syn::visit::visit_type_param - Rust

[][src]Function syn::visit::visit_type_param

pub fn visit_type_param<'ast, V: ?Sized>(v: &mut V, node: &'ast TypeParam) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_param_bound.html b/syn/visit/fn.visit_type_param_bound.html new file mode 100644 index 0000000..382e524 --- /dev/null +++ b/syn/visit/fn.visit_type_param_bound.html @@ -0,0 +1 @@ +syn::visit::visit_type_param_bound - Rust

[][src]Function syn::visit::visit_type_param_bound

pub fn visit_type_param_bound<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast TypeParamBound
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_paren.html b/syn/visit/fn.visit_type_paren.html new file mode 100644 index 0000000..c5f3002 --- /dev/null +++ b/syn/visit/fn.visit_type_paren.html @@ -0,0 +1 @@ +syn::visit::visit_type_paren - Rust

[][src]Function syn::visit::visit_type_paren

pub fn visit_type_paren<'ast, V: ?Sized>(v: &mut V, node: &'ast TypeParen) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_path.html b/syn/visit/fn.visit_type_path.html new file mode 100644 index 0000000..d13ce8a --- /dev/null +++ b/syn/visit/fn.visit_type_path.html @@ -0,0 +1 @@ +syn::visit::visit_type_path - Rust

[][src]Function syn::visit::visit_type_path

pub fn visit_type_path<'ast, V: ?Sized>(v: &mut V, node: &'ast TypePath) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_ptr.html b/syn/visit/fn.visit_type_ptr.html new file mode 100644 index 0000000..4c7eb2d --- /dev/null +++ b/syn/visit/fn.visit_type_ptr.html @@ -0,0 +1 @@ +syn::visit::visit_type_ptr - Rust

[][src]Function syn::visit::visit_type_ptr

pub fn visit_type_ptr<'ast, V: ?Sized>(v: &mut V, node: &'ast TypePtr) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_reference.html b/syn/visit/fn.visit_type_reference.html new file mode 100644 index 0000000..a1f14f7 --- /dev/null +++ b/syn/visit/fn.visit_type_reference.html @@ -0,0 +1 @@ +syn::visit::visit_type_reference - Rust

[][src]Function syn::visit::visit_type_reference

pub fn visit_type_reference<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast TypeReference
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_slice.html b/syn/visit/fn.visit_type_slice.html new file mode 100644 index 0000000..59e38d4 --- /dev/null +++ b/syn/visit/fn.visit_type_slice.html @@ -0,0 +1 @@ +syn::visit::visit_type_slice - Rust

[][src]Function syn::visit::visit_type_slice

pub fn visit_type_slice<'ast, V: ?Sized>(v: &mut V, node: &'ast TypeSlice) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_trait_object.html b/syn/visit/fn.visit_type_trait_object.html new file mode 100644 index 0000000..eb85871 --- /dev/null +++ b/syn/visit/fn.visit_type_trait_object.html @@ -0,0 +1 @@ +syn::visit::visit_type_trait_object - Rust

[][src]Function syn::visit::visit_type_trait_object

pub fn visit_type_trait_object<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast TypeTraitObject
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_type_tuple.html b/syn/visit/fn.visit_type_tuple.html new file mode 100644 index 0000000..a4f6087 --- /dev/null +++ b/syn/visit/fn.visit_type_tuple.html @@ -0,0 +1 @@ +syn::visit::visit_type_tuple - Rust

[][src]Function syn::visit::visit_type_tuple

pub fn visit_type_tuple<'ast, V: ?Sized>(v: &mut V, node: &'ast TypeTuple) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_un_op.html b/syn/visit/fn.visit_un_op.html new file mode 100644 index 0000000..25bcf12 --- /dev/null +++ b/syn/visit/fn.visit_un_op.html @@ -0,0 +1 @@ +syn::visit::visit_un_op - Rust

[][src]Function syn::visit::visit_un_op

pub fn visit_un_op<'ast, V: ?Sized>(v: &mut V, node: &'ast UnOp) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_variadic.html b/syn/visit/fn.visit_variadic.html new file mode 100644 index 0000000..8f5701e --- /dev/null +++ b/syn/visit/fn.visit_variadic.html @@ -0,0 +1 @@ +syn::visit::visit_variadic - Rust

[][src]Function syn::visit::visit_variadic

pub fn visit_variadic<'ast, V: ?Sized>(v: &mut V, node: &'ast Variadic) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_variant.html b/syn/visit/fn.visit_variant.html new file mode 100644 index 0000000..4d3ec77 --- /dev/null +++ b/syn/visit/fn.visit_variant.html @@ -0,0 +1 @@ +syn::visit::visit_variant - Rust

[][src]Function syn::visit::visit_variant

pub fn visit_variant<'ast, V: ?Sized>(v: &mut V, node: &'ast Variant) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_vis_crate.html b/syn/visit/fn.visit_vis_crate.html new file mode 100644 index 0000000..94e8e6b --- /dev/null +++ b/syn/visit/fn.visit_vis_crate.html @@ -0,0 +1 @@ +syn::visit::visit_vis_crate - Rust

[][src]Function syn::visit::visit_vis_crate

pub fn visit_vis_crate<'ast, V: ?Sized>(v: &mut V, node: &'ast VisCrate) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_vis_public.html b/syn/visit/fn.visit_vis_public.html new file mode 100644 index 0000000..8752f7c --- /dev/null +++ b/syn/visit/fn.visit_vis_public.html @@ -0,0 +1 @@ +syn::visit::visit_vis_public - Rust

[][src]Function syn::visit::visit_vis_public

pub fn visit_vis_public<'ast, V: ?Sized>(v: &mut V, node: &'ast VisPublic) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_vis_restricted.html b/syn/visit/fn.visit_vis_restricted.html new file mode 100644 index 0000000..d0d21db --- /dev/null +++ b/syn/visit/fn.visit_vis_restricted.html @@ -0,0 +1 @@ +syn::visit::visit_vis_restricted - Rust

[][src]Function syn::visit::visit_vis_restricted

pub fn visit_vis_restricted<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast VisRestricted
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_visibility.html b/syn/visit/fn.visit_visibility.html new file mode 100644 index 0000000..e27e9d2 --- /dev/null +++ b/syn/visit/fn.visit_visibility.html @@ -0,0 +1 @@ +syn::visit::visit_visibility - Rust

[][src]Function syn::visit::visit_visibility

pub fn visit_visibility<'ast, V: ?Sized>(v: &mut V, node: &'ast Visibility) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_where_clause.html b/syn/visit/fn.visit_where_clause.html new file mode 100644 index 0000000..ff385f8 --- /dev/null +++ b/syn/visit/fn.visit_where_clause.html @@ -0,0 +1 @@ +syn::visit::visit_where_clause - Rust

[][src]Function syn::visit::visit_where_clause

pub fn visit_where_clause<'ast, V: ?Sized>(v: &mut V, node: &'ast WhereClause) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/fn.visit_where_predicate.html b/syn/visit/fn.visit_where_predicate.html new file mode 100644 index 0000000..53491d1 --- /dev/null +++ b/syn/visit/fn.visit_where_predicate.html @@ -0,0 +1 @@ +syn::visit::visit_where_predicate - Rust

[][src]Function syn::visit::visit_where_predicate

pub fn visit_where_predicate<'ast, V: ?Sized>(
    v: &mut V,
    node: &'ast WherePredicate
) where
    V: Visit<'ast>, 
\ No newline at end of file diff --git a/syn/visit/index.html b/syn/visit/index.html new file mode 100644 index 0000000..dd0ae0d --- /dev/null +++ b/syn/visit/index.html @@ -0,0 +1,104 @@ +syn::visit - Rust

[][src]Module syn::visit

Syntax tree traversal to walk a shared borrow of a syntax tree.

+

Each method of the Visit trait is a hook that can be overridden to +customize the behavior when visiting the corresponding type of node. By +default, every method recursively visits the substructure of the input +by invoking the right visitor method of each of its fields.

+ +
+pub trait Visit<'ast> {
+    /* ... */
+
+    fn visit_expr_binary(&mut self, node: &'ast ExprBinary) {
+        visit_expr_binary(self, node);
+    }
+
+    /* ... */
+}
+
+pub fn visit_expr_binary<'ast, V>(v: &mut V, node: &'ast ExprBinary)
+where
+    V: Visit<'ast> + ?Sized,
+{
+    for attr in &node.attrs {
+        v.visit_attribute(attr);
+    }
+    v.visit_expr(&*node.left);
+    v.visit_bin_op(&node.op);
+    v.visit_expr(&*node.right);
+}
+
+/* ... */
+

This module is available if Syn is built with the "visit" feature.

+
+

Example

+

This visitor will print the name of every freestanding function in the +syntax tree, including nested functions.

+ +
+// [dependencies]
+// quote = "1.0"
+// syn = { version = "1.0", features = ["full", "visit"] }
+
+use quote::quote;
+use syn::visit::{self, Visit};
+use syn::{File, ItemFn};
+
+struct FnVisitor;
+
+impl<'ast> Visit<'ast> for FnVisitor {
+    fn visit_item_fn(&mut self, node: &'ast ItemFn) {
+        println!("Function with name={}", node.sig.ident);
+
+        // Delegate to the default impl to visit any nested functions.
+        visit::visit_item_fn(self, node);
+    }
+}
+
+fn main() {
+    let code = quote! {
+        pub fn f() {
+            fn g() {}
+        }
+    };
+
+    let syntax_tree: File = syn::parse2(code).unwrap();
+    FnVisitor.visit_file(&syntax_tree);
+}
+

The 'ast lifetime on the input references means that the syntax tree +outlives the complete recursive visit call, so the visitor is allowed to +hold on to references into the syntax tree.

+ +
+use quote::quote;
+use syn::visit::{self, Visit};
+use syn::{File, ItemFn};
+
+struct FnVisitor<'ast> {
+    functions: Vec<&'ast ItemFn>,
+}
+
+impl<'ast> Visit<'ast> for FnVisitor<'ast> {
+    fn visit_item_fn(&mut self, node: &'ast ItemFn) {
+        self.functions.push(node);
+        visit::visit_item_fn(self, node);
+    }
+}
+
+fn main() {
+    let code = quote! {
+        pub fn f() {
+            fn g() {}
+        }
+    };
+
+    let syntax_tree: File = syn::parse2(code).unwrap();
+    let mut visitor = FnVisitor { functions: Vec::new() };
+    visitor.visit_file(&syntax_tree);
+    for f in visitor.functions {
+        println!("Function with name={}", f.sig.ident);
+    }
+}
+

Traits

+
Visit

Syntax tree traversal to walk a shared borrow of a syntax tree.

+

Functions

+
visit_abi
visit_angle_bracketed_generic_arguments
visit_attr_style
visit_attribute
visit_bare_fn_arg
visit_bin_op
visit_binding
visit_bound_lifetimes
visit_const_param
visit_constraint
visit_data
visit_data_enum
visit_data_struct
visit_data_union
visit_derive_input
visit_expr
visit_expr_binary
visit_expr_call
visit_expr_cast
visit_expr_field
visit_expr_index
visit_expr_lit
visit_expr_paren
visit_expr_path
visit_expr_unary
visit_field
visit_fields
visit_fields_named
visit_fields_unnamed
visit_generic_argument
visit_generic_param
visit_generics
visit_ident
visit_index
visit_lifetime
visit_lifetime_def
visit_lit
visit_lit_bool
visit_lit_byte
visit_lit_byte_str
visit_lit_char
visit_lit_float
visit_lit_int
visit_lit_str
visit_macro
visit_macro_delimiter
visit_member
visit_meta
visit_meta_list
visit_meta_name_value
visit_nested_meta
visit_parenthesized_generic_arguments
visit_path
visit_path_arguments
visit_path_segment
visit_predicate_eq
visit_predicate_lifetime
visit_predicate_type
visit_qself
visit_return_type
visit_span
visit_trait_bound
visit_trait_bound_modifier
visit_type
visit_type_array
visit_type_bare_fn
visit_type_group
visit_type_impl_trait
visit_type_infer
visit_type_macro
visit_type_never
visit_type_param
visit_type_param_bound
visit_type_paren
visit_type_path
visit_type_ptr
visit_type_reference
visit_type_slice
visit_type_trait_object
visit_type_tuple
visit_un_op
visit_variadic
visit_variant
visit_vis_crate
visit_vis_public
visit_vis_restricted
visit_visibility
visit_where_clause
visit_where_predicate
\ No newline at end of file diff --git a/syn/visit/sidebar-items.js b/syn/visit/sidebar-items.js new file mode 100644 index 0000000..05c7e70 --- /dev/null +++ b/syn/visit/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"fn":[["visit_abi",""],["visit_angle_bracketed_generic_arguments",""],["visit_attr_style",""],["visit_attribute",""],["visit_bare_fn_arg",""],["visit_bin_op",""],["visit_binding",""],["visit_bound_lifetimes",""],["visit_const_param",""],["visit_constraint",""],["visit_data",""],["visit_data_enum",""],["visit_data_struct",""],["visit_data_union",""],["visit_derive_input",""],["visit_expr",""],["visit_expr_binary",""],["visit_expr_call",""],["visit_expr_cast",""],["visit_expr_field",""],["visit_expr_index",""],["visit_expr_lit",""],["visit_expr_paren",""],["visit_expr_path",""],["visit_expr_unary",""],["visit_field",""],["visit_fields",""],["visit_fields_named",""],["visit_fields_unnamed",""],["visit_generic_argument",""],["visit_generic_param",""],["visit_generics",""],["visit_ident",""],["visit_index",""],["visit_lifetime",""],["visit_lifetime_def",""],["visit_lit",""],["visit_lit_bool",""],["visit_lit_byte",""],["visit_lit_byte_str",""],["visit_lit_char",""],["visit_lit_float",""],["visit_lit_int",""],["visit_lit_str",""],["visit_macro",""],["visit_macro_delimiter",""],["visit_member",""],["visit_meta",""],["visit_meta_list",""],["visit_meta_name_value",""],["visit_nested_meta",""],["visit_parenthesized_generic_arguments",""],["visit_path",""],["visit_path_arguments",""],["visit_path_segment",""],["visit_predicate_eq",""],["visit_predicate_lifetime",""],["visit_predicate_type",""],["visit_qself",""],["visit_return_type",""],["visit_span",""],["visit_trait_bound",""],["visit_trait_bound_modifier",""],["visit_type",""],["visit_type_array",""],["visit_type_bare_fn",""],["visit_type_group",""],["visit_type_impl_trait",""],["visit_type_infer",""],["visit_type_macro",""],["visit_type_never",""],["visit_type_param",""],["visit_type_param_bound",""],["visit_type_paren",""],["visit_type_path",""],["visit_type_ptr",""],["visit_type_reference",""],["visit_type_slice",""],["visit_type_trait_object",""],["visit_type_tuple",""],["visit_un_op",""],["visit_variadic",""],["visit_variant",""],["visit_vis_crate",""],["visit_vis_public",""],["visit_vis_restricted",""],["visit_visibility",""],["visit_where_clause",""],["visit_where_predicate",""]],"trait":[["Visit","Syntax tree traversal to walk a shared borrow of a syntax tree."]]}); \ No newline at end of file diff --git a/syn/visit/trait.Visit.html b/syn/visit/trait.Visit.html new file mode 100644 index 0000000..f1541f2 --- /dev/null +++ b/syn/visit/trait.Visit.html @@ -0,0 +1,96 @@ +syn::visit::Visit - Rust

[][src]Trait syn::visit::Visit

pub trait Visit<'ast> {
+    fn visit_abi(&mut self, i: &'ast Abi) { ... }
+
fn visit_angle_bracketed_generic_arguments(
        &mut self,
        i: &'ast AngleBracketedGenericArguments
    ) { ... } +
fn visit_attr_style(&mut self, i: &'ast AttrStyle) { ... } +
fn visit_attribute(&mut self, i: &'ast Attribute) { ... } +
fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg) { ... } +
fn visit_bin_op(&mut self, i: &'ast BinOp) { ... } +
fn visit_binding(&mut self, i: &'ast Binding) { ... } +
fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes) { ... } +
fn visit_const_param(&mut self, i: &'ast ConstParam) { ... } +
fn visit_constraint(&mut self, i: &'ast Constraint) { ... } +
fn visit_data(&mut self, i: &'ast Data) { ... } +
fn visit_data_enum(&mut self, i: &'ast DataEnum) { ... } +
fn visit_data_struct(&mut self, i: &'ast DataStruct) { ... } +
fn visit_data_union(&mut self, i: &'ast DataUnion) { ... } +
fn visit_derive_input(&mut self, i: &'ast DeriveInput) { ... } +
fn visit_expr(&mut self, i: &'ast Expr) { ... } +
fn visit_expr_binary(&mut self, i: &'ast ExprBinary) { ... } +
fn visit_expr_call(&mut self, i: &'ast ExprCall) { ... } +
fn visit_expr_cast(&mut self, i: &'ast ExprCast) { ... } +
fn visit_expr_field(&mut self, i: &'ast ExprField) { ... } +
fn visit_expr_index(&mut self, i: &'ast ExprIndex) { ... } +
fn visit_expr_lit(&mut self, i: &'ast ExprLit) { ... } +
fn visit_expr_paren(&mut self, i: &'ast ExprParen) { ... } +
fn visit_expr_path(&mut self, i: &'ast ExprPath) { ... } +
fn visit_expr_unary(&mut self, i: &'ast ExprUnary) { ... } +
fn visit_field(&mut self, i: &'ast Field) { ... } +
fn visit_fields(&mut self, i: &'ast Fields) { ... } +
fn visit_fields_named(&mut self, i: &'ast FieldsNamed) { ... } +
fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed) { ... } +
fn visit_generic_argument(&mut self, i: &'ast GenericArgument) { ... } +
fn visit_generic_param(&mut self, i: &'ast GenericParam) { ... } +
fn visit_generics(&mut self, i: &'ast Generics) { ... } +
fn visit_ident(&mut self, i: &'ast Ident) { ... } +
fn visit_index(&mut self, i: &'ast Index) { ... } +
fn visit_lifetime(&mut self, i: &'ast Lifetime) { ... } +
fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef) { ... } +
fn visit_lit(&mut self, i: &'ast Lit) { ... } +
fn visit_lit_bool(&mut self, i: &'ast LitBool) { ... } +
fn visit_lit_byte(&mut self, i: &'ast LitByte) { ... } +
fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr) { ... } +
fn visit_lit_char(&mut self, i: &'ast LitChar) { ... } +
fn visit_lit_float(&mut self, i: &'ast LitFloat) { ... } +
fn visit_lit_int(&mut self, i: &'ast LitInt) { ... } +
fn visit_lit_str(&mut self, i: &'ast LitStr) { ... } +
fn visit_macro(&mut self, i: &'ast Macro) { ... } +
fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter) { ... } +
fn visit_member(&mut self, i: &'ast Member) { ... } +
fn visit_meta(&mut self, i: &'ast Meta) { ... } +
fn visit_meta_list(&mut self, i: &'ast MetaList) { ... } +
fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue) { ... } +
fn visit_nested_meta(&mut self, i: &'ast NestedMeta) { ... } +
fn visit_parenthesized_generic_arguments(
        &mut self,
        i: &'ast ParenthesizedGenericArguments
    ) { ... } +
fn visit_path(&mut self, i: &'ast Path) { ... } +
fn visit_path_arguments(&mut self, i: &'ast PathArguments) { ... } +
fn visit_path_segment(&mut self, i: &'ast PathSegment) { ... } +
fn visit_predicate_eq(&mut self, i: &'ast PredicateEq) { ... } +
fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime) { ... } +
fn visit_predicate_type(&mut self, i: &'ast PredicateType) { ... } +
fn visit_qself(&mut self, i: &'ast QSelf) { ... } +
fn visit_return_type(&mut self, i: &'ast ReturnType) { ... } +
fn visit_span(&mut self, i: &Span) { ... } +
fn visit_trait_bound(&mut self, i: &'ast TraitBound) { ... } +
fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier) { ... } +
fn visit_type(&mut self, i: &'ast Type) { ... } +
fn visit_type_array(&mut self, i: &'ast TypeArray) { ... } +
fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn) { ... } +
fn visit_type_group(&mut self, i: &'ast TypeGroup) { ... } +
fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait) { ... } +
fn visit_type_infer(&mut self, i: &'ast TypeInfer) { ... } +
fn visit_type_macro(&mut self, i: &'ast TypeMacro) { ... } +
fn visit_type_never(&mut self, i: &'ast TypeNever) { ... } +
fn visit_type_param(&mut self, i: &'ast TypeParam) { ... } +
fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound) { ... } +
fn visit_type_paren(&mut self, i: &'ast TypeParen) { ... } +
fn visit_type_path(&mut self, i: &'ast TypePath) { ... } +
fn visit_type_ptr(&mut self, i: &'ast TypePtr) { ... } +
fn visit_type_reference(&mut self, i: &'ast TypeReference) { ... } +
fn visit_type_slice(&mut self, i: &'ast TypeSlice) { ... } +
fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject) { ... } +
fn visit_type_tuple(&mut self, i: &'ast TypeTuple) { ... } +
fn visit_un_op(&mut self, i: &'ast UnOp) { ... } +
fn visit_variadic(&mut self, i: &'ast Variadic) { ... } +
fn visit_variant(&mut self, i: &'ast Variant) { ... } +
fn visit_vis_crate(&mut self, i: &'ast VisCrate) { ... } +
fn visit_vis_public(&mut self, i: &'ast VisPublic) { ... } +
fn visit_vis_restricted(&mut self, i: &'ast VisRestricted) { ... } +
fn visit_visibility(&mut self, i: &'ast Visibility) { ... } +
fn visit_where_clause(&mut self, i: &'ast WhereClause) { ... } +
fn visit_where_predicate(&mut self, i: &'ast WherePredicate) { ... } +}

Syntax tree traversal to walk a shared borrow of a syntax tree.

+

See the module documentation for details.

+

This trait is available if Syn is built with the "visit" feature.

+
+

Provided methods

fn visit_abi(&mut self, i: &'ast Abi)

fn visit_angle_bracketed_generic_arguments(
    &mut self,
    i: &'ast AngleBracketedGenericArguments
)

fn visit_attr_style(&mut self, i: &'ast AttrStyle)

fn visit_attribute(&mut self, i: &'ast Attribute)

fn visit_bare_fn_arg(&mut self, i: &'ast BareFnArg)

fn visit_bin_op(&mut self, i: &'ast BinOp)

fn visit_binding(&mut self, i: &'ast Binding)

fn visit_bound_lifetimes(&mut self, i: &'ast BoundLifetimes)

fn visit_const_param(&mut self, i: &'ast ConstParam)

fn visit_constraint(&mut self, i: &'ast Constraint)

fn visit_data(&mut self, i: &'ast Data)

fn visit_data_enum(&mut self, i: &'ast DataEnum)

fn visit_data_struct(&mut self, i: &'ast DataStruct)

fn visit_data_union(&mut self, i: &'ast DataUnion)

fn visit_derive_input(&mut self, i: &'ast DeriveInput)

fn visit_expr(&mut self, i: &'ast Expr)

fn visit_expr_binary(&mut self, i: &'ast ExprBinary)

fn visit_expr_call(&mut self, i: &'ast ExprCall)

fn visit_expr_cast(&mut self, i: &'ast ExprCast)

fn visit_expr_field(&mut self, i: &'ast ExprField)

fn visit_expr_index(&mut self, i: &'ast ExprIndex)

fn visit_expr_lit(&mut self, i: &'ast ExprLit)

fn visit_expr_paren(&mut self, i: &'ast ExprParen)

fn visit_expr_path(&mut self, i: &'ast ExprPath)

fn visit_expr_unary(&mut self, i: &'ast ExprUnary)

fn visit_field(&mut self, i: &'ast Field)

fn visit_fields(&mut self, i: &'ast Fields)

fn visit_fields_named(&mut self, i: &'ast FieldsNamed)

fn visit_fields_unnamed(&mut self, i: &'ast FieldsUnnamed)

fn visit_generic_argument(&mut self, i: &'ast GenericArgument)

fn visit_generic_param(&mut self, i: &'ast GenericParam)

fn visit_generics(&mut self, i: &'ast Generics)

fn visit_ident(&mut self, i: &'ast Ident)

fn visit_index(&mut self, i: &'ast Index)

fn visit_lifetime(&mut self, i: &'ast Lifetime)

fn visit_lifetime_def(&mut self, i: &'ast LifetimeDef)

fn visit_lit(&mut self, i: &'ast Lit)

fn visit_lit_bool(&mut self, i: &'ast LitBool)

fn visit_lit_byte(&mut self, i: &'ast LitByte)

fn visit_lit_byte_str(&mut self, i: &'ast LitByteStr)

fn visit_lit_char(&mut self, i: &'ast LitChar)

fn visit_lit_float(&mut self, i: &'ast LitFloat)

fn visit_lit_int(&mut self, i: &'ast LitInt)

fn visit_lit_str(&mut self, i: &'ast LitStr)

fn visit_macro(&mut self, i: &'ast Macro)

fn visit_macro_delimiter(&mut self, i: &'ast MacroDelimiter)

fn visit_member(&mut self, i: &'ast Member)

fn visit_meta(&mut self, i: &'ast Meta)

fn visit_meta_list(&mut self, i: &'ast MetaList)

fn visit_meta_name_value(&mut self, i: &'ast MetaNameValue)

fn visit_nested_meta(&mut self, i: &'ast NestedMeta)

fn visit_parenthesized_generic_arguments(
    &mut self,
    i: &'ast ParenthesizedGenericArguments
)

fn visit_path(&mut self, i: &'ast Path)

fn visit_path_arguments(&mut self, i: &'ast PathArguments)

fn visit_path_segment(&mut self, i: &'ast PathSegment)

fn visit_predicate_eq(&mut self, i: &'ast PredicateEq)

fn visit_predicate_lifetime(&mut self, i: &'ast PredicateLifetime)

fn visit_predicate_type(&mut self, i: &'ast PredicateType)

fn visit_qself(&mut self, i: &'ast QSelf)

fn visit_return_type(&mut self, i: &'ast ReturnType)

fn visit_span(&mut self, i: &Span)

fn visit_trait_bound(&mut self, i: &'ast TraitBound)

fn visit_trait_bound_modifier(&mut self, i: &'ast TraitBoundModifier)

fn visit_type(&mut self, i: &'ast Type)

fn visit_type_array(&mut self, i: &'ast TypeArray)

fn visit_type_bare_fn(&mut self, i: &'ast TypeBareFn)

fn visit_type_group(&mut self, i: &'ast TypeGroup)

fn visit_type_impl_trait(&mut self, i: &'ast TypeImplTrait)

fn visit_type_infer(&mut self, i: &'ast TypeInfer)

fn visit_type_macro(&mut self, i: &'ast TypeMacro)

fn visit_type_never(&mut self, i: &'ast TypeNever)

fn visit_type_param(&mut self, i: &'ast TypeParam)

fn visit_type_param_bound(&mut self, i: &'ast TypeParamBound)

fn visit_type_paren(&mut self, i: &'ast TypeParen)

fn visit_type_path(&mut self, i: &'ast TypePath)

fn visit_type_ptr(&mut self, i: &'ast TypePtr)

fn visit_type_reference(&mut self, i: &'ast TypeReference)

fn visit_type_slice(&mut self, i: &'ast TypeSlice)

fn visit_type_trait_object(&mut self, i: &'ast TypeTraitObject)

fn visit_type_tuple(&mut self, i: &'ast TypeTuple)

fn visit_un_op(&mut self, i: &'ast UnOp)

fn visit_variadic(&mut self, i: &'ast Variadic)

fn visit_variant(&mut self, i: &'ast Variant)

fn visit_vis_crate(&mut self, i: &'ast VisCrate)

fn visit_vis_public(&mut self, i: &'ast VisPublic)

fn visit_vis_restricted(&mut self, i: &'ast VisRestricted)

fn visit_visibility(&mut self, i: &'ast Visibility)

fn visit_where_clause(&mut self, i: &'ast WhereClause)

fn visit_where_predicate(&mut self, i: &'ast WherePredicate)

Loading content... +

Implementors

Loading content...
\ No newline at end of file diff --git a/theme.js b/theme.js new file mode 100644 index 0000000..ebd1a87 --- /dev/null +++ b/theme.js @@ -0,0 +1 @@ +var themes=document.getElementById("theme-choices");var themePicker=document.getElementById("theme-picker");function showThemeButtonState(){themes.style.display="block";themePicker.style.borderBottomRightRadius="0";themePicker.style.borderBottomLeftRadius="0"}function hideThemeButtonState(){themes.style.display="none";themePicker.style.borderBottomRightRadius="3px";themePicker.style.borderBottomLeftRadius="3px"}function switchThemeButtonState(){if(themes.style.display==="block"){hideThemeButtonState()}else{showThemeButtonState()}};function handleThemeButtonsBlur(e){var active=document.activeElement;var related=e.relatedTarget;if(active.id!=="themePicker"&&(!active.parentNode||active.parentNode.id!=="theme-choices")&&(!related||(related.id!=="themePicker"&&(!related.parentNode||related.parentNode.id!=="theme-choices")))){hideThemeButtonState()}}themePicker.onclick=switchThemeButtonState;themePicker.onblur=handleThemeButtonsBlur;["dark","light"].forEach(function(item){var but=document.createElement('button');but.textContent=item;but.onclick=function(el){switchTheme(currentTheme,mainTheme,item,true)};but.onblur=handleThemeButtonsBlur;themes.appendChild(but)}) \ No newline at end of file diff --git a/unicode_xid/all.html b/unicode_xid/all.html new file mode 100644 index 0000000..76dbcaf --- /dev/null +++ b/unicode_xid/all.html @@ -0,0 +1,3 @@ +List of all items in this crate

[] + + List of all items

Traits

Constants

\ No newline at end of file diff --git a/unicode_xid/constant.UNICODE_VERSION.html b/unicode_xid/constant.UNICODE_VERSION.html new file mode 100644 index 0000000..ed2b517 --- /dev/null +++ b/unicode_xid/constant.UNICODE_VERSION.html @@ -0,0 +1,3 @@ +unicode_xid::UNICODE_VERSION - Rust

[][src]Constant unicode_xid::UNICODE_VERSION

pub const UNICODE_VERSION: (u64, u64, u64);

The version of Unicode +that this version of unicode-xid is based on.

+
\ No newline at end of file diff --git a/unicode_xid/index.html b/unicode_xid/index.html new file mode 100644 index 0000000..ec3355a --- /dev/null +++ b/unicode_xid/index.html @@ -0,0 +1,27 @@ +unicode_xid - Rust

[][src]Crate unicode_xid

Determine if a char is a valid identifier for a parser and/or lexer according to +Unicode Standard Annex #31 rules.

+ +
+extern crate unicode_xid;
+
+use unicode_xid::UnicodeXID;
+
+fn main() {
+    let ch = 'a';
+    println!("Is {} a valid start of an identifier? {}", ch, UnicodeXID::is_xid_start(ch));
+}
+

features

+

unicode-xid supports a no_std feature. This eliminates dependence +on std, and instead uses equivalent functions from core.

+

crates.io

+

You can use this package in your project by adding the following +to your Cargo.toml:

+
[dependencies]
+unicode-xid = "0.0.4"
+
+

Constants

+
UNICODE_VERSION

The version of Unicode +that this version of unicode-xid is based on.

+

Traits

+
UnicodeXID

Methods for determining if a character is a valid identifier character.

+
\ No newline at end of file diff --git a/unicode_xid/sidebar-items.js b/unicode_xid/sidebar-items.js new file mode 100644 index 0000000..d23714a --- /dev/null +++ b/unicode_xid/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"constant":[["UNICODE_VERSION","The version of Unicode that this version of unicode-xid is based on."]],"trait":[["UnicodeXID","Methods for determining if a character is a valid identifier character."]]}); \ No newline at end of file diff --git a/unicode_xid/tables/constant.UNICODE_VERSION.html b/unicode_xid/tables/constant.UNICODE_VERSION.html new file mode 100644 index 0000000..b67c5aa --- /dev/null +++ b/unicode_xid/tables/constant.UNICODE_VERSION.html @@ -0,0 +1,10 @@ + + + + + + +

Redirecting to ../../unicode_xid/constant.UNICODE_VERSION.html...

+ + + \ No newline at end of file diff --git a/unicode_xid/trait.UnicodeXID.html b/unicode_xid/trait.UnicodeXID.html new file mode 100644 index 0000000..7e5f59a --- /dev/null +++ b/unicode_xid/trait.UnicodeXID.html @@ -0,0 +1,17 @@ +unicode_xid::UnicodeXID - Rust

[][src]Trait unicode_xid::UnicodeXID

pub trait UnicodeXID {
+    fn is_xid_start(self) -> bool;
+
fn is_xid_continue(self) -> bool; +}

Methods for determining if a character is a valid identifier character.

+
+

Required methods

fn is_xid_start(self) -> bool

Returns whether the specified character satisfies the 'XID_Start' +Unicode property.

+

'XID_Start' is a Unicode Derived Property specified in +UAX #31, +mostly similar to ID_Start but modified for closure under NFKx.

+

fn is_xid_continue(self) -> bool

Returns whether the specified char satisfies the 'XID_Continue' +Unicode property.

+

'XID_Continue' is a Unicode Derived Property specified in +UAX #31, +mostly similar to 'ID_Continue' but modified for closure under NFKx.

+
Loading content... +

Implementors

impl UnicodeXID for char[src]

Loading content...
\ No newline at end of file diff --git a/wheel.svg b/wheel.svg new file mode 100644 index 0000000..01da3b2 --- /dev/null +++ b/wheel.svg @@ -0,0 +1 @@ + \ No newline at end of file