Now a REAL lib

This commit is contained in:
Justine 2023-01-09 19:23:20 +01:00
parent ef46613c71
commit fe9e6f04f5
19014 changed files with 715877 additions and 264 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/target
/html

View File

@ -26,3 +26,6 @@ Options:
-h, --help
Print help information (use `-h` for a summary)
```
# Documentation
See the doc folder.

0
doc/.lock Executable file
View File

46
doc/COPYRIGHT.txt Normal file
View File

@ -0,0 +1,46 @@
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.woff2, FiraSans-Medium.woff2):
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.ttf.woff2,
SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2):
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 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2,
SourceSerif4-It.ttf.woff2):
Copyright 2014-2021 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.
Licensed under the SIL Open Font License, Version 1.1.
See SourceSerif4-LICENSE.md.
This copyright file is intended to be distributed with rustdoc output.

94
doc/FiraSans-LICENSE.txt Normal file
View File

@ -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.

BIN
doc/FiraSans-Medium.woff2 Normal file

Binary file not shown.

BIN
doc/FiraSans-Regular.woff2 Normal file

Binary file not shown.

201
doc/LICENSE-APACHE.txt Normal file
View File

@ -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.

23
doc/LICENSE-MIT.txt Normal file
View File

@ -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.

View File

@ -0,0 +1,99 @@
Copyright (c) 2010, NAVER Corporation (https://www.navercorp.com/),
with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver NanumGothic,
NanumMyeongjo, Naver NanumMyeongjo, NanumBrush, Naver NanumBrush, NanumPen,
Naver NanumPen, Naver NanumGothicEco, NanumGothicEco, Naver NanumMyeongjoEco,
NanumMyeongjoEco, Naver NanumGothicLight, NanumGothicLight, NanumBarunGothic,
Naver NanumBarunGothic, NanumSquareRound, NanumBarunPen, MaruBuri
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.

Binary file not shown.

Binary file not shown.

View File

@ -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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,93 @@
Copyright 2014-2021 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.

Binary file not shown.

1
doc/ahash/all.html Normal file
View File

@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../ahash/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../ahash/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location">Crate ahash</h2></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../ahash/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">List of all items</span></h1><h3 id="Structs">Structs</h3><ul class="structs docblock"><li><a href="struct.AHasher.html">AHasher</a></li><li><a href="struct.RandomState.html">RandomState</a></li></ul><h3 id="Traits">Traits</h3><ul class="traits docblock"><li><a href="trait.CallHasher.html">CallHasher</a></li></ul></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="ahash" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../ahash/struct.AHasher.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../ahash/struct.AHasher.html">../../ahash/struct.AHasher.html</a>...</p>
<script>location.replace("../../ahash/struct.AHasher.html" + location.search + location.hash);</script>
</body>
</html>

29
doc/ahash/index.html Normal file
View File

@ -0,0 +1,29 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="AHash is a hashing algorithm is intended to be a high performance, (hardware specific), keyed hash function. This can be seen as a DOS resistant alternative to `FxHash`, or a fast equivalent to `SipHash`. It provides a high speed hash algorithm, but where the result is not predictable without knowing a Key. This allows it to be used in a `HashMap` without allowing for the possibility that an malicious user can induce a collision."><meta name="keywords" content="rust, rustlang, rust-lang, ahash"><title>ahash - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="../crates.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../ahash/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../ahash/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Crate ahash</a></h2><div class="sidebar-elems"><div class="block"><ul><li class="version">Version 0.7.6</li><li><a id="all-types" href="all.html">All Items</a></li></ul></div><section><div class="block"><ul><li><a href="#structs">Structs</a></li><li><a href="#traits">Traits</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../ahash/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">ahash</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/ahash/lib.rs.html#1-263">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>AHash is a hashing algorithm is intended to be a high performance, (hardware specific), keyed hash function.
This can be seen as a DOS resistant alternative to <code>FxHash</code>, or a fast equivalent to <code>SipHash</code>.
It provides a high speed hash algorithm, but where the result is not predictable without knowing a Key.
This allows it to be used in a <code>HashMap</code> without allowing for the possibility that an malicious user can
induce a collision.</p>
<h2 id="how-ahash-works"><a href="#how-ahash-works">How aHash works</a></h2>
<p>aHash uses the hardware AES instruction on x86 processors to provide a keyed hash function.
aHash is not a cryptographically secure hash.</p>
<h2 id="example"><a href="#example">Example</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">ahash</span>::{<span class="ident">AHasher</span>, <span class="ident">RandomState</span>};
<span class="kw">use</span> <span class="ident">std::collections::HashMap</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span>: <span class="ident">HashMap</span><span class="op">&lt;</span><span class="ident">i32</span>, <span class="ident">i32</span>, <span class="ident">RandomState</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">HashMap::default</span>();
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">12</span>, <span class="number">34</span>);</code></pre></div>
<p>For convinence wrappers called <code>AHashMap</code> and <code>AHashSet</code> are also provided.
These to the same thing with slightly less typing.</p>
<div class='information'><div class='tooltip ignore'></div></div><div class="example-wrap"><pre class="rust rust-example-rendered ignore"><code><span class="kw">use</span> <span class="ident">ahash::AHashMap</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">map</span>: <span class="ident">AHashMap</span><span class="op">&lt;</span><span class="ident">i32</span>, <span class="ident">i32</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">AHashMap::with_capacity</span>(<span class="number">4</span>);
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">12</span>, <span class="number">34</span>);
<span class="ident">map</span>.<span class="ident">insert</span>(<span class="number">56</span>, <span class="number">78</span>);</code></pre></div>
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.AHasher.html" title="ahash::AHasher struct">AHasher</a></div><div class="item-right docblock-short"><p>A <code>Hasher</code> for hashing an arbitrary stream of bytes.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.RandomState.html" title="ahash::RandomState struct">RandomState</a></div><div class="item-right docblock-short"><p>Provides a <a href="std::hash::Hasher">Hasher</a> factory. This is typically used (e.g. by <a href="std::collections::HashMap">HashMap</a>) to create
<a href="struct.AHasher.html" title="AHasher">AHasher</a>s in order to hash the keys of the map. See <code>build_hasher</code> below.</p>
</div></div></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.CallHasher.html" title="ahash::CallHasher trait">CallHasher</a></div><div class="item-right docblock-short"><p>Provides a way to get an optimized hasher for a given data type.
Rather than using a Hasher generically which can hash any value, this provides a way to get a specialized hash
for a specific type. So this may be faster for primitive types.</p>
</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="ahash" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../ahash/struct.RandomState.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../ahash/struct.RandomState.html">../../ahash/struct.RandomState.html</a>...</p>
<script>location.replace("../../ahash/struct.RandomState.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":[["AHasher","A `Hasher` for hashing an arbitrary stream of bytes."],["RandomState","Provides a Hasher factory. This is typically used (e.g. by HashMap) to create [AHasher]s in order to hash the keys of the map. See `build_hasher` below."]],"trait":[["CallHasher","Provides a way to get an optimized hasher for a given data type. Rather than using a Hasher generically which can hash any value, this provides a way to get a specialized hash for a specific type. So this may be faster for primitive types."]]};

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../ahash/trait.CallHasher.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../ahash/trait.CallHasher.html">../../ahash/trait.CallHasher.html</a>...</p>
<script>location.replace("../../ahash/trait.CallHasher.html" + location.search + location.hash);</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,21 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Provides a way to get an optimized hasher for a given data type. Rather than using a Hasher generically which can hash any value, this provides a way to get a specialized hash for a specific type. So this may be faster for primitive types."><meta name="keywords" content="rust, rustlang, rust-lang, CallHasher"><title>CallHasher in ahash - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../ahash/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../ahash/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">CallHasher</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.get_hash">get_hash</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In ahash</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../ahash/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">ahash</a>::<wbr><a class="trait" href="#">CallHasher</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/ahash/specialize.rs.html#41-43">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait CallHasher {
fn <a href="#tymethod.get_hash" class="fnname">get_hash</a>&lt;H:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, B:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.reference.html">&amp;</a>H,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;build_hasher: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.reference.html">&amp;</a>B<br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u64.html">u64</a>;
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Provides a way to get an optimized hasher for a given data type.
Rather than using a Hasher generically which can hash any value, this provides a way to get a specialized hash
for a specific type. So this may be faster for primitive types.</p>
<h2 id="example"><a href="#example">Example</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">std::hash::BuildHasher</span>;
<span class="kw">use</span> <span class="ident">ahash::RandomState</span>;
<span class="kw">use</span> <span class="ident">ahash::CallHasher</span>;
<span class="kw">let</span> <span class="ident">hash_builder</span> <span class="op">=</span> <span class="ident">RandomState::new</span>();
<span class="comment">//...</span>
<span class="kw">let</span> <span class="ident">value</span>: <span class="ident">u32</span> <span class="op">=</span> <span class="number">17</span>;
<span class="kw">let</span> <span class="ident">hash</span> <span class="op">=</span> <span class="ident">u32::get_hash</span>(<span class="kw-2">&amp;</span><span class="ident">value</span>, <span class="kw-2">&amp;</span><span class="ident">hash_builder</span>);</code></pre></div>
<p>Note that the type used to invoke <code>get_hash</code> must be the same a the type of value passed.
For example get a hasher specialized on <code>[u8]</code> can invoke:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="doccomment">/// use std::hash::BuildHasher;</span>
<span class="kw">let</span> <span class="ident">bytes</span>: [<span class="ident">u8</span>; <span class="number">4</span>] <span class="op">=</span> [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>];
<span class="kw">let</span> <span class="ident">hash</span> <span class="op">=</span> <span class="op">&lt;</span>[<span class="ident">u8</span>]<span class="op">&gt;</span><span class="ident">::get_hash</span>(<span class="kw-2">&amp;</span><span class="ident">bytes</span>, <span class="kw-2">&amp;</span><span class="ident">hash_builder</span>);</code></pre></div>
</div></details><h2 id="required-methods" class="small-section-header">Required Methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><div id="tymethod.get_hash" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/ahash/specialize.rs.html#42">source</a></div><h4 class="code-header">fn <a href="#tymethod.get_hash" class="fnname">get_hash</a>&lt;H:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, B:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/hash/trait.BuildHasher.html" title="trait core::hash::BuildHasher">BuildHasher</a>&gt;(value: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.reference.html">&amp;</a>H, build_hasher: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.reference.html">&amp;</a>B) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u64.html">u64</a></h4></div></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><section id="impl-CallHasher-for-T" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/ahash/specialize.rs.html#46-56">source</a></span><a href="#impl-CallHasher-for-T" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="trait.CallHasher.html" title="trait ahash::CallHasher">CallHasher</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/hash/trait.Hash.html" title="trait core::hash::Hash">Hash</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></section></div><script type="text/javascript" src="../implementors/ahash/specialize/trait.CallHasher.js" data-ignore-extern-crates="" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="ahash" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

1
doc/async_trait/all.html Normal file
View File

@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../async_trait/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../async_trait/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location">Crate async_trait</h2></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../async_trait/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">List of all items</span></h1><h3 id="Attribute-Macros">Attribute Macros</h3><ul class="attributes docblock"><li><a href="attr.async_trait.html">async_trait</a></li></ul></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="async_trait" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `async_trait` attr in crate `async_trait`."><meta name="keywords" content="rust, rustlang, rust-lang, async_trait"><title>async_trait in async_trait - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc attr"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../async_trait/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../async_trait/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In async_trait</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../async_trait/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Attribute Macro <a href="index.html">async_trait</a>::<wbr><a class="attr" href="#">async_trait</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/async_trait/lib.rs.html#335-340">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust attr"><code>#[async_trait]</code></pre></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="async_trait" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

187
doc/async_trait/index.html Normal file
View File

@ -0,0 +1,187 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="githubcrates-iodocs-rs"><meta name="keywords" content="rust, rustlang, rust-lang, async_trait"><title>async_trait - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="../crates.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../async_trait/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../async_trait/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Crate async_trait</a></h2><div class="sidebar-elems"><div class="block"><ul><li class="version">Version 0.1.61</li><li><a id="all-types" href="all.html">All Items</a></li></ul></div><section><div class="block"><ul><li><a href="#attributes">Attribute Macros</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../async_trait/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">async_trait</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/async_trait/lib.rs.html#1-340">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><a href="https://github.com/dtolnay/async-trait"><img src="https://img.shields.io/badge/github-8da0cb?style=for-the-badge&amp;labelColor=555555&amp;logo=github" alt="github" /></a><a href="https://crates.io/crates/async-trait"><img src="https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&amp;labelColor=555555&amp;logo=rust" alt="crates-io" /></a><a href="https://docs.rs/async-trait"><img src="https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&amp;labelColor=555555&amp;logo=docs.rs" alt="docs-rs" /></a></p>
<br>
<h5>Type erasure for async trait methods</h5>
<p>The initial round of stabilizations for the async/await language feature in
Rust 1.39 did not include support for async fn in traits. Trying to include
an async fn in a trait produces the following error:</p>
<div class='information'><div class='tooltip compile_fail'></div></div><div class="example-wrap"><pre class="rust rust-example-rendered compile_fail"><code><span class="kw">trait</span> <span class="ident">MyTrait</span> {
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">f</span>() {}
}</code></pre></div>
<div class="example-wrap"><pre class="language-text"><code>error[E0706]: trait fns cannot be declared `async`
--&gt; src/main.rs:4:5
|
4 | async fn f() {}
| ^^^^^^^^^^^^^^^</code></pre></div>
<p>This crate provides an attribute macro to make async fn in traits work.</p>
<p>Please refer to <a href="https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-hard/"><em>why async fn in traits are hard</em></a> for a deeper
analysis of how this implementation differs from what the compiler and
language hope to deliver in the future.</p>
<br>
<h2 id="example"><a href="#example">Example</a></h2>
<p>This example implements the core of a highly effective advertising platform
using async fn in a trait.</p>
<p>The only thing to notice here is that we write an <code>#[async_trait]</code> macro on
top of traits and trait impls that contain async fn, and then they work.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">async_trait::async_trait</span>;
<span class="attribute">#[<span class="ident">async_trait</span>]</span>
<span class="kw">trait</span> <span class="ident">Advertisement</span> {
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">run</span>(<span class="kw-2">&amp;</span><span class="self">self</span>);
}
<span class="kw">struct</span> <span class="ident">Modal</span>;
<span class="attribute">#[<span class="ident">async_trait</span>]</span>
<span class="kw">impl</span> <span class="ident">Advertisement</span> <span class="kw">for</span> <span class="ident">Modal</span> {
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">run</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) {
<span class="self">self</span>.<span class="ident">render_fullscreen</span>().<span class="kw">await</span>;
<span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="number">4u16</span> {
<span class="ident">remind_user_to_join_mailing_list</span>().<span class="kw">await</span>;
}
<span class="self">self</span>.<span class="ident">hide_for_now</span>().<span class="kw">await</span>;
}
}
<span class="kw">struct</span> <span class="ident">AutoplayingVideo</span> {
<span class="ident">media_url</span>: <span class="ident">String</span>,
}
<span class="attribute">#[<span class="ident">async_trait</span>]</span>
<span class="kw">impl</span> <span class="ident">Advertisement</span> <span class="kw">for</span> <span class="ident">AutoplayingVideo</span> {
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">run</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) {
<span class="kw">let</span> <span class="ident">stream</span> <span class="op">=</span> <span class="ident">connect</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">media_url</span>).<span class="kw">await</span>;
<span class="ident">stream</span>.<span class="ident">play</span>().<span class="kw">await</span>;
<span class="comment">// Video probably persuaded user to join our mailing list!</span>
<span class="ident">Modal</span>.<span class="ident">run</span>().<span class="kw">await</span>;
}
}</code></pre></div>
<p><br><br></p>
<h2 id="supported-features"><a href="#supported-features">Supported features</a></h2>
<p>It is the intention that all features of Rust traits should work nicely with
#[async_trait], but the edge cases are numerous. Please file an issue if
you see unexpected borrow checker errors, type errors, or warnings. There is
no use of <code>unsafe</code> in the expanded code, so rest assured that if your code
compiles it cant be that badly broken.</p>
<blockquote>
<p>Self by value, by reference, by mut reference, or no self;<br>
Any number of arguments, any return value;<br>
Generic type parameters and lifetime parameters;<br>
Associated types;<br>
Having async and non-async functions in the same trait;<br>
Default implementations provided by the trait;<br>
Elided lifetimes;<br>
Dyn-capable traits.<br></p>
</blockquote>
<br>
<h2 id="explanation"><a href="#explanation">Explanation</a></h2>
<p>Async fns get transformed into methods that return <code>Pin&lt;Box&lt;dyn Future + Send + 'async&gt;&gt;</code> and delegate to a private async freestanding function.</p>
<p>For example the <code>impl Advertisement for AutoplayingVideo</code> above would be
expanded as:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">impl</span> <span class="ident">Advertisement</span> <span class="kw">for</span> <span class="ident">AutoplayingVideo</span> {
<span class="kw">fn</span> <span class="ident">run</span><span class="op">&lt;</span><span class="lifetime">&#39;async</span><span class="op">&gt;</span>(
<span class="kw-2">&amp;</span><span class="lifetime">&#39;async</span> <span class="self">self</span>,
) -&gt; <span class="ident">Pin</span><span class="op">&lt;</span><span class="ident">Box</span><span class="op">&lt;</span><span class="kw">dyn</span> <span class="ident">core::future::Future</span><span class="op">&lt;</span><span class="ident">Output</span> <span class="op">=</span> ()<span class="op">&gt;</span> <span class="op">+</span> <span class="ident">Send</span> <span class="op">+</span> <span class="lifetime">&#39;async</span><span class="op">&gt;</span><span class="op">&gt;</span>
<span class="kw">where</span>
<span class="self">Self</span>: <span class="ident">Sync</span> <span class="op">+</span> <span class="lifetime">&#39;async</span>,
{
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">run</span>(<span class="ident">_self</span>: <span class="kw-2">&amp;</span><span class="ident">AutoplayingVideo</span>) {
<span class="comment">/* the original method body */</span>
}
<span class="ident">Box::pin</span>(<span class="ident">run</span>(<span class="self">self</span>))
}
}</code></pre></div>
<p><br><br></p>
<h2 id="non-threadsafe-futures"><a href="#non-threadsafe-futures">Non-threadsafe futures</a></h2>
<p>Not all async traits need futures that are <code>dyn Future + Send</code>. To avoid
having Send and Sync bounds placed on the async trait methods, invoke the
async trait macro as <code>#[async_trait(?Send)]</code> on both the trait and the impl
blocks.</p>
<br>
<h2 id="elided-lifetimes"><a href="#elided-lifetimes">Elided lifetimes</a></h2>
<p>Be aware that async fn syntax does not allow lifetime elision outside of <code>&amp;</code>
and <code>&amp;mut</code> references. (This is true even when not using #[async_trait].)
Lifetimes must be named or marked by the placeholder <code>'_</code>.</p>
<p>Fortunately the compiler is able to diagnose missing lifetimes with a good
error message.</p>
<div class='information'><div class='tooltip compile_fail'></div></div><div class="example-wrap"><pre class="rust rust-example-rendered compile_fail"><code><span class="kw">type</span> <span class="ident">Elided</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span><span class="op">&gt;</span> <span class="op">=</span> <span class="kw-2">&amp;</span><span class="lifetime">&#39;a</span> <span class="ident">usize</span>;
<span class="attribute">#[<span class="ident">async_trait</span>]</span>
<span class="kw">trait</span> <span class="ident">Test</span> {
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">test</span>(<span class="ident">not_okay</span>: <span class="ident">Elided</span>, <span class="ident">okay</span>: <span class="kw-2">&amp;</span><span class="ident">usize</span>) {}
}</code></pre></div>
<div class="example-wrap"><pre class="language-text"><code>error[E0726]: implicit elided lifetime not allowed here
--&gt; src/main.rs:9:29
|
9 | async fn test(not_okay: Elided, okay: &amp;usize) {}
| ^^^^^^- help: indicate the anonymous lifetime: `&lt;&#39;_&gt;`</code></pre></div>
<p>The fix is to name the lifetime or use <code>'_</code>.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attribute">#[<span class="ident">async_trait</span>]</span>
<span class="kw">trait</span> <span class="ident">Test</span> {
<span class="comment">// either</span>
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">test</span><span class="op">&lt;</span><span class="lifetime">&#39;e</span><span class="op">&gt;</span>(<span class="ident">elided</span>: <span class="ident">Elided</span><span class="op">&lt;</span><span class="lifetime">&#39;e</span><span class="op">&gt;</span>) {}
<span class="comment">// or</span>
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">test</span>(<span class="ident">elided</span>: <span class="ident">Elided</span><span class="op">&lt;</span><span class="lifetime">&#39;_</span><span class="op">&gt;</span>) {}
}</code></pre></div>
<p><br><br></p>
<h2 id="dyn-traits"><a href="#dyn-traits">Dyn traits</a></h2>
<p>Traits with async methods can be used as trait objects as long as they meet
the usual requirements for dyn no methods with type parameters, no self
by value, no associated types, etc.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attribute">#[<span class="ident">async_trait</span>]</span>
<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">ObjectSafe</span> {
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">f</span>(<span class="kw-2">&amp;</span><span class="self">self</span>);
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">g</span>(<span class="kw-2">&amp;mut</span> <span class="self">self</span>);
}
<span class="kw">impl</span> <span class="ident">ObjectSafe</span> <span class="kw">for</span> <span class="ident">MyType</span> {...}
<span class="kw">let</span> <span class="ident">value</span>: <span class="ident">MyType</span> <span class="op">=</span> ...;
<span class="kw">let</span> <span class="ident">object</span> <span class="op">=</span> <span class="kw-2">&amp;</span><span class="ident">value</span> <span class="kw">as</span> <span class="kw-2">&amp;</span><span class="kw">dyn</span> <span class="ident">ObjectSafe</span>; <span class="comment">// make trait object</span></code></pre></div>
<p>The one wrinkle is in traits that provide default implementations of async
methods. In order for the default implementation to produce a future that is
Send, the async_trait macro must emit a bound of <code>Self: Sync</code> on trait
methods that take <code>&amp;self</code> and a bound <code>Self: Send</code> on trait methods that
take <code>&amp;mut self</code>. An example of the former is visible in the expanded code
in the explanation section above.</p>
<p>If you make a trait with async methods that have default implementations,
everything will work except that the trait cannot be used as a trait object.
Creating a value of type <code>&amp;dyn Trait</code> will produce an error that looks like
this:</p>
<div class="example-wrap"><pre class="language-text"><code>error: the trait `Test` cannot be made into an object
--&gt; src/main.rs:8:5
|
8 | async fn cannot_dyn(&amp;self) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</code></pre></div>
<p>For traits that need to be object safe and need to have default
implementations for some async methods, there are two resolutions. Either
you can add Send and/or Sync as supertraits (Send if there are <code>&amp;mut self</code>
methods with default implementations, Sync if there are <code>&amp;self</code> methods with
default implementations) to constrain all implementors of the trait such that
the default implementations are applicable to them:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attribute">#[<span class="ident">async_trait</span>]</span>
<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">ObjectSafe</span>: <span class="ident">Sync</span> { <span class="comment">// added supertrait</span>
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">can_dyn</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) {}
}
<span class="kw">let</span> <span class="ident">object</span> <span class="op">=</span> <span class="kw-2">&amp;</span><span class="ident">value</span> <span class="kw">as</span> <span class="kw-2">&amp;</span><span class="kw">dyn</span> <span class="ident">ObjectSafe</span>;</code></pre></div>
<p>or you can strike the problematic methods from your trait object by
bounding them with <code>Self: Sized</code>:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attribute">#[<span class="ident">async_trait</span>]</span>
<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">ObjectSafe</span> {
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">cannot_dyn</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="kw">where</span> <span class="self">Self</span>: <span class="ident">Sized</span> {}
<span class="comment">// presumably other methods</span>
}
<span class="kw">let</span> <span class="ident">object</span> <span class="op">=</span> <span class="kw-2">&amp;</span><span class="ident">value</span> <span class="kw">as</span> <span class="kw-2">&amp;</span><span class="kw">dyn</span> <span class="ident">ObjectSafe</span>;</code></pre></div>
</div></details><h2 id="attributes" class="small-section-header"><a href="#attributes">Attribute Macros</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="attr" href="attr.async_trait.html" title="async_trait::async_trait attr">async_trait</a></div><div class="item-right docblock-short"></div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="async_trait" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"attr":[["async_trait",""]]};

