Update doc for version = "0.1.8" (21649671977bc537f2f5954d1c617086518a13f6)

This commit is contained in:
kennytm 2016-06-05 01:13:48 +08:00
parent 3213423e8b
commit a5f1e35b81
61 changed files with 16392 additions and 0 deletions

64
COPYRIGHT.txt Normal file
View file

@ -0,0 +1,64 @@
These documentation pages include resources by third parties. This copyright
file applies only to those resources. The following third party resources are
included, and carry their own copyright notices and license terms:
* Fira Sans (FiraSans-Regular.woff, FiraSans-Medium.woff):
Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
with Reserved Font Name Fira Sans.
Copyright (c) 2014, Telefonica S.A.
Licensed under the SIL Open Font License, Version 1.1.
See FiraSans-LICENSE.txt.
* Heuristica (Heuristica-Italic.woff):
Copyright 1989, 1991 Adobe Systems Incorporated. All rights reserved.
Utopia is either a registered trademark or trademark of Adobe Systems
Incorporated in the United States and/or other countries. Used under
license.
Copyright 2006 Han The Thanh, Vntopia font family, http://vntex.sf.net
Copyright (c) 2008-2012, Andrey V. Panov (panov@canopus.iacp.dvo.ru),
with Reserved Font Name Heuristica.
Licensed under the SIL Open Font License, Version 1.1.
See Heuristica-LICENSE.txt.
* jQuery (jquery-2.1.4.min.js):
Copyright 2005, 2015 jQuery Foundation, Inc.
Licensed under the MIT license (see LICENSE-MIT.txt).
* rustdoc.css, main.js, and playpen.js:
Copyright 2015 The Rust Developers.
Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or
the MIT license (LICENSE-MIT.txt) at your option.
* normalize.css:
Copyright (c) Nicolas Gallagher and Jonathan Neal.
Licensed under the MIT license (see LICENSE-MIT.txt).
* Source Code Pro (SourceCodePro-Regular.woff, SourceCodePro-Semibold.woff):
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark
of Adobe Systems Incorporated in the United States and/or other countries.
Licensed under the SIL Open Font License, Version 1.1.
See SourceCodePro-LICENSE.txt.
* Source Serif Pro (SourceSerifPro-Regular.woff, SourceSerifPro-Bold.woff):
Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/), with
Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of
Adobe Systems Incorporated in the United States and/or other countries.
Licensed under the SIL Open Font License, Version 1.1.
See SourceSerifPro-LICENSE.txt.
This copyright file is intended to be distributed with rustdoc output.

99
FiraSans-LICENSE.txt Normal file
View file

@ -0,0 +1,99 @@
Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
with Reserved Font Name Fira Sans.
Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
with Reserved Font Name Fira Mono.
Copyright (c) 2014, Telefonica S.A.
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
FiraSans-Medium.woff Normal file

Binary file not shown.

BIN
FiraSans-Regular.woff Normal file

Binary file not shown.

BIN
Heuristica-Italic.woff Normal file

Binary file not shown.

101
Heuristica-LICENSE.txt Normal file
View file

@ -0,0 +1,101 @@
Copyright 1989, 1991 Adobe Systems Incorporated. All rights reserved.
Utopia is either a registered trademark or trademark of Adobe Systems
Incorporated in the United States and/or other countries. Used under
license.
Copyright 2006 Han The Thanh, Vntopia font family, http://vntex.sf.net
Copyright (c) 2008-2012, Andrey V. Panov (panov@canopus.iacp.dvo.ru),
with Reserved Font Name Heuristica.
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.

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

93
SourceCodePro-LICENSE.txt Normal file
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.

BIN
SourceCodePro-Regular.woff Normal file

Binary file not shown.

BIN
SourceCodePro-Semibold.woff Normal file

Binary file not shown.

BIN
SourceSerifPro-Bold.woff Normal file

Binary file not shown.

View file

@ -0,0 +1,93 @@
Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
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
SourceSerifPro-Regular.woff Normal file

Binary file not shown.

4
jquery.js vendored Normal file

File diff suppressed because one or more lines are too long

132
main.css Normal file
View file

