Update doc for version = "0.2.0" (3db4311335481f3ac6b84802aa5a54f336d6e0d5)
This commit is contained in:
parent
a5f1e35b81
commit
8a58a2f1d5
|
@ -57,12 +57,12 @@
|
|||
}</pre><div class='docblock'><p>An "extended" 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>
|
||||
<span id='variant.Eci' class='variant'><code>Eci</code></span><div class='docblock'><p>ECI mode indicator, to introduce an ECI designator.</p>
|
||||
</div><span id='variant.Data' class='variant'><code>Data(<a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a>)</code></span><div class='docblock'><p>The normal mode to introduce data.</p>
|
||||
</div><span id='variant.Fnc1First' class='variant'><code>Fnc1First</code></span><div class='docblock'><p>FNC-1 mode in the first position.</p>
|
||||
</div><span id='variant.Fnc1Second' class='variant'><code>Fnc1Second</code></span><div class='docblock'><p>FNC-1 mode in the second position.</p>
|
||||
</div><span id='variant.StructuredAppend' class='variant'><code>StructuredAppend</code></span><div class='docblock'><p>Structured append.</p>
|
||||
</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/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>(&self) -> <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>(&mut self, source: &Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
|
|
|
@ -60,15 +60,15 @@
|
|||
}</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>
|
||||
<span id='variant.Checkerboard' class='variant'><code>Checkerboard</code></span><div class='docblock'><p>QR code pattern 000: <code>(x + y) % 2 == 0</code>.</p>
|
||||
</div><span id='variant.HorizontalLines' class='variant'><code>HorizontalLines</code></span><div class='docblock'><p>QR code pattern 001: <code>y % 2 == 0</code>.</p>
|
||||
</div><span id='variant.VerticalLines' class='variant'><code>VerticalLines</code></span><div class='docblock'><p>QR code pattern 010: <code>x % 3 == 0</code>.</p>
|
||||
</div><span id='variant.DiagonalLines' class='variant'><code>DiagonalLines</code></span><div class='docblock'><p>QR code pattern 011: <code>(x + y) % 3 == 0</code>.</p>
|
||||
</div><span id='variant.LargeCheckerboard' class='variant'><code>LargeCheckerboard</code></span><div class='docblock'><p>QR code pattern 100: <code>((x/3) + (y/2)) % 2 == 0</code>.</p>
|
||||
</div><span id='variant.Fields' class='variant'><code>Fields</code></span><div class='docblock'><p>QR code pattern 101: <code>(x*y)%2 + (x*y)%3 == 0</code>.</p>
|
||||
</div><span id='variant.Diamonds' class='variant'><code>Diamonds</code></span><div class='docblock'><p>QR code pattern 110: <code>((x*y)%2 + (x*y)%3) % 2 == 0</code>.</p>
|
||||
</div><span id='variant.Meadow' class='variant'><code>Meadow</code></span><div class='docblock'><p>QR code pattern 111: <code>((x+y)%2 + (x*y)%3) % 2 == 0</code>.</p>
|
||||
</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/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>(&self) -> <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>(&mut self, source: &Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
|
|
|
@ -56,16 +56,16 @@
|
|||
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
|
||||
<span id='variant.Empty' class='variant'><code>Empty</code></span><div class='docblock'><p>The module is empty.</p>
|
||||
</div><span id='variant.Light' class='variant'><code>Light</code></span><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
|
||||
</div><span id='variant.Dark' class='variant'><code>Dark</code></span><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
|
||||
</div><span id='variant.LightUnmasked' class='variant'><code>LightUnmasked</code></span><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
|
||||
</div><span id='variant.DarkUnmasked' class='variant'><code>DarkUnmasked</code></span><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><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>(&self) -> <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>(&self, should_invert: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>) -> <a class='enum' href='../../qrcode/canvas/enum.Module.html' title='qrcode::canvas::Module'>Module</a></code></h4>
|
||||
|
|
|
@ -47,26 +47,28 @@
|
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
|
||||
[<span class='inner'>−</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>
|
||||
</span><a id='src-0' class='srclink' href='../src/qrcode/src/lib.rs.html#1-292' 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'>extern</span> <span class='kw'>crate</span> <span class='ident'>image</span>;
|
||||
<span class='kw'>extern</span> <span class='kw'>crate</span> <span class='ident'>qrcode</span>;
|
||||
|
||||
<span class='kw'>use</span> <span class='ident'>image</span>::<span class='ident'>GrayImage</span>;
|
||||
<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"Some content here."</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'>=></span> <span class='macro'>panic</span><span class='macro'>!</span>(<span class='string'>"Failed to encode the QR code: {:?}"</span>, <span class='ident'>err</span>),
|
||||
<span class='prelude-val'>Ok</span>(<span class='ident'>code</span>) <span class='op'>=></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'>"black"</span> } <span class='kw'>else</span> { <span class='string'>"white"</span> };
|
||||
<span class='comment'>// render color at position (x, y)</span>
|
||||
}
|
||||
}
|
||||
<span class='kw'>let</span> <span class='ident'>image</span>: <span class='ident'>GrayImage</span> <span class='op'>=</span> <span class='ident'>code</span>.<span class='ident'>render</span>().<span class='ident'>min_width</span>(<span class='number'>100</span>).<span class='ident'>to_image</span>();
|
||||
<span class='comment'>// render `image`...</span>
|
||||
}
|
||||
}</pre>
|
||||
}
|
||||
</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>
|
||||
|
@ -98,6 +100,13 @@
|
|||
<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='render/index.html'
|
||||
title='qrcode::render'>render</a></td>
|
||||
<td class='docblock short'>
|
||||
<p>Render a QR code into image.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class=' module-item'>
|
||||
<td><a class='mod' href='types/index.html'
|
||||
title='qrcode::types'>types</a></td>
|
||||
|
|
|
@ -50,14 +50,14 @@
|
|||
</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<I> {
|
||||
// some fields omitted
|
||||
}</pre><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl<I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a><Item=<a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a>>> <a class='struct' href='../../qrcode/optimize/struct.Optimizer.html' title='qrcode::optimize::Optimizer'>Optimizer</a><I></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>
|
||||
}</pre><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl<I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a><Item=<a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a>>> <a class='struct' href='../../qrcode/optimize/struct.Optimizer.html' title='qrcode::optimize::Optimizer'>Optimizer</a><I></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>) -> <a class='struct' href='../../qrcode/optimize/struct.Optimizer.html' title='qrcode::optimize::Optimizer'>Optimizer</a><I></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<I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a><Item=<a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a>>> <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><I></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></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl<I: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a><Item=<a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a>>> <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><I></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>(&mut self) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='struct' href='../../qrcode/optimize/struct.Segment.html' title='qrcode::optimize::Segment'>Segment</a>></code></h4>
|
||||
|
@ -70,43 +70,43 @@ does <em>not</em> use Annex J from the ISO standard.</p>
|
|||
<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>(&mut self, n: <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><Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>></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><U>(self, other: U) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Chain.html' title='core::iter::Chain'>Chain</a><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>> <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><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>></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
</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><U>(self, other: U) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Chain.html' title='core::iter::Chain'>Chain</a><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>> <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><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>></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><U>(self, other: U) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Zip.html' title='core::iter::Zip'>Zip</a><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>> <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><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><U>(self, other: U) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Zip.html' title='core::iter::Zip'>Zip</a><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>> <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>'Zips up' 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><B, F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Map.html' title='core::iter::Map'>Map</a><Self, F> <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>) -> B</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
</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><B, F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Map.html' title='core::iter::Map'>Map</a><Self, F> <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>) -> 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><P>(self, predicate: P) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Filter.html' title='core::iter::Filter'>Filter</a><Self, P> <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>) -> <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><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><P>(self, predicate: P) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Filter.html' title='core::iter::Filter'>Filter</a><Self, P> <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>) -> <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><B, F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.FilterMap.html' title='core::iter::FilterMap'>FilterMap</a><Self, F> <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>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><B></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
</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><B, F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.FilterMap.html' title='core::iter::FilterMap'>FilterMap</a><Self, F> <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>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><B></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) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Enumerate.html' title='core::iter::Enumerate'>Enumerate</a><Self></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) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Peekable.html' title='core::iter::Peekable'>Peekable</a><Self></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><P>(self, predicate: P) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.SkipWhile.html' title='core::iter::SkipWhile'>SkipWhile</a><Self, P> <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>) -> <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><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><P>(self, predicate: P) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.SkipWhile.html' title='core::iter::SkipWhile'>SkipWhile</a><Self, P> <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>) -> <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><P>(self, predicate: P) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.TakeWhile.html' title='core::iter::TakeWhile'>TakeWhile</a><Self, P> <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>) -> <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><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><P>(self, predicate: P) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.TakeWhile.html' title='core::iter::TakeWhile'>TakeWhile</a><Self, P> <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>) -> <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>) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Skip.html' title='core::iter::Skip'>Skip</a><Self></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>) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Take.html' title='core::iter::Take'>Take</a><Self></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><St, B, F>(self, initial_state: St, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Scan.html' title='core::iter::Scan'>Scan</a><Self, St, F> <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>(&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>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><B></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
</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><St, B, F>(self, initial_state: St, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Scan.html' title='core::iter::Scan'>Scan</a><Self, St, F> <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>(&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>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><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 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><U, F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.FlatMap.html' title='core::iter::FlatMap'>FlatMap</a><Self, U, F> <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>) -> 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><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><U, F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.FlatMap.html' title='core::iter::FlatMap'>FlatMap</a><Self, U, F> <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>) -> 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) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Fuse.html' title='core::iter::Fuse'>Fuse</a><Self></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><F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Inspect.html' title='core::iter::Inspect'>Inspect</a><Self, F> <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>) -> <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><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><F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Inspect.html' title='core::iter::Inspect'>Inspect</a><Self, F> <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>) -> <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>(&mut self) -> &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><B>(self) -> 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><Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>></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><B, F>(self, f: F) -> <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><Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>>, 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>) -> <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><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><B, F>(self, f: F) -> <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><Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>>, 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>) -> <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><B, F>(self, init: B, f: F) -> 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>) -> B</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
</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><B, F>(self, init: B, f: F) -> 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>) -> 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><F>(&mut self, f: F) -> <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>) -> <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>
|
||||
|
@ -122,21 +122,21 @@ does <em>not</em> use Annex J from the ISO standard.</p>
|
|||
<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) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</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>> <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><B, F>(self, f: F) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</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>> <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>(&Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -> B</span></code><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div></h4>
|
||||
</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><B, F>(self, f: F) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</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>> <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>(&Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -> 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><B, F>(self, f: F) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</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>> <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>(&Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -> B</span></code><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div></h4>
|
||||
</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><B, F>(self, f: F) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</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>> <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>(&Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -> 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) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Rev.html' title='core::iter::Rev'>Rev</a><Self> <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'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><A, B, FromA, FromB>(self) -> <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><A>, 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><B>, Self: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a><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>></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
</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><A, B, FromA, FromB>(self) -> <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><A>, 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><B>, Self: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a><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>></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><'a, T>(self) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Cloned.html' title='core::iter::Cloned'>Cloned</a><Self> <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><Item=&'a T>, 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><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><'a, T>(self) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Cloned.html' title='core::iter::Cloned'>Cloned</a><Self> <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><Item=&'a T>, 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) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Cycle.html' title='core::iter::Cycle'>Cycle</a><Self> <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><S>(self) -> 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><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> + <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><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><S>(self) -> 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><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> + <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><P>(self) -> 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><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> + <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><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><P>(self) -> 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><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> + <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><I>(self, other: I) -> <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><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>>, 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>
|
||||
|
|
|
@ -79,43 +79,43 @@ contains their exclusive subsets. No optimization is done at this point.</p>
|
|||
<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>(&mut self, n: <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><Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>></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><U>(self, other: U) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Chain.html' title='core::iter::Chain'>Chain</a><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>> <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><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>></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
</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><U>(self, other: U) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Chain.html' title='core::iter::Chain'>Chain</a><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>> <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><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>></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><U>(self, other: U) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Zip.html' title='core::iter::Zip'>Zip</a><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>> <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><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><U>(self, other: U) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Zip.html' title='core::iter::Zip'>Zip</a><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>> <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>'Zips up' 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><B, F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Map.html' title='core::iter::Map'>Map</a><Self, F> <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>) -> B</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
</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><B, F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Map.html' title='core::iter::Map'>Map</a><Self, F> <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>) -> 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><P>(self, predicate: P) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Filter.html' title='core::iter::Filter'>Filter</a><Self, P> <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>) -> <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><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><P>(self, predicate: P) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Filter.html' title='core::iter::Filter'>Filter</a><Self, P> <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>) -> <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><B, F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.FilterMap.html' title='core::iter::FilterMap'>FilterMap</a><Self, F> <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>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><B></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
</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><B, F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.FilterMap.html' title='core::iter::FilterMap'>FilterMap</a><Self, F> <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>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><B></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) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Enumerate.html' title='core::iter::Enumerate'>Enumerate</a><Self></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) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Peekable.html' title='core::iter::Peekable'>Peekable</a><Self></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><P>(self, predicate: P) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.SkipWhile.html' title='core::iter::SkipWhile'>SkipWhile</a><Self, P> <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>) -> <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><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><P>(self, predicate: P) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.SkipWhile.html' title='core::iter::SkipWhile'>SkipWhile</a><Self, P> <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>) -> <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><P>(self, predicate: P) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.TakeWhile.html' title='core::iter::TakeWhile'>TakeWhile</a><Self, P> <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>) -> <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><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><P>(self, predicate: P) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.TakeWhile.html' title='core::iter::TakeWhile'>TakeWhile</a><Self, P> <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>) -> <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>) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Skip.html' title='core::iter::Skip'>Skip</a><Self></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>) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Take.html' title='core::iter::Take'>Take</a><Self></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><St, B, F>(self, initial_state: St, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Scan.html' title='core::iter::Scan'>Scan</a><Self, St, F> <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>(&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>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><B></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
</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><St, B, F>(self, initial_state: St, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Scan.html' title='core::iter::Scan'>Scan</a><Self, St, F> <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>(&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>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><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 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><U, F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.FlatMap.html' title='core::iter::FlatMap'>FlatMap</a><Self, U, F> <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>) -> 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><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><U, F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.FlatMap.html' title='core::iter::FlatMap'>FlatMap</a><Self, U, F> <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>) -> 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) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Fuse.html' title='core::iter::Fuse'>Fuse</a><Self></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><F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Inspect.html' title='core::iter::Inspect'>Inspect</a><Self, F> <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>) -> <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><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><F>(self, f: F) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Inspect.html' title='core::iter::Inspect'>Inspect</a><Self, F> <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>) -> <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>(&mut self) -> &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><B>(self) -> 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><Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>></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><B, F>(self, f: F) -> <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><Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>>, 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>) -> <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><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><B, F>(self, f: F) -> <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><Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>>, 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>) -> <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><B, F>(self, init: B, f: F) -> 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>) -> B</span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
</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><B, F>(self, init: B, f: F) -> 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>) -> 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><F>(&mut self, f: F) -> <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>) -> <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>
|
||||
|
@ -131,21 +131,21 @@ contains their exclusive subsets. No optimization is done at this point.</p>
|
|||
<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) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</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>> <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><B, F>(self, f: F) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</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>> <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>(&Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -> B</span></code><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div></h4>
|
||||
</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><B, F>(self, f: F) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</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>> <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>(&Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -> 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><B, F>(self, f: F) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</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>> <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>(&Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -> B</span></code><div class='since' title='Stable since Rust version 1.6.0'>1.6.0</div></h4>
|
||||
</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><B, F>(self, f: F) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</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>> <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>(&Self::<a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Item</a>) -> 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) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Rev.html' title='core::iter::Rev'>Rev</a><Self> <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'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><A, B, FromA, FromB>(self) -> <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><A>, 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><B>, Self: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a><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>></span></code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
</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><A, B, FromA, FromB>(self) -> <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><A>, 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><B>, Self: <a class='trait' href='https://doc.rust-lang.org/nightly/core/iter/iterator/trait.Iterator.html' title='core::iter::iterator::Iterator'>Iterator</a><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>></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><'a, T>(self) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Cloned.html' title='core::iter::Cloned'>Cloned</a><Self> <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><Item=&'a T>, 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><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><'a, T>(self) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Cloned.html' title='core::iter::Cloned'>Cloned</a><Self> <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><Item=&'a T>, 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) -> <a class='struct' href='https://doc.rust-lang.org/nightly/core/iter/struct.Cycle.html' title='core::iter::Cycle'>Cycle</a><Self> <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><S>(self) -> 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><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> + <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><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><S>(self) -> 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><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> + <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><P>(self) -> 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><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> + <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><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><P>(self) -> 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><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> + <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><I>(self, other: I) -> <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><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>>, 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>
|
||||
|
|
|
@ -53,14 +53,13 @@
|
|||
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><h2 class='fields'>Fields</h2><span id='structfield.mode'><code>mode: <a class='enum' href='../../qrcode/types/enum.Mode.html' title='qrcode::types::Mode'>Mode</a></code></span>
|
||||
<span class='stab '></span><div class='docblock'><p>The encoding mode of the segment of data.</p>
|
||||
</div><span id='structfield.begin'><code>begin: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code></span>
|
||||
<span class='stab '></span><div class='docblock'><p>The start index of the segment.</p>
|
||||
</div><span id='structfield.end'><code>end: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code></span>
|
||||
<span class='stab '></span><div class='docblock'><p>The end index (exclusive) of the segment.</p>
|
||||
</div><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>(&self, version: <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>) -> <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>
|
||||
|
|
132
qrcode/render/index.html
Normal file
132
qrcode/render/index.html
Normal file
|
@ -0,0 +1,132 @@
|
|||
<!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 `render` mod in crate `qrcode`.">
|
||||
<meta name="keywords" content="rust, rustlang, rust-lang, render">
|
||||
|
||||
<title>qrcode::render - 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: 'render', 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=''>render</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'>−</span>]
|
||||
</a>
|
||||
</span><a id='src-1053' class='srclink' href='../../src/qrcode/src/render.rs.html#1-220' title='goto source code'>[src]</a></span></h1>
|
||||
<div class='docblock'><p>Render a QR code into image.</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.Renderer.html'
|
||||
title='qrcode::render::Renderer'>Renderer</a></td>
|
||||
<td class='docblock short'>
|
||||
<p>A QR code renderer. This is a builder type which converts a bool-vector into
|
||||
an image.</p>
|
||||
</td>
|
||||
</tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
|
||||
<table>
|
||||
<tr class=' module-item'>
|
||||
<td><a class='trait' href='trait.BlankAndWhitePixel.html'
|
||||
title='qrcode::render::BlankAndWhitePixel'>BlankAndWhitePixel</a></td>
|
||||
<td class='docblock short'>
|
||||
<p>A pixel which can support black and white colors.</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>⇤</dt>
|
||||
<dd>Move up in search results</dd>
|
||||
<dt>⇥</dt>
|
||||
<dd>Move down in search results</dd>
|
||||
<dt>⏎</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/render/sidebar-items.js
Normal file
1
qrcode/render/sidebar-items.js
Normal file
|
@ -0,0 +1 @@
|
|||
initSidebarItems({"struct":[["Renderer","A QR code renderer. This is a builder type which converts a bool-vector into an image."]],"trait":[["BlankAndWhitePixel","A pixel which can support black and white colors."]]});
|
140
qrcode/render/struct.Renderer.html
Normal file
140
qrcode/render/struct.Renderer.html
Normal file
|
@ -0,0 +1,140 @@
|
|||
<!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 `Renderer` struct in crate `qrcode`.">
|
||||
<meta name="keywords" content="rust, rustlang, rust-lang, Renderer">
|
||||
|
||||
<title>qrcode::render::Renderer - 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'>render</a></p><script>window.sidebarCurrent = {name: 'Renderer', 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'>render</a>::<wbr><a class='struct' href=''>Renderer</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'>−</span>]
|
||||
</a>
|
||||
</span><a id='src-1079' class='srclink' href='../../src/qrcode/src/render.rs.html#55-64' title='goto source code'>[src]</a></span></h1>
|
||||
<pre class='rust struct'>pub struct Renderer<'a, P: <a class='trait' href='../../qrcode/render/trait.BlankAndWhitePixel.html' title='qrcode::render::BlankAndWhitePixel'>BlankAndWhitePixel</a>> {
|
||||
// some fields omitted
|
||||
}</pre><div class='docblock'><p>A QR code renderer. This is a builder type which converts a bool-vector into
|
||||
an image.</p>
|
||||
</div><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl<'a, P: <a class='trait' href='../../qrcode/render/trait.BlankAndWhitePixel.html' title='qrcode::render::BlankAndWhitePixel'>BlankAndWhitePixel</a> + 'static> <a class='struct' href='../../qrcode/render/struct.Renderer.html' title='qrcode::render::Renderer'>Renderer</a><'a, P></code></span><span class='out-of-band'><div class='ghost'></div><a id='src-1089' class='srclink' href='../../src/qrcode/src/render.rs.html#66-150' 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>(content: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>&'a [</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a><a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.slice.html'>]</a>, modules_count: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>, quiet_zone: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -> <a class='struct' href='../../qrcode/render/struct.Renderer.html' title='qrcode::render::Renderer'>Renderer</a><'a, P></code></h4>
|
||||
<div class='docblock'><p>Creates a new renderer.</p>
|
||||
</div><h4 id='method.dark_color' class='method'><code>fn <a href='#method.dark_color' class='fnname'>dark_color</a>(&mut self, color: P) -> &mut Self</code></h4>
|
||||
<div class='docblock'><p>Sets color of a dark module. Default is opaque black.</p>
|
||||
</div><h4 id='method.light_color' class='method'><code>fn <a href='#method.light_color' class='fnname'>light_color</a>(&mut self, color: P) -> &mut Self</code></h4>
|
||||
<div class='docblock'><p>Sets color of a light module. Default is opaque white.</p>
|
||||
</div><h4 id='method.quiet_zone' class='method'><code>fn <a href='#method.quiet_zone' class='fnname'>quiet_zone</a>(&mut self, has_quiet_zone: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>) -> &mut Self</code></h4>
|
||||
<div class='docblock'><p>Whether to include the quiet zone in the generated image.</p>
|
||||
</div><h4 id='method.module_size' class='method'><code>fn <a href='#method.module_size' class='fnname'>module_size</a>(&mut self, size: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -> &mut Self</code></h4>
|
||||
<div class='docblock'><p>Sets the size of each module in pixels. Default is 8px.</p>
|
||||
</div><h4 id='method.min_width' class='method'><code>fn <a href='#method.min_width' class='fnname'>min_width</a>(&mut self, width: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>) -> &mut Self</code></h4>
|
||||
<div class='docblock'><p>Sets the minimal total image width (and thus height) in pixels,
|
||||
including the quiet zone if applicable. The renderer will try to find
|
||||
the dimension as small as possible, such that each module in the QR code
|
||||
has uniform size (no distortion).</p>
|
||||
|
||||
<p>For instance, a version 1 QR code has 19 modules across including the
|
||||
quiet zone. If we request an image of width ≥200px, we get that each
|
||||
module's size should be 11px, so the actual image size will be 209px.</p>
|
||||
</div><h4 id='method.to_image' class='method'><code>fn <a href='#method.to_image' class='fnname'>to_image</a>(&self) -> <a class='struct' href='../../image/buffer/struct.ImageBuffer.html' title='image::buffer::ImageBuffer'>ImageBuffer</a><P, <a class='struct' href='https://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><P::Subpixel>></code></h4>
|
||||
<div class='docblock'><p>Renders the QR code into an image.</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>⇤</dt>
|
||||
<dd>Move up in search results</dd>
|
||||
<dt>⇥</dt>
|
||||
<dd>Move down in search results</dd>
|
||||
<dt>⏎</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>
|
130
qrcode/render/trait.BlankAndWhitePixel.html
Normal file
130
qrcode/render/trait.BlankAndWhitePixel.html
Normal file
|
@ -0,0 +1,130 @@
|
|||
<!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 `BlankAndWhitePixel` trait in crate `qrcode`.">
|
||||
<meta name="keywords" content="rust, rustlang, rust-lang, BlankAndWhitePixel">
|
||||
|
||||
<title>qrcode::render::BlankAndWhitePixel - 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'>render</a></p><script>window.sidebarCurrent = {name: 'BlankAndWhitePixel', ty: 'trait', 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 trait">
|
||||
<h1 class='fqn'><span class='in-band'>Trait <a href='../index.html'>qrcode</a>::<wbr><a href='index.html'>render</a>::<wbr><a class='trait' href=''>BlankAndWhitePixel</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'>−</span>]
|
||||
</a>
|
||||
</span><a id='src-1056' class='srclink' href='../../src/qrcode/src/render.rs.html#8-11' title='goto source code'>[src]</a></span></h1>
|
||||
<pre class='rust trait'>pub trait BlankAndWhitePixel: <a class='trait' href='../../image/buffer/trait.Pixel.html' title='image::buffer::Pixel'>Pixel</a> {
|
||||
fn <a href='#tymethod.black_color' class='fnname'>black_color</a>() -> Self;
|
||||
fn <a href='#tymethod.white_color' class='fnname'>white_color</a>() -> Self;
|
||||
}</pre><div class='docblock'><p>A pixel which can support black and white colors.</p>
|
||||
</div>
|
||||
<h2 id='required-methods'>Required Methods</h2>
|
||||
<div class='methods'>
|
||||
<h3 id='tymethod.black_color' class='method stab '><code>fn <a href='#tymethod.black_color' class='fnname'>black_color</a>() -> Self</code></h3><h3 id='tymethod.white_color' class='method stab '><code>fn <a href='#tymethod.white_color' class='fnname'>white_color</a>() -> Self</code></h3></div>
|
||||
<h2 id='implementors'>Implementors</h2>
|
||||
<ul class='item-list' id='implementors-list'>
|
||||
<li><code>impl<S: <a class='trait' href='../../image/traits/trait.Primitive.html' title='image::traits::Primitive'>Primitive</a> + 'static> BlankAndWhitePixel for <a class='struct' href='../../image/color/struct.Rgb.html' title='image::color::Rgb'>Rgb</a><S></code></li>
|
||||
<li><code>impl<S: <a class='trait' href='../../image/traits/trait.Primitive.html' title='image::traits::Primitive'>Primitive</a> + 'static> BlankAndWhitePixel for <a class='struct' href='../../image/color/struct.Rgba.html' title='image::color::Rgba'>Rgba</a><S></code></li>
|
||||
<li><code>impl<S: <a class='trait' href='../../image/traits/trait.Primitive.html' title='image::traits::Primitive'>Primitive</a> + 'static> BlankAndWhitePixel for <a class='struct' href='../../image/color/struct.Luma.html' title='image::color::Luma'>Luma</a><S></code></li>
|
||||
<li><code>impl<S: <a class='trait' href='../../image/traits/trait.Primitive.html' title='image::traits::Primitive'>Primitive</a> + 'static> BlankAndWhitePixel for <a class='struct' href='../../image/color/struct.LumaA.html' title='image::color::LumaA'>LumaA</a><S></code></li>
|
||||
</ul><script type="text/javascript" async
|
||||
src="../../implementors/qrcode/render/trait.BlankAndWhitePixel.js">
|
||||
</script></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>⇤</dt>
|
||||
<dd>Move up in search results</dd>
|
||||
<dt>⇥</dt>
|
||||
<dd>Move down in search results</dd>
|
||||
<dt>⏎</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 +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."]]});
|
||||
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."],["render","Render a QR code into image."],["types",""]],"struct":[["QrCode","The encoded QR code symbol."]]});
|
|
@ -47,12 +47,12 @@
|
|||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
|
||||
[<span class='inner'>−</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>
|
||||
</span><a id='src-1132' class='srclink' href='../src/qrcode/src/lib.rs.html#48-53' 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><D: <a class='trait' href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a><<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>>>(data: D) -> <a class='type' href='../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a><<a class='struct' href='../qrcode/struct.QrCode.html' title='qrcode::QrCode'>QrCode</a>></code></h4>
|
||||
</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-1144' class='srclink' href='../src/qrcode/src/lib.rs.html#55-204' 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><D: <a class='trait' href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a><<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>>>(data: D) -> <a class='type' href='../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a><<a class='struct' href='../qrcode/struct.QrCode.html' title='qrcode::QrCode'>QrCode</a>></code></h4>
|
||||
<div class='docblock'><p>Constructs a new QR code which automatically encodes the given data.</p>
|
||||
|
||||
<p>This method uses the "medium" error correction level and automatically
|
||||
|
@ -62,7 +62,7 @@ chooses the smallest QR code.</p>
|
|||
<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"Some data"</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><D: <a class='trait' href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a><<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>>>(data: D, ec_level: <a class='enum' href='../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -> <a class='type' href='../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a><<a class='struct' href='../qrcode/struct.QrCode.html' title='qrcode::QrCode'>QrCode</a>></code></h4>
|
||||
</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><D: <a class='trait' href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a><<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>>>(data: D, ec_level: <a class='enum' href='../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -> <a class='type' href='../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a><<a class='struct' href='../qrcode/struct.QrCode.html' title='qrcode::QrCode'>QrCode</a>></code></h4>
|
||||
<div class='docblock'><p>Constructs a new QR code which automatically encodes the given data at a
|
||||
specific error correction level.</p>
|
||||
|
||||
|
@ -72,7 +72,7 @@ specific error correction level.</p>
|
|||
<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"Some data"</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><D: <a class='trait' href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a><<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>>>(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>) -> <a class='type' href='../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a><<a class='struct' href='../qrcode/struct.QrCode.html' title='qrcode::QrCode'>QrCode</a>></code></h4>
|
||||
</div><h4 id='method.with_version' class='method'><code>fn <a href='#method.with_version' class='fnname'>with_version</a><D: <a class='trait' href='https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html' title='core::convert::AsRef'>AsRef</a><<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>>>(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>) -> <a class='type' href='../qrcode/types/type.QrResult.html' title='qrcode::types::QrResult'>QrResult</a><<a class='struct' href='../qrcode/struct.QrCode.html' title='qrcode::QrCode'>QrCode</a>></code></h4>
|
||||
<div class='docblock'><p>Constructs a new QR code for the given version and error correction
|
||||
level.</p>
|
||||
|
||||
|
@ -136,12 +136,13 @@ color of the module, with "true" means dark and "false" mean
|
|||
</div><h4 id='method.into_vec' class='method'><code>fn <a href='#method.into_vec' class='fnname'>into_vec</a>(self) -> <a class='struct' href='https://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>></code></h4>
|
||||
<div class='docblock'><p>Converts the QR code to a vector of booleans. Each entry represents the
|
||||
color of the module, with "true" means dark and "false" 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><<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>> 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><h4 id='method.render' class='method'><code>fn <a href='#method.render' class='fnname'>render</a><P: <a class='trait' href='../qrcode/render/trait.BlankAndWhitePixel.html' title='qrcode::render::BlankAndWhitePixel'>BlankAndWhitePixel</a> + 'static>(&self) -> <a class='struct' href='../qrcode/render/struct.Renderer.html' title='qrcode::render::Renderer'>Renderer</a><P></code></h4>
|
||||
</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><<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>> 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-1203' class='srclink' href='../src/qrcode/src/lib.rs.html#206-213' 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>(&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>) -> &<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></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-1137' class='srclink' href='../src/qrcode/src/lib.rs.html#47' 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>(&self) -> <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>(&mut self, source: &Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></h4>
|
||||
|
|
|
@ -56,11 +56,11 @@
|
|||
}</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>"Quartile" 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>
|
||||
<span id='variant.L' class='variant'><code>L</code></span><div class='docblock'><p>Low error correction. Allows up to 7% of wrong blocks.</p>
|
||||
</div><span id='variant.M' class='variant'><code>M</code></span><div class='docblock'><p>Medium error correction (default). Allows up to 15% of wrong blocks.</p>
|
||||
</div><span id='variant.Q' class='variant'><code>Q</code></span><div class='docblock'><p>"Quartile" error correction. Allows up to 25% of wrong blocks.</p>
|
||||
</div><span id='variant.H' class='variant'><code>H</code></span><div class='docblock'><p>High error correction. Allows up to 30% of wrong blocks.</p>
|
||||
</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/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>(&self, __arg_0: &<a class='enum' href='../../qrcode/types/enum.EcLevel.html' title='qrcode::types::EcLevel'>EcLevel</a>) -> <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>
|
||||
|
|
|
@ -55,12 +55,12 @@
|
|||
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 (A–Z), numbers (0–9) and a few
|
||||
<span id='variant.Numeric' class='variant'><code>Numeric</code></span><div class='docblock'><p>The data contains only characters 0 to 9.</p>
|
||||
</div><span id='variant.Alphanumeric' class='variant'><code>Alphanumeric</code></span><div class='docblock'><p>The data contains only uppercase letters (A–Z), numbers (0–9) 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><span id='variant.Byte' class='variant'><code>Byte</code></span><div class='docblock'><p>The data contains arbitrary binary data.</p>
|
||||
</div><span id='variant.Kanji' class='variant'><code>Kanji</code></span><div class='docblock'><p>The data contains Shift-JIS-encoded double-byte text.</p>
|
||||
</div><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>(&self, version: <a class='enum' href='../../qrcode/types/enum.Version.html' title='qrcode::types::Version'>Version</a>) -> <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>
|
||||
|
||||
|
|
|
@ -56,15 +56,15 @@
|
|||
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
|
||||
<span id='variant.DataTooLong' class='variant'><code>DataTooLong</code></span><div class='docblock'><p>The data is too long to encode into a QR code for the given version.</p>
|
||||
</div><span id='variant.InvalidVersion' class='variant'><code>InvalidVersion</code></span><div class='docblock'><p>The provided version / error correction level combination is invalid.</p>
|
||||
</div><span id='variant.UnsupportedCharacterSet' class='variant'><code>UnsupportedCharacterSet</code></span><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
|
||||
</div><span id='variant.InvalidEciDesignator' class='variant'><code>InvalidEciDesignator</code></span><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>(&self, fmt: &mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a><<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>></code></h4>
|
||||
</div><span id='variant.InvalidCharacter' class='variant'><code>InvalidCharacter</code></span><div class='docblock'><p>A character not belonging to the character set is found.</p>
|
||||
</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/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>(&self, fmt: &mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a><<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>></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>(&self) -> <a class='enum' href='../../qrcode/types/enum.QrError.html' title='qrcode::types::QrError'>QrError</a></code></h4>
|
||||
|
|
|
@ -58,9 +58,9 @@ 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>
|
||||
<span id='variant.Normal' class='variant'><code>Normal(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i16.html'>i16</a>)</code></span><div class='docblock'><p>A normal QR code version. The parameter should be between 1 and 40.</p>
|
||||
</div><span id='variant.Micro' class='variant'><code>Micro(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.i16.html'>i16</a>)</code></span><div class='docblock'><p>A Micro QR code version. The parameter should be between 1 and 4.</p>
|
||||
</div><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>(&self) -> <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 "modules" on each size of the QR code, i.e. the width
|
||||
and height of the code.</p>
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
[<span class='inner'>−</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<T> = <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a><T, <a class='enum' href='../../qrcode/types/enum.QrError.html' title='qrcode::types::QrError'>QrError</a>>;</pre><div class='docblock'><p><code>QrResult</code> is a convenient alias for a QR code generation result.</p>
|
||||
<pre class='rust typedef'>type QrResult<T> = <a class='enum' href='https://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a><T, <a class='enum' href='../../qrcode/types/enum.QrError.html' title='qrcode::types::QrError'>QrError</a>>;</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>
|
||||
|
||||
|
|
19
rustdoc.css
19
rustdoc.css
|
@ -265,6 +265,10 @@ nav.sub {
|
|||
.docblock h2 { font-size: 1.15em; }
|
||||
.docblock h3, .docblock h4, .docblock h5 { font-size: 1em; }
|
||||
|
||||
.docblock {
|
||||
margin-left: 24px;
|
||||
}
|
||||
|
||||
.content .out-of-band {
|
||||
font-size: 23px;
|
||||
margin: 0px;
|
||||
|
@ -640,6 +644,21 @@ span.since {
|
|||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.enum > .toggle-wrapper > .collapse-toggle, .struct > .toggle-wrapper > .collapse-toggle {
|
||||
left: 0;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
|
||||
margin-left: 30px;
|
||||
margin-bottom: 20px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.enum > .collapsed, .struct > .collapsed {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
:target > code {
|
||||
background: #FDFFD3;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -939,19 +939,6 @@
|
|||
<span id="895">895</span>
|
||||
<span id="896">896</span>
|
||||
<span id="897">897</span>
|
||||
<span id="898">898</span>
|
||||
<span id="899">899</span>
|
||||
<span id="900">900</span>
|
||||
<span id="901">901</span>
|
||||
<span id="902">902</span>
|
||||
<span id="903">903</span>
|
||||
<span id="904">904</span>
|
||||
<span id="905">905</span>
|
||||
<span id="906">906</span>
|
||||
<span id="907">907</span>
|
||||
<span id="908">908</span>
|
||||
<span id="909">909</span>
|
||||
<span id="910">910</span>
|
||||
</pre><pre class='rust '>
|
||||
<span class='doccomment'>//! The `bits` module encodes binary data into raw bits used in a QR code.</span>
|
||||
|
||||
|
@ -1849,19 +1836,6 @@
|
|||
<span class='comment'>//}}}</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 "License"); 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 "AS IS" 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>
|
||||
|
|
|
@ -1929,19 +1929,6 @@
|
|||
<span id="1885">1885</span>
|
||||
<span id="1886">1886</span>
|
||||
<span id="1887">1887</span>
|
||||
<span id="1888">1888</span>
|
||||
<span id="1889">1889</span>
|
||||
<span id="1890">1890</span>
|
||||
<span id="1891">1891</span>
|
||||
<span id="1892">1892</span>
|
||||
<span id="1893">1893</span>
|
||||
<span id="1894">1894</span>
|
||||
<span id="1895">1895</span>
|
||||
<span id="1896">1896</span>
|
||||
<span id="1897">1897</span>
|
||||
<span id="1898">1898</span>
|
||||
<span id="1899">1899</span>
|
||||
<span id="1900">1900</span>
|
||||
</pre><pre class='rust '>
|
||||
<span class='doccomment'>//! The `canvas` module puts raw bits into the QR code canvas.</span>
|
||||
<span class='doccomment'>//!</span>
|
||||
|
@ -1956,13 +1943,13 @@
|
|||
|
||||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>iter</span>::<span class='ident'>repeat</span>;
|
||||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>cmp</span>::<span class='ident'>max</span>;
|
||||
<span class='kw'>use</span> <span class='ident'>num</span>::<span class='ident'>traits</span>::<span class='ident'>PrimInt</span>;
|
||||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>ops</span>::<span class='ident'>Range</span>;
|
||||
|
||||
<span class='kw'>use</span> <span class='ident'>num_traits</span>::<span class='ident'>PrimInt</span>;
|
||||
|
||||
<span class='kw'>use</span> <span class='ident'>types</span>::{<span class='ident'>Version</span>, <span class='ident'>EcLevel</span>};
|
||||
|
||||
<span class='comment'>// TODO remove this after it is decided whether we want `p ... q` or</span>
|
||||
<span class='comment'>// `(p .. q).inclusive()`</span>
|
||||
<span class='comment'>// TODO remove this after `p ... q` becomes stable. See rust-lang/rust#28237.</span>
|
||||
<span class='kw'>fn</span> <span class='ident'>range_inclusive</span><span class='op'><</span><span class='ident'>N</span>: <span class='ident'>PrimInt</span><span class='op'>></span>(<span class='ident'>from</span>: <span class='ident'>N</span>, <span class='ident'>to</span>: <span class='ident'>N</span>) <span class='op'>-></span> <span class='ident'>Range</span><span class='op'><</span><span class='ident'>N</span><span class='op'>></span> {
|
||||
<span class='ident'>from</span> .. (<span class='ident'>to</span> <span class='op'>+</span> <span class='ident'>N</span>::<span class='ident'>one</span>())
|
||||
}
|
||||
|
@ -3829,19 +3816,6 @@
|
|||
<span class='comment'>//}}}</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 "License"); 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 "AS IS" 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>
|
||||
|
|
|
@ -489,19 +489,6 @@
|
|||
<span id="445">445</span>
|
||||
<span id="446">446</span>
|
||||
<span id="447">447</span>
|
||||
<span id="448">448</span>
|
||||
<span id="449">449</span>
|
||||
<span id="450">450</span>
|
||||
<span id="451">451</span>
|
||||
<span id="452">452</span>
|
||||
<span id="453">453</span>
|
||||
<span id="454">454</span>
|
||||
<span id="455">455</span>
|
||||
<span id="456">456</span>
|
||||
<span id="457">457</span>
|
||||
<span id="458">458</span>
|
||||
<span id="459">459</span>
|
||||
<span id="460">460</span>
|
||||
</pre><pre class='rust '>
|
||||
<span class='doccomment'>//! The `ec` module applies the Reed-Solomon error correction codes.</span>
|
||||
|
||||
|
@ -949,19 +936,6 @@
|
|||
|
||||
<span class='comment'>//}}}</span>
|
||||
|
||||
<span class='comment'>// Copyright 2014-2016 kennytm</span>
|
||||
<span class='comment'>//</span>
|
||||
<span class='comment'>// Licensed under the Apache License, Version 2.0 (the "License"); 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 "AS IS" 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>
|
||||
|
|
|
@ -307,42 +307,79 @@
|
|||
<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>
|
||||
</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'>//! extern crate image;</span>
|
||||
<span class='doccomment'>//! extern crate qrcode;</span>
|
||||
<span class='doccomment'>//!</span>
|
||||
<span class='doccomment'>//! let code = QrCode::new(b"Some content here.");</span>
|
||||
<span class='doccomment'>//! match code {</span>
|
||||
<span class='doccomment'>//! Err(err) => panic!("Failed to encode the QR code: {:?}", err),</span>
|
||||
<span class='doccomment'>//! Ok(code) => {</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)] { "black" } else { "white" };</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'>//! use image::GrayImage;</span>
|
||||
<span class='doccomment'>//! use qrcode::QrCode;</span>
|
||||
<span class='doccomment'>//!</span>
|
||||
<span class='doccomment'>//! # fn main() {</span>
|
||||
<span class='doccomment'>//!</span>
|
||||
<span class='doccomment'>//! let code = QrCode::new(b"Some content here.");</span>
|
||||
<span class='doccomment'>//! match code {</span>
|
||||
<span class='doccomment'>//! Err(err) => panic!("Failed to encode the QR code: {:?}", err),</span>
|
||||
<span class='doccomment'>//! Ok(code) => {</span>
|
||||
<span class='doccomment'>//! let image: GrayImage = code.render().min_width(100).to_image();</span>
|
||||
<span class='doccomment'>//! // render `image`...</span>
|
||||
<span class='doccomment'>//! }</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'>"bench"</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'>"bench"</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='attribute'>#[<span class='ident'>cfg</span>(<span class='ident'>feature</span><span class='op'>=</span><span class='string'>"bench"</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_traits</span>;
|
||||
<span class='attribute'>#[<span class='ident'>cfg</span>(<span class='ident'>feature</span><span class='op'>=</span><span class='string'>"image"</span>)]</span> <span class='kw'>extern</span> <span class='kw'>crate</span> <span class='ident'>image</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='kw'>pub</span> <span class='kw'>mod</span> <span class='ident'>render</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='attribute'>#[<span class='ident'>cfg</span>(<span class='ident'>feature</span><span class='op'>=</span><span class='string'>"image"</span>)]</span> <span class='kw'>use</span> <span class='ident'>render</span>::{<span class='ident'>BlankAndWhitePixel</span>, <span class='ident'>Renderer</span>};
|
||||
|
||||
<span class='doccomment'>/// The encoded QR code symbol.</span>
|
||||
<span class='attribute'>#[<span class='ident'>derive</span>(<span class='ident'>Clone</span>)]</span>
|
||||
|
@ -496,6 +533,12 @@
|
|||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>into_vec</span>(<span class='self'>self</span>) <span class='op'>-></span> <span class='ident'>Vec</span><span class='op'><</span><span class='ident'>bool</span><span class='op'>></span> {
|
||||
<span class='self'>self</span>.<span class='ident'>content</span>
|
||||
}
|
||||
|
||||
<span class='attribute'>#[<span class='ident'>cfg</span>(<span class='ident'>feature</span><span class='op'>=</span><span class='string'>"image"</span>)]</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>render</span><span class='op'><</span><span class='ident'>P</span>: <span class='ident'>BlankAndWhitePixel</span> <span class='op'>+</span> <span class='lifetime'>'static</span><span class='op'>></span>(<span class='kw-2'>&</span><span class='self'>self</span>) <span class='op'>-></span> <span class='ident'>Renderer</span><span class='op'><</span><span class='ident'>P</span><span class='op'>></span> {
|
||||
<span class='kw'>let</span> <span class='ident'>quiet_zone</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='self'>self</span>.<span class='ident'>version</span>.<span class='ident'>is_micro</span>() { <span class='number'>2</span> } <span class='kw'>else</span> { <span class='number'>4</span> };
|
||||
<span class='ident'>Renderer</span>::<span class='ident'>new</span>(<span class='kw-2'>&</span><span class='self'>self</span>.<span class='ident'>content</span>, <span class='self'>self</span>.<span class='ident'>width</span>, <span class='ident'>quiet_zone</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class='kw'>impl</span> <span class='ident'>Index</span><span class='op'><</span>(<span class='ident'>usize</span>, <span class='ident'>usize</span>)<span class='op'>></span> <span class='kw'>for</span> <span class='ident'>QrCode</span> {
|
||||
|
@ -559,19 +602,32 @@
|
|||
}
|
||||
}
|
||||
|
||||
<span class='comment'>// Copyright 2014 Kenny Chan</span>
|
||||
<span class='comment'>//</span>
|
||||
<span class='comment'>// Licensed under the Apache License, Version 2.0 (the "License"); 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 "AS IS" 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>
|
||||
<span class='attribute'>#[<span class='ident'>cfg</span>(<span class='ident'>all</span>(<span class='ident'>test</span>, <span class='ident'>feature</span><span class='op'>=</span><span class='string'>"image"</span>))]</span>
|
||||
<span class='kw'>mod</span> <span class='ident'>image_tests</span> {
|
||||
<span class='kw'>use</span> <span class='ident'>image</span>::{<span class='ident'>GrayImage</span>, <span class='ident'>Rgb</span>, <span class='ident'>load_from_memory</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_as_image</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"01234567"</span>).<span class='ident'>unwrap</span>();
|
||||
<span class='kw'>let</span> <span class='ident'>image</span>: <span class='ident'>GrayImage</span> <span class='op'>=</span> <span class='ident'>code</span>.<span class='ident'>render</span>().<span class='ident'>to_image</span>();
|
||||
<span class='kw'>let</span> <span class='ident'>expected</span> <span class='op'>=</span> <span class='ident'>load_from_memory</span>(<span class='macro'>include_bytes</span><span class='macro'>!</span>(<span class='string'>"test_annex_i_qr_as_image.png"</span>)).<span class='ident'>unwrap</span>().<span class='ident'>to_luma</span>();
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>image</span>.<span class='ident'>dimensions</span>(), <span class='ident'>expected</span>.<span class='ident'>dimensions</span>());
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>image</span>.<span class='ident'>into_raw</span>(), <span class='ident'>expected</span>.<span class='ident'>into_raw</span>());
|
||||
}
|
||||
|
||||
<span class='attribute'>#[<span class='ident'>test</span>]</span>
|
||||
<span class='kw'>fn</span> <span class='ident'>test_annex_i_micro_qr_as_image</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"01234567"</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='kw'>let</span> <span class='ident'>image</span> <span class='op'>=</span> <span class='ident'>code</span>.<span class='ident'>render</span>().<span class='ident'>min_width</span>(<span class='number'>200</span>)
|
||||
.<span class='ident'>dark_color</span>(<span class='ident'>Rgb</span> { <span class='ident'>data</span>: [<span class='number'>128</span>, <span class='number'>0</span>, <span class='number'>0</span>] })
|
||||
.<span class='ident'>light_color</span>(<span class='ident'>Rgb</span> { <span class='ident'>data</span>: [<span class='number'>255</span>, <span class='number'>255</span>, <span class='number'>128</span>] })
|
||||
.<span class='ident'>to_image</span>();
|
||||
<span class='kw'>let</span> <span class='ident'>expected</span> <span class='op'>=</span> <span class='ident'>load_from_memory</span>(<span class='macro'>include_bytes</span><span class='macro'>!</span>(<span class='string'>"test_annex_i_micro_qr_as_image.png"</span>)).<span class='ident'>unwrap</span>().<span class='ident'>to_rgb</span>();
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>image</span>.<span class='ident'>dimensions</span>(), <span class='ident'>expected</span>.<span class='ident'>dimensions</span>());
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>image</span>.<span class='ident'>into_raw</span>(), <span class='ident'>expected</span>.<span class='ident'>into_raw</span>());
|
||||
}
|
||||
}
|
||||
|
||||
</pre>
|
||||
</section>
|
||||
|
|
|
@ -721,19 +721,6 @@
|
|||
<span id="677">677</span>
|
||||
<span id="678">678</span>
|
||||
<span id="679">679</span>
|
||||
<span id="680">680</span>
|
||||
<span id="681">681</span>
|
||||
<span id="682">682</span>
|
||||
<span id="683">683</span>
|
||||
<span id="684">684</span>
|
||||
<span id="685">685</span>
|
||||
<span id="686">686</span>
|
||||
<span id="687">687</span>
|
||||
<span id="688">688</span>
|
||||
<span id="689">689</span>
|
||||
<span id="690">690</span>
|
||||
<span id="691">691</span>
|
||||
<span id="692">692</span>
|
||||
</pre><pre class='rust '>
|
||||
<span class='doccomment'>//! Find the optimal data mode sequence to encode a piece of data.</span>
|
||||
<span class='kw'>use</span> <span class='ident'>std</span>::<span class='ident'>slice</span>::<span class='ident'>Iter</span>;
|
||||
|
@ -1413,19 +1400,6 @@
|
|||
|
||||
<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 "License"); 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 "AS IS" 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>
|
||||
|
|
554
src/qrcode/src/render.rs.html
Normal file
554
src/qrcode/src/render.rs.html
Normal file
|
@ -0,0 +1,554 @@
|
|||
<!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/render.rs`.">
|
||||
<meta name="keywords" content="rust, rustlang, rust-lang">
|
||||
|
||||
<title>render.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>
|
||||
</pre><pre class='rust '>
|
||||
<span class='doccomment'>//! Render a QR code into image.</span>
|
||||
|
||||
<span class='attribute'>#<span class='op'>!</span>[<span class='ident'>cfg</span>(<span class='ident'>feature</span><span class='op'>=</span><span class='string'>"image"</span>)]</span>
|
||||
|
||||
<span class='kw'>use</span> <span class='ident'>image</span>::{<span class='ident'>Pixel</span>, <span class='ident'>Rgb</span>, <span class='ident'>Rgba</span>, <span class='ident'>Luma</span>, <span class='ident'>LumaA</span>, <span class='ident'>Primitive</span>, <span class='ident'>ImageBuffer</span>};
|
||||
|
||||
<span class='doccomment'>/// A pixel which can support black and white colors.</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>trait</span> <span class='ident'>BlankAndWhitePixel</span>: <span class='ident'>Pixel</span> {
|
||||
<span class='kw'>fn</span> <span class='ident'>black_color</span>() <span class='op'>-></span> <span class='self'>Self</span>;
|
||||
<span class='kw'>fn</span> <span class='ident'>white_color</span>() <span class='op'>-></span> <span class='self'>Self</span>;
|
||||
}
|
||||
|
||||
<span class='kw'>impl</span><span class='op'><</span><span class='ident'>S</span>: <span class='ident'>Primitive</span> <span class='op'>+</span> <span class='lifetime'>'static</span><span class='op'>></span> <span class='ident'>BlankAndWhitePixel</span> <span class='kw'>for</span> <span class='ident'>Rgb</span><span class='op'><</span><span class='ident'>S</span><span class='op'>></span> {
|
||||
<span class='kw'>fn</span> <span class='ident'>black_color</span>() <span class='op'>-></span> <span class='self'>Self</span> {
|
||||
<span class='ident'>Rgb</span> { <span class='ident'>data</span>: [<span class='ident'>S</span>::<span class='ident'>zero</span>(); <span class='number'>3</span>] }
|
||||
}
|
||||
|
||||
<span class='kw'>fn</span> <span class='ident'>white_color</span>() <span class='op'>-></span> <span class='self'>Self</span> {
|
||||
<span class='ident'>Rgb</span> { <span class='ident'>data</span>: [<span class='ident'>S</span>::<span class='ident'>max_value</span>(); <span class='number'>3</span>] }
|
||||
}
|
||||
}
|
||||
|
||||
<span class='kw'>impl</span><span class='op'><</span><span class='ident'>S</span>: <span class='ident'>Primitive</span> <span class='op'>+</span> <span class='lifetime'>'static</span><span class='op'>></span> <span class='ident'>BlankAndWhitePixel</span> <span class='kw'>for</span> <span class='ident'>Rgba</span><span class='op'><</span><span class='ident'>S</span><span class='op'>></span> {
|
||||
<span class='kw'>fn</span> <span class='ident'>black_color</span>() <span class='op'>-></span> <span class='self'>Self</span> {
|
||||
<span class='ident'>Rgba</span> { <span class='ident'>data</span>: [<span class='ident'>S</span>::<span class='ident'>zero</span>(), <span class='ident'>S</span>::<span class='ident'>zero</span>(), <span class='ident'>S</span>::<span class='ident'>zero</span>(), <span class='ident'>S</span>::<span class='ident'>max_value</span>()] }
|
||||
}
|
||||
|
||||
<span class='kw'>fn</span> <span class='ident'>white_color</span>() <span class='op'>-></span> <span class='self'>Self</span> {
|
||||
<span class='ident'>Rgba</span> { <span class='ident'>data</span>: [<span class='ident'>S</span>::<span class='ident'>max_value</span>(); <span class='number'>4</span>] }
|
||||
}
|
||||
}
|
||||
|
||||
<span class='kw'>impl</span><span class='op'><</span><span class='ident'>S</span>: <span class='ident'>Primitive</span> <span class='op'>+</span> <span class='lifetime'>'static</span><span class='op'>></span> <span class='ident'>BlankAndWhitePixel</span> <span class='kw'>for</span> <span class='ident'>Luma</span><span class='op'><</span><span class='ident'>S</span><span class='op'>></span> {
|
||||
<span class='kw'>fn</span> <span class='ident'>black_color</span>() <span class='op'>-></span> <span class='self'>Self</span> {
|
||||
<span class='ident'>Luma</span> { <span class='ident'>data</span>: [<span class='ident'>S</span>::<span class='ident'>zero</span>()] }
|
||||
}
|
||||
|
||||
<span class='kw'>fn</span> <span class='ident'>white_color</span>() <span class='op'>-></span> <span class='self'>Self</span> {
|
||||
<span class='ident'>Luma</span> { <span class='ident'>data</span>: [<span class='ident'>S</span>::<span class='ident'>max_value</span>()] }
|
||||
}
|
||||
}
|
||||
|
||||
<span class='kw'>impl</span><span class='op'><</span><span class='ident'>S</span>: <span class='ident'>Primitive</span> <span class='op'>+</span> <span class='lifetime'>'static</span><span class='op'>></span> <span class='ident'>BlankAndWhitePixel</span> <span class='kw'>for</span> <span class='ident'>LumaA</span><span class='op'><</span><span class='ident'>S</span><span class='op'>></span> {
|
||||
<span class='kw'>fn</span> <span class='ident'>black_color</span>() <span class='op'>-></span> <span class='self'>Self</span> {
|
||||
<span class='ident'>LumaA</span> { <span class='ident'>data</span>: [<span class='ident'>S</span>::<span class='ident'>zero</span>(), <span class='ident'>S</span>::<span class='ident'>max_value</span>()] }
|
||||
}
|
||||
|
||||
<span class='kw'>fn</span> <span class='ident'>white_color</span>() <span class='op'>-></span> <span class='self'>Self</span> {
|
||||
<span class='ident'>LumaA</span> { <span class='ident'>data</span>: [<span class='ident'>S</span>::<span class='ident'>max_value</span>(); <span class='number'>2</span>] }
|
||||
}
|
||||
}
|
||||
|
||||
<span class='doccomment'>/// A QR code renderer. This is a builder type which converts a bool-vector into</span>
|
||||
<span class='doccomment'>/// an image.</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>struct</span> <span class='ident'>Renderer</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='ident'>P</span>: <span class='ident'>BlankAndWhitePixel</span><span class='op'>></span> {
|
||||
<span class='ident'>content</span>: <span class='kw-2'>&</span><span class='lifetime'>'a</span> [<span class='ident'>bool</span>],
|
||||
<span class='ident'>modules_count</span>: <span class='ident'>u32</span>, <span class='comment'>// <- we call it `modules_count` here to avoid ambiguity of `width`.</span>
|
||||
<span class='ident'>quiet_zone</span>: <span class='ident'>u32</span>,
|
||||
<span class='ident'>module_size</span>: <span class='ident'>u32</span>,
|
||||
|
||||
<span class='ident'>dark_color</span>: <span class='ident'>P</span>,
|
||||
<span class='ident'>light_color</span>: <span class='ident'>P</span>,
|
||||
<span class='ident'>has_quiet_zone</span>: <span class='ident'>bool</span>,
|
||||
}
|
||||
|
||||
<span class='kw'>impl</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='ident'>P</span>: <span class='ident'>BlankAndWhitePixel</span> <span class='op'>+</span> <span class='lifetime'>'static</span><span class='op'>></span> <span class='ident'>Renderer</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='ident'>P</span><span class='op'>></span> {
|
||||
<span class='doccomment'>/// Creates a new renderer.</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>new</span>(<span class='ident'>content</span>: <span class='kw-2'>&</span><span class='lifetime'>'a</span> [<span class='ident'>bool</span>], <span class='ident'>modules_count</span>: <span class='ident'>usize</span>, <span class='ident'>quiet_zone</span>: <span class='ident'>u32</span>) <span class='op'>-></span> <span class='ident'>Renderer</span><span class='op'><</span><span class='lifetime'>'a</span>, <span class='ident'>P</span><span class='op'>></span> {
|
||||
<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>modules_count</span> <span class='op'>*</span> <span class='ident'>modules_count</span> <span class='op'>==</span> <span class='ident'>content</span>.<span class='ident'>len</span>());
|
||||
<span class='ident'>Renderer</span> {
|
||||
<span class='ident'>content</span>: <span class='ident'>content</span>,
|
||||
<span class='ident'>modules_count</span>: <span class='ident'>modules_count</span> <span class='kw'>as</span> <span class='ident'>u32</span>,
|
||||
<span class='ident'>quiet_zone</span>: <span class='ident'>quiet_zone</span>,
|
||||
<span class='ident'>module_size</span>: <span class='number'>8</span>,
|
||||
<span class='ident'>dark_color</span>: <span class='ident'>P</span>::<span class='ident'>black_color</span>(),
|
||||
<span class='ident'>light_color</span>: <span class='ident'>P</span>::<span class='ident'>white_color</span>(),
|
||||
<span class='ident'>has_quiet_zone</span>: <span class='boolvalue'>true</span>,
|
||||
}
|
||||
}
|
||||
|
||||
<span class='doccomment'>/// Sets color of a dark module. Default is opaque black.</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>dark_color</span>(<span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>color</span>: <span class='ident'>P</span>) <span class='op'>-></span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>Self</span> {
|
||||
<span class='self'>self</span>.<span class='ident'>dark_color</span> <span class='op'>=</span> <span class='ident'>color</span>;
|
||||
<span class='self'>self</span>
|
||||
}
|
||||
|
||||
<span class='doccomment'>/// Sets color of a light module. Default is opaque white.</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>light_color</span>(<span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>color</span>: <span class='ident'>P</span>) <span class='op'>-></span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>Self</span> {
|
||||
<span class='self'>self</span>.<span class='ident'>light_color</span> <span class='op'>=</span> <span class='ident'>color</span>;
|
||||
<span class='self'>self</span>
|
||||
}
|
||||
|
||||
<span class='doccomment'>/// Whether to include the quiet zone in the generated image.</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>quiet_zone</span>(<span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>has_quiet_zone</span>: <span class='ident'>bool</span>) <span class='op'>-></span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>Self</span> {
|
||||
<span class='self'>self</span>.<span class='ident'>has_quiet_zone</span> <span class='op'>=</span> <span class='ident'>has_quiet_zone</span>;
|
||||
<span class='self'>self</span>
|
||||
}
|
||||
|
||||
<span class='doccomment'>/// Sets the size of each module in pixels. Default is 8px.</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>module_size</span>(<span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>size</span>: <span class='ident'>u32</span>) <span class='op'>-></span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>Self</span> {
|
||||
<span class='self'>self</span>.<span class='ident'>module_size</span> <span class='op'>=</span> <span class='ident'>size</span>;
|
||||
<span class='self'>self</span>
|
||||
}
|
||||
|
||||
<span class='doccomment'>/// Sets the minimal total image width (and thus height) in pixels,</span>
|
||||
<span class='doccomment'>/// including the quiet zone if applicable. The renderer will try to find</span>
|
||||
<span class='doccomment'>/// the dimension as small as possible, such that each module in the QR code</span>
|
||||
<span class='doccomment'>/// has uniform size (no distortion).</span>
|
||||
<span class='doccomment'>///</span>
|
||||
<span class='doccomment'>/// For instance, a version 1 QR code has 19 modules across including the</span>
|
||||
<span class='doccomment'>/// quiet zone. If we request an image of width ≥200px, we get that each</span>
|
||||
<span class='doccomment'>/// module's size should be 11px, so the actual image size will be 209px.</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>min_width</span>(<span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>self</span>, <span class='ident'>width</span>: <span class='ident'>u32</span>) <span class='op'>-></span> <span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='self'>Self</span> {
|
||||
<span class='kw'>let</span> <span class='ident'>quiet_zone</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='self'>self</span>.<span class='ident'>has_quiet_zone</span> { <span class='number'>2</span> } <span class='kw'>else</span> { <span class='number'>0</span> } <span class='op'>*</span> <span class='self'>self</span>.<span class='ident'>quiet_zone</span>;
|
||||
<span class='kw'>let</span> <span class='ident'>width_in_modules</span> <span class='op'>=</span> <span class='self'>self</span>.<span class='ident'>modules_count</span> <span class='op'>+</span> <span class='ident'>quiet_zone</span>;
|
||||
<span class='kw'>let</span> <span class='ident'>module_size</span> <span class='op'>=</span> (<span class='ident'>width</span> <span class='op'>+</span> <span class='ident'>width_in_modules</span> <span class='op'>-</span> <span class='number'>1</span>) <span class='op'>/</span> <span class='ident'>width_in_modules</span>;
|
||||
<span class='self'>self</span>.<span class='ident'>module_size</span>(<span class='ident'>module_size</span>)
|
||||
}
|
||||
|
||||
<span class='doccomment'>/// Renders the QR code into an image.</span>
|
||||
<span class='kw'>pub</span> <span class='kw'>fn</span> <span class='ident'>to_image</span>(<span class='kw-2'>&</span><span class='self'>self</span>) <span class='op'>-></span> <span class='ident'>ImageBuffer</span><span class='op'><</span><span class='ident'>P</span>, <span class='ident'>Vec</span><span class='op'><</span><span class='ident'>P</span>::<span class='ident'>Subpixel</span><span class='op'>>></span> {
|
||||
<span class='kw'>let</span> <span class='ident'>w</span> <span class='op'>=</span> <span class='self'>self</span>.<span class='ident'>modules_count</span>;
|
||||
<span class='kw'>let</span> <span class='ident'>qz</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='self'>self</span>.<span class='ident'>has_quiet_zone</span> { <span class='self'>self</span>.<span class='ident'>quiet_zone</span> } <span class='kw'>else</span> { <span class='number'>0</span> };
|
||||
<span class='kw'>let</span> <span class='ident'>width</span> <span class='op'>=</span> <span class='ident'>w</span> <span class='op'>+</span> <span class='number'>2</span> <span class='op'>*</span> <span class='ident'>qz</span>;
|
||||
|
||||
<span class='kw'>let</span> <span class='ident'>ms</span> <span class='op'>=</span> <span class='self'>self</span>.<span class='ident'>module_size</span>;
|
||||
<span class='kw'>let</span> <span class='ident'>real_width</span> <span class='op'>=</span> <span class='ident'>width</span> <span class='op'>*</span> <span class='ident'>ms</span>;
|
||||
|
||||
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>image</span> <span class='op'>=</span> <span class='ident'>ImageBuffer</span>::<span class='ident'>new</span>(<span class='ident'>real_width</span>, <span class='ident'>real_width</span>);
|
||||
<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>i</span> <span class='op'>=</span> <span class='number'>0</span>;
|
||||
<span class='kw'>for</span> <span class='ident'>y</span> <span class='kw'>in</span> <span class='number'>0</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'>width</span> {
|
||||
<span class='kw'>let</span> <span class='ident'>color</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='ident'>qz</span> <span class='op'><=</span> <span class='ident'>x</span> <span class='op'>&&</span> <span class='ident'>x</span> <span class='op'><</span> <span class='ident'>w</span> <span class='op'>+</span> <span class='ident'>qz</span> <span class='op'>&&</span> <span class='ident'>qz</span> <span class='op'><=</span> <span class='ident'>y</span> <span class='op'>&&</span> <span class='ident'>y</span> <span class='op'><</span> <span class='ident'>w</span> <span class='op'>+</span> <span class='ident'>qz</span> {
|
||||
<span class='kw'>let</span> <span class='ident'>c</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='self'>self</span>.<span class='ident'>content</span>[<span class='ident'>i</span>] { <span class='self'>self</span>.<span class='ident'>dark_color</span> } <span class='kw'>else</span> { <span class='self'>self</span>.<span class='ident'>light_color</span> };
|
||||
<span class='ident'>i</span> <span class='op'>+=</span> <span class='number'>1</span>;
|
||||
<span class='ident'>c</span>
|
||||
} <span class='kw'>else</span> {
|
||||
<span class='self'>self</span>.<span class='ident'>light_color</span>
|
||||
};
|
||||
<span class='kw'>for</span> <span class='ident'>yy</span> <span class='kw'>in</span> <span class='ident'>y</span> <span class='op'>*</span> <span class='ident'>ms</span> .. (<span class='ident'>y</span> <span class='op'>+</span> <span class='number'>1</span>) <span class='op'>*</span> <span class='ident'>ms</span> {
|
||||
<span class='kw'>for</span> <span class='ident'>xx</span> <span class='kw'>in</span> <span class='ident'>x</span> <span class='op'>*</span> <span class='ident'>ms</span> .. (<span class='ident'>x</span> <span class='op'>+</span> <span class='number'>1</span>) <span class='op'>*</span> <span class='ident'>ms</span> {
|
||||
<span class='ident'>image</span>.<span class='ident'>put_pixel</span>(<span class='ident'>xx</span>, <span class='ident'>yy</span>, <span class='ident'>color</span>);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class='ident'>image</span>
|
||||
}
|
||||
}
|
||||
|
||||
<span class='attribute'>#[<span class='ident'>cfg</span>(<span class='ident'>test</span>)]</span>
|
||||
<span class='kw'>mod</span> <span class='ident'>render_tests</span> {
|
||||
<span class='kw'>use</span> <span class='ident'>render</span>::<span class='ident'>Renderer</span>;
|
||||
<span class='kw'>use</span> <span class='ident'>image</span>::{<span class='ident'>Luma</span>, <span class='ident'>Rgba</span>};
|
||||
|
||||
<span class='attribute'>#[<span class='ident'>test</span>]</span>
|
||||
<span class='kw'>fn</span> <span class='ident'>test_render_luma8_unsized</span>() {
|
||||
<span class='kw'>let</span> <span class='ident'>image</span> <span class='op'>=</span> <span class='ident'>Renderer</span>::<span class='op'><</span><span class='ident'>Luma</span><span class='op'><</span><span class='ident'>u8</span><span class='op'>>></span>::<span class='ident'>new</span>(<span class='kw-2'>&</span>[
|
||||
<span class='boolvalue'>false</span>, <span class='boolvalue'>true</span>, <span class='boolvalue'>true</span>,
|
||||
<span class='boolvalue'>true</span>, <span class='boolvalue'>false</span>, <span class='boolvalue'>false</span>,
|
||||
<span class='boolvalue'>false</span>, <span class='boolvalue'>true</span>, <span class='boolvalue'>false</span>,
|
||||
], <span class='number'>3</span>, <span class='number'>1</span>).<span class='ident'>module_size</span>(<span class='number'>1</span>).<span class='ident'>to_image</span>();
|
||||
|
||||
<span class='kw'>let</span> <span class='ident'>expected</span> <span class='op'>=</span> [
|
||||
<span class='number'>255</span>, <span class='number'>255</span>, <span class='number'>255</span>, <span class='number'>255</span>, <span class='number'>255</span>,
|
||||
<span class='number'>255</span>, <span class='number'>255</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>255</span>,
|
||||
<span class='number'>255</span>, <span class='number'>0</span>, <span class='number'>255</span>, <span class='number'>255</span>, <span class='number'>255</span>,
|
||||
<span class='number'>255</span>, <span class='number'>255</span>, <span class='number'>0</span>, <span class='number'>255</span>, <span class='number'>255</span>,
|
||||
<span class='number'>255</span>, <span class='number'>255</span>, <span class='number'>255</span>, <span class='number'>255</span>, <span class='number'>255</span>,
|
||||
];
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>image</span>.<span class='ident'>into_raw</span>(), <span class='ident'>expected</span>);
|
||||
}
|
||||
|
||||
<span class='attribute'>#[<span class='ident'>test</span>]</span>
|
||||
<span class='kw'>fn</span> <span class='ident'>test_render_rgba_unsized</span>() {
|
||||
<span class='kw'>let</span> <span class='ident'>image</span> <span class='op'>=</span> <span class='ident'>Renderer</span>::<span class='op'><</span><span class='ident'>Rgba</span><span class='op'><</span><span class='ident'>u8</span><span class='op'>>></span>::<span class='ident'>new</span>(<span class='kw-2'>&</span>[
|
||||
<span class='boolvalue'>false</span>, <span class='boolvalue'>true</span>,
|
||||
<span class='boolvalue'>true</span>, <span class='boolvalue'>true</span>,
|
||||
], <span class='number'>2</span>, <span class='number'>1</span>).<span class='ident'>module_size</span>(<span class='number'>1</span>).<span class='ident'>to_image</span>();
|
||||
|
||||
<span class='kw'>let</span> <span class='ident'>expected</span>: <span class='kw-2'>&</span>[<span class='ident'>u8</span>] <span class='op'>=</span> <span class='kw-2'>&</span>[
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>0</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>0</span>,<span class='number'>255</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>0</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
];
|
||||
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>image</span>.<span class='ident'>into_raw</span>(), <span class='ident'>expected</span>);
|
||||
}
|
||||
|
||||
<span class='attribute'>#[<span class='ident'>test</span>]</span>
|
||||
<span class='kw'>fn</span> <span class='ident'>test_render_resized</span>() {
|
||||
<span class='kw'>let</span> <span class='ident'>image</span> <span class='op'>=</span> <span class='ident'>Renderer</span>::<span class='op'><</span><span class='ident'>Luma</span><span class='op'><</span><span class='ident'>u8</span><span class='op'>>></span>::<span class='ident'>new</span>(<span class='kw-2'>&</span>[
|
||||
<span class='boolvalue'>true</span>, <span class='boolvalue'>false</span>,
|
||||
<span class='boolvalue'>false</span>, <span class='boolvalue'>true</span>,
|
||||
], <span class='number'>2</span>, <span class='number'>1</span>).<span class='ident'>min_width</span>(<span class='number'>10</span>).<span class='ident'>to_image</span>();
|
||||
|
||||
<span class='kw'>let</span> <span class='ident'>expected</span>: <span class='kw-2'>&</span>[<span class='ident'>u8</span>] <span class='op'>=</span> <span class='kw-2'>&</span>[
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>0</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
<span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>, <span class='number'>255</span>,<span class='number'>255</span>,<span class='number'>255</span>,
|
||||
];
|
||||
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>image</span>.<span class='ident'>dimensions</span>(), (<span class='number'>12</span>, <span class='number'>12</span>));
|
||||
<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>image</span>.<span class='ident'>into_raw</span>(), <span class='ident'>expected</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>⇤</dt>
|
||||
<dd>Move up in search results</dd>
|
||||
<dt>⇥</dt>
|
||||
<dd>Move down in search results</dd>
|
||||
<dt>⏎</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>
|
|
@ -324,19 +324,6 @@
|
|||
<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>};
|
||||
|
@ -619,19 +606,6 @@
|
|||
|
||||
<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 "License"); 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 "AS IS" 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>
|
||||
|
|
Loading…
Reference in a new issue