1
doc/ayu.css Normal file

File diff suppressed because one or more lines are too long

1
doc/base64/all.html Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Bcrypt character set"><meta name="keywords" content="rust, rustlang, rust-lang, BCRYPT"><title>BCRYPT in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">base64</a>::<wbr><a class="constant" href="#">BCRYPT</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/lib.rs.html#225-229">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const BCRYPT: <a class="struct" href="struct.Config.html" title="struct base64::Config">Config</a>;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Bcrypt character set</p>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,2 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="BinHex character set"><meta name="keywords" content="rust, rustlang, rust-lang, BINHEX"><title>BINHEX in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">base64</a>::<wbr><a class="constant" href="#">BINHEX</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/lib.rs.html#239-243">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const BINHEX: <a class="struct" href="struct.Config.html" title="struct base64::Config">Config</a>;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>BinHex character set</p>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,2 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="As per `crypt(3)` requirements"><meta name="keywords" content="rust, rustlang, rust-lang, CRYPT"><title>CRYPT in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">base64</a>::<wbr><a class="constant" href="#">CRYPT</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/lib.rs.html#218-222">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const CRYPT: <a class="struct" href="struct.Config.html" title="struct base64::Config">Config</a>;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>As per <code>crypt(3)</code> requirements</p>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,2 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="IMAP modified UTF-7 requirements"><meta name="keywords" content="rust, rustlang, rust-lang, IMAP_MUTF7"><title>IMAP_MUTF7 in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">base64</a>::<wbr><a class="constant" href="#">IMAP_MUTF7</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/lib.rs.html#232-236">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const IMAP_MUTF7: <a class="struct" href="struct.Config.html" title="struct base64::Config">Config</a>;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>IMAP modified UTF-7 requirements</p>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,2 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Standard character set with padding."><meta name="keywords" content="rust, rustlang, rust-lang, STANDARD"><title>STANDARD in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">base64</a>::<wbr><a class="constant" href="#">STANDARD</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/lib.rs.html#190-194">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const STANDARD: <a class="struct" href="struct.Config.html" title="struct base64::Config">Config</a>;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Standard character set with padding.</p>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,2 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Standard character set without padding."><meta name="keywords" content="rust, rustlang, rust-lang, STANDARD_NO_PAD"><title>STANDARD_NO_PAD in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">base64</a>::<wbr><a class="constant" href="#">STANDARD_NO_PAD</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/lib.rs.html#197-201">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const STANDARD_NO_PAD: <a class="struct" href="struct.Config.html" title="struct base64::Config">Config</a>;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Standard character set without padding.</p>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,2 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="URL-safe character set with padding"><meta name="keywords" content="rust, rustlang, rust-lang, URL_SAFE"><title>URL_SAFE in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">base64</a>::<wbr><a class="constant" href="#">URL_SAFE</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/lib.rs.html#204-208">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const URL_SAFE: <a class="struct" href="struct.Config.html" title="struct base64::Config">Config</a>;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>URL-safe character set with padding</p>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,2 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="URL-safe character set without padding"><meta name="keywords" content="rust, rustlang, rust-lang, URL_SAFE_NO_PAD"><title>URL_SAFE_NO_PAD in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Constant <a href="index.html">base64</a>::<wbr><a class="constant" href="#">URL_SAFE_NO_PAD</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/lib.rs.html#211-215">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const URL_SAFE_NO_PAD: <a class="struct" href="struct.Config.html" title="struct base64::Config">Config</a>;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>URL-safe character set without padding</p>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../base64/enum.DecodeError.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../base64/enum.DecodeError.html">../../base64/enum.DecodeError.html</a>...</p>
<script>location.replace("../../base64/enum.DecodeError.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../base64/fn.decode.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../base64/fn.decode.html">../../base64/fn.decode.html</a>...</p>
<script>location.replace("../../base64/fn.decode.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../base64/fn.decode_config.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../base64/fn.decode_config.html">../../base64/fn.decode_config.html</a>...</p>
<script>location.replace("../../base64/fn.decode_config.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../base64/fn.decode_config_buf.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../base64/fn.decode_config_buf.html">../../base64/fn.decode_config_buf.html</a>...</p>
<script>location.replace("../../base64/fn.decode_config_buf.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../base64/fn.decode_config_slice.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../base64/fn.decode_config_slice.html">../../base64/fn.decode_config_slice.html</a>...</p>
<script>location.replace("../../base64/fn.decode_config_slice.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Enables base64d output anywhere you might use a `Display` implementation, like a format string."><meta name="keywords" content="rust, rustlang, rust-lang, display"><title>base64::display - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module display</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../base64/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">base64</a>::<wbr><a class="mod" href="#">display</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/base64/display.rs.html#1-88">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Enables base64d output anywhere you might use a <code>Display</code> implementation, like a format string.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">base64::display::Base64Display</span>;
<span class="kw">let</span> <span class="ident">data</span> <span class="op">=</span> <span class="macro">vec!</span>[<span class="number">0x0</span>, <span class="number">0x1</span>, <span class="number">0x2</span>, <span class="number">0x3</span>];
<span class="kw">let</span> <span class="ident">wrapper</span> <span class="op">=</span> <span class="ident">Base64Display::with_config</span>(<span class="kw-2">&amp;</span><span class="ident">data</span>, <span class="ident">base64::STANDARD</span>);
<span class="macro">assert_eq!</span>(<span class="string">&quot;base64: AAECAw==&quot;</span>, <span class="macro">format!</span>(<span class="string">&quot;base64: {}&quot;</span>, <span class="ident">wrapper</span>));</code></pre></div>
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Base64Display.html" title="base64::display::Base64Display struct">Base64Display</a></div><div class="item-right docblock-short"><p>A convenience wrapper for base64ing bytes into a format string without heap allocation.</p>
</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":[["Base64Display","A convenience wrapper for base64ing bytes into a format string without heap allocation."]]};

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../base64/fn.encode.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../base64/fn.encode.html">../../base64/fn.encode.html</a>...</p>
<script>location.replace("../../base64/fn.encode.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../base64/fn.encode_config.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../base64/fn.encode_config.html">../../base64/fn.encode_config.html</a>...</p>
<script>location.replace("../../base64/fn.encode_config.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../base64/fn.encode_config_buf.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../base64/fn.encode_config_buf.html">../../base64/fn.encode_config_buf.html</a>...</p>
<script>location.replace("../../base64/fn.encode_config_buf.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../base64/fn.encode_config_slice.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../base64/fn.encode_config_slice.html">../../base64/fn.encode_config_slice.html</a>...</p>
<script>location.replace("../../base64/fn.encode_config_slice.html" + location.search + location.hash);</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

11
doc/base64/fn.decode.html Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Decode from string reference as octets. Returns a Result containing a Vec. Convenience `decode_config(input, base64::STANDARD);`."><meta name="keywords" content="rust, rustlang, rust-lang, decode"><title>decode in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Function <a href="index.html">base64</a>::<wbr><a class="fn" href="#">decode</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/decode.rs.html#88-90">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn decode&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>]&gt;&gt;(input: T) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.64.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>&gt;, <a class="enum" href="enum.DecodeError.html" title="enum base64::DecodeError">DecodeError</a>&gt;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Decode from string reference as octets.
Returns a Result containing a Vec<u8>.
Convenience <code>decode_config(input, base64::STANDARD);</code>.</p>
<h2 id="example"><a href="#example">Example</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">base64</span>;
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">bytes</span> <span class="op">=</span> <span class="ident">base64::decode</span>(<span class="string">&quot;aGVsbG8gd29ybGQ=&quot;</span>).<span class="ident">unwrap</span>();
<span class="macro">println!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">bytes</span>);
}</code></pre></div>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Decode from string reference as octets. Returns a Result containing a Vec."><meta name="keywords" content="rust, rustlang, rust-lang, decode_config"><title>decode_config in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Function <a href="index.html">base64</a>::<wbr><a class="fn" href="#">decode_config</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/decode.rs.html#109-120">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn decode_config&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>]&gt;&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;input: T,<br>&nbsp;&nbsp;&nbsp;&nbsp;config: <a class="struct" href="struct.Config.html" title="struct base64::Config">Config</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.64.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>&gt;, <a class="enum" href="enum.DecodeError.html" title="enum base64::DecodeError">DecodeError</a>&gt;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Decode from string reference as octets.
Returns a Result containing a Vec<u8>.</p>
<h2 id="example"><a href="#example">Example</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">base64</span>;
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">bytes</span> <span class="op">=</span> <span class="ident">base64::decode_config</span>(<span class="string">&quot;aGVsbG8gd29ybGR+Cg==&quot;</span>, <span class="ident">base64::STANDARD</span>).<span class="ident">unwrap</span>();
<span class="macro">println!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">bytes</span>);
<span class="kw">let</span> <span class="ident">bytes_url</span> <span class="op">=</span> <span class="ident">base64::decode_config</span>(<span class="string">&quot;aGVsbG8gaW50ZXJuZXR-Cg==&quot;</span>, <span class="ident">base64::URL_SAFE</span>).<span class="ident">unwrap</span>();
<span class="macro">println!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">bytes_url</span>);
}</code></pre></div>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Decode the input into the provided output slice."><meta name="keywords" content="rust, rustlang, rust-lang, decode_config_slice"><title>decode_config_slice in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Function <a href="index.html">base64</a>::<wbr><a class="fn" href="#">decode_config_slice</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/decode.rs.html#180-188">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn decode_config_slice&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>]&gt;&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;input: T,<br>&nbsp;&nbsp;&nbsp;&nbsp;config: <a class="struct" href="struct.Config.html" title="struct base64::Config">Config</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;output: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>]<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.usize.html">usize</a>, <a class="enum" href="enum.DecodeError.html" title="enum base64::DecodeError">DecodeError</a>&gt;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Decode the input into the provided output slice.</p>
<p>This will not write any bytes past exactly what is decoded (no stray garbage bytes at the end).</p>
<p>If you dont know ahead of time what the decoded length should be, size your buffer with a
conservative estimate for the decoded length of an input: 3 bytes of output for every 4 bytes of
input, rounded up, or in other words <code>(input_len + 3) / 4 * 3</code>.</p>
<p>If the slice is not large enough, this will panic.</p>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

11
doc/base64/fn.encode.html Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Encode arbitrary octets as base64. Returns a String. Convenience for `encode_config(input, base64::STANDARD);`."><meta name="keywords" content="rust, rustlang, rust-lang, encode"><title>encode in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Function <a href="index.html">base64</a>::<wbr><a class="fn" href="#">encode</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/encode.rs.html#23-25">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn encode&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>]&gt;&gt;(input: T) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.64.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Encode arbitrary octets as base64.
Returns a String.
Convenience for <code>encode_config(input, base64::STANDARD);</code>.</p>
<h2 id="example"><a href="#example">Example</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">base64</span>;
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">b64</span> <span class="op">=</span> <span class="ident">base64::encode</span>(<span class="string">b&quot;hello world&quot;</span>);
<span class="macro">println!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">b64</span>);
}</code></pre></div>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Encode arbitrary octets as base64. Returns a String."><meta name="keywords" content="rust, rustlang, rust-lang, encode_config"><title>encode_config in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Function <a href="index.html">base64</a>::<wbr><a class="fn" href="#">encode_config</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/encode.rs.html#44-53">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn encode_config&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>]&gt;&gt;(input: T, config: <a class="struct" href="struct.Config.html" title="struct base64::Config">Config</a>) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.64.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Encode arbitrary octets as base64.
Returns a String.</p>
<h2 id="example"><a href="#example">Example</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">base64</span>;
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">b64</span> <span class="op">=</span> <span class="ident">base64::encode_config</span>(<span class="string">b&quot;hello world~&quot;</span>, <span class="ident">base64::STANDARD</span>);
<span class="macro">println!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">b64</span>);
<span class="kw">let</span> <span class="ident">b64_url</span> <span class="op">=</span> <span class="ident">base64::encode_config</span>(<span class="string">b&quot;hello internet~&quot;</span>, <span class="ident">base64::URL_SAFE</span>);
<span class="macro">println!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">b64_url</span>);
}</code></pre></div>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Encode arbitrary octets as base64. Writes into the supplied output buffer, which will grow the buffer if needed."><meta name="keywords" content="rust, rustlang, rust-lang, encode_config_buf"><title>encode_config_buf in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Function <a href="index.html">base64</a>::<wbr><a class="fn" href="#">encode_config_buf</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/encode.rs.html#74-85">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn encode_config_buf&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>]&gt;&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;input: T,<br>&nbsp;&nbsp;&nbsp;&nbsp;config: <a class="struct" href="struct.Config.html" title="struct base64::Config">Config</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;buf: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.64.0/alloc/string/struct.String.html" title="struct alloc::string::String">String</a><br>)</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Encode arbitrary octets as base64.
Writes into the supplied output buffer, which will grow the buffer if needed.</p>
<h2 id="example"><a href="#example">Example</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">base64</span>;
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buf</span> <span class="op">=</span> <span class="ident">String::new</span>();
<span class="ident">base64::encode_config_buf</span>(<span class="string">b&quot;hello world~&quot;</span>, <span class="ident">base64::STANDARD</span>, <span class="kw-2">&amp;mut</span> <span class="ident">buf</span>);
<span class="macro">println!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">buf</span>);
<span class="ident">buf</span>.<span class="ident">clear</span>();
<span class="ident">base64::encode_config_buf</span>(<span class="string">b&quot;hello internet~&quot;</span>, <span class="ident">base64::URL_SAFE</span>, <span class="kw-2">&amp;mut</span> <span class="ident">buf</span>);
<span class="macro">println!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">buf</span>);
}</code></pre></div>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,24 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Encode arbitrary octets as base64. Writes into the supplied output buffer."><meta name="keywords" content="rust, rustlang, rust-lang, encode_config_slice"><title>encode_config_slice in base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In base64</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Function <a href="index.html">base64</a>::<wbr><a class="fn" href="#">encode_config_slice</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/encode.rs.html#117-128">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn encode_config_slice&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>]&gt;&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;input: T,<br>&nbsp;&nbsp;&nbsp;&nbsp;config: <a class="struct" href="struct.Config.html" title="struct base64::Config">Config</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;output: &amp;mut [<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.u8.html">u8</a>]<br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.usize.html">usize</a></code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Encode arbitrary octets as base64.
Writes into the supplied output buffer.</p>
<p>This is useful if you wish to avoid allocation entirely (e.g. encoding into a stack-resident
or statically-allocated buffer).</p>
<h2 id="panics"><a href="#panics">Panics</a></h2>
<p>If <code>output</code> is too small to hold the encoded version of <code>input</code>, a panic will result.</p>
<h2 id="example"><a href="#example">Example</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">base64</span>;
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">s</span> <span class="op">=</span> <span class="string">b&quot;hello internet!&quot;</span>;
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buf</span> <span class="op">=</span> <span class="ident">Vec::new</span>();
<span class="comment">// make sure we&#39;ll have a slice big enough for base64 + padding</span>
<span class="ident">buf</span>.<span class="ident">resize</span>(<span class="ident">s</span>.<span class="ident">len</span>() <span class="op">*</span> <span class="number">4</span> <span class="op">/</span> <span class="number">3</span> <span class="op">+</span> <span class="number">4</span>, <span class="number">0</span>);
<span class="kw">let</span> <span class="ident">bytes_written</span> <span class="op">=</span> <span class="ident">base64::encode_config_slice</span>(<span class="ident">s</span>,
<span class="ident">base64::STANDARD</span>, <span class="kw-2">&amp;mut</span> <span class="ident">buf</span>);
<span class="comment">// shorten our vec down to just what was written</span>
<span class="ident">buf</span>.<span class="ident">resize</span>(<span class="ident">bytes_written</span>, <span class="number">0</span>);
<span class="macro">assert_eq!</span>(<span class="ident">s</span>, <span class="ident">base64::decode</span>(<span class="kw-2">&amp;</span><span class="ident">buf</span>).<span class="ident">unwrap</span>().<span class="ident">as_slice</span>());
}</code></pre></div>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

76
doc/base64/index.html Normal file
View File

@ -0,0 +1,76 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Configs"><meta name="keywords" content="rust, rustlang, rust-lang, base64"><title>base64 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="../crates.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Crate base64</a></h2><div class="sidebar-elems"><div class="block"><ul><li class="version">Version 0.13.1</li><li><a id="all-types" href="all.html">All Items</a></li></ul></div><section><div class="block"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li><li><a href="#functions">Functions</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../base64/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">base64</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/base64/lib.rs.html#1-245">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="configs"><a href="#configs">Configs</a></h2>
<p>There isnt just one type of Base64; that would be too simple. You need to choose a character
set (standard, URL-safe, etc) and padding suffix (yes/no).
The <code>Config</code> struct encapsulates this info. There are some common configs included: <code>STANDARD</code>,
<code>URL_SAFE</code>, etc. You can also make your own <code>Config</code> if needed.</p>
<p>The functions that dont have <code>config</code> in the name (e.g. <code>encode()</code> and <code>decode()</code>) use the
<code>STANDARD</code> config .</p>
<p>The functions that write to a slice (the ones that end in <code>_slice</code>) are generally the fastest
because they dont need to resize anything. If it fits in your workflow and you care about
performance, keep using the same buffer (growing as need be) and use the <code>_slice</code> methods for
the best performance.</p>
<h2 id="encoding"><a href="#encoding">Encoding</a></h2>
<p>Several different encoding functions are available to you depending on your desire for
convenience vs performance.</p>
<div><table><thead><tr><th>Function</th><th>Output</th><th>Allocates</th></tr></thead><tbody>
<tr><td><code>encode</code></td><td>Returns a new <code>String</code></td><td>Always</td></tr>
<tr><td><code>encode_config</code></td><td>Returns a new <code>String</code></td><td>Always</td></tr>
<tr><td><code>encode_config_buf</code></td><td>Appends to provided <code>String</code></td><td>Only if <code>String</code> needs to grow</td></tr>
<tr><td><code>encode_config_slice</code></td><td>Writes to provided <code>&amp;[u8]</code></td><td>Never</td></tr>
</tbody></table>
</div>
<p>All of the encoding functions that take a <code>Config</code> will pad as per the config.</p>
<h2 id="decoding"><a href="#decoding">Decoding</a></h2>
<p>Just as for encoding, there are different decoding functions available.</p>
<div><table><thead><tr><th>Function</th><th>Output</th><th>Allocates</th></tr></thead><tbody>
<tr><td><code>decode</code></td><td>Returns a new <code>Vec&lt;u8&gt;</code></td><td>Always</td></tr>
<tr><td><code>decode_config</code></td><td>Returns a new <code>Vec&lt;u8&gt;</code></td><td>Always</td></tr>
<tr><td><code>decode_config_buf</code></td><td>Appends to provided <code>Vec&lt;u8&gt;</code></td><td>Only if <code>Vec</code> needs to grow</td></tr>
<tr><td><code>decode_config_slice</code></td><td>Writes to provided <code>&amp;[u8]</code></td><td>Never</td></tr>
</tbody></table>
</div>
<p>Unlike encoding, where all possible input is valid, decoding can fail (see <code>DecodeError</code>).</p>
<p>Input can be invalid because it has invalid characters or invalid padding. (No padding at all is
valid, but excess padding is not.) Whitespace in the input is invalid.</p>
<h2 id="read-and-write"><a href="#read-and-write"><code>Read</code> and <code>Write</code></a></h2>
<p>To map a <code>Read</code> of b64 bytes to the decoded bytes, wrap a reader (file, network socket, etc)
with <code>base64::read::DecoderReader</code>. To write raw bytes and have them b64 encoded on the fly,
wrap a writer with <code>base64::write::EncoderWriter</code>. There is some performance overhead (15% or
so) because of the necessary buffer shuffling still fast enough that almost nobody cares.
Also, these implementations do not heap allocate.</p>
<h2 id="panics"><a href="#panics">Panics</a></h2>
<p>If length calculations result in overflowing <code>usize</code>, a panic will result.</p>
<p>The <code>_slice</code> flavors of encode or decode will panic if the provided output slice is too small,</p>
</div></details><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="display/index.html" title="base64::display mod">display</a></div><div class="item-right docblock-short"><p>Enables base64d output anywhere you might use a <code>Display</code> implementation, like a format string.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="read/index.html" title="base64::read mod">read</a></div><div class="item-right docblock-short"><p>Implementations of <code>io::Read</code> to transparently decode base64.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="write/index.html" title="base64::write mod">write</a></div><div class="item-right docblock-short"><p>Implementations of <code>io::Write</code> to transparently handle base64.</p>
</div></div></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Config.html" title="base64::Config struct">Config</a></div><div class="item-right docblock-short"><p>Contains configuration parameters for base64 encoding</p>
</div></div></div><h2 id="enums" class="small-section-header"><a href="#enums">Enums</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.CharacterSet.html" title="base64::CharacterSet enum">CharacterSet</a></div><div class="item-right docblock-short"><p>Available encoding character sets</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.DecodeError.html" title="base64::DecodeError enum">DecodeError</a></div><div class="item-right docblock-short"><p>Errors that can occur while decoding.</p>
</div></div></div><h2 id="constants" class="small-section-header"><a href="#constants">Constants</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.BCRYPT.html" title="base64::BCRYPT constant">BCRYPT</a></div><div class="item-right docblock-short"><p>Bcrypt character set</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.BINHEX.html" title="base64::BINHEX constant">BINHEX</a></div><div class="item-right docblock-short"><p>BinHex character set</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.CRYPT.html" title="base64::CRYPT constant">CRYPT</a></div><div class="item-right docblock-short"><p>As per <code>crypt(3)</code> requirements</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.IMAP_MUTF7.html" title="base64::IMAP_MUTF7 constant">IMAP_MUTF7</a></div><div class="item-right docblock-short"><p>IMAP modified UTF-7 requirements</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.STANDARD.html" title="base64::STANDARD constant">STANDARD</a></div><div class="item-right docblock-short"><p>Standard character set with padding.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.STANDARD_NO_PAD.html" title="base64::STANDARD_NO_PAD constant">STANDARD_NO_PAD</a></div><div class="item-right docblock-short"><p>Standard character set without padding.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.URL_SAFE.html" title="base64::URL_SAFE constant">URL_SAFE</a></div><div class="item-right docblock-short"><p>URL-safe character set with padding</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.URL_SAFE_NO_PAD.html" title="base64::URL_SAFE_NO_PAD constant">URL_SAFE_NO_PAD</a></div><div class="item-right docblock-short"><p>URL-safe character set without padding</p>
</div></div></div><h2 id="functions" class="small-section-header"><a href="#functions">Functions</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.decode.html" title="base64::decode fn">decode</a></div><div class="item-right docblock-short"><p>Decode from string reference as octets.
Returns a Result containing a Vec<u8>.
Convenience <code>decode_config(input, base64::STANDARD);</code>.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.decode_config.html" title="base64::decode_config fn">decode_config</a></div><div class="item-right docblock-short"><p>Decode from string reference as octets.
Returns a Result containing a Vec<u8>.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.decode_config_buf.html" title="base64::decode_config_buf fn">decode_config_buf</a></div><div class="item-right docblock-short"><p>Decode from string reference as octets.
Writes into the supplied buffer to avoid allocation.
Returns a Result containing an empty tuple, aka ().</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.decode_config_slice.html" title="base64::decode_config_slice fn">decode_config_slice</a></div><div class="item-right docblock-short"><p>Decode the input into the provided output slice.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.encode.html" title="base64::encode fn">encode</a></div><div class="item-right docblock-short"><p>Encode arbitrary octets as base64.
Returns a String.
Convenience for <code>encode_config(input, base64::STANDARD);</code>.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.encode_config.html" title="base64::encode_config fn">encode_config</a></div><div class="item-right docblock-short"><p>Encode arbitrary octets as base64.
Returns a String.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.encode_config_buf.html" title="base64::encode_config_buf fn">encode_config_buf</a></div><div class="item-right docblock-short"><p>Encode arbitrary octets as base64.
Writes into the supplied output buffer, which will grow the buffer if needed.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.encode_config_slice.html" title="base64::encode_config_slice fn">encode_config_slice</a></div><div class="item-right docblock-short"><p>Encode arbitrary octets as base64.
Writes into the supplied output buffer.</p>
</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../base64/read/struct.DecoderReader.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../base64/read/struct.DecoderReader.html">../../../base64/read/struct.DecoderReader.html</a>...</p>
<script>location.replace("../../../base64/read/struct.DecoderReader.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,3 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Implementations of `io::Read` to transparently decode base64."><meta name="keywords" content="rust, rustlang, rust-lang, read"><title>base64::read - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module read</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../base64/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">base64</a>::<wbr><a class="mod" href="#">read</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/base64/read/mod.rs.html#1-6">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Implementations of <code>io::Read</code> to transparently decode base64.</p>
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.DecoderReader.html" title="base64::read::DecoderReader struct">DecoderReader</a></div><div class="item-right docblock-short"><p>A <code>Read</code> implementation that decodes base64 data read from an underlying reader.</p>
</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":[["DecoderReader","A `Read` implementation that decodes base64 data read from an underlying reader."]]};

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"constant":[["BCRYPT","Bcrypt character set"],["BINHEX","BinHex character set"],["CRYPT","As per `crypt(3)` requirements"],["IMAP_MUTF7","IMAP modified UTF-7 requirements"],["STANDARD","Standard character set with padding."],["STANDARD_NO_PAD","Standard character set without padding."],["URL_SAFE","URL-safe character set with padding"],["URL_SAFE_NO_PAD","URL-safe character set without padding"]],"enum":[["CharacterSet","Available encoding character sets"],["DecodeError","Errors that can occur while decoding."]],"fn":[["decode","Decode from string reference as octets. Returns a Result containing a Vec. Convenience `decode_config(input, base64::STANDARD);`."],["decode_config","Decode from string reference as octets. Returns a Result containing a Vec."],["decode_config_buf","Decode from string reference as octets. Writes into the supplied buffer to avoid allocation. Returns a Result containing an empty tuple, aka ()."],["decode_config_slice","Decode the input into the provided output slice."],["encode","Encode arbitrary octets as base64. Returns a String. Convenience for `encode_config(input, base64::STANDARD);`."],["encode_config","Encode arbitrary octets as base64. Returns a String."],["encode_config_buf","Encode arbitrary octets as base64. Writes into the supplied output buffer, which will grow the buffer if needed."],["encode_config_slice","Encode arbitrary octets as base64. Writes into the supplied output buffer."]],"mod":[["display","Enables base64d output anywhere you might use a `Display` implementation, like a format string."],["read","Implementations of `io::Read` to transparently decode base64."],["write","Implementations of `io::Write` to transparently handle base64."]],"struct":[["Config","Contains configuration parameters for base64 encoding"]]};

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../base64/write/struct.EncoderWriter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../base64/write/struct.EncoderWriter.html">../../../base64/write/struct.EncoderWriter.html</a>...</p>
<script>location.replace("../../../base64/write/struct.EncoderWriter.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../base64/write/struct.EncoderStringWriter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../base64/write/struct.EncoderStringWriter.html">../../../base64/write/struct.EncoderStringWriter.html</a>...</p>
<script>location.replace("../../../base64/write/struct.EncoderStringWriter.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,5 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Implementations of `io::Write` to transparently handle base64."><meta name="keywords" content="rust, rustlang, rust-lang, write"><title>base64::write - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../base64/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module write</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../base64/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">base64</a>::<wbr><a class="mod" href="#">write</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/base64/write/mod.rs.html#1-8">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Implementations of <code>io::Write</code> to transparently handle base64.</p>
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.EncoderStringWriter.html" title="base64::write::EncoderStringWriter struct">EncoderStringWriter</a></div><div class="item-right docblock-short"><p>A <code>Write</code> implementation that base64-encodes data using the provided config and accumulates the
resulting base64 in memory, which is then exposed as a String via <code>into_inner()</code>.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.EncoderWriter.html" title="base64::write::EncoderWriter struct">EncoderWriter</a></div><div class="item-right docblock-short"><p>A <code>Write</code> implementation that base64 encodes data before delegating to the wrapped writer.</p>
</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="base64" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":[["EncoderStringWriter","A `Write` implementation that base64-encodes data using the provided config and accumulates the resulting base64 in memory, which is then exposed as a String via `into_inner()`."],["EncoderWriter","A `Write` implementation that base64 encodes data before delegating to the wrapped writer."]]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
doc/bitflags/all.html Normal file
View File

@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../bitflags/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../bitflags/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location">Crate bitflags</h2></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../bitflags/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">List of all items</span></h1><h3 id="Macros">Macros</h3><ul class="macros docblock"><li><a href="macro.bitflags.html">bitflags</a></li></ul></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bitflags" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

229
doc/bitflags/index.html Normal file
View File

@ -0,0 +1,229 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A typesafe bitmask flag generator useful for sets of C-style bitmask flags. It can be used for creating typesafe wrappers around C APIs."><meta name="keywords" content="rust, rustlang, rust-lang, bitflags"><title>bitflags - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="../crates.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../bitflags/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../bitflags/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Crate bitflags</a></h2><div class="sidebar-elems"><div class="block"><ul><li class="version">Version 1.3.2</li><li><a id="all-types" href="all.html">All Items</a></li></ul></div><section><div class="block"><ul><li><a href="#macros">Macros</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../bitflags/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">bitflags</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/bitflags/lib.rs.html#11-1729">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A typesafe bitmask flag generator useful for sets of C-style bitmask flags.
It can be used for creating typesafe wrappers around C APIs.</p>
<p>The <code>bitflags!</code> macro generates <code>struct</code>s that manage a set of flags. The
flags should only be defined for integer types, otherwise unexpected type
errors may occur at compile time.</p>
<h2 id="example"><a href="#example">Example</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
<span class="macro">bitflags!</span> {
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
<span class="kw">const</span> <span class="ident">C</span> <span class="op">=</span> <span class="number">0b00000100</span>;
<span class="kw">const</span> <span class="ident">ABC</span> <span class="op">=</span> <span class="ident"><span class="self">Self</span>::A</span>.<span class="ident">bits</span> <span class="op">|</span> <span class="ident"><span class="self">Self</span>::B</span>.<span class="ident">bits</span> <span class="op">|</span> <span class="ident"><span class="self">Self</span>::C</span>.<span class="ident">bits</span>;
}
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">e1</span> <span class="op">=</span> <span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::C</span>;
<span class="kw">let</span> <span class="ident">e2</span> <span class="op">=</span> <span class="ident">Flags::B</span> <span class="op">|</span> <span class="ident">Flags::C</span>;
<span class="macro">assert_eq!</span>((<span class="ident">e1</span> <span class="op">|</span> <span class="ident">e2</span>), <span class="ident">Flags::ABC</span>); <span class="comment">// union</span>
<span class="macro">assert_eq!</span>((<span class="ident">e1</span> <span class="op">&amp;</span> <span class="ident">e2</span>), <span class="ident">Flags::C</span>); <span class="comment">// intersection</span>
<span class="macro">assert_eq!</span>((<span class="ident">e1</span> <span class="op">-</span> <span class="ident">e2</span>), <span class="ident">Flags::A</span>); <span class="comment">// set difference</span>
<span class="macro">assert_eq!</span>(<span class="op">!</span><span class="ident">e2</span>, <span class="ident">Flags::A</span>); <span class="comment">// set complement</span>
}</code></pre></div>
<p>See <a href="./example_generated/struct.Flags.html"><code>example_generated::Flags</code></a> for documentation of code
generated by the above <code>bitflags!</code> expansion.</p>
<p>The generated <code>struct</code>s can also be extended with type and trait
implementations:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">std::fmt</span>;
<span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
<span class="macro">bitflags!</span> {
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
}
}
<span class="kw">impl</span> <span class="ident">Flags</span> {
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">clear</span>(<span class="kw-2">&amp;mut</span> <span class="self">self</span>) {
<span class="self">self</span>.<span class="ident">bits</span> <span class="op">=</span> <span class="number">0</span>; <span class="comment">// The `bits` field can be accessed from within the</span>
<span class="comment">// same module where the `bitflags!` macro was invoked.</span>
}
}
<span class="kw">impl</span> <span class="ident">fmt::Display</span> <span class="kw">for</span> <span class="ident">Flags</span> {
<span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&amp;mut</span> <span class="ident">fmt::Formatter</span>) -&gt; <span class="ident">fmt::Result</span> {
<span class="macro">write!</span>(<span class="ident">f</span>, <span class="string">&quot;hi!&quot;</span>)
}
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">flags</span> <span class="op">=</span> <span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::B</span>;
<span class="ident">flags</span>.<span class="ident">clear</span>();
<span class="macro">assert!</span>(<span class="ident">flags</span>.<span class="ident">is_empty</span>());
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">flags</span>), <span class="string">&quot;hi!&quot;</span>);
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::B</span>), <span class="string">&quot;A | B&quot;</span>);
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">Flags::B</span>), <span class="string">&quot;B&quot;</span>);
}</code></pre></div>
<h2 id="visibility"><a href="#visibility">Visibility</a></h2>
<p>The generated structs and their associated flag constants are not exported
out of the current module by default. A definition can be exported out of
the current module by adding <code>pub</code> before <code>struct</code>:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">mod</span> <span class="ident">example</span> {
<span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
<span class="macro">bitflags!</span> {
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Flags1</span>: <span class="ident">u32</span> {
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
}
<span class="kw">struct</span> <span class="ident">Flags2</span>: <span class="ident">u32</span> {
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
}
}
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">flag1</span> <span class="op">=</span> <span class="ident">example::Flags1::A</span>;
<span class="kw">let</span> <span class="ident">flag2</span> <span class="op">=</span> <span class="ident">example::Flags2::B</span>; <span class="comment">// error: const `B` is private</span>
}</code></pre></div>
<h2 id="attributes"><a href="#attributes">Attributes</a></h2>
<p>Attributes can be attached to the generated <code>struct</code>s by placing them
before the <code>struct</code> keyword.</p>
<h3 id="representations"><a href="#representations">Representations</a></h3>
<p>Its valid to add a <code>#[repr(C)]</code> or <code>#[repr(transparent)]</code> attribute to a type
generated by <code>bitflags!</code>. In these cases, the type is guaranteed to be a newtype.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
<span class="macro">bitflags!</span> {
<span class="attribute">#[<span class="ident">repr</span>(<span class="ident">transparent</span>)]</span>
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
<span class="kw">const</span> <span class="ident">C</span> <span class="op">=</span> <span class="number">0b00000100</span>;
}
}</code></pre></div>
<h2 id="trait-implementations-1"><a href="#trait-implementations-1">Trait implementations</a></h2>
<p>The <code>Copy</code>, <code>Clone</code>, <code>PartialEq</code>, <code>Eq</code>, <code>PartialOrd</code>, <code>Ord</code> and <code>Hash</code>
traits are automatically derived for the <code>struct</code>s using the <code>derive</code> attribute.
Additional traits can be derived by providing an explicit <code>derive</code>
attribute on <code>struct</code>.</p>
<p>The <code>Extend</code> and <code>FromIterator</code> traits are implemented for the <code>struct</code>s,
too: <code>Extend</code> adds the union of the instances of the <code>struct</code> iterated over,
while <code>FromIterator</code> calculates the union.</p>
<p>The <code>Binary</code>, <code>Debug</code>, <code>LowerHex</code>, <code>Octal</code> and <code>UpperHex</code> traits are also
implemented by displaying the bits value of the internal struct.</p>
<h3 id="operators"><a href="#operators">Operators</a></h3>
<p>The following operator traits are implemented for the generated <code>struct</code>s:</p>
<ul>
<li><code>BitOr</code> and <code>BitOrAssign</code>: union</li>
<li><code>BitAnd</code> and <code>BitAndAssign</code>: intersection</li>
<li><code>BitXor</code> and <code>BitXorAssign</code>: toggle</li>
<li><code>Sub</code> and <code>SubAssign</code>: set difference</li>
<li><code>Not</code>: set complement</li>
</ul>
<h2 id="methods"><a href="#methods">Methods</a></h2>
<p>The following methods are defined for the generated <code>struct</code>s:</p>
<ul>
<li><code>empty</code>: an empty set of flags</li>
<li><code>all</code>: the set of all defined flags</li>
<li><code>bits</code>: the raw value of the flags currently stored</li>
<li><code>from_bits</code>: convert from underlying bit representation, unless that
representation contains bits that do not correspond to a
defined flag</li>
<li><code>from_bits_truncate</code>: convert from underlying bit representation, dropping
any bits that do not correspond to defined flags</li>
<li><code>from_bits_unchecked</code>: convert from underlying bit representation, keeping
all bits (even those not corresponding to defined
flags)</li>
<li><code>is_empty</code>: <code>true</code> if no flags are currently stored</li>
<li><code>is_all</code>: <code>true</code> if currently set flags exactly equal all defined flags</li>
<li><code>intersects</code>: <code>true</code> if there are flags common to both <code>self</code> and <code>other</code></li>
<li><code>contains</code>: <code>true</code> if all of the flags in <code>other</code> are contained within <code>self</code></li>
<li><code>insert</code>: inserts the specified flags in-place</li>
<li><code>remove</code>: removes the specified flags in-place</li>
<li><code>toggle</code>: the specified flags will be inserted if not present, and removed
if they are.</li>
<li><code>set</code>: inserts or removes the specified flags depending on the passed value</li>
<li><code>intersection</code>: returns a new set of flags, containing only the flags present
in both <code>self</code> and <code>other</code> (the argument to the function).</li>
<li><code>union</code>: returns a new set of flags, containing any flags present in
either <code>self</code> or <code>other</code> (the argument to the function).</li>
<li><code>difference</code>: returns a new set of flags, containing all flags present in
<code>self</code> without any of the flags present in <code>other</code> (the
argument to the function).</li>
<li><code>symmetric_difference</code>: returns a new set of flags, containing all flags
present in either <code>self</code> or <code>other</code> (the argument
to the function), but not both.</li>
<li><code>complement</code>: returns a new set of flags, containing all flags which are
not set in <code>self</code>, but which are allowed for this type.</li>
</ul>
<h3 id="default"><a href="#default">Default</a></h3>
<p>The <code>Default</code> trait is not automatically implemented for the generated structs.</p>
<p>If your default value is equal to <code>0</code> (which is the same value as calling <code>empty()</code>
on the generated struct), you can simply derive <code>Default</code>:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
<span class="macro">bitflags!</span> {
<span class="comment">// Results in default value with bits: 0</span>
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Default</span>)]</span>
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
<span class="kw">const</span> <span class="ident">C</span> <span class="op">=</span> <span class="number">0b00000100</span>;
}
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">derived_default</span>: <span class="ident">Flags</span> <span class="op">=</span> <span class="ident">Default::default</span>();
<span class="macro">assert_eq!</span>(<span class="ident">derived_default</span>.<span class="ident">bits</span>(), <span class="number">0</span>);
}</code></pre></div>
<p>If your default value is not equal to <code>0</code> you need to implement <code>Default</code> yourself:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
<span class="macro">bitflags!</span> {
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
<span class="kw">const</span> <span class="ident">C</span> <span class="op">=</span> <span class="number">0b00000100</span>;
}
}
<span class="comment">// explicit `Default` implementation</span>
<span class="kw">impl</span> <span class="ident">Default</span> <span class="kw">for</span> <span class="ident">Flags</span> {
<span class="kw">fn</span> <span class="ident">default</span>() -&gt; <span class="ident">Flags</span> {
<span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::C</span>
}
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">implemented_default</span>: <span class="ident">Flags</span> <span class="op">=</span> <span class="ident">Default::default</span>();
<span class="macro">assert_eq!</span>(<span class="ident">implemented_default</span>, (<span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::C</span>));
}</code></pre></div>
<h2 id="zero-flags"><a href="#zero-flags">Zero Flags</a></h2>
<p>Flags with a value equal to zero will have some strange behavior that one should be aware of.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
<span class="macro">bitflags!</span> {
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
<span class="kw">const</span> <span class="ident">NONE</span> <span class="op">=</span> <span class="number">0b00000000</span>;
<span class="kw">const</span> <span class="ident">SOME</span> <span class="op">=</span> <span class="number">0b00000001</span>;
}
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">empty</span> <span class="op">=</span> <span class="ident">Flags::empty</span>();
<span class="kw">let</span> <span class="ident">none</span> <span class="op">=</span> <span class="ident">Flags::NONE</span>;
<span class="kw">let</span> <span class="ident">some</span> <span class="op">=</span> <span class="ident">Flags::SOME</span>;
<span class="comment">// Zero flags are treated as always present</span>
<span class="macro">assert!</span>(<span class="ident">empty</span>.<span class="ident">contains</span>(<span class="ident">Flags::NONE</span>));
<span class="macro">assert!</span>(<span class="ident">none</span>.<span class="ident">contains</span>(<span class="ident">Flags::NONE</span>));
<span class="macro">assert!</span>(<span class="ident">some</span>.<span class="ident">contains</span>(<span class="ident">Flags::NONE</span>));
<span class="comment">// Zero flags will be ignored when testing for emptiness</span>
<span class="macro">assert!</span>(<span class="ident">none</span>.<span class="ident">is_empty</span>());
}</code></pre></div>
<p>Users should generally avoid defining a flag with a value of zero.</p>
</div></details><h2 id="macros" class="small-section-header"><a href="#macros">Macros</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.bitflags.html" title="bitflags::bitflags macro">bitflags</a></div><div class="item-right docblock-short"><p>The macro used to generate the flag structures.</p>
</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bitflags" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.bitflags.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.bitflags.html">macro.bitflags.html</a>...</p>
<script>location.replace("macro.bitflags.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,72 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The macro used to generate the flag structures."><meta name="keywords" content="rust, rustlang, rust-lang, bitflags"><title>bitflags in bitflags - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../bitflags/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../bitflags/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In bitflags</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../bitflags/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Macro <a href="index.html">bitflags</a>::<wbr><a class="macro" href="#">bitflags</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/bitflags/lib.rs.html#350-382">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><div class="example-wrap"><pre class="rust macro"><code><span class="macro">macro_rules!</span> <span class="ident">bitflags</span> {
(
$(<span class="attribute">#[<span class="macro-nonterminal">$</span><span class="macro-nonterminal">outer</span>:<span class="ident">meta</span>]</span>)<span class="op">*</span>
<span class="macro-nonterminal">$</span><span class="macro-nonterminal">vis</span>:<span class="ident">vis</span> <span class="kw">struct</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">BitFlags</span>:<span class="ident">ident</span>: <span class="macro-nonterminal">$</span><span class="macro-nonterminal">T</span>:<span class="ident">ty</span> {
$(
$(<span class="attribute">#[<span class="macro-nonterminal">$</span><span class="macro-nonterminal">inner</span>:<span class="ident">ident</span> $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">args</span>:<span class="ident">tt</span>)<span class="kw-2">*</span>]</span>)<span class="op">*</span>
<span class="kw">const</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">Flag</span>:<span class="ident">ident</span> <span class="op">=</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">value</span>:<span class="ident">expr</span>;
)<span class="op">*</span>
}
$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">t</span>:<span class="ident">tt</span>)<span class="op">*</span>
) =&gt; { ... };
() =&gt; { ... };
}</code></pre></div>
</div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The macro used to generate the flag structures.</p>
<p>See the <a href="../bitflags/index.html">crate level docs</a> for complete documentation.</p>
<h2 id="example"><a href="#example">Example</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
<span class="macro">bitflags!</span> {
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
<span class="kw">const</span> <span class="ident">C</span> <span class="op">=</span> <span class="number">0b00000100</span>;
<span class="kw">const</span> <span class="ident">ABC</span> <span class="op">=</span> <span class="ident"><span class="self">Self</span>::A</span>.<span class="ident">bits</span> <span class="op">|</span> <span class="ident"><span class="self">Self</span>::B</span>.<span class="ident">bits</span> <span class="op">|</span> <span class="ident"><span class="self">Self</span>::C</span>.<span class="ident">bits</span>;
}
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">e1</span> <span class="op">=</span> <span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::C</span>;
<span class="kw">let</span> <span class="ident">e2</span> <span class="op">=</span> <span class="ident">Flags::B</span> <span class="op">|</span> <span class="ident">Flags::C</span>;
<span class="macro">assert_eq!</span>((<span class="ident">e1</span> <span class="op">|</span> <span class="ident">e2</span>), <span class="ident">Flags::ABC</span>); <span class="comment">// union</span>
<span class="macro">assert_eq!</span>((<span class="ident">e1</span> <span class="op">&amp;</span> <span class="ident">e2</span>), <span class="ident">Flags::C</span>); <span class="comment">// intersection</span>
<span class="macro">assert_eq!</span>((<span class="ident">e1</span> <span class="op">-</span> <span class="ident">e2</span>), <span class="ident">Flags::A</span>); <span class="comment">// set difference</span>
<span class="macro">assert_eq!</span>(<span class="op">!</span><span class="ident">e2</span>, <span class="ident">Flags::A</span>); <span class="comment">// set complement</span>
}</code></pre></div>
<p>The generated <code>struct</code>s can also be extended with type and trait
implementations:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">std::fmt</span>;
<span class="kw">use</span> <span class="ident">bitflags::bitflags</span>;
<span class="macro">bitflags!</span> {
<span class="kw">struct</span> <span class="ident">Flags</span>: <span class="ident">u32</span> {
<span class="kw">const</span> <span class="ident">A</span> <span class="op">=</span> <span class="number">0b00000001</span>;
<span class="kw">const</span> <span class="ident">B</span> <span class="op">=</span> <span class="number">0b00000010</span>;
}
}
<span class="kw">impl</span> <span class="ident">Flags</span> {
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">clear</span>(<span class="kw-2">&amp;mut</span> <span class="self">self</span>) {
<span class="self">self</span>.<span class="ident">bits</span> <span class="op">=</span> <span class="number">0</span>; <span class="comment">// The `bits` field can be accessed from within the</span>
<span class="comment">// same module where the `bitflags!` macro was invoked.</span>
}
}
<span class="kw">impl</span> <span class="ident">fmt::Display</span> <span class="kw">for</span> <span class="ident">Flags</span> {
<span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&amp;mut</span> <span class="ident">fmt::Formatter</span>) -&gt; <span class="ident">fmt::Result</span> {
<span class="macro">write!</span>(<span class="ident">f</span>, <span class="string">&quot;hi!&quot;</span>)
}
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">flags</span> <span class="op">=</span> <span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::B</span>;
<span class="ident">flags</span>.<span class="ident">clear</span>();
<span class="macro">assert!</span>(<span class="ident">flags</span>.<span class="ident">is_empty</span>());
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">&quot;{}&quot;</span>, <span class="ident">flags</span>), <span class="string">&quot;hi!&quot;</span>);
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">Flags::A</span> <span class="op">|</span> <span class="ident">Flags::B</span>), <span class="string">&quot;A | B&quot;</span>);
<span class="macro">assert_eq!</span>(<span class="macro">format!</span>(<span class="string">&quot;{:?}&quot;</span>, <span class="ident">Flags::B</span>), <span class="string">&quot;B&quot;</span>);
}</code></pre></div>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="bitflags" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"macro":[["bitflags","The macro used to generate the flag structures."]]};