@ -0,0 +1,132 @@
/**
* Copyright 2015 The Rust Project Developers. See the COPYRIGHT
* file at the top-level directory of this distribution and at
* http://rust-lang.org/COPYRIGHT.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
* http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
* <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
* option. This file may not be copied, modified, or distributed
* except according to those terms.
*/
/* General structure and fonts */
body {
background-color: white;
color: black;
}
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
color: black;
}
h1.fqn {
border-bottom-color: #D5D5D5;
}
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
border-bottom-color: #DDDDDD;
}
.in-band, code {
background-color: white;
}
div.stability > em > code {
background-color: initial;
}
.docblock code {
background-color: #F5F5F5;
}
pre {
background-color: #F5F5F5;
}
.sidebar .location {
background: #e1e1e1;
color: #333;
}
.block a:hover {
background: #F5F5F5;
}
.line-numbers span { color: #c67e2d; }
.line-numbers .line-highlighted {
background-color: #f6fdb0 !important;
}
:target { background: #FDFFD3; }
.content .highlighted {
color: #000 !important;
background-color: #ccc;
}
.content .highlighted a, .content .highlighted span { color: #000 !important; }
.content .highlighted.trait { background-color: #fece7e; }
.content .highlighted.mod { background-color: #afc6e4; }
.content .highlighted.enum { background-color: #b4d1b9; }
.content .highlighted.struct { background-color: #e7b1a0; }
.content .highlighted.fn { background-color: #c6afb3; }
.content .highlighted.method { background-color: #c6afb3; }
.content .highlighted.tymethod { background-color: #c6afb3; }
.content .highlighted.type { background-color: #c6afb3; }
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
border-bottom-color: #DDD;
}
.docblock table {
border-color: #ddd;
}
.docblock table td {
border-top-color: #ddd;
border-bottom-color: #ddd;
}
.docblock table th {
border-top-color: #ddd;
border-bottom-color: #ddd;
}
.content a.primitive { color: #39a7bf; }
.content span.externcrate, span.mod, .content a.mod, block a.current.mod { color: #4d76ae; }
.content span.fn, .content a.fn, .block a.current.fn,
.content span.method, .content a.method, .block a.current.method,
.content span.tymethod, .content a.tymethod, .block a.current.tymethod,
.content .fnname { color: #8c6067; }
pre.rust .comment { color: #8E908C; }
pre.rust .doccomment { color: #4D4D4C; }
nav {
border-bottom-color: #e0e0e0;
}
nav.main .current {
border-top-color: #000;
border-bottom-color: #000;
}
nav.main .separator {
border-color: 1px solid #000;
}
a {
color: #000;
}
.docblock a, .stability a {
color: #3873AD;
}
a.test-arrow {
color: #f5f5f5;
}
.content span.trait, .content a.trait, .block a.current.trait { color: #7c5af3; }
.search-input {
color: #555;
box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
background-color: white;
}
em.stab.unstable { background: #FFF5D6; border-color: #FFC600; }
em.stab.deprecated { background: #F3DFFF; border-color: #7F0087; }

1040
main.js Normal file

File diff suppressed because it is too large Load diff

1
normalize.css vendored Normal file
View file

@ -0,0 +1 @@
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}

56
playpen.js Normal file
View file

@ -0,0 +1,56 @@
// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
/*jslint browser: true, es5: true */
/*globals $: true, rootPath: true */
document.addEventListener('DOMContentLoaded', function() {
'use strict';
if (!window.playgroundUrl) {
return;
}
var featureRegexp = new RegExp('^\s*#!\\[feature\\(\.*?\\)\\]');
var elements = document.querySelectorAll('pre.rust-example-rendered');
Array.prototype.forEach.call(elements, function(el) {
el.onmouseover = function(e) {
if (el.contains(e.relatedTarget)) {
return;
}
var a = document.createElement('a');
a.setAttribute('class', 'test-arrow');
a.textContent = 'Run';
var code = el.previousElementSibling.textContent;
var channel = '';
if (featureRegexp.test(code)) {
channel = '&version=nightly';
}
a.setAttribute('href', window.playgroundUrl + '?code=' +
encodeURIComponent(code) + channel);
a.setAttribute('target', '_blank');
el.appendChild(a);
};
el.onmouseout = function(e) {
if (el.contains(e.relatedTarget)) {
return;
}
el.removeChild(el.querySelectorAll('a.test-arrow')[0]);
};
});
});

View file

@ -0,0 +1,134 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `ExtendedMode` enum in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, ExtendedMode">
<title>qrcode::bits::ExtendedMode - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>bits</a></p><script>window.sidebarCurrent = {name: 'ExtendedMode', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content enum">
<h1 class='fqn'><span class='in-band'>Enum <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>bits</a>::<wbr><a class='enum' href=''>ExtendedMode</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-234' class='srclink' href='../../src/qrcode/src/bits.rs.html#151-166' title='goto source code'>[src]</a></span></h1>
<pre class='rust enum'>pub enum ExtendedMode {
Eci,
Data(<a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a>),
Fnc1First,
Fnc1Second,
StructuredAppend,
}</pre><div class='docblock'><p>An &quot;extended&quot; mode indicator, includes all indicators supported by QR code
beyond those bearing data.</p>
</div><h2 class='variants'>Variants</h2>
<table class='variants_table'><tr><td id='variant.Eci'><code>Eci</code></td><td><div class='docblock'><p>ECI mode indicator, to introduce an ECI designator.</p>
</div></td><td></td></tr><tr><td id='variant.Data'><code>Data</code></td><td><div class='docblock'><p>The normal mode to introduce data.</p>
</div></td><td></td></tr><tr><td id='variant.Fnc1First'><code>Fnc1First</code></td><td><div class='docblock'><p>FNC-1 mode in the first position.</p>
</div></td><td></td></tr><tr><td id='variant.Fnc1Second'><code>Fnc1Second</code></td><td><div class='docblock'><p>FNC-1 mode in the second position.</p>
</div></td><td></td></tr><tr><td id='variant.StructuredAppend'><code>StructuredAppend</code></td><td><div class='docblock'><p>Structured append.</p>
</div></td><td></td></tr></table><h2 id='implementations'>Trait Implementations</h2><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='enum' href='../../qrcode/bits/enum.ExtendedMode.html' title='qrcode::bits::ExtendedMode'>ExtendedMode</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-241' class='srclink' href='../../src/qrcode/src/bits.rs.html#150' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='enum' href='../../qrcode/bits/enum.ExtendedMode.html' title='qrcode::bits::ExtendedMode'>ExtendedMode</a></code></h4>
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='enum' href='../../qrcode/bits/enum.ExtendedMode.html' title='qrcode::bits::ExtendedMode'>ExtendedMode</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-245' class='srclink' href='../../src/qrcode/src/bits.rs.html#150' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1,118 @@
<!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 `encode_auto` fn in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, encode_auto">
<title>qrcode::bits::encode_auto - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>bits</a></p><script>window.sidebarCurrent = {name: 'encode_auto', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content fn">
<h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>bits</a>::<wbr><a class='fn' href=''>encode_auto</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-354' class='srclink' href='../../src/qrcode/src/bits.rs.html#824-840' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'>pub fn encode_auto(data: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>, ec_level: <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='struct' href='../../qrcode/bits/struct.Bits.html' title='qrcode::bits::Bits'>Bits</a>&gt;</pre><div class='docblock'><p>Automatically determines the minimum version to store the data, and encode
the result.</p>
<p>This method will not consider any Micro QR code versions.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

141
qrcode/bits/index.html Normal file
View file

@ -0,0 +1,141 @@
<!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 `bits` mod in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, bits">
<title>qrcode::bits - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a></p><script>window.sidebarCurrent = {name: 'bits', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content mod">
<h1 class='fqn'><span class='in-band'>Module <a href='../index.html'>qrcode</a>::<wbr><a class='mod' href=''>bits</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-196' class='srclink' href='../../src/qrcode/src/bits.rs.html#1-892' title='goto source code'>[src]</a></span></h1>
<div class='docblock'><p>The <code>bits</code> module encodes binary data into raw bits used in a QR code.</p>
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table>
<tr class=' module-item'>
<td><a class='struct' href='struct.Bits.html'
title='qrcode::bits::Bits'>Bits</a></td>
<td class='docblock short'>
<p>The <code>Bits</code> structure stores the encoded data for a QR code.</p>
</td>
</tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
<table>
<tr class=' module-item'>
<td><a class='enum' href='enum.ExtendedMode.html'
title='qrcode::bits::ExtendedMode'>ExtendedMode</a></td>
<td class='docblock short'>
<p>An &quot;extended&quot; mode indicator, includes all indicators supported by QR code
beyond those bearing data.</p>
</td>
</tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table>
<tr class=' module-item'>
<td><a class='fn' href='fn.encode_auto.html'
title='qrcode::bits::encode_auto'>encode_auto</a></td>
<td class='docblock short'>
<p>Automatically determines the minimum version to store the data, and encode
the result.</p>
</td>
</tr></table></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1 @@
initSidebarItems({"enum":[["ExtendedMode","An \"extended\" mode indicator, includes all indicators supported by QR code beyond those bearing data."]],"fn":[["encode_auto","Automatically determines the minimum version to store the data, and encode the result."]],"struct":[["Bits","The `Bits` structure stores the encoded data for a QR code."]]});

View file

@ -0,0 +1,268 @@
<!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 `Bits` struct in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Bits">
<title>qrcode::bits::Bits - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>bits</a></p><script>window.sidebarCurrent = {name: 'Bits', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content struct">
<h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>bits</a>::<wbr><a class='struct' href=''>Bits</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-201' class='srclink' href='../../src/qrcode/src/bits.rs.html#15-19' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct Bits {
// some fields omitted
}</pre><div class='docblock'><p>The <code>Bits</code> structure stores the encoded data for a QR code.</p>
</div><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/bits/struct.Bits.html' title='qrcode::bits::Bits'>Bits</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-205' class='srclink' href='../../src/qrcode/src/bits.rs.html#21-104' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.new' class='method'><code>fn <a href='#method.new' class='fnname'>new</a>(version: <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>) -&gt; <a class='struct' href='../../qrcode/bits/struct.Bits.html' title='qrcode::bits::Bits'>Bits</a></code></h4>
<div class='docblock'><p>Constructs a new, empty bits structure.</p>
</div><h4 id='method.into_bytes' class='method'><code>fn <a href='#method.into_bytes' class='fnname'>into_bytes</a>(self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a>&gt;</code></h4>
<div class='docblock'><p>Convert the bits into a bytes vector.</p>
</div><h4 id='method.len' class='method'><code>fn <a href='#method.len' class='fnname'>len</a>(&amp;self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code></h4>
<div class='docblock'><p>Total number of bits currently pushed.</p>
</div><h4 id='method.max_len' class='method'><code>fn <a href='#method.max_len' class='fnname'>max_len</a>(&amp;self, ec_level: <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>&gt;</code></h4>
<div class='docblock'><p>The maximum number of bits allowed by the provided QR code version and
error correction level.</p>
</div><h4 id='method.version' class='method'><code>fn <a href='#method.version' class='fnname'>version</a>(&amp;self) -&gt; <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a></code></h4>
<div class='docblock'><p>Version of the QR code.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/bits/struct.Bits.html' title='qrcode::bits::Bits'>Bits</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-246' class='srclink' href='../../src/qrcode/src/bits.rs.html#168-193' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.push_mode_indicator' class='method'><code>fn <a href='#method.push_mode_indicator' class='fnname'>push_mode_indicator</a>(&amp;mut self, mode: <a class='enum' href='../../qrcode/bits/enum.ExtendedMode.html' title='qrcode::bits::ExtendedMode'>ExtendedMode</a>) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>&gt;</code></h4>
<div class='docblock'><p>Push the mode indicator to the end of the bits.</p>
<p>If the mode is not supported in the provided version, this method
returns <code>Err(QrError::UnsupportedCharacterSet)</code>.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/bits/struct.Bits.html' title='qrcode::bits::Bits'>Bits</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-252' class='srclink' href='../../src/qrcode/src/bits.rs.html#199-255' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.push_eci_designator' class='method'><code>fn <a href='#method.push_eci_designator' class='fnname'>push_eci_designator</a>(&amp;mut self, eci_designator: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>&gt;</code></h4>
<div class='docblock'><p>Push an ECI (Extended Channel Interpretation) designator to the bits.</p>
<p>An ECI designator is a 6-digit number to specify the character set of
the following binary data. After calling this method, one could call
<code>.push_byte_data()</code> or similar methods to insert the actual data, e.g.</p>
<pre class='rust rust-example-rendered'>
<span class='attribute'>#<span class='op'>!</span>[<span class='ident'>allow</span>(<span class='ident'>unused_must_use</span>)]</span>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>bits</span>::<span class='ident'>Bits</span>;
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>types</span>::<span class='ident'>Version</span>;
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>bits</span> <span class='op'>=</span> <span class='ident'>Bits</span>::<span class='ident'>new</span>(<span class='ident'>Version</span>::<span class='ident'>Normal</span>(<span class='number'>1</span>));
<span class='ident'>bits</span>.<span class='ident'>push_eci_designator</span>(<span class='number'>9</span>); <span class='comment'>// 9 = ISO-8859-7 (Greek).</span>
<span class='ident'>bits</span>.<span class='ident'>push_byte_data</span>(<span class='string'>b&quot;\xa1\xa2\xa3\xa4\xa5&quot;</span>); <span class='comment'>// ΑΒΓΔΕ</span></pre>
<p>The full list of ECI designator values can be found from
<a href="http://strokescribe.com/en/ECI.html">http://strokescribe.com/en/ECI.html</a>. Some example values are:</p>
<table>
<thead>
<tr>
<th>ECI #</th>
<th>Character set</th>
</tr>
</thead>
<tbody>
<tr>
<td>3</td>
<td>ISO-8859-1 (Western European)</td>
</tr>
<tr>
<td>20</td>
<td>Shift JIS (Japanese)</td>
</tr>
<tr>
<td>23</td>
<td>Windows 1252 (Latin 1) (Western European)</td>
</tr>
<tr>
<td>25</td>
<td>UTF-16 Big Endian</td>
</tr>
<tr>
<td>26</td>
<td>UTF-8</td>
</tr>
<tr>
<td>28</td>
<td>Big 5 (Traditional Chinese)</td>
</tr>
<tr>
<td>29</td>
<td>GB-18030 (Simplified Chinese)</td>
</tr>
<tr>
<td>30</td>
<td>EUC-KR (Korean)</td>
</tr>
</tbody>
</table>
<p>If the QR code version does not support ECI, this method will return
<code>Err(QrError::UnsupportedCharacterSet)</code>.</p>
<p>If the designator is outside of the expected range, this method will
return <code>Err(QrError::InvalidECIDesignator)</code>.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/bits/struct.Bits.html' title='qrcode::bits::Bits'>Bits</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-258' class='srclink' href='../../src/qrcode/src/bits.rs.html#303-324' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.push_numeric_data' class='method'><code>fn <a href='#method.push_numeric_data' class='fnname'>push_numeric_data</a>(&amp;mut self, data: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>&gt;</code></h4>
<div class='docblock'><p>Encodes a numeric string to the bits.</p>
<p>The data should only contain the characters 0 to 9.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/bits/struct.Bits.html' title='qrcode::bits::Bits'>Bits</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-283' class='srclink' href='../../src/qrcode/src/bits.rs.html#406-420' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.push_alphanumeric_data' class='method'><code>fn <a href='#method.push_alphanumeric_data' class='fnname'>push_alphanumeric_data</a>(&amp;mut self, data: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>&gt;</code></h4>
<div class='docblock'><p>Encodes an alphanumeric string to the bits.</p>
<p>The data should only contain the charaters A to Z (excluding lowercase),
0 to 9, space, <code>$</code>, <code>%</code>, <code>*</code>, <code>+</code>, <code>-</code>, <code>.</code>, <code>/</code> or <code>:</code>.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/bits/struct.Bits.html' title='qrcode::bits::Bits'>Bits</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-297' class='srclink' href='../../src/qrcode/src/bits.rs.html#456-465' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.push_byte_data' class='method'><code>fn <a href='#method.push_byte_data' class='fnname'>push_byte_data</a>(&amp;mut self, data: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>&gt;</code></h4>
<div class='docblock'><p>Encodes 8-bit byte data to the bits.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/bits/struct.Bits.html' title='qrcode::bits::Bits'>Bits</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-304' class='srclink' href='../../src/qrcode/src/bits.rs.html#505-520' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.push_kanji_data' class='method'><code>fn <a href='#method.push_kanji_data' class='fnname'>push_kanji_data</a>(&amp;mut self, data: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>&gt;</code></h4>
<div class='docblock'><p>Encodes Shift JIS double-byte data to the bits.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/bits/struct.Bits.html' title='qrcode::bits::Bits'>Bits</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-314' class='srclink' href='../../src/qrcode/src/bits.rs.html#556-600' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.push_fnc1_first_position' class='method'><code>fn <a href='#method.push_fnc1_first_position' class='fnname'>push_fnc1_first_position</a>(&amp;mut self) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>&gt;</code></h4>
<div class='docblock'><p>Encodes an indicator that the following data are formatted according to
the UCC/EAN Application Identifiers standard.</p>
<pre class='rust rust-example-rendered'>
<span class='attribute'>#<span class='op'>!</span>[<span class='ident'>allow</span>(<span class='ident'>unused_must_use</span>)]</span>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>bits</span>::<span class='ident'>Bits</span>;
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>types</span>::<span class='ident'>Version</span>;
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>bits</span> <span class='op'>=</span> <span class='ident'>Bits</span>::<span class='ident'>new</span>(<span class='ident'>Version</span>::<span class='ident'>Normal</span>(<span class='number'>1</span>));
<span class='ident'>bits</span>.<span class='ident'>push_fnc1_first_position</span>();
<span class='ident'>bits</span>.<span class='ident'>push_numeric_data</span>(<span class='string'>b&quot;01049123451234591597033130128&quot;</span>);
<span class='ident'>bits</span>.<span class='ident'>push_alphanumeric_data</span>(<span class='string'>b&quot;%10ABC123&quot;</span>);</pre>
<p>In QR code, the character <code>%</code> is used as the data field separator (0x1D).</p>
</div><h4 id='method.push_fnc1_second_position' class='method'><code>fn <a href='#method.push_fnc1_second_position' class='fnname'>push_fnc1_second_position</a>(&amp;mut self, application_indicator: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a>) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>&gt;</code></h4>
<div class='docblock'><p>Encodes an indicator that the following data are formatted in accordance
with specific industry or application specifications previously agreed
with AIM International.</p>
<pre class='rust rust-example-rendered'>
<span class='attribute'>#<span class='op'>!</span>[<span class='ident'>allow</span>(<span class='ident'>unused_must_use</span>)]</span>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>bits</span>::<span class='ident'>Bits</span>;
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>types</span>::<span class='ident'>Version</span>;
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>bits</span> <span class='op'>=</span> <span class='ident'>Bits</span>::<span class='ident'>new</span>(<span class='ident'>Version</span>::<span class='ident'>Normal</span>(<span class='number'>1</span>));
<span class='ident'>bits</span>.<span class='ident'>push_fnc1_second_position</span>(<span class='number'>37</span>);
<span class='ident'>bits</span>.<span class='ident'>push_alphanumeric_data</span>(<span class='string'>b&quot;AA1234BBB112&quot;</span>);
<span class='ident'>bits</span>.<span class='ident'>push_byte_data</span>(<span class='string'>b&quot;text text text text\r&quot;</span>);</pre>
<p>If the application indicator is a single Latin alphabet (az / AZ),
please pass in its ASCII value + 100:</p>
<pre class='rust rust-example-rendered'>
<span class='ident'>bits</span>.<span class='ident'>push_fnc1_second_position</span>(<span class='string'>b&#39;A&#39;</span> <span class='op'>+</span> <span class='number'>100</span>);</pre>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/bits/struct.Bits.html' title='qrcode::bits::Bits'>Bits</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-325' class='srclink' href='../../src/qrcode/src/bits.rs.html#657-692' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.push_terminator' class='method'><code>fn <a href='#method.push_terminator' class='fnname'>push_terminator</a>(&amp;mut self, ec_level: <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>&gt;</code></h4>
<div class='docblock'><p>Pushes the ending bits to indicate no more data.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/bits/struct.Bits.html' title='qrcode::bits::Bits'>Bits</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-340' class='srclink' href='../../src/qrcode/src/bits.rs.html#755-778' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.push_segments' class='method'><code>fn <a href='#method.push_segments' class='fnname'>push_segments</a>&lt;I&gt;(&amp;mut self, data: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>, segments_iter: I) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>&gt; <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a>&lt;Item=<a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a>&gt;</span></code></h4>
<div class='docblock'><p>Push a segmented data to the bits, and then terminate it.</p>
</div><h4 id='method.push_optimal_data' class='method'><code>fn <a href='#method.push_optimal_data' class='fnname'>push_optimal_data</a>(&amp;mut self, data: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>&gt;</code></h4>
<div class='docblock'><p>Pushes the data the bits, using the optimal encoding.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1,143 @@
<!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 `MaskPattern` enum in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, MaskPattern">
<title>qrcode::canvas::MaskPattern - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>canvas</a></p><script>window.sidebarCurrent = {name: 'MaskPattern', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content enum">
<h1 class='fqn'><span class='in-band'>Enum <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>canvas</a>::<wbr><a class='enum' href=''>MaskPattern</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-872' class='srclink' href='../../src/qrcode/src/canvas.rs.html#1380-1404' title='goto source code'>[src]</a></span></h1>
<pre class='rust enum'>pub enum MaskPattern {
Checkerboard,
HorizontalLines,
VerticalLines,
DiagonalLines,
LargeCheckerboard,
Fields,
Diamonds,
Meadow,
}</pre><div class='docblock'><p>The mask patterns. Since QR code and Micro QR code do not use the same
pattern number, we name them according to their shape instead of the number.</p>
</div><h2 class='variants'>Variants</h2>
<table class='variants_table'><tr><td id='variant.Checkerboard'><code>Checkerboard</code></td><td><div class='docblock'><p>QR code pattern 000: <code>(x + y) % 2 == 0</code>.</p>
</div></td><td></td></tr><tr><td id='variant.HorizontalLines'><code>HorizontalLines</code></td><td><div class='docblock'><p>QR code pattern 001: <code>y % 2 == 0</code>.</p>
</div></td><td></td></tr><tr><td id='variant.VerticalLines'><code>VerticalLines</code></td><td><div class='docblock'><p>QR code pattern 010: <code>x % 3 == 0</code>.</p>
</div></td><td></td></tr><tr><td id='variant.DiagonalLines'><code>DiagonalLines</code></td><td><div class='docblock'><p>QR code pattern 011: <code>(x + y) % 3 == 0</code>.</p>
</div></td><td></td></tr><tr><td id='variant.LargeCheckerboard'><code>LargeCheckerboard</code></td><td><div class='docblock'><p>QR code pattern 100: <code>((x/3) + (y/2)) % 2 == 0</code>.</p>
</div></td><td></td></tr><tr><td id='variant.Fields'><code>Fields</code></td><td><div class='docblock'><p>QR code pattern 101: <code>(x*y)%2 + (x*y)%3 == 0</code>.</p>
</div></td><td></td></tr><tr><td id='variant.Diamonds'><code>Diamonds</code></td><td><div class='docblock'><p>QR code pattern 110: <code>((x*y)%2 + (x*y)%3) % 2 == 0</code>.</p>
</div></td><td></td></tr><tr><td id='variant.Meadow'><code>Meadow</code></td><td><div class='docblock'><p>QR code pattern 111: <code>((x+y)%2 + (x*y)%3) % 2 == 0</code>.</p>
</div></td><td></td></tr></table><h2 id='implementations'>Trait Implementations</h2><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='enum' href='../../qrcode/canvas/enum.MaskPattern.html' title='qrcode::canvas::MaskPattern'>MaskPattern</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-889' class='srclink' href='../../src/qrcode/src/canvas.rs.html#1379' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='enum' href='../../qrcode/canvas/enum.MaskPattern.html' title='qrcode::canvas::MaskPattern'>MaskPattern</a></code></h4>
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='enum' href='../../qrcode/canvas/enum.MaskPattern.html' title='qrcode::canvas::MaskPattern'>MaskPattern</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-892' class='srclink' href='../../src/qrcode/src/canvas.rs.html#1379' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='enum' href='../../qrcode/canvas/enum.MaskPattern.html' title='qrcode::canvas::MaskPattern'>MaskPattern</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-893' class='srclink' href='../../src/qrcode/src/canvas.rs.html#1379' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='type' href='https://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1,160 @@
<!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 `Module` enum in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Module">
<title>qrcode::canvas::Module - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>canvas</a></p><script>window.sidebarCurrent = {name: 'Module', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content enum">
<h1 class='fqn'><span class='in-band'>Enum <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>canvas</a>::<wbr><a class='enum' href=''>Module</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-661' class='srclink' href='../../src/qrcode/src/canvas.rs.html#30-49' title='goto source code'>[src]</a></span></h1>
<pre class='rust enum'>pub enum Module {
Empty,
Light,
Dark,
LightUnmasked,
DarkUnmasked,
}</pre><div class='docblock'><p>The color of a module (pixel) in the QR code.</p>
</div><h2 class='variants'>Variants</h2>
<table class='variants_table'><tr><td id='variant.Empty'><code>Empty</code></td><td><div class='docblock'><p>The module is empty.</p>
</div></td><td></td></tr><tr><td id='variant.Light'><code>Light</code></td><td><div class='docblock'><p>The module is light (white), and cannot be masked. This mainly refers to
modules of functional patterns.</p>
</div></td><td></td></tr><tr><td id='variant.Dark'><code>Dark</code></td><td><div class='docblock'><p>The module is dark (black), and cannot be masked. This mainly refers to
modules of functional patterns.</p>
</div></td><td></td></tr><tr><td id='variant.LightUnmasked'><code>LightUnmasked</code></td><td><div class='docblock'><p>The module is light (white), but not yet masked. This mainly refers to
modules of data and error correction bits before masking.</p>
</div></td><td></td></tr><tr><td id='variant.DarkUnmasked'><code>DarkUnmasked</code></td><td><div class='docblock'><p>The module is dark (black), but not yet masked. This mainly refers to
modules of data and error correction bits before masking.</p>
</div></td><td></td></tr></table><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class='enum' href='../../qrcode/canvas/enum.Module.html' title='qrcode::canvas::Module'>Module</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-689' class='srclink' href='../../src/qrcode/src/canvas.rs.html#51-79' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.is_dark' class='method'><code>fn <a href='#method.is_dark' class='fnname'>is_dark</a>(&amp;self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>Checks whether a module is dark.</p>
</div><h4 id='method.mask' class='method'><code>fn <a href='#method.mask' class='fnname'>mask</a>(&amp;self, should_invert: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>) -&gt; <a class='enum' href='../../qrcode/canvas/enum.Module.html' title='qrcode::canvas::Module'>Module</a></code></h4>
<div class='docblock'><p>Apply a mask to the unmasked modules.</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>canvas</span>::<span class='ident'>Module</span>;
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Module</span>::<span class='ident'>LightUnmasked</span>.<span class='ident'>mask</span>(<span class='boolvalue'>true</span>), <span class='ident'>Module</span>::<span class='ident'>Dark</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Module</span>::<span class='ident'>DarkUnmasked</span>.<span class='ident'>mask</span>(<span class='boolvalue'>true</span>), <span class='ident'>Module</span>::<span class='ident'>Light</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Module</span>::<span class='ident'>LightUnmasked</span>.<span class='ident'>mask</span>(<span class='boolvalue'>false</span>), <span class='ident'>Module</span>::<span class='ident'>Light</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Module</span>::<span class='ident'>Dark</span>.<span class='ident'>mask</span>(<span class='boolvalue'>true</span>), <span class='ident'>Module</span>::<span class='ident'>Dark</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Module</span>::<span class='ident'>Dark</span>.<span class='ident'>mask</span>(<span class='boolvalue'>false</span>), <span class='ident'>Module</span>::<span class='ident'>Dark</span>);</pre>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='enum' href='../../qrcode/canvas/enum.Module.html' title='qrcode::canvas::Module'>Module</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-667' class='srclink' href='../../src/qrcode/src/canvas.rs.html#29' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='type' href='https://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='enum' href='../../qrcode/canvas/enum.Module.html' title='qrcode::canvas::Module'>Module</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-676' class='srclink' href='../../src/qrcode/src/canvas.rs.html#29' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='enum' href='../../qrcode/canvas/enum.Module.html' title='qrcode::canvas::Module'>Module</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-677' class='srclink' href='../../src/qrcode/src/canvas.rs.html#29' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='enum' href='../../qrcode/canvas/enum.Module.html' title='qrcode::canvas::Module'>Module</a></code></h4>
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html' title='core::cmp::Eq'>Eq</a> for <a class='enum' href='../../qrcode/canvas/enum.Module.html' title='qrcode::canvas::Module'>Module</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-680' class='srclink' href='../../src/qrcode/src/canvas.rs.html#29' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='enum' href='../../qrcode/canvas/enum.Module.html' title='qrcode::canvas::Module'>Module</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-683' class='srclink' href='../../src/qrcode/src/canvas.rs.html#29' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, __arg_0: &amp;<a class='enum' href='../../qrcode/canvas/enum.Module.html' title='qrcode::canvas::Module'>Module</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: &amp;Rhs) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1,116 @@
<!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 `is_functional` fn in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, is_functional">
<title>qrcode::canvas::is_functional - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>canvas</a></p><script>window.sidebarCurrent = {name: 'is_functional', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content fn">
<h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>canvas</a>::<wbr><a class='fn' href=''>is_functional</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-816' class='srclink' href='../../src/qrcode/src/canvas.rs.html#895-932' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'>pub fn is_functional(version: <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>, width: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i16.html'>i16</a>, x: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i16.html'>i16</a>, y: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i16.html'>i16</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></pre><div class='docblock'><p>Gets whether the module at the given coordinates represents a functional
module.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

159
qrcode/canvas/index.html Normal file
View file

@ -0,0 +1,159 @@
<!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 `canvas` mod in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, canvas">
<title>qrcode::canvas - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a></p><script>window.sidebarCurrent = {name: 'canvas', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content mod">
<h1 class='fqn'><span class='in-band'>Module <a href='../index.html'>qrcode</a>::<wbr><a class='mod' href=''>canvas</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-650' class='srclink' href='../../src/qrcode/src/canvas.rs.html#1-1882' title='goto source code'>[src]</a></span></h1>
<div class='docblock'><p>The <code>canvas</code> module puts raw bits into the QR code canvas.</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>types</span>::{<span class='ident'>Version</span>, <span class='ident'>EcLevel</span>};
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>canvas</span>::{<span class='ident'>Canvas</span>, <span class='ident'>MaskPattern</span>};
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>c</span> <span class='op'>=</span> <span class='ident'>Canvas</span>::<span class='ident'>new</span>(<span class='ident'>Version</span>::<span class='ident'>Normal</span>(<span class='number'>1</span>), <span class='ident'>EcLevel</span>::<span class='ident'>L</span>);
<span class='ident'>c</span>.<span class='ident'>draw_all_functional_patterns</span>();
<span class='ident'>c</span>.<span class='ident'>draw_data</span>(<span class='string'>b&quot;data_here&quot;</span>, <span class='string'>b&quot;ec_code_here&quot;</span>);
<span class='ident'>c</span>.<span class='ident'>apply_mask</span>(<span class='ident'>MaskPattern</span>::<span class='ident'>Checkerboard</span>);
<span class='kw'>let</span> <span class='ident'>bools</span> <span class='op'>=</span> <span class='ident'>c</span>.<span class='ident'>to_bools</span>();</pre>
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table>
<tr class=' module-item'>
<td><a class='struct' href='struct.Canvas.html'
title='qrcode::canvas::Canvas'>Canvas</a></td>
<td class='docblock short'>
<p><code>Canvas</code> is an intermediate helper structure to render error-corrected data
into a QR code.</p>
</td>
</tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
<table>
<tr class=' module-item'>
<td><a class='enum' href='enum.MaskPattern.html'
title='qrcode::canvas::MaskPattern'>MaskPattern</a></td>
<td class='docblock short'>
<p>The mask patterns. Since QR code and Micro QR code do not use the same
pattern number, we name them according to their shape instead of the number.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class='enum' href='enum.Module.html'
title='qrcode::canvas::Module'>Module</a></td>
<td class='docblock short'>
<p>The color of a module (pixel) in the QR code.</p>
</td>
</tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table>
<tr class=' module-item'>
<td><a class='fn' href='fn.is_functional.html'
title='qrcode::canvas::is_functional'>is_functional</a></td>
<td class='docblock short'>
<p>Gets whether the module at the given coordinates represents a functional
module.</p>
</td>
</tr></table></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

View file

@ -0,0 +1 @@
initSidebarItems({});

View file

@ -0,0 +1 @@
initSidebarItems({"enum":[["MaskPattern","The mask patterns. Since QR code and Micro QR code do not use the same pattern number, we name them according to their shape instead of the number."],["Module","The color of a module (pixel) in the QR code."]],"fn":[["is_functional","Gets whether the module at the given coordinates represents a functional module."]],"struct":[["Canvas","`Canvas` is an intermediate helper structure to render error-corrected data into a QR code."]]});

View file

@ -0,0 +1,156 @@
<!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 `Canvas` struct in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Canvas">
<title>qrcode::canvas::Canvas - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>canvas</a></p><script>window.sidebarCurrent = {name: 'Canvas', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content struct">
<h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>canvas</a>::<wbr><a class='struct' href=''>Canvas</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-696' class='srclink' href='../../src/qrcode/src/canvas.rs.html#88-101' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct Canvas {
// some fields omitted
}</pre><div class='docblock'><p><code>Canvas</code> is an intermediate helper structure to render error-corrected data
into a QR code.</p>
</div><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/canvas/struct.Canvas.html' title='qrcode::canvas::Canvas'>Canvas</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-708' class='srclink' href='../../src/qrcode/src/canvas.rs.html#103-160' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.new' class='method'><code>fn <a href='#method.new' class='fnname'>new</a>(version: <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>, ec_level: <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -&gt; <a class='struct' href='../../qrcode/canvas/struct.Canvas.html' title='qrcode::canvas::Canvas'>Canvas</a></code></h4>
<div class='docblock'><p>Constructs a new canvas big enough for a QR code of the given version.</p>
</div><h4 id='method.get' class='method'><code>fn <a href='#method.get' class='fnname'>get</a>(&amp;self, x: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i16.html'>i16</a>, y: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i16.html'>i16</a>) -&gt; <a class='enum' href='../../qrcode/canvas/enum.Module.html' title='qrcode::canvas::Module'>Module</a></code></h4>
<div class='docblock'><p>Obtains a module at the given coordinates. For convenience, negative
coordinates will wrap around.</p>
</div><h4 id='method.get_mut' class='method'><code>fn <a href='#method.get_mut' class='fnname'>get_mut</a>(&amp;mut self, x: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i16.html'>i16</a>, y: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i16.html'>i16</a>) -&gt; &amp;mut <a class='enum' href='../../qrcode/canvas/enum.Module.html' title='qrcode::canvas::Module'>Module</a></code></h4>
<div class='docblock'><p>Obtains a mutable module at the given coordinates. For convenience,
negative coordinates will wrap around.</p>
</div><h4 id='method.put' class='method'><code>fn <a href='#method.put' class='fnname'>put</a>(&amp;mut self, x: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i16.html'>i16</a>, y: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i16.html'>i16</a>, module: <a class='enum' href='../../qrcode/canvas/enum.Module.html' title='qrcode::canvas::Module'>Module</a>)</code></h4>
<div class='docblock'><p>Sets the color of a module at the given coordinates. For convenience,
negative coordinates will wrap around.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/canvas/struct.Canvas.html' title='qrcode::canvas::Canvas'>Canvas</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-813' class='srclink' href='../../src/qrcode/src/canvas.rs.html#877-891' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.draw_all_functional_patterns' class='method'><code>fn <a href='#method.draw_all_functional_patterns' class='fnname'>draw_all_functional_patterns</a>(&amp;mut self)</code></h4>
<div class='docblock'><p>Draw all functional patterns, before data placement.</p>
<p>All functional patterns (e.g. the finder pattern) <em>except</em> the format
info pattern will be filled in. The format info pattern will be filled
with light modules instead. Data bits can then put in the empty modules.
with <code>.draw_data()</code>.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/canvas/struct.Canvas.html' title='qrcode::canvas::Canvas'>Canvas</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-848' class='srclink' href='../../src/qrcode/src/canvas.rs.html#1273-1314' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.draw_data' class='method'><code>fn <a href='#method.draw_data' class='fnname'>draw_data</a>(&amp;mut self, data: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>, ec: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>)</code></h4>
<div class='docblock'><p>Draws the encoded data and error correction codes to the empty modules.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/canvas/struct.Canvas.html' title='qrcode::canvas::Canvas'>Canvas</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-933' class='srclink' href='../../src/qrcode/src/canvas.rs.html#1430-1481' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.apply_mask' class='method'><code>fn <a href='#method.apply_mask' class='fnname'>apply_mask</a>(&amp;mut self, pattern: <a class='enum' href='../../qrcode/canvas/enum.MaskPattern.html' title='qrcode::canvas::MaskPattern'>MaskPattern</a>)</code></h4>
<div class='docblock'><p>Applies a mask to the canvas. This method will also draw the format info
patterns.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/canvas/struct.Canvas.html' title='qrcode::canvas::Canvas'>Canvas</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-1037' class='srclink' href='../../src/qrcode/src/canvas.rs.html#1850-1882' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.apply_best_mask' class='method'><code>fn <a href='#method.apply_best_mask' class='fnname'>apply_best_mask</a>(&amp;self) -&gt; <a class='struct' href='../../qrcode/canvas/struct.Canvas.html' title='qrcode::canvas::Canvas'>Canvas</a></code></h4>
<div class='docblock'><p>Construct a new canvas and apply the best masking that gives the lowest
penalty score.</p>
</div><h4 id='method.to_bools' class='method'><code>fn <a href='#method.to_bools' class='fnname'>to_bools</a>(&amp;self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>&gt;</code></h4>
<div class='docblock'><p>Convert the modules into a vector of booleans.</p>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../../qrcode/canvas/struct.Canvas.html' title='qrcode::canvas::Canvas'>Canvas</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-701' class='srclink' href='../../src/qrcode/src/canvas.rs.html#87' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='struct' href='../../qrcode/canvas/struct.Canvas.html' title='qrcode::canvas::Canvas'>Canvas</a></code></h4>
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1,116 @@
<!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 `construct_codewords` fn in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, construct_codewords">
<title>qrcode::ec::construct_codewords - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>ec</a></p><script>window.sidebarCurrent = {name: 'construct_codewords', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content fn">
<h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>ec</a>::<wbr><a class='fn' href=''>construct_codewords</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-591' class='srclink' href='../../src/qrcode/src/ec.rs.html#101-130' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'>pub fn construct_codewords(rawbits: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>, version: <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>, ec_level: <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a><a class='struct' href='https://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a>&gt;, <a class='struct' href='https://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a>&gt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a>&gt;</pre><div class='docblock'><p>Constructs data and error correction codewords ready to be put in the QR
code matrix.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1,123 @@
<!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 `create_error_correction_code` fn in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, create_error_correction_code">
<title>qrcode::ec::create_error_correction_code - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>ec</a></p><script>window.sidebarCurrent = {name: 'create_error_correction_code', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content fn">
<h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>ec</a>::<wbr><a class='fn' href=''>create_error_correction_code</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-572' class='srclink' href='../../src/qrcode/src/ec.rs.html#20-40' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'>pub fn create_error_correction_code(data: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>, ec_code_size: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a>&gt;</pre><div class='docblock'><p>Creates the error correction code in N bytes.</p>
<p>This method only supports computing the error-correction code up to
69 bytes. Longer blocks will result in task panic.</p>
<p>This method treats the data as a polynomial of the form
(a[0] x<sup>m+n</sup> + a[1] x<sup>m+n-1</sup> + … + a[m] x<sup>n</sup>) in
GF(256), and then computes the polynomial modulus with a generator
polynomial of degree N.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1,116 @@
<!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 `max_allowed_errors` fn in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, max_allowed_errors">
<title>qrcode::ec::max_allowed_errors - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>ec</a></p><script>window.sidebarCurrent = {name: 'max_allowed_errors', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content fn">
<h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>ec</a>::<wbr><a class='fn' href=''>max_allowed_errors</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-619' class='srclink' href='../../src/qrcode/src/ec.rs.html#162-178' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'>pub fn max_allowed_errors(version: <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>, ec_level: <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>&gt;</pre><div class='docblock'><p>Computes the maximum allowed number of erratic modules can be introduced to
the QR code, before the data becomes truly corrupted.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

139
qrcode/ec/index.html Normal file
View file

@ -0,0 +1,139 @@
<!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 `ec` mod in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, ec">
<title>qrcode::ec - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a></p><script>window.sidebarCurrent = {name: 'ec', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content mod">
<h1 class='fqn'><span class='in-band'>Module <a href='../index.html'>qrcode</a>::<wbr><a class='mod' href=''>ec</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-567' class='srclink' href='../../src/qrcode/src/ec.rs.html#1-443' title='goto source code'>[src]</a></span></h1>
<div class='docblock'><p>The <code>ec</code> module applies the Reed-Solomon error correction codes.</p>
</div><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table>
<tr class=' module-item'>
<td><a class='fn' href='fn.construct_codewords.html'
title='qrcode::ec::construct_codewords'>construct_codewords</a></td>
<td class='docblock short'>
<p>Constructs data and error correction codewords ready to be put in the QR
code matrix.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class='fn' href='fn.create_error_correction_code.html'
title='qrcode::ec::create_error_correction_code'>create_error_correction_code</a></td>
<td class='docblock short'>
<p>Creates the error correction code in N bytes.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class='fn' href='fn.max_allowed_errors.html'
title='qrcode::ec::max_allowed_errors'>max_allowed_errors</a></td>
<td class='docblock short'>
<p>Computes the maximum allowed number of erratic modules can be introduced to
the QR code, before the data becomes truly corrupted.</p>
</td>
</tr></table></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1 @@
initSidebarItems({"fn":[["construct_codewords","Constructs data and error correction codewords ready to be put in the QR code matrix."],["create_error_correction_code","Creates the error correction code in N bytes."],["max_allowed_errors","Computes the maximum allowed number of erratic modules can be introduced to the QR code, before the data becomes truly corrupted."]]});

178
qrcode/index.html Normal file
View file

@ -0,0 +1,178 @@
<!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 `qrcode` crate.">
<meta name="keywords" content="rust, rustlang, rust-lang, qrcode">
<title>qrcode - Rust</title>
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'></p><script>window.sidebarCurrent = {name: 'qrcode', ty: 'mod', relpath: '../'};</script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content mod">
<h1 class='fqn'><span class='in-band'>Crate <a class='mod' href=''>qrcode</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-0' class='srclink' href='../src/qrcode/src/lib.rs.html#1-250' title='goto source code'>[src]</a></span></h1>
<div class='docblock'><p>QRCode encoder</p>
<p>This crate provides a QR code and Micro QR code encoder for binary data.</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>QrCode</span>;
<span class='kw'>let</span> <span class='ident'>code</span> <span class='op'>=</span> <span class='ident'>QrCode</span>::<span class='ident'>new</span>(<span class='string'>b&quot;Some content here.&quot;</span>);
<span class='kw'>match</span> <span class='ident'>code</span> {
<span class='prelude-val'>Err</span>(<span class='ident'>err</span>) <span class='op'>=&gt;</span> <span class='macro'>panic</span><span class='macro'>!</span>(<span class='string'>&quot;Failed to encode the QR code: {:?}&quot;</span>, <span class='ident'>err</span>),
<span class='prelude-val'>Ok</span>(<span class='ident'>code</span>) <span class='op'>=&gt;</span> {
<span class='kw'>for</span> <span class='ident'>y</span> <span class='kw'>in</span> <span class='number'>0</span> .. <span class='ident'>code</span>.<span class='ident'>width</span>() {
<span class='kw'>for</span> <span class='ident'>x</span> <span class='kw'>in</span> <span class='number'>0</span> .. <span class='ident'>code</span>.<span class='ident'>width</span>() {
<span class='kw'>let</span> <span class='ident'>color</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='ident'>code</span>[(<span class='ident'>x</span>, <span class='ident'>y</span>)] { <span class='string'>&quot;black&quot;</span> } <span class='kw'>else</span> { <span class='string'>&quot;white&quot;</span> };
<span class='comment'>// render color at position (x, y)</span>
}
}
}
}</pre>
</div><h2 id='reexports' class='section-header'><a href="#reexports">Reexports</a></h2>
<table><tr><td><code>pub use types::{<a class='type' href='../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>, <a class='enum' href='../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>, <a class='enum' href='../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>};</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
<table>
<tr class=' module-item'>
<td><a class='mod' href='bits/index.html'
title='qrcode::bits'>bits</a></td>
<td class='docblock short'>
<p>The <code>bits</code> module encodes binary data into raw bits used in a QR code.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class='mod' href='canvas/index.html'
title='qrcode::canvas'>canvas</a></td>
<td class='docblock short'>
<p>The <code>canvas</code> module puts raw bits into the QR code canvas.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class='mod' href='ec/index.html'
title='qrcode::ec'>ec</a></td>
<td class='docblock short'>
<p>The <code>ec</code> module applies the Reed-Solomon error correction codes.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class='mod' href='optimize/index.html'
title='qrcode::optimize'>optimize</a></td>
<td class='docblock short'>
<p>Find the optimal data mode sequence to encode a piece of data.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class='mod' href='types/index.html'
title='qrcode::types'>types</a></td>
<td class='docblock short'>
</td>
</tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table>
<tr class=' module-item'>
<td><a class='struct' href='struct.QrCode.html'
title='qrcode::QrCode'>QrCode</a></td>
<td class='docblock short'>
<p>The encoded QR code symbol.</p>
</td>
</tr></table></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../jquery.js"></script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1,115 @@
<!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 `total_encoded_len` fn in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, total_encoded_len">
<title>qrcode::optimize::total_encoded_len - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>optimize</a></p><script>window.sidebarCurrent = {name: 'total_encoded_len', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content fn">
<h1 class='fqn'><span class='in-band'>Function <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>optimize</a>::<wbr><a class='fn' href=''>total_encoded_len</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-501' class='srclink' href='../../src/qrcode/src/optimize.rs.html#322-325' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'>pub fn total_encoded_len(segments: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>, version: <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></pre><div class='docblock'><p>Computes the total encoded length of all segments.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

145
qrcode/optimize/index.html Normal file
View file

@ -0,0 +1,145 @@
<!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 `optimize` mod in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, optimize">
<title>qrcode::optimize - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a></p><script>window.sidebarCurrent = {name: 'optimize', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content mod">
<h1 class='fqn'><span class='in-band'>Module <a href='../index.html'>qrcode</a>::<wbr><a class='mod' href=''>optimize</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-376' class='srclink' href='../../src/qrcode/src/optimize.rs.html#1-675' title='goto source code'>[src]</a></span></h1>
<div class='docblock'><p>Find the optimal data mode sequence to encode a piece of data.</p>
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table>
<tr class=' module-item'>
<td><a class='struct' href='struct.Optimizer.html'
title='qrcode::optimize::Optimizer'>Optimizer</a></td>
<td class='docblock short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class='struct' href='struct.Parser.html'
title='qrcode::optimize::Parser'>Parser</a></td>
<td class='docblock short'>
<p>QR code data parser to classify the input into distinct segments.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class='struct' href='struct.Segment.html'
title='qrcode::optimize::Segment'>Segment</a></td>
<td class='docblock short'>
<p>A segment of data committed to an encoding mode.</p>
</td>
</tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table>
<tr class=' module-item'>
<td><a class='fn' href='fn.total_encoded_len.html'
title='qrcode::optimize::total_encoded_len'>total_encoded_len</a></td>
<td class='docblock short'>
<p>Computes the total encoded length of all segments.</p>
</td>
</tr></table></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1 @@
initSidebarItems({"fn":[["total_encoded_len","Computes the total encoded length of all segments."]],"struct":[["Optimizer",""],["Parser","QR code data parser to classify the input into distinct segments."],["Segment","A segment of data committed to an encoding mode."]]});

View file

@ -0,0 +1,220 @@
<!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 `Optimizer` struct in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Optimizer">
<title>qrcode::optimize::Optimizer - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>optimize</a></p><script>window.sidebarCurrent = {name: 'Optimizer', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content struct">
<h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>optimize</a>::<wbr><a class='struct' href=''>Optimizer</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-471' class='srclink' href='../../src/qrcode/src/optimize.rs.html#241-247' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct Optimizer&lt;I&gt; {
// some fields omitted
}</pre><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl&lt;I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a>&lt;Item=<a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a>&gt;&gt; <a class='struct' href='../../qrcode/optimize/struct.Optimizer.html' title='qrcode::optimize::Optimizer'>Optimizer</a>&lt;I&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a id='src-478' class='srclink' href='../../src/qrcode/src/optimize.rs.html#249-274' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.new' class='method'><code>fn <a href='#method.new' class='fnname'>new</a>(segments: I, version: <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>) -&gt; <a class='struct' href='../../qrcode/optimize/struct.Optimizer.html' title='qrcode::optimize::Optimizer'>Optimizer</a>&lt;I&gt;</code></h4>
<div class='docblock'><p>Optimize the segments by combining adjacent segments when possible.</p>
<p>Currently this method uses a greedy algorithm by combining segments from
left to right until the new segment is longer than before. This method
does <em>not</em> use Annex J from the ISO standard.</p>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl&lt;I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a>&lt;Item=<a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a>&gt;&gt; <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a> for <a class='struct' href='../../qrcode/optimize/struct.Optimizer.html' title='qrcode::optimize::Optimizer'>Optimizer</a>&lt;I&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a id='src-490' class='srclink' href='../../src/qrcode/src/optimize.rs.html#282-319' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='associatedtype.Item' class='type'><code>type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class='type'>Item</a> = <a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a></code></h4>
<div class='docblock'><p>The type of the elements being iterated over.</p>
</div><h4 id='method.next' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#tymethod.next' class='fnname'>next</a>(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a>&gt;</code></h4>
<div class='docblock'><p>Advances the iterator and returns the next value. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#tymethod.next">Read more</a></p>
</div><h4 id='method.size_hint' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.size_hint' class='fnname'>size_hint</a>(&amp;self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>, <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>&gt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Returns the bounds on the remaining length of the iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.size_hint">Read more</a></p>
</div><h4 id='method.count' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.count' class='fnname'>count</a>(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Consumes the iterator, counting the number of iterations and returning it. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.count">Read more</a></p>
</div><h4 id='method.last' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.last' class='fnname'>last</a>(self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Consumes the iterator, returning the last element. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.last">Read more</a></p>
</div><h4 id='method.nth' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.nth' class='fnname'>nth</a>(&amp;mut self, n: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Consumes the <code>n</code> first elements of the iterator, then returns the <code>next()</code> one. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.nth">Read more</a></p>
</div><h4 id='method.chain' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.chain' class='fnname'>chain</a>&lt;U&gt;(self, other: U) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Chain.html' title='core::iter::Chain'>Chain</a>&lt;Self, U::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIter</a>&gt; <span class='where'>where U: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>&lt;Item=Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Takes two iterators and creates a new iterator over both in sequence. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.chain">Read more</a></p>
</div><h4 id='method.zip' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.zip' class='fnname'>zip</a>&lt;U&gt;(self, other: U) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Zip.html' title='core::iter::Zip'>Zip</a>&lt;Self, U::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIter</a>&gt; <span class='where'>where U: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>&#39;Zips up&#39; two iterators into a single iterator of pairs. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.zip">Read more</a></p>
</div><h4 id='method.map' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.map' class='fnname'>map</a>&lt;B, F&gt;(self, f: F) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Map.html' title='core::iter::Map'>Map</a>&lt;Self, F&gt; <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; B</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Takes a closure and creates an iterator which calls that closure on each element. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.map">Read more</a></p>
</div><h4 id='method.filter' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.filter' class='fnname'>filter</a>&lt;P&gt;(self, predicate: P) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Filter.html' title='core::iter::Filter'>Filter</a>&lt;Self, P&gt; <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator which uses a closure to determine if an element should be yielded. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.filter">Read more</a></p>
</div><h4 id='method.filter_map' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.filter_map' class='fnname'>filter_map</a>&lt;B, F&gt;(self, f: F) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.FilterMap.html' title='core::iter::FilterMap'>FilterMap</a>&lt;Self, F&gt; <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;B&gt;</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator that both filters and maps. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.filter_map">Read more</a></p>
</div><h4 id='method.enumerate' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.enumerate' class='fnname'>enumerate</a>(self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Enumerate.html' title='core::iter::Enumerate'>Enumerate</a>&lt;Self&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator which gives the current iteration count as well as the next value. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.enumerate">Read more</a></p>
</div><h4 id='method.peekable' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.peekable' class='fnname'>peekable</a>(self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Peekable.html' title='core::iter::Peekable'>Peekable</a>&lt;Self&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator which can use <code>peek</code> to look at the next element of the iterator without consuming it. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.peekable">Read more</a></p>
</div><h4 id='method.skip_while' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.skip_while' class='fnname'>skip_while</a>&lt;P&gt;(self, predicate: P) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.SkipWhile.html' title='core::iter::SkipWhile'>SkipWhile</a>&lt;Self, P&gt; <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator that [<code>skip()</code>]s elements based on a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.skip_while">Read more</a></p>
</div><h4 id='method.take_while' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.take_while' class='fnname'>take_while</a>&lt;P&gt;(self, predicate: P) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.TakeWhile.html' title='core::iter::TakeWhile'>TakeWhile</a>&lt;Self, P&gt; <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator that yields elements based on a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.take_while">Read more</a></p>
</div><h4 id='method.skip' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.skip' class='fnname'>skip</a>(self, n: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Skip.html' title='core::iter::Skip'>Skip</a>&lt;Self&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator that skips the first <code>n</code> elements. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.skip">Read more</a></p>
</div><h4 id='method.take' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.take' class='fnname'>take</a>(self, n: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Take.html' title='core::iter::Take'>Take</a>&lt;Self&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator that yields its first <code>n</code> elements. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.take">Read more</a></p>
</div><h4 id='method.scan' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.scan' class='fnname'>scan</a>&lt;St, B, F&gt;(self, initial_state: St, f: F) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Scan.html' title='core::iter::Scan'>Scan</a>&lt;Self, St, F&gt; <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;mut St, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;B&gt;</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>An iterator adaptor similar to [<code>fold()</code>] that holds internal state and produces a new iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.scan">Read more</a></p>
</div><h4 id='method.flat_map' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.flat_map' class='fnname'>flat_map</a>&lt;U, F&gt;(self, f: F) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.FlatMap.html' title='core::iter::FlatMap'>FlatMap</a>&lt;Self, U, F&gt; <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; U, U: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator that works like map, but flattens nested structure. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.flat_map">Read more</a></p>
</div><h4 id='method.fuse' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.fuse' class='fnname'>fuse</a>(self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Fuse.html' title='core::iter::Fuse'>Fuse</a>&lt;Self&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator which ends after the first <code>None</code>. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.fuse">Read more</a></p>
</div><h4 id='method.inspect' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.inspect' class='fnname'>inspect</a>&lt;F&gt;(self, f: F) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Inspect.html' title='core::iter::Inspect'>Inspect</a>&lt;Self, F&gt; <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Do something with each element of an iterator, passing the value on. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.inspect">Read more</a></p>
</div><h4 id='method.by_ref' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.by_ref' class='fnname'>by_ref</a>(&amp;mut self) -&gt; &amp;mut Self</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Borrows an iterator, rather than consuming it. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.by_ref">Read more</a></p>
</div><h4 id='method.collect' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.collect' class='fnname'>collect</a>&lt;B&gt;(self) -&gt; B <span class='where'>where B: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.FromIterator.html' title='core::iter::traits::FromIterator'>FromIterator</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Transforms an iterator into a collection. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.collect">Read more</a></p>
</div><h4 id='method.partition' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.partition' class='fnname'>partition</a>&lt;B, F&gt;(self, f: F) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a>B, B<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a> <span class='where'>where B: <a class='trait' href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html' title='core::default::Default'>Default</a> + <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html' title='core::iter::traits::Extend'>Extend</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt;, F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Consumes an iterator, creating two collections from it. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.partition">Read more</a></p>
</div><h4 id='method.fold' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.fold' class='fnname'>fold</a>&lt;B, F&gt;(self, init: B, f: F) -&gt; B <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(B, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; B</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>An iterator adaptor that applies a function, producing a single, final value. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.fold">Read more</a></p>
</div><h4 id='method.all' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.all' class='fnname'>all</a>&lt;F&gt;(&amp;mut self, f: F) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Tests if every element of the iterator matches a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.all">Read more</a></p>
</div><h4 id='method.any' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.any' class='fnname'>any</a>&lt;F&gt;(&amp;mut self, f: F) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Tests if any element of the iterator matches a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.any">Read more</a></p>
</div><h4 id='method.find' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.find' class='fnname'>find</a>&lt;P&gt;(&amp;mut self, predicate: P) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt; <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Searches for an element of an iterator that satisfies a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.find">Read more</a></p>
</div><h4 id='method.position' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.position' class='fnname'>position</a>&lt;P&gt;(&amp;mut self, predicate: P) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>&gt; <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Searches for an element in an iterator, returning its index. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.position">Read more</a></p>
</div><h4 id='method.rposition' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.rposition' class='fnname'>rposition</a>&lt;P&gt;(&amp;mut self, predicate: P) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>&gt; <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>, Self: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.ExactSizeIterator.html' title='core::iter::traits::ExactSizeIterator'>ExactSizeIterator</a> + <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.DoubleEndedIterator.html' title='core::iter::traits::DoubleEndedIterator'>DoubleEndedIterator</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Searches for an element in an iterator from the right, returning its index. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.rposition">Read more</a></p>
</div><h4 id='method.max' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.max' class='fnname'>max</a>(self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt; <span class='where'>where Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Returns the maximum element of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.max">Read more</a></p>
</div><h4 id='method.min' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.min' class='fnname'>min</a>(self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt; <span class='where'>where Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Returns the minimum element of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.min">Read more</a></p>
</div><h4 id='method.max_by_key' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.max_by_key' class='fnname'>max_by_key</a>&lt;B, F&gt;(self, f: F) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt; <span class='where'>where B: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a>, F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; B</span></code><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div></h4>
<div class='docblock'><p>Returns the element that gives the maximum value from the specified function. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.max_by_key">Read more</a></p>
</div><h4 id='method.min_by_key' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.min_by_key' class='fnname'>min_by_key</a>&lt;B, F&gt;(self, f: F) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt; <span class='where'>where B: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a>, F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; B</span></code><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div></h4>
<div class='docblock'><p>Returns the element that gives the minimum value from the specified function. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.min_by_key">Read more</a></p>
</div><h4 id='method.rev' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.rev' class='fnname'>rev</a>(self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Rev.html' title='core::iter::Rev'>Rev</a>&lt;Self&gt; <span class='where'>where Self: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.DoubleEndedIterator.html' title='core::iter::traits::DoubleEndedIterator'>DoubleEndedIterator</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Reverses an iterator&#39;s direction. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.rev">Read more</a></p>
</div><h4 id='method.unzip' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.unzip' class='fnname'>unzip</a>&lt;A, B, FromA, FromB&gt;(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a>FromA, FromB<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a> <span class='where'>where FromA: <a class='trait' href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html' title='core::default::Default'>Default</a> + <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html' title='core::iter::traits::Extend'>Extend</a>&lt;A&gt;, FromB: <a class='trait' href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html' title='core::default::Default'>Default</a> + <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html' title='core::iter::traits::Extend'>Extend</a>&lt;B&gt;, Self: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a>&lt;Item=<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a>A, B<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Converts an iterator of pairs into a pair of containers. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.unzip">Read more</a></p>
</div><h4 id='method.cloned' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.cloned' class='fnname'>cloned</a>&lt;'a, T&gt;(self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Cloned.html' title='core::iter::Cloned'>Cloned</a>&lt;Self&gt; <span class='where'>where Self: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a>&lt;Item=&amp;'a T&gt;, T: 'a + <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator which <code>clone()</code>s all of its elements. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.cloned">Read more</a></p>
</div><h4 id='method.cycle' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.cycle' class='fnname'>cycle</a>(self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Cycle.html' title='core::iter::Cycle'>Cycle</a>&lt;Self&gt; <span class='where'>where Self: <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Repeats an iterator endlessly. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.cycle">Read more</a></p>
</div><h4 id='method.sum' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.sum' class='fnname'>sum</a>&lt;S&gt;(self) -&gt; S <span class='where'>where S: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.Add.html' title='core::ops::Add'>Add</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>, Output=S&gt; + <a class='trait' href='https://doc.rust-lang.org/nightly/core/num/trait.Zero.html' title='core::num::Zero'>Zero</a></span></code></h4>
<div class='docblock'><p>Sums the elements of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.sum">Read more</a></p>
</div><h4 id='method.product' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.product' class='fnname'>product</a>&lt;P&gt;(self) -&gt; P <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.Mul.html' title='core::ops::Mul'>Mul</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>, Output=P&gt; + <a class='trait' href='https://doc.rust-lang.org/nightly/core/num/trait.One.html' title='core::num::One'>One</a></span></code></h4>
<div class='docblock'><p>Iterates over the entire iterator, multiplying all the elements <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.product">Read more</a></p>
</div><h4 id='method.cmp' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.cmp' class='fnname'>cmp</a>&lt;I&gt;(self, other: I) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a> <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>&lt;Item=Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt;, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a></span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Lexicographically compares the elements of this <code>Iterator</code> with those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.cmp">Read more</a></p>
</div><h4 id='method.partial_cmp' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.partial_cmp' class='fnname'>partial_cmp</a>&lt;I&gt;(self, other: I) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='enum' href='https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a>&gt; <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a>&lt;I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Lexicographically compares the elements of this <code>Iterator</code> with those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.partial_cmp">Read more</a></p>
</div><h4 id='method.eq' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.eq' class='fnname'>eq</a>&lt;I&gt;(self, other: I) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a>&lt;I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Determines if the elements of this <code>Iterator</code> are equal to those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.eq">Read more</a></p>
</div><h4 id='method.ne' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.ne' class='fnname'>ne</a>&lt;I&gt;(self, other: I) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a>&lt;I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Determines if the elements of this <code>Iterator</code> are unequal to those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.ne">Read more</a></p>
</div><h4 id='method.lt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.lt' class='fnname'>lt</a>&lt;I&gt;(self, other: I) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a>&lt;I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Determines if the elements of this <code>Iterator</code> are lexicographically less than those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.lt">Read more</a></p>
</div><h4 id='method.le' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.le' class='fnname'>le</a>&lt;I&gt;(self, other: I) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a>&lt;I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Determines if the elements of this <code>Iterator</code> are lexicographically less or equal to those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.le">Read more</a></p>
</div><h4 id='method.gt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.gt' class='fnname'>gt</a>&lt;I&gt;(self, other: I) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a>&lt;I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Determines if the elements of this <code>Iterator</code> are lexicographically greater than those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.gt">Read more</a></p>
</div><h4 id='method.ge' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.ge' class='fnname'>ge</a>&lt;I&gt;(self, other: I) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a>&lt;I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Determines if the elements of this <code>Iterator</code> are lexicographically greater than or equal to those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.ge">Read more</a></p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

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="API documentation for the Rust `Parser` struct in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Parser">
<title>qrcode::optimize::Parser - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>optimize</a></p><script>window.sidebarCurrent = {name: 'Parser', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content struct">
<h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>optimize</a>::<wbr><a class='struct' href=''>Parser</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-447' class='srclink' href='../../src/qrcode/src/optimize.rs.html#82-87' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct Parser&lt;'a&gt; {
// some fields omitted
}</pre><div class='docblock'><p>QR code data parser to classify the input into distinct segments.</p>
</div><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl&lt;'a&gt; <a class='struct' href='../../qrcode/optimize/struct.Parser.html' title='qrcode::optimize::Parser'>Parser</a>&lt;'a&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a id='src-453' class='srclink' href='../../src/qrcode/src/optimize.rs.html#89-109' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.new' class='method'><code>fn <a href='#method.new' class='fnname'>new</a>(data: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>) -&gt; <a class='struct' href='../../qrcode/optimize/struct.Parser.html' title='qrcode::optimize::Parser'>Parser</a></code></h4>
<div class='docblock'><p>Creates a new iterator which parse the data into segments that only
contains their exclusive subsets. No optimization is done at this point.</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>optimize</span>::{<span class='ident'>Parser</span>, <span class='ident'>Segment</span>};
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>types</span>::<span class='ident'>Mode</span>::{<span class='ident'>Alphanumeric</span>, <span class='ident'>Numeric</span>, <span class='ident'>Byte</span>};
<span class='kw'>let</span> <span class='ident'>parse_res</span> <span class='op'>=</span> <span class='ident'>Parser</span>::<span class='ident'>new</span>(<span class='string'>b&quot;ABC123abcd&quot;</span>).<span class='ident'>collect</span>::<span class='op'>&lt;</span><span class='ident'>Vec</span><span class='op'>&lt;</span><span class='ident'>Segment</span><span class='op'>&gt;&gt;</span>();
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>parse_res</span>, <span class='macro'>vec</span><span class='macro'>!</span>[<span class='ident'>Segment</span> { <span class='ident'>mode</span>: <span class='ident'>Alphanumeric</span>, <span class='ident'>begin</span>: <span class='number'>0</span>, <span class='ident'>end</span>: <span class='number'>3</span> },
<span class='ident'>Segment</span> { <span class='ident'>mode</span>: <span class='ident'>Numeric</span>, <span class='ident'>begin</span>: <span class='number'>3</span>, <span class='ident'>end</span>: <span class='number'>6</span> },
<span class='ident'>Segment</span> { <span class='ident'>mode</span>: <span class='ident'>Byte</span>, <span class='ident'>begin</span>: <span class='number'>6</span>, <span class='ident'>end</span>: <span class='number'>10</span> }]);</pre>
</div></div><h3 class='impl'><span class='in-band'><code>impl&lt;'a&gt; <a class='struct' href='../../qrcode/optimize/struct.Parser.html' title='qrcode::optimize::Parser'>Parser</a>&lt;'a&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a id='src-485' class='srclink' href='../../src/qrcode/src/optimize.rs.html#276-280' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.optimize' class='method'><code>fn <a href='#method.optimize' class='fnname'>optimize</a>(self, version: <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>) -&gt; <a class='struct' href='../../qrcode/optimize/struct.Optimizer.html' title='qrcode::optimize::Optimizer'>Optimizer</a>&lt;<a class='struct' href='../../qrcode/optimize/struct.Parser.html' title='qrcode::optimize::Parser'>Parser</a>&lt;'a&gt;&gt;</code></h4>
</div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl&lt;'a&gt; <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a> for <a class='struct' href='../../qrcode/optimize/struct.Parser.html' title='qrcode::optimize::Parser'>Parser</a>&lt;'a&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a id='src-457' class='srclink' href='../../src/qrcode/src/optimize.rs.html#111-164' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='associatedtype.Item' class='type'><code>type <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#associatedtype.Item' class='type'>Item</a> = <a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a></code></h4>
<div class='docblock'><p>The type of the elements being iterated over.</p>
</div><h4 id='method.next' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#tymethod.next' class='fnname'>next</a>(&amp;mut self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a>&gt;</code></h4>
<div class='docblock'><p>Advances the iterator and returns the next value. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#tymethod.next">Read more</a></p>
</div><h4 id='method.size_hint' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.size_hint' class='fnname'>size_hint</a>(&amp;self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>, <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>&gt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Returns the bounds on the remaining length of the iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.size_hint">Read more</a></p>
</div><h4 id='method.count' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.count' class='fnname'>count</a>(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Consumes the iterator, counting the number of iterations and returning it. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.count">Read more</a></p>
</div><h4 id='method.last' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.last' class='fnname'>last</a>(self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Consumes the iterator, returning the last element. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.last">Read more</a></p>
</div><h4 id='method.nth' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.nth' class='fnname'>nth</a>(&amp;mut self, n: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Consumes the <code>n</code> first elements of the iterator, then returns the <code>next()</code> one. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.nth">Read more</a></p>
</div><h4 id='method.chain' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.chain' class='fnname'>chain</a>&lt;U&gt;(self, other: U) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Chain.html' title='core::iter::Chain'>Chain</a>&lt;Self, U::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIter</a>&gt; <span class='where'>where U: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>&lt;Item=Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Takes two iterators and creates a new iterator over both in sequence. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.chain">Read more</a></p>
</div><h4 id='method.zip' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.zip' class='fnname'>zip</a>&lt;U&gt;(self, other: U) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Zip.html' title='core::iter::Zip'>Zip</a>&lt;Self, U::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIter</a>&gt; <span class='where'>where U: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>&#39;Zips up&#39; two iterators into a single iterator of pairs. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.zip">Read more</a></p>
</div><h4 id='method.map' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.map' class='fnname'>map</a>&lt;B, F&gt;(self, f: F) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Map.html' title='core::iter::Map'>Map</a>&lt;Self, F&gt; <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; B</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Takes a closure and creates an iterator which calls that closure on each element. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.map">Read more</a></p>
</div><h4 id='method.filter' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.filter' class='fnname'>filter</a>&lt;P&gt;(self, predicate: P) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Filter.html' title='core::iter::Filter'>Filter</a>&lt;Self, P&gt; <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator which uses a closure to determine if an element should be yielded. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.filter">Read more</a></p>
</div><h4 id='method.filter_map' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.filter_map' class='fnname'>filter_map</a>&lt;B, F&gt;(self, f: F) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.FilterMap.html' title='core::iter::FilterMap'>FilterMap</a>&lt;Self, F&gt; <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;B&gt;</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator that both filters and maps. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.filter_map">Read more</a></p>
</div><h4 id='method.enumerate' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.enumerate' class='fnname'>enumerate</a>(self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Enumerate.html' title='core::iter::Enumerate'>Enumerate</a>&lt;Self&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator which gives the current iteration count as well as the next value. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.enumerate">Read more</a></p>
</div><h4 id='method.peekable' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.peekable' class='fnname'>peekable</a>(self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Peekable.html' title='core::iter::Peekable'>Peekable</a>&lt;Self&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator which can use <code>peek</code> to look at the next element of the iterator without consuming it. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.peekable">Read more</a></p>
</div><h4 id='method.skip_while' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.skip_while' class='fnname'>skip_while</a>&lt;P&gt;(self, predicate: P) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.SkipWhile.html' title='core::iter::SkipWhile'>SkipWhile</a>&lt;Self, P&gt; <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator that [<code>skip()</code>]s elements based on a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.skip_while">Read more</a></p>
</div><h4 id='method.take_while' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.take_while' class='fnname'>take_while</a>&lt;P&gt;(self, predicate: P) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.TakeWhile.html' title='core::iter::TakeWhile'>TakeWhile</a>&lt;Self, P&gt; <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator that yields elements based on a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.take_while">Read more</a></p>
</div><h4 id='method.skip' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.skip' class='fnname'>skip</a>(self, n: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Skip.html' title='core::iter::Skip'>Skip</a>&lt;Self&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator that skips the first <code>n</code> elements. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.skip">Read more</a></p>
</div><h4 id='method.take' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.take' class='fnname'>take</a>(self, n: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Take.html' title='core::iter::Take'>Take</a>&lt;Self&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator that yields its first <code>n</code> elements. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.take">Read more</a></p>
</div><h4 id='method.scan' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.scan' class='fnname'>scan</a>&lt;St, B, F&gt;(self, initial_state: St, f: F) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Scan.html' title='core::iter::Scan'>Scan</a>&lt;Self, St, F&gt; <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;mut St, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;B&gt;</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>An iterator adaptor similar to [<code>fold()</code>] that holds internal state and produces a new iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.scan">Read more</a></p>
</div><h4 id='method.flat_map' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.flat_map' class='fnname'>flat_map</a>&lt;U, F&gt;(self, f: F) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.FlatMap.html' title='core::iter::FlatMap'>FlatMap</a>&lt;Self, U, F&gt; <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; U, U: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator that works like map, but flattens nested structure. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.flat_map">Read more</a></p>
</div><h4 id='method.fuse' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.fuse' class='fnname'>fuse</a>(self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Fuse.html' title='core::iter::Fuse'>Fuse</a>&lt;Self&gt;</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator which ends after the first <code>None</code>. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.fuse">Read more</a></p>
</div><h4 id='method.inspect' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.inspect' class='fnname'>inspect</a>&lt;F&gt;(self, f: F) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Inspect.html' title='core::iter::Inspect'>Inspect</a>&lt;Self, F&gt; <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Do something with each element of an iterator, passing the value on. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.inspect">Read more</a></p>
</div><h4 id='method.by_ref' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.by_ref' class='fnname'>by_ref</a>(&amp;mut self) -&gt; &amp;mut Self</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Borrows an iterator, rather than consuming it. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.by_ref">Read more</a></p>
</div><h4 id='method.collect' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.collect' class='fnname'>collect</a>&lt;B&gt;(self) -&gt; B <span class='where'>where B: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.FromIterator.html' title='core::iter::traits::FromIterator'>FromIterator</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Transforms an iterator into a collection. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.collect">Read more</a></p>
</div><h4 id='method.partition' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.partition' class='fnname'>partition</a>&lt;B, F&gt;(self, f: F) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a>B, B<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a> <span class='where'>where B: <a class='trait' href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html' title='core::default::Default'>Default</a> + <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html' title='core::iter::traits::Extend'>Extend</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt;, F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Consumes an iterator, creating two collections from it. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.partition">Read more</a></p>
</div><h4 id='method.fold' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.fold' class='fnname'>fold</a>&lt;B, F&gt;(self, init: B, f: F) -&gt; B <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(B, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; B</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>An iterator adaptor that applies a function, producing a single, final value. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.fold">Read more</a></p>
</div><h4 id='method.all' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.all' class='fnname'>all</a>&lt;F&gt;(&amp;mut self, f: F) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Tests if every element of the iterator matches a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.all">Read more</a></p>
</div><h4 id='method.any' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.any' class='fnname'>any</a>&lt;F&gt;(&amp;mut self, f: F) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Tests if any element of the iterator matches a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.any">Read more</a></p>
</div><h4 id='method.find' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.find' class='fnname'>find</a>&lt;P&gt;(&amp;mut self, predicate: P) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt; <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Searches for an element of an iterator that satisfies a predicate. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.find">Read more</a></p>
</div><h4 id='method.position' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.position' class='fnname'>position</a>&lt;P&gt;(&amp;mut self, predicate: P) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>&gt; <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Searches for an element in an iterator, returning its index. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.position">Read more</a></p>
</div><h4 id='method.rposition' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.rposition' class='fnname'>rposition</a>&lt;P&gt;(&amp;mut self, predicate: P) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>&gt; <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>, Self: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.ExactSizeIterator.html' title='core::iter::traits::ExactSizeIterator'>ExactSizeIterator</a> + <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.DoubleEndedIterator.html' title='core::iter::traits::DoubleEndedIterator'>DoubleEndedIterator</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Searches for an element in an iterator from the right, returning its index. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.rposition">Read more</a></p>
</div><h4 id='method.max' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.max' class='fnname'>max</a>(self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt; <span class='where'>where Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Returns the maximum element of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.max">Read more</a></p>
</div><h4 id='method.min' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.min' class='fnname'>min</a>(self) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt; <span class='where'>where Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Returns the minimum element of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.min">Read more</a></p>
</div><h4 id='method.max_by_key' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.max_by_key' class='fnname'>max_by_key</a>&lt;B, F&gt;(self, f: F) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt; <span class='where'>where B: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a>, F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; B</span></code><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div></h4>
<div class='docblock'><p>Returns the element that gives the maximum value from the specified function. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.max_by_key">Read more</a></p>
</div><h4 id='method.min_by_key' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.min_by_key' class='fnname'>min_by_key</a>&lt;B, F&gt;(self, f: F) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt; <span class='where'>where B: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a>, F: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&amp;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -&gt; B</span></code><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div></h4>
<div class='docblock'><p>Returns the element that gives the minimum value from the specified function. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.min_by_key">Read more</a></p>
</div><h4 id='method.rev' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.rev' class='fnname'>rev</a>(self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Rev.html' title='core::iter::Rev'>Rev</a>&lt;Self&gt; <span class='where'>where Self: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.DoubleEndedIterator.html' title='core::iter::traits::DoubleEndedIterator'>DoubleEndedIterator</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Reverses an iterator&#39;s direction. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.rev">Read more</a></p>
</div><h4 id='method.unzip' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.unzip' class='fnname'>unzip</a>&lt;A, B, FromA, FromB&gt;(self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a>FromA, FromB<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a> <span class='where'>where FromA: <a class='trait' href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html' title='core::default::Default'>Default</a> + <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html' title='core::iter::traits::Extend'>Extend</a>&lt;A&gt;, FromB: <a class='trait' href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html' title='core::default::Default'>Default</a> + <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html' title='core::iter::traits::Extend'>Extend</a>&lt;B&gt;, Self: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a>&lt;Item=<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a>A, B<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Converts an iterator of pairs into a pair of containers. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.unzip">Read more</a></p>
</div><h4 id='method.cloned' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.cloned' class='fnname'>cloned</a>&lt;'a, T&gt;(self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Cloned.html' title='core::iter::Cloned'>Cloned</a>&lt;Self&gt; <span class='where'>where Self: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a>&lt;Item=&amp;'a T&gt;, T: 'a + <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Creates an iterator which <code>clone()</code>s all of its elements. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.cloned">Read more</a></p>
</div><h4 id='method.cycle' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.cycle' class='fnname'>cycle</a>(self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Cycle.html' title='core::iter::Cycle'>Cycle</a>&lt;Self&gt; <span class='where'>where Self: <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Repeats an iterator endlessly. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.cycle">Read more</a></p>
</div><h4 id='method.sum' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.sum' class='fnname'>sum</a>&lt;S&gt;(self) -&gt; S <span class='where'>where S: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.Add.html' title='core::ops::Add'>Add</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>, Output=S&gt; + <a class='trait' href='https://doc.rust-lang.org/nightly/core/num/trait.Zero.html' title='core::num::Zero'>Zero</a></span></code></h4>
<div class='docblock'><p>Sums the elements of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.sum">Read more</a></p>
</div><h4 id='method.product' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.product' class='fnname'>product</a>&lt;P&gt;(self) -&gt; P <span class='where'>where P: <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.Mul.html' title='core::ops::Mul'>Mul</a>&lt;Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>, Output=P&gt; + <a class='trait' href='https://doc.rust-lang.org/nightly/core/num/trait.One.html' title='core::num::One'>One</a></span></code></h4>
<div class='docblock'><p>Iterates over the entire iterator, multiplying all the elements <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.product">Read more</a></p>
</div><h4 id='method.cmp' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.cmp' class='fnname'>cmp</a>&lt;I&gt;(self, other: I) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a> <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>&lt;Item=Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>&gt;, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a></span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Lexicographically compares the elements of this <code>Iterator</code> with those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.cmp">Read more</a></p>
</div><h4 id='method.partial_cmp' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.partial_cmp' class='fnname'>partial_cmp</a>&lt;I&gt;(self, other: I) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='enum' href='https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a>&gt; <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a>&lt;I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Lexicographically compares the elements of this <code>Iterator</code> with those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.partial_cmp">Read more</a></p>
</div><h4 id='method.eq' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.eq' class='fnname'>eq</a>&lt;I&gt;(self, other: I) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a>&lt;I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Determines if the elements of this <code>Iterator</code> are equal to those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.eq">Read more</a></p>
</div><h4 id='method.ne' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.ne' class='fnname'>ne</a>&lt;I&gt;(self, other: I) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a>&lt;I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Determines if the elements of this <code>Iterator</code> are unequal to those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.ne">Read more</a></p>
</div><h4 id='method.lt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.lt' class='fnname'>lt</a>&lt;I&gt;(self, other: I) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a>&lt;I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Determines if the elements of this <code>Iterator</code> are lexicographically less than those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.lt">Read more</a></p>
</div><h4 id='method.le' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.le' class='fnname'>le</a>&lt;I&gt;(self, other: I) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a>&lt;I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Determines if the elements of this <code>Iterator</code> are lexicographically less or equal to those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.le">Read more</a></p>
</div><h4 id='method.gt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.gt' class='fnname'>gt</a>&lt;I&gt;(self, other: I) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a>&lt;I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Determines if the elements of this <code>Iterator</code> are lexicographically greater than those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.gt">Read more</a></p>
</div><h4 id='method.ge' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.ge' class='fnname'>ge</a>&lt;I&gt;(self, other: I) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a> <span class='where'>where I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>IntoIterator</a>, Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a>&lt;I::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html' title='core::iter::traits::IntoIterator'>Item</a>&gt;</span></code><div class='since' title='Stable since Rust version 1.5.0'>1.5.0</div></h4>
<div class='docblock'><p>Determines if the elements of this <code>Iterator</code> are lexicographically greater than or equal to those of another. <a href="https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html#method.ge">Read more</a></p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1,145 @@
<!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 `Segment` struct in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Segment">
<title>qrcode::optimize::Segment - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>optimize</a></p><script>window.sidebarCurrent = {name: 'Segment', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content struct">
<h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>optimize</a>::<wbr><a class='struct' href=''>Segment</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-380' class='srclink' href='../../src/qrcode/src/optimize.rs.html#13-22' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct Segment {
pub mode: <a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a>,
pub begin: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>,
pub end: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>,
}</pre><div class='docblock'><p>A segment of data committed to an encoding mode.</p>
</div><h2 class='fields'>Fields</h2>
<table><tr class='stab '>
<td id='structfield.mode'><code>mode</code></td><td><div class='docblock'><p>The encoding mode of the segment of data.</p>
</div></td></tr><tr class='stab '>
<td id='structfield.begin'><code>begin</code></td><td><div class='docblock'><p>The start index of the segment.</p>
</div></td></tr><tr class='stab '>
<td id='structfield.end'><code>end</code></td><td><div class='docblock'><p>The end index (exclusive) of the segment.</p>
</div></td></tr></table><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-424' class='srclink' href='../../src/qrcode/src/optimize.rs.html#24-37' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.encoded_len' class='method'><code>fn <a href='#method.encoded_len' class='fnname'>encoded_len</a>(&amp;self, version: <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code></h4>
<div class='docblock'><p>Compute the number of bits (including the size of the mode indicator and
length bits) when this segment is encoded.</p>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-384' class='srclink' href='../../src/qrcode/src/optimize.rs.html#12' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a></code></h4>
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-390' class='srclink' href='../../src/qrcode/src/optimize.rs.html#12' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-391' class='srclink' href='../../src/qrcode/src/optimize.rs.html#12' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='type' href='https://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html' title='core::cmp::Eq'>Eq</a> for <a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-399' class='srclink' href='../../src/qrcode/src/optimize.rs.html#12' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-405' class='srclink' href='../../src/qrcode/src/optimize.rs.html#12' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, __arg_0: &amp;<a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, __arg_0: &amp;<a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

1
qrcode/sidebar-items.js Normal file
View file

@ -0,0 +1 @@
initSidebarItems({"mod":[["bits","The `bits` module encodes binary data into raw bits used in a QR code."],["canvas","The `canvas` module puts raw bits into the QR code canvas."],["ec","The `ec` module applies the Reed-Solomon error correction codes."],["optimize","Find the optimal data mode sequence to encode a piece of data."],["types",""]],"struct":[["QrCode","The encoded QR code symbol."]]});

212
qrcode/struct.QrCode.html Normal file
View file

@ -0,0 +1,212 @@
<!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 `QrCode` struct in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, QrCode">
<title>qrcode::QrCode - Rust</title>
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='index.html'>qrcode</a></p><script>window.sidebarCurrent = {name: 'QrCode', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content struct">
<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>qrcode</a>::<wbr><a class='struct' href=''>QrCode</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-1053' class='srclink' href='../src/qrcode/src/lib.rs.html#39-44' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct QrCode {
// some fields omitted
}</pre><div class='docblock'><p>The encoded QR code symbol.</p>
</div><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class='struct' href='../qrcode/struct.QrCode.html' title='qrcode::QrCode'>QrCode</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-1065' class='srclink' href='../src/qrcode/src/lib.rs.html#46-189' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.new' class='method'><code>fn <a href='#method.new' class='fnname'>new</a>&lt;D: <a class='trait' href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>&gt;&gt;(data: D) -&gt; <a class='type' href='../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='struct' href='../qrcode/struct.QrCode.html' title='qrcode::QrCode'>QrCode</a>&gt;</code></h4>
<div class='docblock'><p>Constructs a new QR code which automatically encodes the given data.</p>
<p>This method uses the &quot;medium&quot; error correction level and automatically
chooses the smallest QR code.</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>QrCode</span>;
<span class='kw'>let</span> <span class='ident'>code</span> <span class='op'>=</span> <span class='ident'>QrCode</span>::<span class='ident'>new</span>(<span class='string'>b&quot;Some data&quot;</span>).<span class='ident'>unwrap</span>();</pre>
</div><h4 id='method.with_error_correction_level' class='method'><code>fn <a href='#method.with_error_correction_level' class='fnname'>with_error_correction_level</a>&lt;D: <a class='trait' href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>&gt;&gt;(data: D, ec_level: <a class='enum' href='../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -&gt; <a class='type' href='../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='struct' href='../qrcode/struct.QrCode.html' title='qrcode::QrCode'>QrCode</a>&gt;</code></h4>
<div class='docblock'><p>Constructs a new QR code which automatically encodes the given data at a
specific error correction level.</p>
<p>This method automatically chooses the smallest QR code.</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::{<span class='ident'>QrCode</span>, <span class='ident'>EcLevel</span>};
<span class='kw'>let</span> <span class='ident'>code</span> <span class='op'>=</span> <span class='ident'>QrCode</span>::<span class='ident'>with_error_correction_level</span>(<span class='string'>b&quot;Some data&quot;</span>, <span class='ident'>EcLevel</span>::<span class='ident'>H</span>).<span class='ident'>unwrap</span>();</pre>
</div><h4 id='method.with_version' class='method'><code>fn <a href='#method.with_version' class='fnname'>with_version</a>&lt;D: <a class='trait' href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>&gt;&gt;(data: D, version: <a class='enum' href='../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>, ec_level: <a class='enum' href='../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -&gt; <a class='type' href='../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='struct' href='../qrcode/struct.QrCode.html' title='qrcode::QrCode'>QrCode</a>&gt;</code></h4>
<div class='docblock'><p>Constructs a new QR code for the given version and error correction
level.</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::{<span class='ident'>QrCode</span>, <span class='ident'>Version</span>, <span class='ident'>EcLevel</span>};
<span class='kw'>let</span> <span class='ident'>code</span> <span class='op'>=</span> <span class='ident'>QrCode</span>::<span class='ident'>with_version</span>(<span class='string'>b&quot;Some data&quot;</span>, <span class='ident'>Version</span>::<span class='ident'>Normal</span>(<span class='number'>5</span>), <span class='ident'>EcLevel</span>::<span class='ident'>M</span>).<span class='ident'>unwrap</span>();</pre>
<p>This method can also be used to generate Micro QR code.</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::{<span class='ident'>QrCode</span>, <span class='ident'>Version</span>, <span class='ident'>EcLevel</span>};
<span class='kw'>let</span> <span class='ident'>micro_code</span> <span class='op'>=</span> <span class='ident'>QrCode</span>::<span class='ident'>with_version</span>(<span class='string'>b&quot;123&quot;</span>, <span class='ident'>Version</span>::<span class='ident'>Micro</span>(<span class='number'>1</span>), <span class='ident'>EcLevel</span>::<span class='ident'>L</span>).<span class='ident'>unwrap</span>();</pre>
</div><h4 id='method.with_bits' class='method'><code>fn <a href='#method.with_bits' class='fnname'>with_bits</a>(bits: <a class='struct' href='../qrcode/bits/struct.Bits.html' title='qrcode::bits::Bits'>Bits</a>, ec_level: <a class='enum' href='../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -&gt; <a class='type' href='../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;<a class='struct' href='../qrcode/struct.QrCode.html' title='qrcode::QrCode'>QrCode</a>&gt;</code></h4>
<div class='docblock'><p>Constructs a new QR code with encoded bits.</p>
<p>Use this method only if there are very special need to manipulate the
raw bits before encoding. Some examples are:</p>
<ul>
<li>Encode data using specific character set with ECI</li>
<li>Use the FNC1 modes</li>
<li>Avoid the optimal segmentation algorithm</li>
</ul>
<p>See the <code>Bits</code> structure for detail.</p>
<pre class='rust rust-example-rendered'>
<span class='attribute'>#<span class='op'>!</span>[<span class='ident'>allow</span>(<span class='ident'>unused_must_use</span>)]</span>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::{<span class='ident'>QrCode</span>, <span class='ident'>Version</span>, <span class='ident'>EcLevel</span>};
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>bits</span>::<span class='ident'>Bits</span>;
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>bits</span> <span class='op'>=</span> <span class='ident'>Bits</span>::<span class='ident'>new</span>(<span class='ident'>Version</span>::<span class='ident'>Normal</span>(<span class='number'>1</span>));
<span class='ident'>bits</span>.<span class='ident'>push_eci_designator</span>(<span class='number'>9</span>);
<span class='ident'>bits</span>.<span class='ident'>push_byte_data</span>(<span class='string'>b&quot;\xca\xfe\xe4\xe9\xea\xe1\xf2 QR&quot;</span>);
<span class='ident'>bits</span>.<span class='ident'>push_terminator</span>(<span class='ident'>EcLevel</span>::<span class='ident'>L</span>);
<span class='kw'>let</span> <span class='ident'>qrcode</span> <span class='op'>=</span> <span class='ident'>QrCode</span>::<span class='ident'>with_bits</span>(<span class='ident'>bits</span>, <span class='ident'>EcLevel</span>::<span class='ident'>L</span>);</pre>
</div><h4 id='method.version' class='method'><code>fn <a href='#method.version' class='fnname'>version</a>(&amp;self) -&gt; <a class='enum' href='../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a></code></h4>
<div class='docblock'><p>Gets the version of this QR code.</p>
</div><h4 id='method.error_correction_level' class='method'><code>fn <a href='#method.error_correction_level' class='fnname'>error_correction_level</a>(&amp;self) -&gt; <a class='enum' href='../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a></code></h4>
<div class='docblock'><p>Gets the error correction level of this QR code.</p>
</div><h4 id='method.width' class='method'><code>fn <a href='#method.width' class='fnname'>width</a>(&amp;self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code></h4>
<div class='docblock'><p>Gets the number of modules per side, i.e. the width of this QR code.</p>
<p>The width here does not contain the quiet zone paddings.</p>
</div><h4 id='method.max_allowed_errors' class='method'><code>fn <a href='#method.max_allowed_errors' class='fnname'>max_allowed_errors</a>(&amp;self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code></h4>
<div class='docblock'><p>Gets the maximum number of allowed erratic modules can be introduced
before the data becomes corrupted. Note that errors should not be
introduced to functional modules.</p>
</div><h4 id='method.is_functional' class='method'><code>fn <a href='#method.is_functional' class='fnname'>is_functional</a>(&amp;self, x: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>, y: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>Checks whether a module at coordinate (x, y) is a functional module or
not.</p>
</div><h4 id='method.to_debug_str' class='method'><code>fn <a href='#method.to_debug_str' class='fnname'>to_debug_str</a>(&amp;self, on_char: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>, off_char: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a></code></h4>
<div class='docblock'><p>Converts the QR code into a human-readable string. This is mainly for
debugging only.</p>
</div><h4 id='method.to_vec' class='method'><code>fn <a href='#method.to_vec' class='fnname'>to_vec</a>(&amp;self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>&gt;</code></h4>
<div class='docblock'><p>Converts the QR code to a vector of booleans. Each entry represents the
color of the module, with &quot;true&quot; means dark and &quot;false&quot; means light.</p>
</div><h4 id='method.into_vec' class='method'><code>fn <a href='#method.into_vec' class='fnname'>into_vec</a>(self) -&gt; <a class='struct' href='https://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>&gt;</code></h4>
<div class='docblock'><p>Converts the QR code to a vector of booleans. Each entry represents the
color of the module, with &quot;true&quot; means dark and &quot;false&quot; means light.</p>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/ops/trait.Index.html' title='core::ops::Index'>Index</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>, <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a>&gt; for <a class='struct' href='../qrcode/struct.QrCode.html' title='qrcode::QrCode'>QrCode</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-1120' class='srclink' href='../src/qrcode/src/lib.rs.html#191-198' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='associatedtype.Output' class='type'><code>type <a href='https://doc.rust-lang.org/nightly/core/ops/trait.Index.html#associatedtype.Output' class='type'>Output</a> = <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>The returned type after indexing</p>
</div><h4 id='method.index' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/trait.Index.html#tymethod.index' class='fnname'>index</a>(&amp;self, (x, y): <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>(</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>, <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>)</a>) -&gt; &amp;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>The method for the indexing (<code>Foo[Bar]</code>) operation</p>
</div></div><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../qrcode/struct.QrCode.html' title='qrcode::QrCode'>QrCode</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-1058' class='srclink' href='../src/qrcode/src/lib.rs.html#38' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='struct' href='../qrcode/struct.QrCode.html' title='qrcode::QrCode'>QrCode</a></code></h4>
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../jquery.js"></script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1,155 @@
<!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 `EcLevel` enum in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, EcLevel">
<title>qrcode::types::EcLevel - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>types</a></p><script>window.sidebarCurrent = {name: 'EcLevel', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content enum">
<h1 class='fqn'><span class='in-band'>Enum <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>types</a>::<wbr><a class='enum' href=''>EcLevel</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-47' class='srclink' href='../../src/qrcode/src/types.rs.html#52-64' title='goto source code'>[src]</a></span></h1>
<pre class='rust enum'>pub enum EcLevel {
L,
M,
Q,
H,
}</pre><div class='docblock'><p>The error correction level. It allows the original information be recovered
even if parts of the code is damaged.</p>
</div><h2 class='variants'>Variants</h2>
<table class='variants_table'><tr><td id='variant.L'><code>L</code></td><td><div class='docblock'><p>Low error correction. Allows up to 7% of wrong blocks.</p>
</div></td><td></td></tr><tr><td id='variant.M'><code>M</code></td><td><div class='docblock'><p>Medium error correction (default). Allows up to 15% of wrong blocks.</p>
</div></td><td></td></tr><tr><td id='variant.Q'><code>Q</code></td><td><div class='docblock'><p>&quot;Quartile&quot; error correction. Allows up to 25% of wrong blocks.</p>
</div></td><td></td></tr><tr><td id='variant.H'><code>H</code></td><td><div class='docblock'><p>High error correction. Allows up to 30% of wrong blocks.</p>
</div></td><td></td></tr></table><h2 id='implementations'>Trait Implementations</h2><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a> for <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-56' class='srclink' href='../../src/qrcode/src/types.rs.html#51' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.cmp' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp' class='fnname'>cmp</a>(&amp;self, __arg_0: &amp;<a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a></code></h4>
<div class='docblock'><p>This method returns an <code>Ordering</code> between <code>self</code> and <code>other</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#tymethod.cmp">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a> for <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-62' class='srclink' href='../../src/qrcode/src/types.rs.html#51' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.partial_cmp' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, __arg_0: &amp;<a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='enum' href='https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a>&gt;</code></h4>
<div class='docblock'><p>This method returns an ordering between <code>self</code> and <code>other</code> values if one exists. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp">Read more</a></p>
</div><h4 id='method.lt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: &amp;Rhs) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: &amp;Rhs) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: &amp;Rhs) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: &amp;Rhs) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-68' class='srclink' href='../../src/qrcode/src/types.rs.html#51' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a></code></h4>
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-71' class='srclink' href='../../src/qrcode/src/types.rs.html#51' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html' title='core::cmp::Eq'>Eq</a> for <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-72' class='srclink' href='../../src/qrcode/src/types.rs.html#51' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-75' class='srclink' href='../../src/qrcode/src/types.rs.html#51' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, __arg_0: &amp;<a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: &amp;Rhs) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-81' class='srclink' href='../../src/qrcode/src/types.rs.html#51' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='type' href='https://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

185
qrcode/types/enum.Mode.html Normal file
View file

@ -0,0 +1,185 @@
<!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 `Mode` enum in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Mode">
<title>qrcode::types::Mode - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>types</a></p><script>window.sidebarCurrent = {name: 'Mode', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content enum">
<h1 class='fqn'><span class='in-band'>Enum <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>types</a>::<wbr><a class='enum' href=''>Mode</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-151' class='srclink' href='../../src/qrcode/src/types.rs.html#146-159' title='goto source code'>[src]</a></span></h1>
<pre class='rust enum'>pub enum Mode {
Numeric,
Alphanumeric,
Byte,
Kanji,
}</pre><div class='docblock'><p>The mode indicator, which specifies the character set of the encoded data.</p>
</div><h2 class='variants'>Variants</h2>
<table class='variants_table'><tr><td id='variant.Numeric'><code>Numeric</code></td><td><div class='docblock'><p>The data contains only characters 0 to 9.</p>
</div></td><td></td></tr><tr><td id='variant.Alphanumeric'><code>Alphanumeric</code></td><td><div class='docblock'><p>The data contains only uppercase letters (AZ), numbers (09) and a few
punctuations marks (space, <code>$</code>, <code>%</code>, <code>*</code>, <code>+</code>, <code>-</code>, <code>.</code>, <code>/</code>, <code>:</code>).</p>
</div></td><td></td></tr><tr><td id='variant.Byte'><code>Byte</code></td><td><div class='docblock'><p>The data contains arbitrary binary data.</p>
</div></td><td></td></tr><tr><td id='variant.Kanji'><code>Kanji</code></td><td><div class='docblock'><p>The data contains Shift-JIS-encoded double-byte text.</p>
</div></td><td></td></tr></table><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-177' class='srclink' href='../../src/qrcode/src/types.rs.html#161-235' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.length_bits_count' class='method'><code>fn <a href='#method.length_bits_count' class='fnname'>length_bits_count</a>(&amp;self, version: <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code></h4>
<div class='docblock'><p>Computes the number of bits needed to encode the data length.</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>types</span>::{<span class='ident'>Version</span>, <span class='ident'>Mode</span>};
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Mode</span>::<span class='ident'>Numeric</span>.<span class='ident'>length_bits_count</span>(<span class='ident'>Version</span>::<span class='ident'>Normal</span>(<span class='number'>1</span>)), <span class='number'>10</span>);</pre>
<p>This method will return <code>Err(QrError::UnsupportedCharacterSet)</code> if the
mode is not supported in the given version.</p>
</div><h4 id='method.data_bits_count' class='method'><code>fn <a href='#method.data_bits_count' class='fnname'>data_bits_count</a>(&amp;self, raw_data_len: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code></h4>
<div class='docblock'><p>Computes the number of bits needed to some data of a given raw length.</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>types</span>::<span class='ident'>Mode</span>;
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Mode</span>::<span class='ident'>Numeric</span>.<span class='ident'>data_bits_count</span>(<span class='number'>7</span>), <span class='number'>24</span>);</pre>
<p>Note that in Kanji mode, the <code>raw_data_len</code> is the number of Kanjis,
i.e. half the total size of bytes.</p>
</div><h4 id='method.max' class='method'><code>fn <a href='#method.max' class='fnname'>max</a>(&amp;self, other: <a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a>) -&gt; <a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a></code></h4>
<div class='docblock'><p>Find the lowest common mode which both modes are compatible with.</p>
<pre class='rust rust-example-rendered'>
<span class='kw'>use</span> <span class='ident'>qrcode</span>::<span class='ident'>types</span>::<span class='ident'>Mode</span>;
<span class='kw'>let</span> <span class='ident'>a</span> <span class='op'>=</span> <span class='ident'>Mode</span>::<span class='ident'>Numeric</span>;
<span class='kw'>let</span> <span class='ident'>b</span> <span class='op'>=</span> <span class='ident'>Mode</span>::<span class='ident'>Kanji</span>;
<span class='kw'>let</span> <span class='ident'>c</span> <span class='op'>=</span> <span class='ident'>a</span>.<span class='ident'>max</span>(<span class='ident'>b</span>);
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>a</span> <span class='op'>&lt;=</span> <span class='ident'>c</span>);
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>b</span> <span class='op'>&lt;=</span> <span class='ident'>c</span>);</pre>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a> for <a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-190' class='srclink' href='../../src/qrcode/src/types.rs.html#237-254' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.partial_cmp' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#tymethod.partial_cmp' class='fnname'>partial_cmp</a>(&amp;self, other: &amp;<a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a>&lt;<a class='enum' href='https://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a>&gt;</code></h4>
<div class='docblock'><p>Defines a partial ordering between modes. If <code>a &lt;= b</code>, then <code>b</code> contains
a superset of all characters supported by <code>a</code>.</p>
</div><h4 id='method.lt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&amp;self, other: &amp;Rhs) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>This method tests less than (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt">Read more</a></p>
</div><h4 id='method.le' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&amp;self, other: &amp;Rhs) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>This method tests less than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&lt;=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le">Read more</a></p>
</div><h4 id='method.gt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&amp;self, other: &amp;Rhs) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>This method tests greater than (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt">Read more</a></p>
</div><h4 id='method.ge' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&amp;self, other: &amp;Rhs) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>This method tests greater than or equal to (for <code>self</code> and <code>other</code>) and is used by the <code>&gt;=</code> operator. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge">Read more</a></p>
</div></div><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-156' class='srclink' href='../../src/qrcode/src/types.rs.html#145' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a></code></h4>
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-159' class='srclink' href='../../src/qrcode/src/types.rs.html#145' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html' title='core::cmp::Eq'>Eq</a> for <a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-160' class='srclink' href='../../src/qrcode/src/types.rs.html#145' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-163' class='srclink' href='../../src/qrcode/src/types.rs.html#145' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, __arg_0: &amp;<a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: &amp;Rhs) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-169' class='srclink' href='../../src/qrcode/src/types.rs.html#145' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='type' href='https://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1,147 @@
<!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 `QrError` enum in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, QrError">
<title>qrcode::types::QrError - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>types</a></p><script>window.sidebarCurrent = {name: 'QrError', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content enum">
<h1 class='fqn'><span class='in-band'>Enum <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>types</a>::<wbr><a class='enum' href=''>QrError</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-12' class='srclink' href='../../src/qrcode/src/types.rs.html#10-27' title='goto source code'>[src]</a></span></h1>
<pre class='rust enum'>pub enum QrError {
DataTooLong,
InvalidVersion,
UnsupportedCharacterSet,
InvalidEciDesignator,
InvalidCharacter,
}</pre><div class='docblock'><p><code>QrError</code> encodes the error encountered when generating a QR code.</p>
</div><h2 class='variants'>Variants</h2>
<table class='variants_table'><tr><td id='variant.DataTooLong'><code>DataTooLong</code></td><td><div class='docblock'><p>The data is too long to encode into a QR code for the given version.</p>
</div></td><td></td></tr><tr><td id='variant.InvalidVersion'><code>InvalidVersion</code></td><td><div class='docblock'><p>The provided version / error correction level combination is invalid.</p>
</div></td><td></td></tr><tr><td id='variant.UnsupportedCharacterSet'><code>UnsupportedCharacterSet</code></td><td><div class='docblock'><p>Some characters in the data cannot be supported by the provided QR code
version.</p>
</div></td><td></td></tr><tr><td id='variant.InvalidEciDesignator'><code>InvalidEciDesignator</code></td><td><div class='docblock'><p>The provided ECI designator is invalid. A valid designator should be
between 0 and 999999.</p>
</div></td><td></td></tr><tr><td id='variant.InvalidCharacter'><code>InvalidCharacter</code></td><td><div class='docblock'><p>A character not belonging to the character set is found.</p>
</div></td><td></td></tr></table><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html' title='core::fmt::Display'>Display</a> for <a class='enum' href='../../qrcode/types/enum.QrError.html' title='qrcode::types::QrError'>QrError</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-40' class='srclink' href='../../src/qrcode/src/types.rs.html#29-40' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, fmt: &amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.tuple.html'>()</a>, <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Error.html' title='core::fmt::Error'>Error</a>&gt;</code></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='enum' href='../../qrcode/types/enum.QrError.html' title='qrcode::types::QrError'>QrError</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-18' class='srclink' href='../../src/qrcode/src/types.rs.html#9' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='enum' href='../../qrcode/types/enum.QrError.html' title='qrcode::types::QrError'>QrError</a></code></h4>
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='enum' href='../../qrcode/types/enum.QrError.html' title='qrcode::types::QrError'>QrError</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-21' class='srclink' href='../../src/qrcode/src/types.rs.html#9' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html' title='core::cmp::Eq'>Eq</a> for <a class='enum' href='../../qrcode/types/enum.QrError.html' title='qrcode::types::QrError'>QrError</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-22' class='srclink' href='../../src/qrcode/src/types.rs.html#9' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='enum' href='../../qrcode/types/enum.QrError.html' title='qrcode::types::QrError'>QrError</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-25' class='srclink' href='../../src/qrcode/src/types.rs.html#9' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, __arg_0: &amp;<a class='enum' href='../../qrcode/types/enum.QrError.html' title='qrcode::types::QrError'>QrError</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, other: &amp;Rhs) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='enum' href='../../qrcode/types/enum.QrError.html' title='qrcode::types::QrError'>QrError</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-31' class='srclink' href='../../src/qrcode/src/types.rs.html#9' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt-1' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='type' href='https://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1,160 @@
<!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 `Version` enum in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Version">
<title>qrcode::types::Version - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>types</a></p><script>window.sidebarCurrent = {name: 'Version', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content enum">
<h1 class='fqn'><span class='in-band'>Enum <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>types</a>::<wbr><a class='enum' href=''>Version</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-89' class='srclink' href='../../src/qrcode/src/types.rs.html#77-83' title='goto source code'>[src]</a></span></h1>
<pre class='rust enum'>pub enum Version {
Normal(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i16.html'>i16</a>),
Micro(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i16.html'>i16</a>),
}</pre><div class='docblock'><p>In QR code terminology, <code>Version</code> means the size of the generated image.
Larger version means the size of code is larger, and therefore can carry
more information.</p>
<p>The smallest version is <code>Version::Normal(1)</code> of size 21×21, and the largest
is <code>Version::Normal(40)</code> of size 177×177.</p>
</div><h2 class='variants'>Variants</h2>
<table class='variants_table'><tr><td id='variant.Normal'><code>Normal</code></td><td><div class='docblock'><p>A normal QR code version. The parameter should be between 1 and 40.</p>
</div></td><td></td></tr><tr><td id='variant.Micro'><code>Micro</code></td><td><div class='docblock'><p>A Micro QR code version. The parameter should be between 1 and 4.</p>
</div></td><td></td></tr></table><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-132' class='srclink' href='../../src/qrcode/src/types.rs.html#85-137' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.width' class='method'><code>fn <a href='#method.width' class='fnname'>width</a>(&amp;self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i16.html'>i16</a></code></h4>
<div class='docblock'><p>Get the number of &quot;modules&quot; on each size of the QR code, i.e. the width
and height of the code.</p>
</div><h4 id='method.fetch' class='method'><code>fn <a href='#method.fetch' class='fnname'>fetch</a>&lt;T&gt;(&amp;self, ec_level: <a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>, table: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&amp;[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.array.html'>[</a>T<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.array.html'>; 4]</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>) -&gt; <a class='type' href='../../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a>&lt;T&gt; <span class='where'>where T: <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> + <a class='trait' href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html' title='core::default::Default'>Default</a> + <a class='trait' href='https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a></span></code></h4>
<div class='docblock'><p>Obtains an object from a hard-coded table.</p>
<p>The table must be a 44×4 array. The outer array represents the content
for each version. The first 40 entry corresponds to QR code versions 1
to 40, and the last 4 corresponds to Micro QR code version 1 to 4. The
inner array represents the content in each error correction level, in
the order [L, M, Q, H].</p>
<p>If the entry compares equal to the default value of T, this method
returns <code>Err(QrError::InvalidVersion)</code>.</p>
</div><h4 id='method.mode_bits_count' class='method'><code>fn <a href='#method.mode_bits_count' class='fnname'>mode_bits_count</a>(&amp;self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code></h4>
<div class='docblock'><p>The number of bits needed to encode the mode indicator.</p>
</div><h4 id='method.is_micro' class='method'><code>fn <a href='#method.is_micro' class='fnname'>is_micro</a>(&amp;self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>Checks whether is version refers to a Micro QR code.</p>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-94' class='srclink' href='../../src/qrcode/src/types.rs.html#76' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a></code></h4>
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-99' class='srclink' href='../../src/qrcode/src/types.rs.html#76' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html' title='core::cmp::Eq'>Eq</a> for <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-100' class='srclink' href='../../src/qrcode/src/types.rs.html#76' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-105' class='srclink' href='../../src/qrcode/src/types.rs.html#76' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, __arg_0: &amp;<a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
</div><h4 id='method.ne' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, __arg_0: &amp;<a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
<div class='docblock'><p>This method tests for <code>!=</code>.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-124' class='srclink' href='../../src/qrcode/src/types.rs.html#76' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -&gt; <a class='type' href='https://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

154
qrcode/types/index.html Normal file
View file

@ -0,0 +1,154 @@
<!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 `types` mod in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, types">
<title>qrcode::types - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a></p><script>window.sidebarCurrent = {name: 'types', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content mod">
<h1 class='fqn'><span class='in-band'>Module <a href='../index.html'>qrcode</a>::<wbr><a class='mod' href=''>types</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-7' class='srclink' href='../../src/qrcode/src/types.rs.html#1-278' title='goto source code'>[src]</a></span></h1>
<h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
<table>
<tr class=' module-item'>
<td><a class='enum' href='enum.EcLevel.html'
title='qrcode::types::EcLevel'>EcLevel</a></td>
<td class='docblock short'>
<p>The error correction level. It allows the original information be recovered
even if parts of the code is damaged.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class='enum' href='enum.Mode.html'
title='qrcode::types::Mode'>Mode</a></td>
<td class='docblock short'>
<p>The mode indicator, which specifies the character set of the encoded data.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class='enum' href='enum.QrError.html'
title='qrcode::types::QrError'>QrError</a></td>
<td class='docblock short'>
<p><code>QrError</code> encodes the error encountered when generating a QR code.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class='enum' href='enum.Version.html'
title='qrcode::types::Version'>Version</a></td>
<td class='docblock short'>
<p>In QR code terminology, <code>Version</code> means the size of the generated image.
Larger version means the size of code is larger, and therefore can carry
more information.</p>
</td>
</tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
<table>
<tr class=' module-item'>
<td><a class='type' href='type.QrResult.html'
title='qrcode::types::QrResult'>QrResult</a></td>
<td class='docblock short'>
<p><code>QrResult</code> is a convenient alias for a QR code generation result.</p>
</td>
</tr></table></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View file

@ -0,0 +1 @@
initSidebarItems({"enum":[["EcLevel","The error correction level. It allows the original information be recovered even if parts of the code is damaged."],["Mode","The mode indicator, which specifies the character set of the encoded data."],["QrError","`QrError` encodes the error encountered when generating a QR code."],["Version","In QR code terminology, `Version` means the size of the generated image. Larger version means the size of code is larger, and therefore can carry more information."]],"type":[["QrResult","`QrResult` is a convenient alias for a QR code generation result."]]});

View file

@ -0,0 +1,115 @@
<!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 `QrResult` type in crate `qrcode`.">
<meta name="keywords" content="rust, rustlang, rust-lang, QrResult">
<title>qrcode::types::QrResult - Rust</title>
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>types</a></p><script>window.sidebarCurrent = {name: 'QrResult', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content type">
<h1 class='fqn'><span class='in-band'><a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>types</a>::<wbr><a class='type' href=''>QrResult</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-45' class='srclink' href='../../src/qrcode/src/types.rs.html#43' title='goto source code'>[src]</a></span></h1>
<pre class='rust typedef'>type QrResult&lt;T&gt; = <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a>&lt;T, <a class='enum' href='../../qrcode/types/enum.QrError.html' title='qrcode::types::QrError'>QrError</a>&gt;;</pre><div class='docblock'><p><code>QrResult</code> is a convenient alias for a QR code generation result.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../jquery.js"></script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

717
rustdoc.css Normal file
View file

@ -0,0 +1,717 @@
/**
* Copyright 2013 The Rust Project Developers. See the COPYRIGHT
* file at the top-level directory of this distribution and at
* http://rust-lang.org/COPYRIGHT.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
* http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
* <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
* option. This file may not be copied, modified, or distributed
* except according to those terms.
*/
/* See FiraSans-LICENSE.txt for the Fira Sans license. */
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 400;
src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff');
}
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 500;
src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff');
}
/* See SourceSerifPro-LICENSE.txt for the Source Serif Pro license and
* Heuristica-LICENSE.txt for the Heuristica license. */
@font-face {
font-family: 'Source Serif Pro';
font-style: normal;
font-weight: 400;
src: local('Source Serif Pro'), url("SourceSerifPro-Regular.woff") format('woff');
}
@font-face {
font-family: 'Source Serif Pro';
font-style: italic;
font-weight: 400;
src: url("Heuristica-Italic.woff") format('woff');
}
@font-face {
font-family: 'Source Serif Pro';
font-style: normal;
font-weight: 700;
src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.woff") format('woff');
}
/* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 400;
src: local('Source Code Pro'), url("SourceCodePro-Regular.woff") format('woff');
}
@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 600;
src: local('Source Code Pro Semibold'), url("SourceCodePro-Semibold.woff") format('woff');
}
@import "normalize.css";
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* General structure and fonts */
body {
font: 16px/1.4 "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
margin: 0;
position: relative;
padding: 10px 15px 20px 15px;
-webkit-font-feature-settings: "kern", "liga";
-moz-font-feature-settings: "kern", "liga";
font-feature-settings: "kern", "liga";
}
h1 {
font-size: 1.5em;
}
h2 {
font-size: 1.4em;
}
h3 {
font-size: 1.3em;
}
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
font-weight: 500;
margin: 20px 0 15px 0;
padding-bottom: 6px;
}
h1.fqn {
border-bottom: 1px dashed;
margin-top: 0;
position: relative;
}
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
border-bottom: 1px solid;
}
h3.impl, h3.method, h4.method, h3.type, h4.type {
font-weight: 600;
margin-top: 10px;
margin-bottom: 10px;
position: relative;
}
h3.impl, h3.method, h3.type {
margin-top: 15px;
}
h1, h2, h3, h4, .sidebar, a.source, .search-input, .content table :not(code)>a, .collapse-toggle {
font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
ol, ul {
padding-left: 25px;
}
ul ul, ol ul, ul ol, ol ol {
margin-bottom: 0;
}
p {
margin: 0 0 .6em 0;
}
code, pre {
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
white-space: pre-wrap;
}
.docblock code {
border-radius: 3px;
padding: 0 0.2em;
}
.docblock pre code {
padding: 0;
}
pre {
padding: 14px;
}
.source pre {
padding: 20px;
}
img {
max-width: 100%;
}
.content.source {
margin-top: 50px;
max-width: none;
overflow: visible;
margin-left: 0px;
min-width: 70em;
}
nav.sub {
font-size: 16px;
text-transform: uppercase;
}
.sidebar {
width: 200px;
position: absolute;
left: 0;
top: 0;
min-height: 100%;
}
.content, nav { max-width: 960px; }
/* Everything else */
.js-only, .hidden { display: none !important; }
.sidebar {
padding: 10px;
}
.sidebar img {
margin: 20px auto;
display: block;
}
.sidebar .location {
font-size: 17px;
margin: 30px 0 20px 0;
text-align: center;
}
.location a:first-child { font-weight: 500; }
.block {
padding: 0 10px;
margin-bottom: 14px;
}
.block h2, .block h3 {
margin-top: 0;
margin-bottom: 8px;
text-align: center;
}
.block ul, .block li {
margin: 0;
padding: 0;
list-style: none;
}
.block a {
display: block;
text-overflow: ellipsis;
overflow: hidden;
line-height: 15px;
padding: 7px 5px;
font-size: 14px;
font-weight: 300;
transition: border 500ms ease-out;
}
.content {
padding: 15px 0;
}
.content.source pre.rust {
white-space: pre;
overflow: auto;
padding-left: 0;
}
.content pre.line-numbers {
float: left;
border: none;
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.line-numbers span { cursor: pointer; }
.docblock.short p {
display: inline;
}
.docblock.short.nowrap {
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.docblock.short p {
overflow: hidden;
text-overflow: ellipsis;
margin: 0;
}
.docblock.short code { white-space: nowrap; }
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
border-bottom: 1px solid;
}
.docblock h1 { font-size: 1.3em; }
.docblock h2 { font-size: 1.15em; }
.docblock h3, .docblock h4, .docblock h5 { font-size: 1em; }
.content .out-of-band {
font-size: 23px;
margin: 0px;
padding: 0px;
text-align: right;
display: inline-block;
font-weight: normal;
position: absolute;
right: 0;
}
h3.impl > .out-of-band {
font-size: 21px;
}
h4 > code, h3 > code {
position: inherit;
}
.in-band, code {
z-index: 5;
}
.content .in-band {
margin: 0px;
padding: 0px;
display: inline-block;
}
#main { position: relative; }
#main > .since {
top: inherit;
font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.content table {
border-spacing: 0 5px;
border-collapse: separate;
}
.content td { vertical-align: top; }
.content td:first-child { padding-right: 20px; }
.content td p:first-child { margin-top: 0; }
.content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
.docblock table {
border: 1px solid;
margin: .5em 0;
border-collapse: collapse;
width: 100%;
}
.docblock table td {
padding: .5em;
border-top: 1px dashed;
border-bottom: 1px dashed;
}
.docblock table th {
padding: .5em;
text-align: left;
border-top: 1px solid;
border-bottom: 1px solid;
}
.content .item-list {
list-style-type: none;
padding: 0;
}
.content .item-list li { margin-bottom: 3px; }
.content .multi-column {
-moz-column-count: 5;
-moz-column-gap: 2.5em;
-webkit-column-count: 5;
-webkit-column-gap: 2.5em;
column-count: 5;
column-gap: 2.5em;
}
.content .multi-column li { width: 100%; display: inline-block; }
.content .method {
font-size: 1em;
position: relative;
}
/* Shift "where ..." part of method or fn definition down a line */
.content .method .where, .content .fn .where { display: block; }
/* Bit of whitespace to indent it */
.content .method .where::before, .content .fn .where::before { content: ' '; }
.content .methods > div { margin-left: 40px; }
.content .impl-items .docblock, .content .impl-items .stability {
margin-left: 40px;
}
.content .impl-items .method, .content .impl-items > .type {
margin-left: 20px;
}
.content .stability code {
font-size: 90%;
}
nav {
border-bottom: 1px solid;
padding-bottom: 10px;
margin-bottom: 10px;
}
nav.main {
padding: 20px 0;
text-align: center;
}
nav.main .current {
border-top: 1px solid;
border-bottom: 1px solid;
}
nav.main .separator {
border: 1px solid;
display: inline-block;
height: 23px;
margin: 0 20px;
}
nav.sum { text-align: right; }
nav.sub form { display: inline; }
nav.sub, .content {
margin-left: 230px;
}
a {
text-decoration: none;
background: transparent;
}
.docblock a:hover, .stability a {
text-decoration: underline;
}
.content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; }
.content span.struct, .content a.struct, .block a.current.struct { color: #df3600; }
.content a.type { color: #e57300; }
.content a.macro { color: #068000; }
.block a.current.crate { font-weight: 500; }
.search-input {
width: 100%;
/* Override Normalize.css: we have margins and do
not want to overflow - the `moz` attribute is necessary
until Firefox 29, too early to drop at this point */
-moz-box-sizing: border-box !important;
box-sizing: border-box !important;
outline: none;
border: none;
border-radius: 1px;
margin-top: 5px;
padding: 10px 16px;
font-size: 17px;
transition: border-color 300ms ease;
transition: border-radius 300ms ease-in-out;
transition: box-shadow 300ms ease-in-out;
}
.search-input:focus {
border-color: #66afe9;
border-radius: 2px;
border: 0;
outline: 0;
box-shadow: 0 0 8px #078dd8;
}
.search-results .desc {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: block;
}
.search-results a {
display: block;
}
.content .search-results td:first-child { padding-right: 0; }
.content .search-results td:first-child a { padding-right: 10px; }
tr.result span.primitive::after { content: ' (primitive type)'; font-style: italic; }
body.blur > :not(#help) {
filter: blur(8px);
-webkit-filter: blur(8px);
opacity: .7;
}
#help {
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
}
#help > div {
flex: 0 0 auto;
background: #e9e9e9;
box-shadow: 0 0 6px rgba(0,0,0,.2);
width: 550px;
height: 330px;
border: 1px solid #bfbfbf;
}
#help dt {
float: left;
border-radius: 4px;
border: 1px solid #bfbfbf;
background: #fff;
width: 23px;
text-align: center;
clear: left;
display: block;
margin-top: -1px;
}
#help dd { margin: 5px 33px; }
#help .infos { padding-left: 0; }
#help h1, #help h2 { margin-top: 0; }
#help > div div {
width: 50%;
float: left;
padding: 20px;
}
em.stab {
display: inline-block;
border-width: 1px;
border-style: solid;
padding: 3px;
margin-bottom: 5px;
font-size: 90%;
font-style: normal;
}
em.stab p {
display: inline;
}
.module-item .stab {
border-width: 0;
padding: 0;
margin: 0;
background: inherit !important;
}
.module-item.unstable {
opacity: 0.65;
}
.since {
font-weight: normal;
font-size: initial;
color: grey;
position: absolute;
right: 0;
top: 0;
}
.variants_table {
width: 100%;
}
.variants_table tbody tr td:first-child {
width: 1%; /* make the variant name as small as possible */
}
td.summary-column {
width: 100%;
}
.summary {
padding-right: 0px;
}
.line-numbers :target { background-color: transparent; }
/* Code highlighting */
pre.rust .kw { color: #8959A8; }
pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
pre.rust .number, pre.rust .string { color: #718C00; }
pre.rust .self, pre.rust .boolval, pre.rust .prelude-val,
pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
pre.rust .lifetime { color: #B76514; }
.rusttest { display: none; }
pre.rust { position: relative; }
a.test-arrow {
display: inline-block;
position: absolute;
background-color: #4e8bca;
padding: 5px 10px 5px 10px;
border-radius: 5px;
font-size: 130%;
top: 5px;
right: 5px;
}
.methods .section-header {
/* Override parent class attributes. */
border-bottom: none !important;
font-size: 1.1em !important;
margin: 0 0 -5px;
padding: 0;
}
.section-header:hover a:after {
content: '\2002\00a7\2002';
}
.section-header:hover a {
text-decoration: none;
}
.section-header a {
color: inherit;
}
.collapse-toggle {
font-weight: 300;
position: absolute;
left: -23px;
color: #999;
top: 0;
}
.toggle-wrapper > .collapse-toggle {
left: -24px;
margin-top: 0px;
}
.toggle-wrapper {
position: relative;
}
.toggle-wrapper.collapsed {
height: 1em;
transition: height .2s;
}
.collapse-toggle > .inner {
display: inline-block;
width: 1.2ch;
text-align: center;
}
.toggle-label {
color: #999;
}
.ghost {
display: none;
}
.ghost + .since {
position: initial;
display: table-cell;
}
.since + .srclink {
display: table-cell;
padding-left: 10px;
}
span.since {
position: initial;
font-size: 20px;
margin-right: 5px;
}
:target > code {
background: #FDFFD3;
}
/* Media Queries */
@media (max-width: 700px) {
body {
padding-top: 0px;
}
.sidebar {
height: 40px;
min-height: 40px;
width: 100%;
margin: 0px;
padding: 0px;
position: static;
}
.sidebar .location {
float: right;
margin: 0px;
padding: 3px 10px 1px 10px;
min-height: 39px;
background: inherit;
text-align: left;
font-size: 24px;
}
.sidebar .location:empty {
padding: 0;
}
.sidebar img {
width: 35px;
margin-top: 5px;
margin-bottom: 0px;
float: left;
}
nav.sub {
margin: 0 auto;
}
.sidebar .block {
display: none;
}
.content {
margin-left: 0px;
}
.content .in-band {
width: 100%;
}
.content .out-of-band {
display: none;
}
.toggle-wrapper > .collapse-toggle {
left: 0px;
}
.toggle-wrapper {
height: 1.5em;
}
}
@media print {
nav.sub, .content .out-of-band, .collapse-toggle {
display: none;
}
}

8
search-index.js Normal file

File diff suppressed because one or more lines are too long

1930
src/qrcode/src/bits.rs.html Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

1030
src/qrcode/src/ec.rs.html Normal file

File diff suppressed because it is too large Load diff

640
src/qrcode/src/lib.rs.html Normal file
View file

@ -0,0 +1,640 @@
<!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="Source to the Rust file `src/lib.rs`.">
<meta name="keywords" content="rust, rustlang, rust-lang">
<title>lib.rs.html -- source</title>
<link rel="stylesheet" type="text/css" href="../../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content source"><pre class="line-numbers"><span id="1"> 1</span>
<span id="2"> 2</span>
<span id="3"> 3</span>
<span id="4"> 4</span>
<span id="5"> 5</span>
<span id="6"> 6</span>
<span id="7"> 7</span>
<span id="8"> 8</span>
<span id="9"> 9</span>
<span id="10"> 10</span>
<span id="11"> 11</span>
<span id="12"> 12</span>
<span id="13"> 13</span>
<span id="14"> 14</span>
<span id="15"> 15</span>
<span id="16"> 16</span>
<span id="17"> 17</span>
<span id="18"> 18</span>
<span id="19"> 19</span>
<span id="20"> 20</span>
<span id="21"> 21</span>
<span id="22"> 22</span>
<span id="23"> 23</span>
<span id="24"> 24</span>
<span id="25"> 25</span>
<span id="26"> 26</span>
<span id="27"> 27</span>
<span id="28"> 28</span>
<span id="29"> 29</span>
<span id="30"> 30</span>
<span id="31"> 31</span>
<span id="32"> 32</span>
<span id="33"> 33</span>
<span id="34"> 34</span>
<span id="35"> 35</span>
<span id="36"> 36</span>
<span id="37"> 37</span>
<span id="38"> 38</span>
<span id="39"> 39</span>
<span id="40"> 40</span>
<span id="41"> 41</span>
<span id="42"> 42</span>
<span id="43"> 43</span>
<span id="44"> 44</span>
<span id="45"> 45</span>
<span id="46"> 46</span>
<span id="47"> 47</span>
<span id="48"> 48</span>
<span id="49"> 49</span>
<span id="50"> 50</span>
<span id="51"> 51</span>
<span id="52"> 52</span>
<span id="53"> 53</span>
<span id="54"> 54</span>
<span id="55"> 55</span>
<span id="56"> 56</span>
<span id="57"> 57</span>
<span id="58"> 58</span>
<span id="59"> 59</span>
<span id="60"> 60</span>
<span id="61"> 61</span>
<span id="62"> 62</span>
<span id="63"> 63</span>
<span id="64"> 64</span>
<span id="65"> 65</span>
<span id="66"> 66</span>
<span id="67"> 67</span>
<span id="68"> 68</span>
<span id="69"> 69</span>
<span id="70"> 70</span>
<span id="71"> 71</span>
<span id="72"> 72</span>
<span id="73"> 73</span>
<span id="74"> 74</span>
<span id="75"> 75</span>
<span id="76"> 76</span>
<span id="77"> 77</span>
<span id="78"> 78</span>
<span id="79"> 79</span>
<span id="80"> 80</span>
<span id="81"> 81</span>
<span id="82"> 82</span>
<span id="83"> 83</span>
<span id="84"> 84</span>
<span id="85"> 85</span>
<span id="86"> 86</span>
<span id="87"> 87</span>
<span id="88"> 88</span>
<span id="89"> 89</span>
<span id="90"> 90</span>
<span id="91"> 91</span>
<span id="92"> 92</span>
<span id="93"> 93</span>
<span id="94"> 94</span>
<span id="95"> 95</span>
<span id="96"> 96</span>
<span id="97"> 97</span>
<span id="98"> 98</span>
<span id="99"> 99</span>
<span id="100">100</span>
<span id="101">101</span>
<span id="102">102</span>
<span id="103">103</span>
<span id="104">104</span>
<span id="105">105</span>
<span id="106">106</span>
<span id="107">107</span>
<span id="108">108</span>
<span id="109">109</span>
<span id="110">110</span>
<span id="111">111</span>
<span id="112">112</span>
<span id="113">113</span>
<span id="114">114</span>
<span id="115">115</span>
<span id="116">116</span>
<span id="117">117</span>
<span id="118">118</span>
<span id="119">119</span>
<span id="120">120</span>
<span id="121">121</span>
<span id="122">122</span>
<span id="123">123</span>
<span id="124">124</span>
<span id="125">125</span>
<span id="126">126</span>
<span id="127">127</span>
<span id="128">128</span>
<span id="129">129</span>
<span id="130">130</span>
<span id="131">131</span>
<span id="132">132</span>
<span id="133">133</span>
<span id="134">134</span>
<span id="135">135</span>
<span id="136">136</span>
<span id="137">137</span>
<span id="138">138</span>
<span id="139">139</span>
<span id="140">140</span>
<span id="141">141</span>
<span id="142">142</span>
<span id="143">143</span>
<span id="144">144</span>
<span id="145">145</span>
<span id="146">146</span>
<span id="147">147</span>
<span id="148">148</span>
<span id="149">149</span>
<span id="150">150</span>
<span id="151">151</span>
<span id="152">152</span>
<span id="153">153</span>
<span id="154">154</span>
<span id="155">155</span>
<span id="156">156</span>
<span id="157">157</span>
<span id="158">158</span>
<span id="159">159</span>
<span id="160">160</span>
<span id="161">161</span>
<span id="162">162</span>
<span id="163">163</span>
<span id="164">164</span>
<span id="165">165</span>
<span id="166">166</span>
<span id="167">167</span>
<span id="168">168</span>
<span id="169">169</span>
<span id="170">170</span>
<span id="171">171</span>
<span id="172">172</span>
<span id="173">173</span>
<span id="174">174</span>
<span id="175">175</span>
<span id="176">176</span>
<span id="177">177</span>
<span id="178">178</span>
<span id="179">179</span>
<span id="180">180</span>
<span id="181">181</span>
<span id="182">182</span>
<span id="183">183</span>
<span id="184">184</span>
<span id="185">185</span>
<span id="186">186</span>
<span id="187">187</span>
<span id="188">188</span>
<span id="189">189</span>
<span id="190">190</span>
<span id="191">191</span>
<span id="192">192</span>
<span id="193">193</span>
<span id="194">194</span>
<span id="195">195</span>
<span id="196">196</span>
<span id="197">197</span>
<span id="198">198</span>
<span id="199">199</span>
<span id="200">200</span>
<span id="201">201</span>
<span id="202">202</span>
<span id="203">203</span>
<span id="204">204</span>
<span id="205">205</span>
<span id="206">206</span>
<span id="207">207</span>
<span id="208">208</span>
<span id="209">209</span>
<span id="210">210</span>
<span id="211">211</span>
<span id="212">212</span>
<span id="213">213</span>
<span id="214">214</span>
<span id="215">215</span>
<span id="216">216</span>
<span id="217">217</span>
<span id="218">218</span>
<span id="219">219</span>
<span id="220">220</span>
<span id="221">221</span>
<span id="222">222</span>
<span id="223">223</span>
<span id="224">224</span>
<span id="225">225</span>
<span id="226">226</span>
<span id="227">227</span>
<span id="228">228</span>
<span id="229">229</span>
<span id="230">230</span>
<span id="231">231</span>
<span id="232">232</span>
<span id="233">233</span>
<span id="234">234</span>
<span id="235">235</span>
<span id="236">236</span>
<span id="237">237</span>
<span id="238">238</span>
<span id="239">239</span>
<span id="240">240</span>
<span id="241">241</span>
<span id="242">242</span>
<span id="243">243</span>
<span id="244">244</span>
<span id="245">245</span>
<span id="246">246</span>
<span id="247">247</span>
<span id="248">248</span>
<span id="249">249</span>
<span id="250">250</span>
<span id="251">251</span>
<span id="252">252</span>
<span id="253">253</span>
<span id="254">254</span>
<span id="255">255</span>
<span id="256">256</span>
<span id="257">257</span>
<span id="258">258</span>
<span id="259">259</span>
<span id="260">260</span>
<span id="261">261</span>
<span id="262">262</span>
<span id="263">263</span>
<span id="264">264</span>
<span id="265">265</span>
</pre><pre class='rust '>
<span class='doccomment'>//! QRCode encoder</span>
<span class='doccomment'>//!</span>
<span class='doccomment'>//! This crate provides a QR code and Micro QR code encoder for binary data.</span>
<span class='doccomment'>//!</span>
<span class='doccomment'>//! use qrcode::QrCode;</span>
<span class='doccomment'>//!</span>
<span class='doccomment'>//! let code = QrCode::new(b&quot;Some content here.&quot;);</span>
<span class='doccomment'>//! match code {</span>
<span class='doccomment'>//! Err(err) =&gt; panic!(&quot;Failed to encode the QR code: {:?}&quot;, err),</span>
<span class='doccomment'>//! Ok(code) =&gt; {</span>
<span class='doccomment'>//! for y in 0 .. code.width() {</span>
<span class='doccomment'>//! for x in 0 .. code.width() {</span>
<span class='doccomment'>//! let color = if code[(x, y)] { &quot;black&quot; } else { &quot;white&quot; };</span>
<span class='doccomment'>//! // render color at position (x, y)</span>
<span class='doccomment'>//! }</span>
<span class='doccomment'>//! }</span>
<span class='doccomment'>//! }</span>
<span class='doccomment'>//! }</span>
<span class='doccomment'>//!</span>
<span class='attribute'>#<span class='op'>!</span>[<span class='ident'>cfg_attr</span>(<span class='ident'>feature</span><span class='op'>=</span><span class='string'>&quot;bench&quot;</span>, <span class='ident'>feature</span>(<span class='ident'>test</span>))]</span> <span class='comment'>// Unstable libraries</span>
<span class='attribute'>#[<span class='ident'>cfg</span>(<span class='ident'>feature</span><span class='op'>=</span><span class='string'>&quot;bench&quot;</span>)]</span>
<span class='kw'>extern</span> <span class='kw'>crate</span> <span class='ident'>test</span>;
<span class='kw'>extern</span> <span class='kw'>crate</span> <span class='ident'>num</span>;
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>ops</span>::<span class='ident'>Index</span>;
<span class='kw'>pub</span> <span class='kw'>use</span> <span class='ident'>types</span>::{<span class='ident'>QrResult</span>, <span class='ident'>EcLevel</span>, <span class='ident'>Version</span>};
<span class='kw'>pub</span> <span class='kw'>mod</span> <span class='ident'>types</span>;
<span class='kw'>pub</span> <span class='kw'>mod</span> <span class='ident'>bits</span>;
<span class='kw'>pub</span> <span class='kw'>mod</span> <span class='ident'>optimize</span>;
<span class='kw'>pub</span> <span class='kw'>mod</span> <span class='ident'>ec</span>;
<span class='kw'>pub</span> <span class='kw'>mod</span> <span class='ident'>canvas</span>;
<span class='doccomment'>/// The encoded QR code symbol.</span>
<span class='attribute'>#[<span class='ident'>derive</span>(<span class='ident'>Clone</span>)]</span>
<span class='kw'>pub</span> <span class='kw'>struct</span> <span class='ident'>QrCode</span> {
<span class='ident'>content</span>: <span class='ident'>Vec</span><span class='op'>&lt;</span><span class='ident'>bool</span><span class='op'>&gt;</span>,
<span class='ident'>version</span>: <span class='ident'>Version</span>,
<span class='ident'>ec_level</span>: <span class='ident'>EcLevel</span>,
<span class='ident'>width</span>: <span class='ident'>usize</span>,
}
<span class='kw'>impl</span> <span class='ident'>QrCode</span> {
<span class='doccomment'>/// Constructs a new QR code which automatically encodes the given data.</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// This method uses the &quot;medium&quot; error correction level and automatically</span>
<span class='doccomment'>/// chooses the smallest QR code.</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// use qrcode::QrCode;</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// let code = QrCode::new(b&quot;Some data&quot;).unwrap();</span>
<span class='doccomment'>///</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>new</span><span class='op'>&lt;</span><span class='ident'>D</span>: <span class='ident'>AsRef</span><span class='op'>&lt;</span>[<span class='ident'>u8</span>]<span class='op'>&gt;&gt;</span>(<span class='ident'>data</span>: <span class='ident'>D</span>) <span class='op'>-&gt;</span> <span class='ident'>QrResult</span><span class='op'>&lt;</span><span class='ident'>QrCode</span><span class='op'>&gt;</span> {
<span class='ident'>QrCode</span>::<span class='ident'>with_error_correction_level</span>(<span class='ident'>data</span>, <span class='ident'>EcLevel</span>::<span class='ident'>M</span>)
}
<span class='doccomment'>/// Constructs a new QR code which automatically encodes the given data at a</span>
<span class='doccomment'>/// specific error correction level.</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// This method automatically chooses the smallest QR code.</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// use qrcode::{QrCode, EcLevel};</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// let code = QrCode::with_error_correction_level(b&quot;Some data&quot;, EcLevel::H).unwrap();</span>
<span class='doccomment'>///</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>with_error_correction_level</span><span class='op'>&lt;</span><span class='ident'>D</span>: <span class='ident'>AsRef</span><span class='op'>&lt;</span>[<span class='ident'>u8</span>]<span class='op'>&gt;&gt;</span>(<span class='ident'>data</span>: <span class='ident'>D</span>, <span class='ident'>ec_level</span>: <span class='ident'>EcLevel</span>) <span class='op'>-&gt;</span> <span class='ident'>QrResult</span><span class='op'>&lt;</span><span class='ident'>QrCode</span><span class='op'>&gt;</span> {
<span class='kw'>let</span> <span class='ident'>bits</span> <span class='op'>=</span> <span class='macro'>try</span><span class='macro'>!</span>(<span class='ident'>bits</span>::<span class='ident'>encode_auto</span>(<span class='ident'>data</span>.<span class='ident'>as_ref</span>(), <span class='ident'>ec_level</span>));
<span class='ident'>QrCode</span>::<span class='ident'>with_bits</span>(<span class='ident'>bits</span>, <span class='ident'>ec_level</span>)
}
<span class='doccomment'>/// Constructs a new QR code for the given version and error correction</span>
<span class='doccomment'>/// level.</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// use qrcode::{QrCode, Version, EcLevel};</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// let code = QrCode::with_version(b&quot;Some data&quot;, Version::Normal(5), EcLevel::M).unwrap();</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// This method can also be used to generate Micro QR code.</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// use qrcode::{QrCode, Version, EcLevel};</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// let micro_code = QrCode::with_version(b&quot;123&quot;, Version::Micro(1), EcLevel::L).unwrap();</span>
<span class='doccomment'>///</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>with_version</span><span class='op'>&lt;</span><span class='ident'>D</span>: <span class='ident'>AsRef</span><span class='op'>&lt;</span>[<span class='ident'>u8</span>]<span class='op'>&gt;&gt;</span>(<span class='ident'>data</span>: <span class='ident'>D</span>, <span class='ident'>version</span>: <span class='ident'>Version</span>, <span class='ident'>ec_level</span>: <span class='ident'>EcLevel</span>) <span class='op'>-&gt;</span> <span class='ident'>QrResult</span><span class='op'>&lt;</span><span class='ident'>QrCode</span><span class='op'>&gt;</span> {
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>bits</span> <span class='op'>=</span> <span class='ident'>bits</span>::<span class='ident'>Bits</span>::<span class='ident'>new</span>(<span class='ident'>version</span>);
<span class='macro'>try</span><span class='macro'>!</span>(<span class='ident'>bits</span>.<span class='ident'>push_optimal_data</span>(<span class='ident'>data</span>.<span class='ident'>as_ref</span>()));
<span class='macro'>try</span><span class='macro'>!</span>(<span class='ident'>bits</span>.<span class='ident'>push_terminator</span>(<span class='ident'>ec_level</span>));
<span class='ident'>QrCode</span>::<span class='ident'>with_bits</span>(<span class='ident'>bits</span>, <span class='ident'>ec_level</span>)
}
<span class='doccomment'>/// Constructs a new QR code with encoded bits.</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// Use this method only if there are very special need to manipulate the</span>
<span class='doccomment'>/// raw bits before encoding. Some examples are:</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// * Encode data using specific character set with ECI</span>
<span class='doccomment'>/// * Use the FNC1 modes</span>
<span class='doccomment'>/// * Avoid the optimal segmentation algorithm</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// See the `Bits` structure for detail.</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// #![allow(unused_must_use)]</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// use qrcode::{QrCode, Version, EcLevel};</span>
<span class='doccomment'>/// use qrcode::bits::Bits;</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// let mut bits = Bits::new(Version::Normal(1));</span>
<span class='doccomment'>/// bits.push_eci_designator(9);</span>
<span class='doccomment'>/// bits.push_byte_data(b&quot;\xca\xfe\xe4\xe9\xea\xe1\xf2 QR&quot;);</span>
<span class='doccomment'>/// bits.push_terminator(EcLevel::L);</span>
<span class='doccomment'>/// let qrcode = QrCode::with_bits(bits, EcLevel::L);</span>
<span class='doccomment'>///</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>with_bits</span>(<span class='ident'>bits</span>: <span class='ident'>bits</span>::<span class='ident'>Bits</span>, <span class='ident'>ec_level</span>: <span class='ident'>EcLevel</span>) <span class='op'>-&gt;</span> <span class='ident'>QrResult</span><span class='op'>&lt;</span><span class='ident'>QrCode</span><span class='op'>&gt;</span> {
<span class='kw'>let</span> <span class='ident'>version</span> <span class='op'>=</span> <span class='ident'>bits</span>.<span class='ident'>version</span>();
<span class='kw'>let</span> <span class='ident'>data</span> <span class='op'>=</span> <span class='ident'>bits</span>.<span class='ident'>into_bytes</span>();
<span class='kw'>let</span> (<span class='ident'>encoded_data</span>, <span class='ident'>ec_data</span>) <span class='op'>=</span> <span class='macro'>try</span><span class='macro'>!</span>(<span class='ident'>ec</span>::<span class='ident'>construct_codewords</span>(<span class='kw-2'>&amp;</span><span class='op'>*</span><span class='ident'>data</span>, <span class='ident'>version</span>, <span class='ident'>ec_level</span>));
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>canvas</span> <span class='op'>=</span> <span class='ident'>canvas</span>::<span class='ident'>Canvas</span>::<span class='ident'>new</span>(<span class='ident'>version</span>, <span class='ident'>ec_level</span>);
<span class='ident'>canvas</span>.<span class='ident'>draw_all_functional_patterns</span>();
<span class='ident'>canvas</span>.<span class='ident'>draw_data</span>(<span class='kw-2'>&amp;</span><span class='op'>*</span><span class='ident'>encoded_data</span>, <span class='kw-2'>&amp;</span><span class='op'>*</span><span class='ident'>ec_data</span>);
<span class='kw'>let</span> <span class='ident'>canvas</span> <span class='op'>=</span> <span class='ident'>canvas</span>.<span class='ident'>apply_best_mask</span>();
<span class='prelude-val'>Ok</span>(<span class='ident'>QrCode</span> {
<span class='ident'>content</span>: <span class='ident'>canvas</span>.<span class='ident'>to_bools</span>(),
<span class='ident'>version</span>: <span class='ident'>version</span>,
<span class='ident'>ec_level</span>: <span class='ident'>ec_level</span>,
<span class='ident'>width</span>: <span class='ident'>version</span>.<span class='ident'>width</span>() <span class='kw'>as</span> <span class='ident'>usize</span>,
})
}
<span class='doccomment'>/// Gets the version of this QR code.</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>version</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>) <span class='op'>-&gt;</span> <span class='ident'>Version</span> {
<span class='self'>self</span>.<span class='ident'>version</span>
}
<span class='doccomment'>/// Gets the error correction level of this QR code.</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>error_correction_level</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>) <span class='op'>-&gt;</span> <span class='ident'>EcLevel</span> {
<span class='self'>self</span>.<span class='ident'>ec_level</span>
}
<span class='doccomment'>/// Gets the number of modules per side, i.e. the width of this QR code.</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// The width here does not contain the quiet zone paddings.</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>width</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>) <span class='op'>-&gt;</span> <span class='ident'>usize</span> {
<span class='self'>self</span>.<span class='ident'>width</span>
}
<span class='doccomment'>/// Gets the maximum number of allowed erratic modules can be introduced</span>
<span class='doccomment'>/// before the data becomes corrupted. Note that errors should not be</span>
<span class='doccomment'>/// introduced to functional modules.</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>max_allowed_errors</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>) <span class='op'>-&gt;</span> <span class='ident'>usize</span> {
<span class='ident'>ec</span>::<span class='ident'>max_allowed_errors</span>(<span class='self'>self</span>.<span class='ident'>version</span>, <span class='self'>self</span>.<span class='ident'>ec_level</span>).<span class='ident'>unwrap</span>()
}
<span class='doccomment'>/// Checks whether a module at coordinate (x, y) is a functional module or</span>
<span class='doccomment'>/// not.</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>is_functional</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>, <span class='ident'>x</span>: <span class='ident'>usize</span>, <span class='ident'>y</span>: <span class='ident'>usize</span>) <span class='op'>-&gt;</span> <span class='ident'>bool</span> {
<span class='ident'>canvas</span>::<span class='ident'>is_functional</span>(<span class='self'>self</span>.<span class='ident'>version</span>, <span class='self'>self</span>.<span class='ident'>version</span>.<span class='ident'>width</span>(), <span class='ident'>x</span> <span class='kw'>as</span> <span class='ident'>i16</span>, <span class='ident'>y</span> <span class='kw'>as</span> <span class='ident'>i16</span>)
}
<span class='doccomment'>/// Converts the QR code into a human-readable string. This is mainly for</span>
<span class='doccomment'>/// debugging only.</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>to_debug_str</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>, <span class='ident'>on_char</span>: <span class='ident'>char</span>, <span class='ident'>off_char</span>: <span class='ident'>char</span>) <span class='op'>-&gt;</span> <span class='ident'>String</span> {
<span class='kw'>let</span> <span class='ident'>width</span> <span class='op'>=</span> <span class='self'>self</span>.<span class='ident'>width</span>;
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>k</span> <span class='op'>=</span> <span class='number'>0</span>;
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>res</span> <span class='op'>=</span> <span class='ident'>String</span>::<span class='ident'>with_capacity</span>(<span class='ident'>width</span> <span class='op'>*</span> (<span class='ident'>width</span> <span class='op'>+</span> <span class='number'>1</span>));
<span class='kw'>for</span> _ <span class='kw'>in</span> <span class='number'>0</span> .. <span class='ident'>width</span> {
<span class='ident'>res</span>.<span class='ident'>push</span>(<span class='string'>&#39;\n&#39;</span>);
<span class='kw'>for</span> _ <span class='kw'>in</span> <span class='number'>0</span> .. <span class='ident'>width</span> {
<span class='ident'>res</span>.<span class='ident'>push</span>(<span class='kw'>if</span> <span class='self'>self</span>.<span class='ident'>content</span>[<span class='ident'>k</span>] { <span class='ident'>on_char</span> } <span class='kw'>else</span> { <span class='ident'>off_char</span> });
<span class='ident'>k</span> <span class='op'>+=</span> <span class='number'>1</span>;
}
}
<span class='ident'>res</span>
}
<span class='doccomment'>/// Converts the QR code to a vector of booleans. Each entry represents the</span>
<span class='doccomment'>/// color of the module, with &quot;true&quot; means dark and &quot;false&quot; means light.</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>to_vec</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>) <span class='op'>-&gt;</span> <span class='ident'>Vec</span><span class='op'>&lt;</span><span class='ident'>bool</span><span class='op'>&gt;</span> {
<span class='self'>self</span>.<span class='ident'>content</span>.<span class='ident'>clone</span>()
}
<span class='doccomment'>/// Converts the QR code to a vector of booleans. Each entry represents the</span>
<span class='doccomment'>/// color of the module, with &quot;true&quot; means dark and &quot;false&quot; means light.</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>into_vec</span>(<span class='self'>self</span>) <span class='op'>-&gt;</span> <span class='ident'>Vec</span><span class='op'>&lt;</span><span class='ident'>bool</span><span class='op'>&gt;</span> {
<span class='self'>self</span>.<span class='ident'>content</span>
}
}
<span class='kw'>impl</span> <span class='ident'>Index</span><span class='op'>&lt;</span>(<span class='ident'>usize</span>, <span class='ident'>usize</span>)<span class='op'>&gt;</span> <span class='kw'>for</span> <span class='ident'>QrCode</span> {
<span class='kw'>type</span> <span class='ident'>Output</span> <span class='op'>=</span> <span class='ident'>bool</span>;
<span class='kw'>fn</span> <span class='ident'>index</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>, (<span class='ident'>x</span>, <span class='ident'>y</span>): (<span class='ident'>usize</span>, <span class='ident'>usize</span>)) <span class='op'>-&gt;</span> <span class='kw-2'>&amp;</span><span class='ident'>bool</span> {
<span class='kw'>let</span> <span class='ident'>index</span> <span class='op'>=</span> <span class='ident'>y</span> <span class='op'>*</span> <span class='self'>self</span>.<span class='ident'>width</span> <span class='op'>+</span> <span class='ident'>x</span>;
<span class='kw-2'>&amp;</span><span class='self'>self</span>.<span class='ident'>content</span>[<span class='ident'>index</span>]
}
}
<span class='attribute'>#[<span class='ident'>cfg</span>(<span class='ident'>test</span>)]</span>
<span class='kw'>mod</span> <span class='ident'>tests</span> {
<span class='kw'>use</span> {<span class='ident'>QrCode</span>, <span class='ident'>Version</span>, <span class='ident'>EcLevel</span>};
<span class='attribute'>#[<span class='ident'>test</span>]</span>
<span class='kw'>fn</span> <span class='ident'>test_annex_i_qr</span>() {
<span class='comment'>// This uses the ISO Annex I as test vector.</span>
<span class='kw'>let</span> <span class='ident'>code</span> <span class='op'>=</span> <span class='ident'>QrCode</span>::<span class='ident'>with_version</span>(<span class='string'>b&quot;01234567&quot;</span>, <span class='ident'>Version</span>::<span class='ident'>Normal</span>(<span class='number'>1</span>), <span class='ident'>EcLevel</span>::<span class='ident'>M</span>).<span class='ident'>unwrap</span>();
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='kw-2'>&amp;</span><span class='op'>*</span><span class='ident'>code</span>.<span class='ident'>to_debug_str</span>(<span class='string'>&#39;#&#39;</span>, <span class='string'>&#39;.&#39;</span>), <span class='string'>&quot;\n\
#######..#.##.#######\n\
#.....#..####.#.....#\n\
#.###.#.#.....#.###.#\n\
#.###.#.##....#.###.#\n\
#.###.#.#.###.#.###.#\n\
#.....#.#...#.#.....#\n\
#######.#.#.#.#######\n\
........#..##........\n\
#.#####..#..#.#####..\n\
...#.#.##.#.#..#.##..\n\
..#...##.#.#.#..#####\n\
....#....#.....####..\n\
...######..#.#..#....\n\
........#.#####..##..\n\
#######..##.#.##.....\n\
#.....#.#.#####...#.#\n\
#.###.#.#...#..#.##..\n\
#.###.#.##..#..#.....\n\
#.###.#.#.##.#..#.#..\n\
#.....#........##.##.\n\
#######.####.#..#.#..&quot;</span>);
}
<span class='attribute'>#[<span class='ident'>test</span>]</span>
<span class='kw'>fn</span> <span class='ident'>test_annex_i_micro_qr</span>() {
<span class='kw'>let</span> <span class='ident'>code</span> <span class='op'>=</span> <span class='ident'>QrCode</span>::<span class='ident'>with_version</span>(<span class='string'>b&quot;01234567&quot;</span>, <span class='ident'>Version</span>::<span class='ident'>Micro</span>(<span class='number'>2</span>), <span class='ident'>EcLevel</span>::<span class='ident'>L</span>).<span class='ident'>unwrap</span>();
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='kw-2'>&amp;</span><span class='op'>*</span><span class='ident'>code</span>.<span class='ident'>to_debug_str</span>(<span class='string'>&#39;#&#39;</span>, <span class='string'>&#39;.&#39;</span>), <span class='string'>&quot;\n\
#######.#.#.#\n\
#.....#.###.#\n\
#.###.#..##.#\n\
#.###.#..####\n\
#.###.#.###..\n\
#.....#.#...#\n\
#######..####\n\
.........##..\n\
##.#....#...#\n\
.##.#.#.#.#.#\n\
###..#######.\n\
...#.#....##.\n\
###.#..##.###&quot;</span>);
}
}
<span class='comment'>// Copyright 2014 Kenny Chan</span>
<span class='comment'>//</span>
<span class='comment'>// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not</span>
<span class='comment'>// use this file except in compliance with the License. You may obtain a copy of</span>
<span class='comment'>// the License at</span>
<span class='comment'>//</span>
<span class='comment'>// http://www.apache.org/licenses/LICENSE-2.0</span>
<span class='comment'>//</span>
<span class='comment'>// Unless required by applicable law or agreed to in writing, software</span>
<span class='comment'>// distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT</span>
<span class='comment'>// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the</span>
<span class='comment'>// License for the specific language governing permissions and limitations under</span>
<span class='comment'>// the License.</span>
</pre>
</section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../../jquery.js"></script>
<script src="../../../main.js"></script>
<script defer src="../../../search-index.js"></script>
</body>
</html>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,700 @@
<!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="Source to the Rust file `src/types.rs`.">
<meta name="keywords" content="rust, rustlang, rust-lang">
<title>types.rs.html -- source</title>
<link rel="stylesheet" type="text/css" href="../../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content source"><pre class="line-numbers"><span id="1"> 1</span>
<span id="2"> 2</span>
<span id="3"> 3</span>
<span id="4"> 4</span>
<span id="5"> 5</span>
<span id="6"> 6</span>
<span id="7"> 7</span>
<span id="8"> 8</span>
<span id="9"> 9</span>
<span id="10"> 10</span>
<span id="11"> 11</span>
<span id="12"> 12</span>
<span id="13"> 13</span>
<span id="14"> 14</span>
<span id="15"> 15</span>
<span id="16"> 16</span>
<span id="17"> 17</span>
<span id="18"> 18</span>
<span id="19"> 19</span>
<span id="20"> 20</span>
<span id="21"> 21</span>
<span id="22"> 22</span>
<span id="23"> 23</span>
<span id="24"> 24</span>
<span id="25"> 25</span>
<span id="26"> 26</span>
<span id="27"> 27</span>
<span id="28"> 28</span>
<span id="29"> 29</span>
<span id="30"> 30</span>
<span id="31"> 31</span>
<span id="32"> 32</span>
<span id="33"> 33</span>
<span id="34"> 34</span>
<span id="35"> 35</span>
<span id="36"> 36</span>
<span id="37"> 37</span>
<span id="38"> 38</span>
<span id="39"> 39</span>
<span id="40"> 40</span>
<span id="41"> 41</span>
<span id="42"> 42</span>
<span id="43"> 43</span>
<span id="44"> 44</span>
<span id="45"> 45</span>
<span id="46"> 46</span>
<span id="47"> 47</span>
<span id="48"> 48</span>
<span id="49"> 49</span>
<span id="50"> 50</span>
<span id="51"> 51</span>
<span id="52"> 52</span>
<span id="53"> 53</span>
<span id="54"> 54</span>
<span id="55"> 55</span>
<span id="56"> 56</span>
<span id="57"> 57</span>
<span id="58"> 58</span>
<span id="59"> 59</span>
<span id="60"> 60</span>
<span id="61"> 61</span>
<span id="62"> 62</span>
<span id="63"> 63</span>
<span id="64"> 64</span>
<span id="65"> 65</span>
<span id="66"> 66</span>
<span id="67"> 67</span>
<span id="68"> 68</span>
<span id="69"> 69</span>
<span id="70"> 70</span>
<span id="71"> 71</span>
<span id="72"> 72</span>
<span id="73"> 73</span>
<span id="74"> 74</span>
<span id="75"> 75</span>
<span id="76"> 76</span>
<span id="77"> 77</span>
<span id="78"> 78</span>
<span id="79"> 79</span>
<span id="80"> 80</span>
<span id="81"> 81</span>
<span id="82"> 82</span>
<span id="83"> 83</span>
<span id="84"> 84</span>
<span id="85"> 85</span>
<span id="86"> 86</span>
<span id="87"> 87</span>
<span id="88"> 88</span>
<span id="89"> 89</span>
<span id="90"> 90</span>
<span id="91"> 91</span>
<span id="92"> 92</span>
<span id="93"> 93</span>
<span id="94"> 94</span>
<span id="95"> 95</span>
<span id="96"> 96</span>
<span id="97"> 97</span>
<span id="98"> 98</span>
<span id="99"> 99</span>
<span id="100">100</span>
<span id="101">101</span>
<span id="102">102</span>
<span id="103">103</span>
<span id="104">104</span>
<span id="105">105</span>
<span id="106">106</span>
<span id="107">107</span>
<span id="108">108</span>
<span id="109">109</span>
<span id="110">110</span>
<span id="111">111</span>
<span id="112">112</span>
<span id="113">113</span>
<span id="114">114</span>
<span id="115">115</span>
<span id="116">116</span>
<span id="117">117</span>
<span id="118">118</span>
<span id="119">119</span>
<span id="120">120</span>
<span id="121">121</span>
<span id="122">122</span>
<span id="123">123</span>
<span id="124">124</span>
<span id="125">125</span>
<span id="126">126</span>
<span id="127">127</span>
<span id="128">128</span>
<span id="129">129</span>
<span id="130">130</span>
<span id="131">131</span>
<span id="132">132</span>
<span id="133">133</span>
<span id="134">134</span>
<span id="135">135</span>
<span id="136">136</span>
<span id="137">137</span>
<span id="138">138</span>
<span id="139">139</span>
<span id="140">140</span>
<span id="141">141</span>
<span id="142">142</span>
<span id="143">143</span>
<span id="144">144</span>
<span id="145">145</span>
<span id="146">146</span>
<span id="147">147</span>
<span id="148">148</span>
<span id="149">149</span>
<span id="150">150</span>
<span id="151">151</span>
<span id="152">152</span>
<span id="153">153</span>
<span id="154">154</span>
<span id="155">155</span>
<span id="156">156</span>
<span id="157">157</span>
<span id="158">158</span>
<span id="159">159</span>
<span id="160">160</span>
<span id="161">161</span>
<span id="162">162</span>
<span id="163">163</span>
<span id="164">164</span>
<span id="165">165</span>
<span id="166">166</span>
<span id="167">167</span>
<span id="168">168</span>
<span id="169">169</span>
<span id="170">170</span>
<span id="171">171</span>
<span id="172">172</span>
<span id="173">173</span>
<span id="174">174</span>
<span id="175">175</span>
<span id="176">176</span>
<span id="177">177</span>
<span id="178">178</span>
<span id="179">179</span>
<span id="180">180</span>
<span id="181">181</span>
<span id="182">182</span>
<span id="183">183</span>
<span id="184">184</span>
<span id="185">185</span>
<span id="186">186</span>
<span id="187">187</span>
<span id="188">188</span>
<span id="189">189</span>
<span id="190">190</span>
<span id="191">191</span>
<span id="192">192</span>
<span id="193">193</span>
<span id="194">194</span>
<span id="195">195</span>
<span id="196">196</span>
<span id="197">197</span>
<span id="198">198</span>
<span id="199">199</span>
<span id="200">200</span>
<span id="201">201</span>
<span id="202">202</span>
<span id="203">203</span>
<span id="204">204</span>
<span id="205">205</span>
<span id="206">206</span>
<span id="207">207</span>
<span id="208">208</span>
<span id="209">209</span>
<span id="210">210</span>
<span id="211">211</span>
<span id="212">212</span>
<span id="213">213</span>
<span id="214">214</span>
<span id="215">215</span>
<span id="216">216</span>
<span id="217">217</span>
<span id="218">218</span>
<span id="219">219</span>
<span id="220">220</span>
<span id="221">221</span>
<span id="222">222</span>
<span id="223">223</span>
<span id="224">224</span>
<span id="225">225</span>
<span id="226">226</span>
<span id="227">227</span>
<span id="228">228</span>
<span id="229">229</span>
<span id="230">230</span>
<span id="231">231</span>
<span id="232">232</span>
<span id="233">233</span>
<span id="234">234</span>
<span id="235">235</span>
<span id="236">236</span>
<span id="237">237</span>
<span id="238">238</span>
<span id="239">239</span>
<span id="240">240</span>
<span id="241">241</span>
<span id="242">242</span>
<span id="243">243</span>
<span id="244">244</span>
<span id="245">245</span>
<span id="246">246</span>
<span id="247">247</span>
<span id="248">248</span>
<span id="249">249</span>
<span id="250">250</span>
<span id="251">251</span>
<span id="252">252</span>
<span id="253">253</span>
<span id="254">254</span>
<span id="255">255</span>
<span id="256">256</span>
<span id="257">257</span>
<span id="258">258</span>
<span id="259">259</span>
<span id="260">260</span>
<span id="261">261</span>
<span id="262">262</span>
<span id="263">263</span>
<span id="264">264</span>
<span id="265">265</span>
<span id="266">266</span>
<span id="267">267</span>
<span id="268">268</span>
<span id="269">269</span>
<span id="270">270</span>
<span id="271">271</span>
<span id="272">272</span>
<span id="273">273</span>
<span id="274">274</span>
<span id="275">275</span>
<span id="276">276</span>
<span id="277">277</span>
<span id="278">278</span>
<span id="279">279</span>
<span id="280">280</span>
<span id="281">281</span>
<span id="282">282</span>
<span id="283">283</span>
<span id="284">284</span>
<span id="285">285</span>
<span id="286">286</span>
<span id="287">287</span>
<span id="288">288</span>
<span id="289">289</span>
<span id="290">290</span>
<span id="291">291</span>
<span id="292">292</span>
<span id="293">293</span>
<span id="294">294</span>
<span id="295">295</span>
</pre><pre class='rust '>
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>default</span>::<span class='ident'>Default</span>;
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>cmp</span>::{<span class='ident'>PartialOrd</span>, <span class='ident'>Ordering</span>};
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>fmt</span>::{<span class='ident'>Display</span>, <span class='ident'>Formatter</span>, <span class='ident'>Error</span>};
<span class='comment'>//------------------------------------------------------------------------------</span>
<span class='comment'>//{{{ QrResult</span>
<span class='doccomment'>/// `QrError` encodes the error encountered when generating a QR code.</span>
<span class='attribute'>#[<span class='ident'>derive</span>(<span class='ident'>Debug</span>, <span class='ident'>PartialEq</span>, <span class='ident'>Eq</span>, <span class='ident'>Copy</span>, <span class='ident'>Clone</span>)]</span>
<span class='kw'>pub</span> <span class='kw'>enum</span> <span class='ident'>QrError</span> {
<span class='doccomment'>/// The data is too long to encode into a QR code for the given version.</span>
<span class='ident'>DataTooLong</span>,
<span class='doccomment'>/// The provided version / error correction level combination is invalid.</span>
<span class='ident'>InvalidVersion</span>,
<span class='doccomment'>/// Some characters in the data cannot be supported by the provided QR code</span>
<span class='doccomment'>/// version.</span>
<span class='ident'>UnsupportedCharacterSet</span>,
<span class='doccomment'>/// The provided ECI designator is invalid. A valid designator should be</span>
<span class='doccomment'>/// between 0 and 999999.</span>
<span class='ident'>InvalidEciDesignator</span>,
<span class='doccomment'>/// A character not belonging to the character set is found.</span>
<span class='ident'>InvalidCharacter</span>,
}
<span class='kw'>impl</span> <span class='ident'>Display</span> <span class='kw'>for</span> <span class='ident'>QrError</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'>fmt</span>: <span class='kw-2'>&amp;</span><span class='kw-2'>mut</span> <span class='ident'>Formatter</span>) <span class='op'>-&gt;</span> <span class='prelude-ty'>Result</span><span class='op'>&lt;</span>(), <span class='ident'>Error</span><span class='op'>&gt;</span> {
<span class='kw'>let</span> <span class='ident'>msg</span> <span class='op'>=</span> <span class='kw'>match</span> <span class='op'>*</span><span class='self'>self</span> {
<span class='ident'>QrError</span>::<span class='ident'>DataTooLong</span> <span class='op'>=&gt;</span> <span class='string'>&quot;data too long&quot;</span>,
<span class='ident'>QrError</span>::<span class='ident'>InvalidVersion</span> <span class='op'>=&gt;</span> <span class='string'>&quot;invalid version&quot;</span>,
<span class='ident'>QrError</span>::<span class='ident'>UnsupportedCharacterSet</span> <span class='op'>=&gt;</span> <span class='string'>&quot;unsupported character set&quot;</span>,
<span class='ident'>QrError</span>::<span class='ident'>InvalidEciDesignator</span> <span class='op'>=&gt;</span> <span class='string'>&quot;invalid ECI designator&quot;</span>,
<span class='ident'>QrError</span>::<span class='ident'>InvalidCharacter</span> <span class='op'>=&gt;</span> <span class='string'>&quot;invalid character&quot;</span>,
};
<span class='ident'>fmt</span>.<span class='ident'>write_str</span>(<span class='ident'>msg</span>)
}
}
<span class='doccomment'>/// `QrResult` is a convenient alias for a QR code generation result.</span>
<span class='kw'>pub</span> <span class='kw'>type</span> <span class='ident'>QrResult</span><span class='op'>&lt;</span><span class='ident'>T</span><span class='op'>&gt;</span> <span class='op'>=</span> <span class='prelude-ty'>Result</span><span class='op'>&lt;</span><span class='ident'>T</span>, <span class='ident'>QrError</span><span class='op'>&gt;</span>;
<span class='comment'>//}}}</span>
<span class='comment'>//------------------------------------------------------------------------------</span>
<span class='comment'>//{{{ Error correction level</span>
<span class='doccomment'>/// The error correction level. It allows the original information be recovered</span>
<span class='doccomment'>/// even if parts of the code is damaged.</span>
<span class='attribute'>#[<span class='ident'>derive</span>(<span class='ident'>Debug</span>, <span class='ident'>PartialEq</span>, <span class='ident'>Eq</span>, <span class='ident'>Copy</span>, <span class='ident'>Clone</span>, <span class='ident'>PartialOrd</span>, <span class='ident'>Ord</span>)]</span>
<span class='kw'>pub</span> <span class='kw'>enum</span> <span class='ident'>EcLevel</span> {
<span class='doccomment'>/// Low error correction. Allows up to 7% of wrong blocks.</span>
<span class='ident'>L</span> <span class='op'>=</span> <span class='number'>0</span>,
<span class='doccomment'>/// Medium error correction (default). Allows up to 15% of wrong blocks.</span>
<span class='ident'>M</span> <span class='op'>=</span> <span class='number'>1</span>,
<span class='doccomment'>/// &quot;Quartile&quot; error correction. Allows up to 25% of wrong blocks.</span>
<span class='ident'>Q</span> <span class='op'>=</span> <span class='number'>2</span>,
<span class='doccomment'>/// High error correction. Allows up to 30% of wrong blocks.</span>
<span class='ident'>H</span> <span class='op'>=</span> <span class='number'>3</span>,
}
<span class='comment'>//}}}</span>
<span class='comment'>//------------------------------------------------------------------------------</span>
<span class='comment'>//{{{ Version</span>
<span class='doccomment'>/// In QR code terminology, `Version` means the size of the generated image.</span>
<span class='doccomment'>/// Larger version means the size of code is larger, and therefore can carry</span>
<span class='doccomment'>/// more information.</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// The smallest version is `Version::Normal(1)` of size 21×21, and the largest</span>
<span class='doccomment'>/// is `Version::Normal(40)` of size 177×177.</span>
<span class='attribute'>#[<span class='ident'>derive</span>(<span class='ident'>Debug</span>, <span class='ident'>PartialEq</span>, <span class='ident'>Eq</span>, <span class='ident'>Copy</span>, <span class='ident'>Clone</span>)]</span>
<span class='kw'>pub</span> <span class='kw'>enum</span> <span class='ident'>Version</span> {
<span class='doccomment'>/// A normal QR code version. The parameter should be between 1 and 40.</span>
<span class='ident'>Normal</span>(<span class='ident'>i16</span>),
<span class='doccomment'>/// A Micro QR code version. The parameter should be between 1 and 4.</span>
<span class='ident'>Micro</span>(<span class='ident'>i16</span>),
}
<span class='kw'>impl</span> <span class='ident'>Version</span> {
<span class='doccomment'>/// Get the number of &quot;modules&quot; on each size of the QR code, i.e. the width</span>
<span class='doccomment'>/// and height of the code.</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>width</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>) <span class='op'>-&gt;</span> <span class='ident'>i16</span> {
<span class='kw'>match</span> <span class='op'>*</span><span class='self'>self</span> {
<span class='ident'>Version</span>::<span class='ident'>Normal</span>(<span class='ident'>v</span>) <span class='op'>=&gt;</span> <span class='ident'>v</span> <span class='op'>*</span> <span class='number'>4</span> <span class='op'>+</span> <span class='number'>17</span>,
<span class='ident'>Version</span>::<span class='ident'>Micro</span>(<span class='ident'>v</span>) <span class='op'>=&gt;</span> <span class='ident'>v</span> <span class='op'>*</span> <span class='number'>2</span> <span class='op'>+</span> <span class='number'>9</span>,
}
}
<span class='doccomment'>/// Obtains an object from a hard-coded table.</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// The table must be a 44×4 array. The outer array represents the content</span>
<span class='doccomment'>/// for each version. The first 40 entry corresponds to QR code versions 1</span>
<span class='doccomment'>/// to 40, and the last 4 corresponds to Micro QR code version 1 to 4. The</span>
<span class='doccomment'>/// inner array represents the content in each error correction level, in</span>
<span class='doccomment'>/// the order [L, M, Q, H].</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// If the entry compares equal to the default value of T, this method</span>
<span class='doccomment'>/// returns `Err(QrError::InvalidVersion)`.</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>fetch</span><span class='op'>&lt;</span><span class='ident'>T</span><span class='op'>&gt;</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>, <span class='ident'>ec_level</span>: <span class='ident'>EcLevel</span>, <span class='ident'>table</span>: <span class='kw-2'>&amp;</span>[[<span class='ident'>T</span>; <span class='number'>4</span>]]) <span class='op'>-&gt;</span> <span class='ident'>QrResult</span><span class='op'>&lt;</span><span class='ident'>T</span><span class='op'>&gt;</span>
<span class='kw'>where</span> <span class='ident'>T</span>: <span class='ident'>PartialEq</span> <span class='op'>+</span> <span class='ident'>Default</span> <span class='op'>+</span> <span class='ident'>Copy</span>
{
<span class='kw'>match</span> <span class='op'>*</span><span class='self'>self</span> {
<span class='ident'>Version</span>::<span class='ident'>Normal</span>(<span class='ident'>v</span> @ <span class='number'>1</span>...<span class='number'>40</span>) <span class='op'>=&gt;</span> <span class='prelude-val'>Ok</span>(<span class='ident'>table</span>[<span class='ident'>v</span> <span class='kw'>as</span> <span class='ident'>usize</span> <span class='op'>-</span> <span class='number'>1</span>][<span class='ident'>ec_level</span> <span class='kw'>as</span> <span class='ident'>usize</span>]),
<span class='ident'>Version</span>::<span class='ident'>Micro</span>(<span class='ident'>v</span> @ <span class='number'>1</span>...<span class='number'>4</span>) <span class='op'>=&gt;</span> {
<span class='kw'>let</span> <span class='ident'>obj</span> <span class='op'>=</span> <span class='ident'>table</span>[<span class='ident'>v</span> <span class='kw'>as</span> <span class='ident'>usize</span> <span class='op'>+</span> <span class='number'>39</span>][<span class='ident'>ec_level</span> <span class='kw'>as</span> <span class='ident'>usize</span>];
<span class='kw'>if</span> <span class='ident'>obj</span> <span class='op'>!=</span> <span class='ident'>Default</span>::<span class='ident'>default</span>() {
<span class='prelude-val'>Ok</span>(<span class='ident'>obj</span>)
} <span class='kw'>else</span> {
<span class='prelude-val'>Err</span>(<span class='ident'>QrError</span>::<span class='ident'>InvalidVersion</span>)
}
}
_ <span class='op'>=&gt;</span> <span class='prelude-val'>Err</span>(<span class='ident'>QrError</span>::<span class='ident'>InvalidVersion</span>)
}
}
<span class='doccomment'>/// The number of bits needed to encode the mode indicator.</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>mode_bits_count</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>) <span class='op'>-&gt;</span> <span class='ident'>usize</span> {
<span class='kw'>match</span> <span class='op'>*</span><span class='self'>self</span> {
<span class='ident'>Version</span>::<span class='ident'>Micro</span>(<span class='ident'>a</span>) <span class='op'>=&gt;</span> (<span class='ident'>a</span> <span class='op'>-</span> <span class='number'>1</span>) <span class='kw'>as</span> <span class='ident'>usize</span>,
_ <span class='op'>=&gt;</span> <span class='number'>4</span>,
}
}
<span class='doccomment'>/// Checks whether is version refers to a Micro QR code.</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>is_micro</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>) <span class='op'>-&gt;</span> <span class='ident'>bool</span> {
<span class='kw'>match</span> <span class='op'>*</span><span class='self'>self</span> {
<span class='ident'>Version</span>::<span class='ident'>Normal</span>(_) <span class='op'>=&gt;</span> <span class='boolvalue'>false</span>,
<span class='ident'>Version</span>::<span class='ident'>Micro</span>(_) <span class='op'>=&gt;</span> <span class='boolvalue'>true</span>,
}
}
}
<span class='comment'>//}}}</span>
<span class='comment'>//------------------------------------------------------------------------------</span>
<span class='comment'>//{{{ Mode indicator</span>
<span class='doccomment'>/// The mode indicator, which specifies the character set of the encoded data.</span>
<span class='attribute'>#[<span class='ident'>derive</span>(<span class='ident'>Debug</span>, <span class='ident'>PartialEq</span>, <span class='ident'>Eq</span>, <span class='ident'>Copy</span>, <span class='ident'>Clone</span>)]</span>
<span class='kw'>pub</span> <span class='kw'>enum</span> <span class='ident'>Mode</span> {
<span class='doccomment'>/// The data contains only characters 0 to 9.</span>
<span class='ident'>Numeric</span>,
<span class='doccomment'>/// The data contains only uppercase letters (AZ), numbers (09) and a few</span>
<span class='doccomment'>/// punctuations marks (space, `$`, `%`, `*`, `+`, `-`, `.`, `/`, `:`).</span>
<span class='ident'>Alphanumeric</span>,
<span class='doccomment'>/// The data contains arbitrary binary data.</span>
<span class='ident'>Byte</span>,
<span class='doccomment'>/// The data contains Shift-JIS-encoded double-byte text.</span>
<span class='ident'>Kanji</span>,
}
<span class='kw'>impl</span> <span class='ident'>Mode</span> {
<span class='doccomment'>/// Computes the number of bits needed to encode the data length.</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// use qrcode::types::{Version, Mode};</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// assert_eq!(Mode::Numeric.length_bits_count(Version::Normal(1)), 10);</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// This method will return `Err(QrError::UnsupportedCharacterSet)` if the</span>
<span class='doccomment'>/// mode is not supported in the given version.</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>length_bits_count</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>, <span class='ident'>version</span>: <span class='ident'>Version</span>) <span class='op'>-&gt;</span> <span class='ident'>usize</span> {
<span class='kw'>match</span> <span class='ident'>version</span> {
<span class='ident'>Version</span>::<span class='ident'>Micro</span>(<span class='ident'>a</span>) <span class='op'>=&gt;</span> {
<span class='kw'>let</span> <span class='ident'>a</span> <span class='op'>=</span> <span class='ident'>a</span> <span class='kw'>as</span> <span class='ident'>usize</span>;
<span class='kw'>match</span> <span class='op'>*</span><span class='self'>self</span> {
<span class='ident'>Mode</span>::<span class='ident'>Numeric</span> <span class='op'>=&gt;</span> <span class='number'>2</span> <span class='op'>+</span> <span class='ident'>a</span>,
<span class='ident'>Mode</span>::<span class='ident'>Alphanumeric</span> <span class='op'>|</span> <span class='ident'>Mode</span>::<span class='ident'>Byte</span> <span class='op'>=&gt;</span> <span class='number'>1</span> <span class='op'>+</span> <span class='ident'>a</span>,
<span class='ident'>Mode</span>::<span class='ident'>Kanji</span> <span class='op'>=&gt;</span> <span class='ident'>a</span>,
}
}
<span class='ident'>Version</span>::<span class='ident'>Normal</span>(<span class='number'>1</span>...<span class='number'>9</span>) <span class='op'>=&gt;</span> <span class='kw'>match</span> <span class='op'>*</span><span class='self'>self</span> {
<span class='ident'>Mode</span>::<span class='ident'>Numeric</span> <span class='op'>=&gt;</span> <span class='number'>10</span>,
<span class='ident'>Mode</span>::<span class='ident'>Alphanumeric</span> <span class='op'>=&gt;</span> <span class='number'>9</span>,
<span class='ident'>Mode</span>::<span class='ident'>Byte</span> <span class='op'>=&gt;</span> <span class='number'>8</span>,
<span class='ident'>Mode</span>::<span class='ident'>Kanji</span> <span class='op'>=&gt;</span> <span class='number'>8</span>,
},
<span class='ident'>Version</span>::<span class='ident'>Normal</span>(<span class='number'>10</span>...<span class='number'>26</span>) <span class='op'>=&gt;</span> <span class='kw'>match</span> <span class='op'>*</span><span class='self'>self</span> {
<span class='ident'>Mode</span>::<span class='ident'>Numeric</span> <span class='op'>=&gt;</span> <span class='number'>12</span>,
<span class='ident'>Mode</span>::<span class='ident'>Alphanumeric</span> <span class='op'>=&gt;</span> <span class='number'>11</span>,
<span class='ident'>Mode</span>::<span class='ident'>Byte</span> <span class='op'>=&gt;</span> <span class='number'>16</span>,
<span class='ident'>Mode</span>::<span class='ident'>Kanji</span> <span class='op'>=&gt;</span> <span class='number'>10</span>,
},
<span class='ident'>Version</span>::<span class='ident'>Normal</span>(_) <span class='op'>=&gt;</span> <span class='kw'>match</span> <span class='op'>*</span><span class='self'>self</span> {
<span class='ident'>Mode</span>::<span class='ident'>Numeric</span> <span class='op'>=&gt;</span> <span class='number'>14</span>,
<span class='ident'>Mode</span>::<span class='ident'>Alphanumeric</span> <span class='op'>=&gt;</span> <span class='number'>13</span>,
<span class='ident'>Mode</span>::<span class='ident'>Byte</span> <span class='op'>=&gt;</span> <span class='number'>16</span>,
<span class='ident'>Mode</span>::<span class='ident'>Kanji</span> <span class='op'>=&gt;</span> <span class='number'>12</span>,
},
}
}
<span class='doccomment'>/// Computes the number of bits needed to some data of a given raw length.</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// use qrcode::types::Mode;</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// assert_eq!(Mode::Numeric.data_bits_count(7), 24);</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// Note that in Kanji mode, the `raw_data_len` is the number of Kanjis,</span>
<span class='doccomment'>/// i.e. half the total size of bytes.</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>data_bits_count</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>, <span class='ident'>raw_data_len</span>: <span class='ident'>usize</span>) <span class='op'>-&gt;</span> <span class='ident'>usize</span> {
<span class='kw'>match</span> <span class='op'>*</span><span class='self'>self</span> {
<span class='ident'>Mode</span>::<span class='ident'>Numeric</span> <span class='op'>=&gt;</span> (<span class='ident'>raw_data_len</span> <span class='op'>*</span> <span class='number'>10</span> <span class='op'>+</span> <span class='number'>2</span>) <span class='op'>/</span> <span class='number'>3</span>,
<span class='ident'>Mode</span>::<span class='ident'>Alphanumeric</span> <span class='op'>=&gt;</span> (<span class='ident'>raw_data_len</span> <span class='op'>*</span> <span class='number'>11</span> <span class='op'>+</span> <span class='number'>1</span>) <span class='op'>/</span> <span class='number'>2</span>,
<span class='ident'>Mode</span>::<span class='ident'>Byte</span> <span class='op'>=&gt;</span> <span class='ident'>raw_data_len</span> <span class='op'>*</span> <span class='number'>8</span>,
<span class='ident'>Mode</span>::<span class='ident'>Kanji</span> <span class='op'>=&gt;</span> <span class='ident'>raw_data_len</span> <span class='op'>*</span> <span class='number'>13</span>,
}
}
<span class='doccomment'>/// Find the lowest common mode which both modes are compatible with.</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// use qrcode::types::Mode;</span>
<span class='doccomment'>///</span>
<span class='doccomment'>/// let a = Mode::Numeric;</span>
<span class='doccomment'>/// let b = Mode::Kanji;</span>
<span class='doccomment'>/// let c = a.max(b);</span>
<span class='doccomment'>/// assert!(a &lt;= c);</span>
<span class='doccomment'>/// assert!(b &lt;= c);</span>
<span class='doccomment'>///</span>
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>max</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>, <span class='ident'>other</span>: <span class='ident'>Mode</span>) <span class='op'>-&gt;</span> <span class='ident'>Mode</span> {
<span class='kw'>match</span> <span class='self'>self</span>.<span class='ident'>partial_cmp</span>(<span class='kw-2'>&amp;</span><span class='ident'>other</span>) {
<span class='prelude-val'>Some</span>(<span class='ident'>Ordering</span>::<span class='ident'>Less</span>) <span class='op'>|</span> <span class='prelude-val'>Some</span>(<span class='ident'>Ordering</span>::<span class='ident'>Equal</span>) <span class='op'>=&gt;</span> <span class='ident'>other</span>,
<span class='prelude-val'>Some</span>(<span class='ident'>Ordering</span>::<span class='ident'>Greater</span>) <span class='op'>=&gt;</span> <span class='op'>*</span><span class='self'>self</span>,
<span class='prelude-val'>None</span> <span class='op'>=&gt;</span> <span class='ident'>Mode</span>::<span class='ident'>Byte</span>,
}
}
}
<span class='kw'>impl</span> <span class='ident'>PartialOrd</span> <span class='kw'>for</span> <span class='ident'>Mode</span> {
<span class='doccomment'>/// Defines a partial ordering between modes. If `a &lt;= b`, then `b` contains</span>
<span class='doccomment'>/// a superset of all characters supported by `a`.</span>
<span class='kw'>fn</span> <span class='ident'>partial_cmp</span>(<span class='kw-2'>&amp;</span><span class='self'>self</span>, <span class='ident'>other</span>: <span class='kw-2'>&amp;</span><span class='ident'>Mode</span>) <span class='op'>-&gt;</span> <span class='prelude-ty'>Option</span><span class='op'>&lt;</span><span class='ident'>Ordering</span><span class='op'>&gt;</span> {
<span class='kw'>match</span> (<span class='op'>*</span><span class='self'>self</span>, <span class='op'>*</span><span class='ident'>other</span>) {
(<span class='ident'>Mode</span>::<span class='ident'>Numeric</span>, <span class='ident'>Mode</span>::<span class='ident'>Alphanumeric</span>) <span class='op'>=&gt;</span> <span class='prelude-val'>Some</span>(<span class='ident'>Ordering</span>::<span class='ident'>Less</span>),
(<span class='ident'>Mode</span>::<span class='ident'>Alphanumeric</span>, <span class='ident'>Mode</span>::<span class='ident'>Numeric</span>) <span class='op'>=&gt;</span> <span class='prelude-val'>Some</span>(<span class='ident'>Ordering</span>::<span class='ident'>Greater</span>),
(<span class='ident'>Mode</span>::<span class='ident'>Numeric</span>, <span class='ident'>Mode</span>::<span class='ident'>Byte</span>) <span class='op'>=&gt;</span> <span class='prelude-val'>Some</span>(<span class='ident'>Ordering</span>::<span class='ident'>Less</span>),
(<span class='ident'>Mode</span>::<span class='ident'>Byte</span>, <span class='ident'>Mode</span>::<span class='ident'>Numeric</span>) <span class='op'>=&gt;</span> <span class='prelude-val'>Some</span>(<span class='ident'>Ordering</span>::<span class='ident'>Greater</span>),
(<span class='ident'>Mode</span>::<span class='ident'>Alphanumeric</span>, <span class='ident'>Mode</span>::<span class='ident'>Byte</span>) <span class='op'>=&gt;</span> <span class='prelude-val'>Some</span>(<span class='ident'>Ordering</span>::<span class='ident'>Less</span>),
(<span class='ident'>Mode</span>::<span class='ident'>Byte</span>, <span class='ident'>Mode</span>::<span class='ident'>Alphanumeric</span>) <span class='op'>=&gt;</span> <span class='prelude-val'>Some</span>(<span class='ident'>Ordering</span>::<span class='ident'>Greater</span>),
(<span class='ident'>Mode</span>::<span class='ident'>Kanji</span>, <span class='ident'>Mode</span>::<span class='ident'>Byte</span>) <span class='op'>=&gt;</span> <span class='prelude-val'>Some</span>(<span class='ident'>Ordering</span>::<span class='ident'>Less</span>),
(<span class='ident'>Mode</span>::<span class='ident'>Byte</span>, <span class='ident'>Mode</span>::<span class='ident'>Kanji</span>) <span class='op'>=&gt;</span> <span class='prelude-val'>Some</span>(<span class='ident'>Ordering</span>::<span class='ident'>Greater</span>),
(<span class='ident'>a</span>, <span class='ident'>b</span>) <span class='kw'>if</span> <span class='ident'>a</span> <span class='op'>==</span> <span class='ident'>b</span> <span class='op'>=&gt;</span> <span class='prelude-val'>Some</span>(<span class='ident'>Ordering</span>::<span class='ident'>Equal</span>),
_ <span class='op'>=&gt;</span> <span class='prelude-val'>None</span>,
}
}
}
<span class='attribute'>#[<span class='ident'>cfg</span>(<span class='ident'>test</span>)]</span>
<span class='kw'>mod</span> <span class='ident'>mode_tests</span> {
<span class='kw'>use</span> <span class='ident'>types</span>::<span class='ident'>Mode</span>::{<span class='ident'>Numeric</span>, <span class='ident'>Alphanumeric</span>, <span class='ident'>Byte</span>, <span class='ident'>Kanji</span>};
<span class='attribute'>#[<span class='ident'>test</span>]</span>
<span class='kw'>fn</span> <span class='ident'>test_mode_order</span>() {
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>Numeric</span> <span class='op'>&lt;</span> <span class='ident'>Alphanumeric</span>);
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>Byte</span> <span class='op'>&gt;</span> <span class='ident'>Kanji</span>);
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span>(<span class='ident'>Numeric</span> <span class='op'>&lt;</span> <span class='ident'>Kanji</span>));
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span>(<span class='ident'>Numeric</span> <span class='op'>&gt;=</span> <span class='ident'>Kanji</span>));
}
<span class='attribute'>#[<span class='ident'>test</span>]</span>
<span class='kw'>fn</span> <span class='ident'>test_max</span>() {
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Byte</span>.<span class='ident'>max</span>(<span class='ident'>Kanji</span>), <span class='ident'>Byte</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Numeric</span>.<span class='ident'>max</span>(<span class='ident'>Alphanumeric</span>), <span class='ident'>Alphanumeric</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Alphanumeric</span>.<span class='ident'>max</span>(<span class='ident'>Alphanumeric</span>), <span class='ident'>Alphanumeric</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Numeric</span>.<span class='ident'>max</span>(<span class='ident'>Kanji</span>), <span class='ident'>Byte</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Kanji</span>.<span class='ident'>max</span>(<span class='ident'>Numeric</span>), <span class='ident'>Byte</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Alphanumeric</span>.<span class='ident'>max</span>(<span class='ident'>Numeric</span>), <span class='ident'>Alphanumeric</span>);
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Kanji</span>.<span class='ident'>max</span>(<span class='ident'>Kanji</span>), <span class='ident'>Kanji</span>);
}
}
<span class='comment'>//}}}</span>
<span class='comment'>// Copyright 2014 Kenny Chan</span>
<span class='comment'>//</span>
<span class='comment'>// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not</span>
<span class='comment'>// use this file except in compliance with the License. You may obtain a copy of</span>
<span class='comment'>// the License at</span>
<span class='comment'>//</span>
<span class='comment'>// http://www.apache.org/licenses/LICENSE-2.0</span>
<span class='comment'>//</span>
<span class='comment'>// Unless required by applicable law or agreed to in writing, software</span>
<span class='comment'>// distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT</span>
<span class='comment'>// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the</span>
<span class='comment'>// License for the specific language governing permissions and limitations under</span>
<span class='comment'>// the License.</span>
</pre>
</section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../../";
window.currentCrate = "qrcode";
window.playgroundUrl = "";
</script>
<script src="../../../jquery.js"></script>
<script src="../../../main.js"></script>
<script defer src="../../../search-index.js"></script>
</body>
</html>