1
doc/cfg_if/all.html Normal file
View File

@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="List of all items in this crate"><meta name="keywords" content="rust, rustlang, rust-lang"><title>List of all items in this crate</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../cfg_if/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../cfg_if/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location">Crate cfg_if</h2></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../cfg_if/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">List of all items</span></h1><h3 id="Macros">Macros</h3><ul class="macros docblock"><li><a href="macro.cfg_if.html">cfg_if</a></li></ul></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="cfg_if" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

20
doc/cfg_if/index.html Normal file
View File

@ -0,0 +1,20 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A macro for defining `#[cfg]` if-else statements."><meta name="keywords" content="rust, rustlang, rust-lang, cfg_if"><title>cfg_if - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="../crates.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../cfg_if/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../cfg_if/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Crate cfg_if</a></h2><div class="sidebar-elems"><div class="block"><ul><li class="version">Version 1.0.0</li><li><a id="all-types" href="all.html">All Items</a></li></ul></div><section><div class="block"><ul><li><a href="#macros">Macros</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../cfg_if/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">cfg_if</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/cfg_if/lib.rs.html#1-176">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A macro for defining <code>#[cfg]</code> if-else statements.</p>
<p>The macro provided by this crate, <code>cfg_if</code>, is similar to the <code>if/elif</code> C
preprocessor macro by allowing definition of a cascade of <code>#[cfg]</code> cases,
emitting the implementation which matches first.</p>
<p>This allows you to conveniently provide a long list <code>#[cfg]</code>d blocks of code
without having to rewrite each clause multiple times.</p>
<h2 id="example"><a href="#example">Example</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">cfg_if::cfg_if!</span> {
<span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">unix</span>)]</span> {
<span class="kw">fn</span> <span class="ident">foo</span>() { <span class="comment">/* unix specific functionality */</span> }
} <span class="kw">else</span> <span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">target_pointer_width</span> <span class="op">=</span> <span class="string">&quot;32&quot;</span>)]</span> {
<span class="kw">fn</span> <span class="ident">foo</span>() { <span class="comment">/* non-unix, 32-bit functionality */</span> }
} <span class="kw">else</span> {
<span class="kw">fn</span> <span class="ident">foo</span>() { <span class="comment">/* fallback implementation */</span> }
}
}
</code></pre></div>
</div></details><h2 id="macros" class="small-section-header"><a href="#macros">Macros</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.cfg_if.html" title="cfg_if::cfg_if macro">cfg_if</a></div><div class="item-right docblock-short"><p>The main macro provided by this crate. See crate documentation for more
information.</p>
</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="cfg_if" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=macro.cfg_if.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="macro.cfg_if.html">macro.cfg_if.html</a>...</p>
<script>location.replace("macro.cfg_if.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The main macro provided by this crate. See crate documentation for more information."><meta name="keywords" content="rust, rustlang, rust-lang, cfg_if"><title>cfg_if in cfg_if - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc macro"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../cfg_if/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../cfg_if/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In cfg_if</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../cfg_if/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Macro <a href="index.html">cfg_if</a>::<wbr><a class="macro" href="#">cfg_if</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/cfg_if/lib.rs.html#34-87">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><div class="example-wrap"><pre class="rust macro"><code><span class="macro">macro_rules!</span> <span class="ident">cfg_if</span> {
($(
<span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">meta</span>:<span class="ident">meta</span>)]</span> { $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">tokens</span>:<span class="ident">tt</span>)<span class="op">*</span> }
) <span class="kw">else</span> <span class="op">*</span> <span class="kw">else</span> {
$(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">tokens2</span>:<span class="ident">tt</span>)<span class="op">*</span>
}) =&gt; { ... };
(
<span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">i_met</span>:<span class="ident">meta</span>)]</span> { $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">i_tokens</span>:<span class="ident">tt</span>)<span class="op">*</span> }
$(
<span class="kw">else</span> <span class="kw">if</span> <span class="attribute">#[<span class="ident">cfg</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">e_met</span>:<span class="ident">meta</span>)]</span> { $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">e_tokens</span>:<span class="ident">tt</span>)<span class="op">*</span> }
)<span class="op">*</span>
) =&gt; { ... };
(@<span class="ident">__items</span> ($(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">not</span>:<span class="ident">meta</span>,)<span class="kw-2">*</span>) ; ) =&gt; { ... };
(@<span class="ident">__items</span> ($(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">not</span>:<span class="ident">meta</span>,)<span class="kw-2">*</span>) ; ( ($(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">m</span>:<span class="ident">meta</span>),<span class="kw-2">*</span>) ($(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">tokens</span>:<span class="ident">tt</span>)<span class="kw-2">*</span>) ), $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">rest</span>:<span class="ident">tt</span>)<span class="kw-2">*</span>) =&gt; { ... };
(@<span class="ident">__identity</span> $(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">tokens</span>:<span class="ident">tt</span>)<span class="kw-2">*</span>) =&gt; { ... };
}</code></pre></div>
</div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The main macro provided by this crate. See crate documentation for more
information.</p>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="cfg_if" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"macro":[["cfg_if","The main macro provided by this crate. See crate documentation for more information."]]};

3
doc/clap/all.html Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../clap/builder/enum.ArgAction.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../clap/builder/enum.ArgAction.html">../../../clap/builder/enum.ArgAction.html</a>...</p>
<script>location.replace("../../../clap/builder/enum.ArgAction.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../clap/builder/struct.Arg.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../clap/builder/struct.Arg.html">../../../clap/builder/struct.Arg.html</a>...</p>
<script>location.replace("../../../clap/builder/struct.Arg.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../clap/builder/struct.ArgGroup.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../clap/builder/struct.ArgGroup.html">../../../clap/builder/struct.ArgGroup.html</a>...</p>
<script>location.replace("../../../clap/builder/struct.ArgGroup.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../clap/builder/enum.ArgPredicate.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../clap/builder/enum.ArgPredicate.html">../../../clap/builder/enum.ArgPredicate.html</a>...</p>
<script>location.replace("../../../clap/builder/enum.ArgPredicate.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../clap/builder/struct.Command.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../clap/builder/struct.Command.html">../../../clap/builder/struct.Command.html</a>...</p>
<script>location.replace("../../../clap/builder/struct.Command.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,228 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Behavior of arguments when they are encountered while parsing"><meta name="keywords" content="rust, rustlang, rust-lang, ArgAction"><title>ArgAction in clap::builder - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc enum"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../clap/index.html"><div class="logo-container"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../clap/index.html"><div class="logo-container">
<img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></div></a><h2 class="location"><a href="#">ArgAction</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#variants">Variants</a></h3><ul><li><a href="#variant.Append">Append</a></li><li><a href="#variant.Count">Count</a></li><li><a href="#variant.Help">Help</a></li><li><a href="#variant.Set">Set</a></li><li><a href="#variant.SetFalse">SetFalse</a></li><li><a href="#variant.SetTrue">SetTrue</a></li><li><a href="#variant.Version">Version</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><ul><li><a href="#method.takes_values">takes_values</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Clone-for-ArgAction">Clone</a></li><li><a href="#impl-Debug-for-ArgAction">Debug</a></li><li><a href="#impl-IntoResettable%3CArgAction%3E-for-ArgAction">IntoResettable&lt;ArgAction&gt;</a></li><li><a href="#impl-IntoResettable%3CArgAction%3E-for-Option%3CArgAction%3E">IntoResettable&lt;ArgAction&gt;</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><a href="#impl-RefUnwindSafe-for-ArgAction">RefUnwindSafe</a></li><li><a href="#impl-Send-for-ArgAction">Send</a></li><li><a href="#impl-Sync-for-ArgAction">Sync</a></li><li><a href="#impl-Unpin-for-ArgAction">Unpin</a></li><li><a href="#impl-UnwindSafe-for-ArgAction">UnwindSafe</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><ul><li><a href="#impl-Any-for-ArgAction">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-ArgAction">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-ArgAction">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-ArgAction">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E-for-ArgAction">Into&lt;U&gt;</a></li><li><a href="#impl-ToOwned-for-ArgAction">ToOwned</a></li><li><a href="#impl-TryFrom%3CU%3E-for-ArgAction">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-ArgAction">TryInto&lt;U&gt;</a></li></ul></div></section><h2 class="location"><a href="index.html">In clap::builder</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../clap/index.html">
<img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Enum <a href="../index.html">clap</a>::<wbr><a href="index.html">builder</a>::<wbr><a class="enum" href="#">ArgAction</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/clap/builder/action.rs.html#27-273">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust enum"><code>#[non_exhaustive]
pub enum ArgAction {
Set,
Append,
SetTrue,
SetFalse,
Count,
Help,
Version,
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Behavior of arguments when they are encountered while parsing</p>
<h2 id="examples"><a href="#examples">Examples</a></h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">cmd</span> <span class="op">=</span> <span class="ident">Command::new</span>(<span class="string">&quot;mycmd&quot;</span>)
.<span class="ident">arg</span>(
<span class="ident">Arg::new</span>(<span class="string">&quot;special-help&quot;</span>)
.<span class="ident">short</span>(<span class="string">&#39;?&#39;</span>)
.<span class="ident">action</span>(<span class="ident">clap::ArgAction::Help</span>)
);
<span class="comment">// Existing help still exists</span>
<span class="kw">let</span> <span class="ident">err</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">clone</span>().<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>, <span class="string">&quot;-h&quot;</span>]).<span class="ident">unwrap_err</span>();
<span class="macro">assert_eq!</span>(<span class="ident">err</span>.<span class="ident">kind</span>(), <span class="ident">clap::error::ErrorKind::DisplayHelp</span>);
<span class="comment">// New help available</span>
<span class="kw">let</span> <span class="ident">err</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>, <span class="string">&quot;-?&quot;</span>]).<span class="ident">unwrap_err</span>();
<span class="macro">assert_eq!</span>(<span class="ident">err</span>.<span class="ident">kind</span>(), <span class="ident">clap::error::ErrorKind::DisplayHelp</span>);</code></pre></div>
</div></details><h2 id="variants" class="variants small-section-header">Variants (Non-exhaustive)<a href="#variants" class="anchor"></a></h2><details class="rustdoc-toggle non-exhaustive"><summary class="hideme"><span>This enum is marked as non-exhaustive</span></summary><div class="docblock">Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.</div></details><h3 id="variant.Set" class="variant small-section-header"><a href="#variant.Set" class="anchor field"></a><code>Set</code></h3><div class="docblock"><p>When encountered, store the associated value(s) in <a href="../parser/struct.ArgMatches.html" title="crate::ArgMatches"><code>ArgMatches</code></a></p>
<p><strong>NOTE:</strong> If the argument has previously been seen, it will result in a
<a href="../error/enum.ErrorKind.html#variant.ArgumentConflict" title="crate::error::ErrorKind::ArgumentConflict"><code>ArgumentConflict</code></a> unless
<a href="struct.Command.html#method.args_override_self" title="crate::Command::args_override_self"><code>Command::args_override_self(true)</code></a> is set.</p>
<h4 id="examples-1"><a href="#examples-1">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">cmd</span> <span class="op">=</span> <span class="ident">Command::new</span>(<span class="string">&quot;mycmd&quot;</span>)
.<span class="ident">arg</span>(
<span class="ident">Arg::new</span>(<span class="string">&quot;flag&quot;</span>)
.<span class="ident">long</span>(<span class="string">&quot;flag&quot;</span>)
.<span class="ident">action</span>(<span class="ident">clap::ArgAction::Set</span>)
);
<span class="kw">let</span> <span class="ident">matches</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>, <span class="string">&quot;--flag&quot;</span>, <span class="string">&quot;value&quot;</span>]).<span class="ident">unwrap</span>();
<span class="macro">assert!</span>(<span class="ident">matches</span>.<span class="ident">contains_id</span>(<span class="string">&quot;flag&quot;</span>));
<span class="macro">assert_eq!</span>(
<span class="ident">matches</span>.<span class="ident">get_many</span>::<span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span>(<span class="string">&quot;flag&quot;</span>).<span class="ident">unwrap_or_default</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">v</span><span class="op">|</span> <span class="ident">v</span>.<span class="ident">as_str</span>()).<span class="ident">collect</span>::<span class="op">&lt;</span><span class="ident">Vec</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span><span class="op">&gt;</span>(),
<span class="macro">vec!</span>[<span class="string">&quot;value&quot;</span>]
);</code></pre></div>
</div><h3 id="variant.Append" class="variant small-section-header"><a href="#variant.Append" class="anchor field"></a><code>Append</code></h3><div class="docblock"><p>When encountered, store the associated value(s) in <a href="../parser/struct.ArgMatches.html" title="crate::ArgMatches"><code>ArgMatches</code></a></p>
<h4 id="examples-2"><a href="#examples-2">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">cmd</span> <span class="op">=</span> <span class="ident">Command::new</span>(<span class="string">&quot;mycmd&quot;</span>)
.<span class="ident">arg</span>(
<span class="ident">Arg::new</span>(<span class="string">&quot;flag&quot;</span>)
.<span class="ident">long</span>(<span class="string">&quot;flag&quot;</span>)
.<span class="ident">action</span>(<span class="ident">clap::ArgAction::Append</span>)
);
<span class="kw">let</span> <span class="ident">matches</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>, <span class="string">&quot;--flag&quot;</span>, <span class="string">&quot;value1&quot;</span>, <span class="string">&quot;--flag&quot;</span>, <span class="string">&quot;value2&quot;</span>]).<span class="ident">unwrap</span>();
<span class="macro">assert!</span>(<span class="ident">matches</span>.<span class="ident">contains_id</span>(<span class="string">&quot;flag&quot;</span>));
<span class="macro">assert_eq!</span>(
<span class="ident">matches</span>.<span class="ident">get_many</span>::<span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span>(<span class="string">&quot;flag&quot;</span>).<span class="ident">unwrap_or_default</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">v</span><span class="op">|</span> <span class="ident">v</span>.<span class="ident">as_str</span>()).<span class="ident">collect</span>::<span class="op">&lt;</span><span class="ident">Vec</span><span class="op">&lt;</span><span class="kw">_</span><span class="op">&gt;</span><span class="op">&gt;</span>(),
<span class="macro">vec!</span>[<span class="string">&quot;value1&quot;</span>, <span class="string">&quot;value2&quot;</span>]
);</code></pre></div>
</div><h3 id="variant.SetTrue" class="variant small-section-header"><a href="#variant.SetTrue" class="anchor field"></a><code>SetTrue</code></h3><div class="docblock"><p>When encountered, act as if <code>&quot;true&quot;</code> was encountered on the command-line</p>
<p>If no <a href="struct.Arg.html#method.default_value" title="super::Arg::default_value"><code>default_value</code></a> is set, it will be <code>false</code>.</p>
<p>No value is allowed. To optionally accept a value, see
<a href="struct.Arg.html#method.default_missing_value" title="super::Arg::default_missing_value"><code>Arg::default_missing_value</code></a></p>
<p><strong>NOTE:</strong> If the argument has previously been seen, it will result in a
<a href="../error/enum.ErrorKind.html#variant.ArgumentConflict" title="crate::error::ErrorKind::ArgumentConflict"><code>ArgumentConflict</code></a> unless
<a href="struct.Command.html#method.args_override_self" title="crate::Command::args_override_self"><code>Command::args_override_self(true)</code></a> is set.</p>
<h4 id="examples-3"><a href="#examples-3">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">cmd</span> <span class="op">=</span> <span class="ident">Command::new</span>(<span class="string">&quot;mycmd&quot;</span>)
.<span class="ident">arg</span>(
<span class="ident">Arg::new</span>(<span class="string">&quot;flag&quot;</span>)
.<span class="ident">long</span>(<span class="string">&quot;flag&quot;</span>)
.<span class="ident">action</span>(<span class="ident">clap::ArgAction::SetTrue</span>)
);
<span class="kw">let</span> <span class="ident">matches</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">clone</span>().<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>, <span class="string">&quot;--flag&quot;</span>]).<span class="ident">unwrap</span>();
<span class="macro">assert!</span>(<span class="ident">matches</span>.<span class="ident">contains_id</span>(<span class="string">&quot;flag&quot;</span>));
<span class="macro">assert_eq!</span>(
<span class="ident">matches</span>.<span class="ident">get_one</span>::<span class="op">&lt;</span><span class="ident">bool</span><span class="op">&gt;</span>(<span class="string">&quot;flag&quot;</span>).<span class="ident">copied</span>(),
<span class="prelude-val">Some</span>(<span class="bool-val">true</span>)
);
<span class="kw">let</span> <span class="ident">matches</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>]).<span class="ident">unwrap</span>();
<span class="macro">assert!</span>(<span class="ident">matches</span>.<span class="ident">contains_id</span>(<span class="string">&quot;flag&quot;</span>));
<span class="macro">assert_eq!</span>(
<span class="ident">matches</span>.<span class="ident">get_one</span>::<span class="op">&lt;</span><span class="ident">bool</span><span class="op">&gt;</span>(<span class="string">&quot;flag&quot;</span>).<span class="ident">copied</span>(),
<span class="prelude-val">Some</span>(<span class="bool-val">false</span>)
);</code></pre></div>
<p>You can use <a href="trait.TypedValueParser.html#method.map" title="crate::builder::TypedValueParser::map"><code>TypedValueParser::map</code></a> to have the
flag control an application-specific type:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">cmd</span> <span class="op">=</span> <span class="ident">Command::new</span>(<span class="string">&quot;mycmd&quot;</span>)
.<span class="ident">arg</span>(
<span class="ident">Arg::new</span>(<span class="string">&quot;flag&quot;</span>)
.<span class="ident">long</span>(<span class="string">&quot;flag&quot;</span>)
.<span class="ident">action</span>(<span class="ident">clap::ArgAction::SetTrue</span>)
.<span class="ident">value_parser</span>(
<span class="ident">BoolishValueParser::new</span>()
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">b</span><span class="op">|</span> -&gt; <span class="ident">usize</span> {
<span class="kw">if</span> <span class="ident">b</span> { <span class="number">10</span> } <span class="kw">else</span> { <span class="number">5</span> }
})
)
);
<span class="kw">let</span> <span class="ident">matches</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">clone</span>().<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>, <span class="string">&quot;--flag&quot;</span>]).<span class="ident">unwrap</span>();
<span class="macro">assert!</span>(<span class="ident">matches</span>.<span class="ident">contains_id</span>(<span class="string">&quot;flag&quot;</span>));
<span class="macro">assert_eq!</span>(
<span class="ident">matches</span>.<span class="ident">get_one</span>::<span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span>(<span class="string">&quot;flag&quot;</span>).<span class="ident">copied</span>(),
<span class="prelude-val">Some</span>(<span class="number">10</span>)
);
<span class="kw">let</span> <span class="ident">matches</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>]).<span class="ident">unwrap</span>();
<span class="macro">assert!</span>(<span class="ident">matches</span>.<span class="ident">contains_id</span>(<span class="string">&quot;flag&quot;</span>));
<span class="macro">assert_eq!</span>(
<span class="ident">matches</span>.<span class="ident">get_one</span>::<span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span>(<span class="string">&quot;flag&quot;</span>).<span class="ident">copied</span>(),
<span class="prelude-val">Some</span>(<span class="number">5</span>)
);</code></pre></div>
</div><h3 id="variant.SetFalse" class="variant small-section-header"><a href="#variant.SetFalse" class="anchor field"></a><code>SetFalse</code></h3><div class="docblock"><p>When encountered, act as if <code>&quot;false&quot;</code> was encountered on the command-line</p>
<p>If no <a href="struct.Arg.html#method.default_value" title="super::Arg::default_value"><code>default_value</code></a> is set, it will be <code>true</code>.</p>
<p>No value is allowed. To optionally accept a value, see
<a href="struct.Arg.html#method.default_missing_value" title="super::Arg::default_missing_value"><code>Arg::default_missing_value</code></a></p>
<p><strong>NOTE:</strong> If the argument has previously been seen, it will result in a
<a href="../error/enum.ErrorKind.html#variant.ArgumentConflict" title="crate::error::ErrorKind::ArgumentConflict"><code>ArgumentConflict</code></a> unless
<a href="struct.Command.html#method.args_override_self" title="crate::Command::args_override_self"><code>Command::args_override_self(true)</code></a> is set.</p>
<h4 id="examples-4"><a href="#examples-4">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">cmd</span> <span class="op">=</span> <span class="ident">Command::new</span>(<span class="string">&quot;mycmd&quot;</span>)
.<span class="ident">arg</span>(
<span class="ident">Arg::new</span>(<span class="string">&quot;flag&quot;</span>)
.<span class="ident">long</span>(<span class="string">&quot;flag&quot;</span>)
.<span class="ident">action</span>(<span class="ident">clap::ArgAction::SetFalse</span>)
);
<span class="kw">let</span> <span class="ident">matches</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">clone</span>().<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>, <span class="string">&quot;--flag&quot;</span>]).<span class="ident">unwrap</span>();
<span class="macro">assert!</span>(<span class="ident">matches</span>.<span class="ident">contains_id</span>(<span class="string">&quot;flag&quot;</span>));
<span class="macro">assert_eq!</span>(
<span class="ident">matches</span>.<span class="ident">get_one</span>::<span class="op">&lt;</span><span class="ident">bool</span><span class="op">&gt;</span>(<span class="string">&quot;flag&quot;</span>).<span class="ident">copied</span>(),
<span class="prelude-val">Some</span>(<span class="bool-val">false</span>)
);
<span class="kw">let</span> <span class="ident">matches</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>]).<span class="ident">unwrap</span>();
<span class="macro">assert!</span>(<span class="ident">matches</span>.<span class="ident">contains_id</span>(<span class="string">&quot;flag&quot;</span>));
<span class="macro">assert_eq!</span>(
<span class="ident">matches</span>.<span class="ident">get_one</span>::<span class="op">&lt;</span><span class="ident">bool</span><span class="op">&gt;</span>(<span class="string">&quot;flag&quot;</span>).<span class="ident">copied</span>(),
<span class="prelude-val">Some</span>(<span class="bool-val">true</span>)
);</code></pre></div>
</div><h3 id="variant.Count" class="variant small-section-header"><a href="#variant.Count" class="anchor field"></a><code>Count</code></h3><div class="docblock"><p>When encountered, increment a <code>u8</code> counter</p>
<p>If no <a href="struct.Arg.html#method.default_value" title="super::Arg::default_value"><code>default_value</code></a> is set, it will be <code>0</code>.</p>
<p>No value is allowed. To optionally accept a value, see
<a href="struct.Arg.html#method.default_missing_value" title="super::Arg::default_missing_value"><code>Arg::default_missing_value</code></a></p>
<h4 id="examples-5"><a href="#examples-5">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">cmd</span> <span class="op">=</span> <span class="ident">Command::new</span>(<span class="string">&quot;mycmd&quot;</span>)
.<span class="ident">arg</span>(
<span class="ident">Arg::new</span>(<span class="string">&quot;flag&quot;</span>)
.<span class="ident">long</span>(<span class="string">&quot;flag&quot;</span>)
.<span class="ident">action</span>(<span class="ident">clap::ArgAction::Count</span>)
);
<span class="kw">let</span> <span class="ident">matches</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">clone</span>().<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>, <span class="string">&quot;--flag&quot;</span>, <span class="string">&quot;--flag&quot;</span>]).<span class="ident">unwrap</span>();
<span class="macro">assert!</span>(<span class="ident">matches</span>.<span class="ident">contains_id</span>(<span class="string">&quot;flag&quot;</span>));
<span class="macro">assert_eq!</span>(
<span class="ident">matches</span>.<span class="ident">get_count</span>(<span class="string">&quot;flag&quot;</span>),
<span class="number">2</span>
);
<span class="kw">let</span> <span class="ident">matches</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>]).<span class="ident">unwrap</span>();
<span class="macro">assert!</span>(<span class="ident">matches</span>.<span class="ident">contains_id</span>(<span class="string">&quot;flag&quot;</span>));
<span class="macro">assert_eq!</span>(
<span class="ident">matches</span>.<span class="ident">get_count</span>(<span class="string">&quot;flag&quot;</span>),
<span class="number">0</span>
);</code></pre></div>
</div><h3 id="variant.Help" class="variant small-section-header"><a href="#variant.Help" class="anchor field"></a><code>Help</code></h3><div class="docblock"><p>When encountered, display <a href="struct.Command.html#method.print_help" title="super::Command::print_help"><code>Command::print_help</code></a></p>
<p>Depending on the flag, <a href="struct.Command.html#method.print_long_help" title="super::Command::print_long_help"><code>Command::print_long_help</code></a> may be shown</p>
<h4 id="examples-6"><a href="#examples-6">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">cmd</span> <span class="op">=</span> <span class="ident">Command::new</span>(<span class="string">&quot;mycmd&quot;</span>)
.<span class="ident">arg</span>(
<span class="ident">Arg::new</span>(<span class="string">&quot;special-help&quot;</span>)
.<span class="ident">short</span>(<span class="string">&#39;?&#39;</span>)
.<span class="ident">action</span>(<span class="ident">clap::ArgAction::Help</span>)
);
<span class="comment">// Existing help still exists</span>
<span class="kw">let</span> <span class="ident">err</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">clone</span>().<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>, <span class="string">&quot;-h&quot;</span>]).<span class="ident">unwrap_err</span>();
<span class="macro">assert_eq!</span>(<span class="ident">err</span>.<span class="ident">kind</span>(), <span class="ident">clap::error::ErrorKind::DisplayHelp</span>);
<span class="comment">// New help available</span>
<span class="kw">let</span> <span class="ident">err</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>, <span class="string">&quot;-?&quot;</span>]).<span class="ident">unwrap_err</span>();
<span class="macro">assert_eq!</span>(<span class="ident">err</span>.<span class="ident">kind</span>(), <span class="ident">clap::error::ErrorKind::DisplayHelp</span>);</code></pre></div>
</div><h3 id="variant.Version" class="variant small-section-header"><a href="#variant.Version" class="anchor field"></a><code>Version</code></h3><div class="docblock"><p>When encountered, display <a href="struct.Command.html#method.version" title="super::Command::version"><code>Command::version</code></a></p>
<p>Depending on the flag, <a href="struct.Command.html#method.long_version" title="super::Command::long_version"><code>Command::long_version</code></a> may be shown</p>
<h4 id="examples-7"><a href="#examples-7">Examples</a></h4>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">cmd</span> <span class="op">=</span> <span class="ident">Command::new</span>(<span class="string">&quot;mycmd&quot;</span>)
.<span class="ident">version</span>(<span class="string">&quot;1.0.0&quot;</span>)
.<span class="ident">arg</span>(
<span class="ident">Arg::new</span>(<span class="string">&quot;special-version&quot;</span>)
.<span class="ident">long</span>(<span class="string">&quot;special-version&quot;</span>)
.<span class="ident">action</span>(<span class="ident">clap::ArgAction::Version</span>)
);
<span class="comment">// Existing help still exists</span>
<span class="kw">let</span> <span class="ident">err</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">clone</span>().<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>, <span class="string">&quot;--version&quot;</span>]).<span class="ident">unwrap_err</span>();
<span class="macro">assert_eq!</span>(<span class="ident">err</span>.<span class="ident">kind</span>(), <span class="ident">clap::error::ErrorKind::DisplayVersion</span>);
<span class="comment">// New help available</span>
<span class="kw">let</span> <span class="ident">err</span> <span class="op">=</span> <span class="ident">cmd</span>.<span class="ident">try_get_matches_from</span>([<span class="string">&quot;mycmd&quot;</span>, <span class="string">&quot;--special-version&quot;</span>]).<span class="ident">unwrap_err</span>();
<span class="macro">assert_eq!</span>(<span class="ident">err</span>.<span class="ident">kind</span>(), <span class="ident">clap::error::ErrorKind::DisplayVersion</span>);</code></pre></div>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-ArgAction" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/clap/builder/action.rs.html#275-342">source</a></span><a href="#impl-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl <a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.takes_values" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/clap/builder/action.rs.html#280-290">source</a></span><h4 class="code-header">pub fn <a href="#method.takes_values" class="fnname">takes_values</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.bool.html">bool</a></h4></section></summary><div class="docblock"><p>Returns whether this action accepts values on the command-line</p>
<p><a href="struct.Arg.html#method.default_values" title="super::Arg::default_values"><code>default_values</code></a> and [<code>env</code>][super::Arg::env] may still be
processed.</p>
</div></details></div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone-for-ArgAction" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/clap/builder/action.rs.html#24">source</a></span><a href="#impl-Clone-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/clap/builder/action.rs.html#24">source</a></span><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.64.0/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a></h4></section></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/1.64.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/clone.rs.html#132-134">source</a></span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.64.0/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.reference.html">&amp;</a>Self)</h4></section></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/1.64.0/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug-for-ArgAction" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/clap/builder/action.rs.html#24">source</a></span><a href="#impl-Debug-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/clap/builder/action.rs.html#24">source</a></span><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.64.0/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.64.0/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/1.64.0/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/1.64.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-IntoResettable%3CArgAction%3E-for-ArgAction" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/clap/builder/resettable.rs.html#159-163">source</a></span><a href="#impl-IntoResettable%3CArgAction%3E-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.IntoResettable.html" title="trait clap::builder::IntoResettable">IntoResettable</a>&lt;<a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a>&gt; for <a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_resettable-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/clap/builder/resettable.rs.html#160-162">source</a></span><a href="#method.into_resettable-1" class="anchor"></a><h4 class="code-header">fn <a href="trait.IntoResettable.html#tymethod.into_resettable" class="fnname">into_resettable</a>(self) -&gt; <a class="enum" href="enum.Resettable.html" title="enum clap::builder::Resettable">Resettable</a>&lt;<a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a>&gt;</h4></section></summary><div class='docblock'><p>Convert to the intended resettable type</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-IntoResettable%3CArgAction%3E-for-Option%3CArgAction%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/clap/builder/resettable.rs.html#87-94">source</a></span><a href="#impl-IntoResettable%3CArgAction%3E-for-Option%3CArgAction%3E" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.IntoResettable.html" title="trait clap::builder::IntoResettable">IntoResettable</a>&lt;<a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a>&gt; for <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a>&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_resettable" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/clap/builder/resettable.rs.html#88-93">source</a></span><a href="#method.into_resettable" class="anchor"></a><h4 class="code-header">fn <a href="trait.IntoResettable.html#tymethod.into_resettable" class="fnname">into_resettable</a>(self) -&gt; <a class="enum" href="enum.Resettable.html" title="enum clap::builder::Resettable">Resettable</a>&lt;<a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a>&gt;</h4></section></summary><div class='docblock'><p>Convert to the intended resettable type</p>
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><section id="impl-RefUnwindSafe-for-ArgAction" class="impl has-srclink"><a href="#impl-RefUnwindSafe-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a></h3></section><section id="impl-Send-for-ArgAction" class="impl has-srclink"><a href="#impl-Send-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a></h3></section><section id="impl-Sync-for-ArgAction" class="impl has-srclink"><a href="#impl-Sync-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a></h3></section><section id="impl-Unpin-for-ArgAction" class="impl has-srclink"><a href="#impl-Unpin-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a></h3></section><section id="impl-UnwindSafe-for-ArgAction" class="impl has-srclink"><a href="#impl-UnwindSafe-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="enum" href="enum.ArgAction.html" title="enum clap::builder::ArgAction">ArgAction</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any-for-ArgAction" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/any.rs.html#203">source</a></span><a href="#impl-Any-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/any.rs.html#204">source</a></span><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.64.0/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.64.0/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></section></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.64.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-ArgAction" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/borrow.rs.html#209">source</a></span><a href="#impl-Borrow%3CT%3E-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/borrow.rs.html#211">source</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.64.0/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.reference.html">&amp;</a>T</h4></section></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.64.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-ArgAction" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/borrow.rs.html#218">source</a></span><a href="#impl-BorrowMut%3CT%3E-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a>&lt;T&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/borrow.rs.html#219">source</a></span><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.64.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.reference.html">&amp;mut </a>T</h4></section></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.64.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-ArgAction" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/convert/mod.rs.html#557">source</a></span><a href="#impl-From%3CT%3E-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/convert/mod.rs.html#559">source</a></span><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.64.0/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-ArgAction" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/convert/mod.rs.html#541">source</a></span><a href="#impl-Into%3CU%3E-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;T&gt;,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/convert/mod.rs.html#549">source</a></span><a href="#method.into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.64.0/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code><a href="https://doc.rust-lang.org/1.64.0/core/convert/trait.From.html" title="From">From</a>&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ToOwned-for-ArgAction" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/alloc/borrow.rs.html#83">source</a></span><a href="#impl-ToOwned-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/1.64.0/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Owned" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.64.0/alloc/borrow/trait.ToOwned.html#associatedtype.Owned" class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'><p>The resulting type after obtaining ownership.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/alloc/borrow.rs.html#88">source</a></span><a href="#method.to_owned" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.64.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; T</h4></section></summary><div class='docblock'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/1.64.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/alloc/borrow.rs.html#92">source</a></span><a href="#method.clone_into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.64.0/alloc/borrow/trait.ToOwned.html#method.clone_into" class="fnname">clone_into</a>(&amp;self, target: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.reference.html">&amp;mut </a>T)</h4></section></summary><div class='docblock'><p>Uses borrowed data to replace owned data, usually by cloning. <a href="https://doc.rust-lang.org/1.64.0/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-ArgAction" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/convert/mod.rs.html#598">source</a></span><a href="#impl-TryFrom%3CU%3E-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;T&gt;,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.64.0/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></section></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/convert/mod.rs.html#604">source</a></span><a href="#method.try_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.64.0/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;T, &lt;T as <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;U&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-ArgAction" class="impl has-srclink"><span class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/convert/mod.rs.html#583">source</a></span><a href="#impl-TryInto%3CU%3E-for-ArgAction" class="anchor"></a><h3 class="code-header in-band">impl&lt;T, U&gt; <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a>&lt;U&gt; for T <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.64.0/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span> · <a class="srclink" href="https://doc.rust-lang.org/1.64.0/src/core/convert/mod.rs.html#589">source</a></span><a href="#method.try_into" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/1.64.0/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;U, &lt;U as <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a>&lt;T&gt;&gt;::<a class="associatedtype" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>&gt;</h4></section></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="clap" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,33 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Define [`Command`] line [arguments][`Arg`]"><meta name="keywords" content="rust, rustlang, rust-lang, builder"><title>clap::builder - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../clap/index.html"><div class="logo-container"><img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../clap/index.html"><div class="logo-container">
<img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></div></a><h2 class="location"><a href="#">Module builder</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../clap/index.html">
<img src="https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">clap</a>::<wbr><a class="mod" href="#">builder</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/clap/builder/mod.rs.html#1-60">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Define <a href="struct.Command.html" title="Command"><code>Command</code></a> line <a href="struct.Arg.html" title="Arg">arguments</a></p>
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Arg.html" title="clap::builder::Arg struct">Arg</a></div><div class="item-right docblock-short"><p>The abstract representation of a command line argument. Used to set all the options and
relationships that define a valid argument for the program.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ArgGroup.html" title="clap::builder::ArgGroup struct">ArgGroup</a></div><div class="item-right docblock-short"><p>Family of related <a href="struct.Arg.html">arguments</a>.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.BoolValueParser.html" title="clap::builder::BoolValueParser struct">BoolValueParser</a></div><div class="item-right docblock-short"><p>Implementation for <a href="struct.ValueParser.html#method.bool" title="ValueParser::bool"><code>ValueParser::bool</code></a></p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.BoolishValueParser.html" title="clap::builder::BoolishValueParser struct">BoolishValueParser</a></div><div class="item-right docblock-short"><p>Parse bool-like string values, everything else is <code>true</code></p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Command.html" title="clap::builder::Command struct">Command</a></div><div class="item-right docblock-short"><p>Build a command-line interface.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.EnumValueParser.html" title="clap::builder::EnumValueParser struct">EnumValueParser</a></div><div class="item-right docblock-short"><p>Parse an <a href="../trait.ValueEnum.html" title="crate::ValueEnum"><code>ValueEnum</code></a> value.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FalseyValueParser.html" title="clap::builder::FalseyValueParser struct">FalseyValueParser</a></div><div class="item-right docblock-short"><p>Parse false-like string values, everything else is <code>true</code></p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.MapValueParser.html" title="clap::builder::MapValueParser struct">MapValueParser</a></div><div class="item-right docblock-short"><p>Adapt a <code>TypedValueParser</code> from one value to another</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.NonEmptyStringValueParser.html" title="clap::builder::NonEmptyStringValueParser struct">NonEmptyStringValueParser</a></div><div class="item-right docblock-short"><p>Parse non-empty string values</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.OsStr.html" title="clap::builder::OsStr struct">OsStr</a></div><div class="item-right docblock-short"><p>A UTF-8-encoded fixed string</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.OsStringValueParser.html" title="clap::builder::OsStringValueParser struct">OsStringValueParser</a></div><div class="item-right docblock-short"><p>Implementation for <a href="struct.ValueParser.html#method.os_string" title="ValueParser::os_string"><code>ValueParser::os_string</code></a></p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.PathBufValueParser.html" title="clap::builder::PathBufValueParser struct">PathBufValueParser</a></div><div class="item-right docblock-short"><p>Implementation for <a href="struct.ValueParser.html#method.path_buf" title="ValueParser::path_buf"><code>ValueParser::path_buf</code></a></p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.PossibleValue.html" title="clap::builder::PossibleValue struct">PossibleValue</a></div><div class="item-right docblock-short"><p>A possible value of an argument.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.PossibleValuesParser.html" title="clap::builder::PossibleValuesParser struct">PossibleValuesParser</a></div><div class="item-right docblock-short"><p>Verify the value is from an enumerated set of <a href="struct.PossibleValue.html" title="crate::builder::PossibleValue"><code>PossibleValue</code></a>.</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.RangedI64ValueParser.html" title="clap::builder::RangedI64ValueParser struct">RangedI64ValueParser</a></div><div class="item-right docblock-short"><p>Parse number that fall within a range of values</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.RangedU64ValueParser.html" title="clap::builder::RangedU64ValueParser struct">RangedU64ValueParser</a></div><div class="item-right docblock-short"><p>Parse number that fall within a range of values</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Str.html" title="clap::builder::Str struct">Str</a></div><div class="item-right docblock-short"><p>A UTF-8-encoded fixed string</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.StringValueParser.html" title="clap::builder::StringValueParser struct">StringValueParser</a></div><div class="item-right docblock-short"><p>Implementation for <a href="struct.ValueParser.html#method.string" title="ValueParser::string"><code>ValueParser::string</code></a></p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.StyledStr.html" title="clap::builder::StyledStr struct">StyledStr</a></div><div class="item-right docblock-short"><p>Terminal-styling container</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ValueParser.html" title="clap::builder::ValueParser struct">ValueParser</a></div><div class="item-right docblock-short"><p>Parse/validate argument values</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ValueRange.html" title="clap::builder::ValueRange struct">ValueRange</a></div><div class="item-right docblock-short"><p>Values per occurrence for an argument</p>
</div></div></div><h2 id="enums" class="small-section-header"><a href="#enums">Enums</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.ArgAction.html" title="clap::builder::ArgAction enum">ArgAction</a></div><div class="item-right docblock-short"><p>Behavior of arguments when they are encountered while parsing</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.ArgPredicate.html" title="clap::builder::ArgPredicate enum">ArgPredicate</a></div><div class="item-right docblock-short"><p>Operations to perform on argument values</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.Resettable.html" title="clap::builder::Resettable enum">Resettable</a></div><div class="item-right docblock-short"><p>Clearable builder value</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.ValueHint.html" title="clap::builder::ValueHint enum">ValueHint</a></div><div class="item-right docblock-short"><p>Provide shell with hint on how to complete an argument.</p>
</div></div></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.IntoResettable.html" title="clap::builder::IntoResettable trait">IntoResettable</a></div><div class="item-right docblock-short"><p>Convert to the intended resettable type</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.TypedValueParser.html" title="clap::builder::TypedValueParser trait">TypedValueParser</a></div><div class="item-right docblock-short"><p>Parse/validate argument values</p>
</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.ValueParserFactory.html" title="clap::builder::ValueParserFactory trait">ValueParserFactory</a></div><div class="item-right docblock-short"><p>Register a type with <a href="../macro.value_parser.html" title="crate::value_parser!">value_parser!</a></p>
</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="clap" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../clap/builder/struct.OsStr.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../clap/builder/struct.OsStr.html">../../../clap/builder/struct.OsStr.html</a>...</p>
<script>location.replace("../../../clap/builder/struct.OsStr.html" + location.search + location.hash);</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../clap/builder/struct.PossibleValue.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../clap/builder/struct.PossibleValue.html">../../../clap/builder/struct.PossibleValue.html</a>...</p>
<script>location.replace("../../../clap/builder/struct.PossibleValue.html" + location.search + location.hash);</script>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More