edlang/itertools/structs/index.html
2024-02-13 06:38:44 +00:00

34 lines
24 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

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

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The concrete iterator types."><title>itertools::structs - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="itertools" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../itertools/index.html">itertools</a><span class="version">0.12.1</span></h2></div><h2 class="location"><a href="#">Module structs</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#structs">Structs</a></li><li><a href="#types">Type Aliases</a></li></ul></section><h2><a href="../index.html">In crate itertools</a></h2></div></nav><div class="sidebar-resizer"></div>
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../itertools/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../index.html">itertools</a>::<wbr><a class="mod" href="#">structs</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/itertools/lib.rs.html#82">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The concrete iterator types.</p>
</div></details><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.Batching.html" title="struct itertools::structs::Batching">Batching</a></div><div class="desc docblock-short">A “meta iterator adaptor”. Its closure receives a reference to the iterator
and may pick off as many elements as it likes, to produce the next iterator element.</div></li><li><div class="item-name"><a class="struct" href="struct.Chunk.html" title="struct itertools::structs::Chunk">Chunk</a></div><div class="desc docblock-short">An iterator for the elements in a single chunk.</div></li><li><div class="item-name"><a class="struct" href="struct.Chunks.html" title="struct itertools::structs::Chunks">Chunks</a></div><div class="desc docblock-short">An iterator that yields the Chunk iterators.</div></li><li><div class="item-name"><a class="struct" href="struct.CircularTupleWindows.html" title="struct itertools::structs::CircularTupleWindows">CircularTupleWindows</a></div><div class="desc docblock-short">An iterator over all windows, wrapping back to the first elements when the
window would otherwise exceed the length of the iterator, producing tuples
of a specific size.</div></li><li><div class="item-name"><a class="struct" href="struct.Combinations.html" title="struct itertools::structs::Combinations">Combinations</a></div><div class="desc docblock-short">An iterator to iterate through all the <code>k</code>-length combinations in an iterator.</div></li><li><div class="item-name"><a class="struct" href="struct.CombinationsWithReplacement.html" title="struct itertools::structs::CombinationsWithReplacement">CombinationsWithReplacement</a></div><div class="desc docblock-short">An iterator to iterate through all the <code>n</code>-length combinations in an iterator, with replacement.</div></li><li><div class="item-name"><a class="struct" href="struct.ConsTuples.html" title="struct itertools::structs::ConsTuples">ConsTuples</a></div><div class="desc docblock-short">An iterator that maps an iterator of tuples like
<code>((A, B), C)</code> to an iterator of <code>(A, B, C)</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.ExactlyOneError.html" title="struct itertools::structs::ExactlyOneError">ExactlyOneError</a></div><div class="desc docblock-short">Iterator returned for the error case of <code>Itertools::exactly_one()</code>
This iterator yields exactly the same elements as the input iterator.</div></li><li><div class="item-name"><a class="struct" href="struct.FilterMapOk.html" title="struct itertools::structs::FilterMapOk">FilterMapOk</a></div><div class="desc docblock-short">An iterator adapter to filter and apply a transformation on values within a nested <code>Result::Ok</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.FilterOk.html" title="struct itertools::structs::FilterOk">FilterOk</a></div><div class="desc docblock-short">An iterator adapter to filter values within a nested <code>Result::Ok</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.FlattenOk.html" title="struct itertools::structs::FlattenOk">FlattenOk</a></div><div class="desc docblock-short">An iterator adaptor that flattens <code>Result::Ok</code> values and
allows <code>Result::Err</code> values through unchanged.</div></li><li><div class="item-name"><a class="struct" href="struct.Format.html" title="struct itertools::structs::Format">Format</a></div><div class="desc docblock-short">Format all iterator elements lazily, separated by <code>sep</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.FormatWith.html" title="struct itertools::structs::FormatWith">FormatWith</a></div><div class="desc docblock-short">Format all iterator elements lazily, separated by <code>sep</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.Group.html" title="struct itertools::structs::Group">Group</a></div><div class="desc docblock-short">An iterator for the elements in a single group.</div></li><li><div class="item-name"><a class="struct" href="struct.GroupBy.html" title="struct itertools::structs::GroupBy">GroupBy</a></div><div class="desc docblock-short"><code>GroupBy</code> is the storage for the lazy grouping operation.</div></li><li><div class="item-name"><a class="struct" href="struct.GroupingMap.html" title="struct itertools::structs::GroupingMap">GroupingMap</a></div><div class="desc docblock-short"><code>GroupingMap</code> is an intermediate struct for efficient group-and-fold operations.
It groups elements by their key and at the same time fold each group
using some aggregating operation.</div></li><li><div class="item-name"><a class="struct" href="struct.Groups.html" title="struct itertools::structs::Groups">Groups</a></div><div class="desc docblock-short">An iterator that yields the Group iterators.</div></li><li><div class="item-name"><a class="struct" href="struct.Interleave.html" title="struct itertools::structs::Interleave">Interleave</a></div><div class="desc docblock-short">An iterator adaptor that alternates elements from two iterators until both
run out.</div></li><li><div class="item-name"><a class="struct" href="struct.InterleaveShortest.html" title="struct itertools::structs::InterleaveShortest">InterleaveShortest</a></div><div class="desc docblock-short">An iterator adaptor that alternates elements from the two iterators until
one of them runs out.</div></li><li><div class="item-name"><a class="struct" href="struct.IntersperseWith.html" title="struct itertools::structs::IntersperseWith">IntersperseWith</a></div><div class="desc docblock-short">An iterator adaptor to insert a particular value created by a function
between each element of the adapted iterator.</div></li><li><div class="item-name"><a class="struct" href="struct.IntoChunks.html" title="struct itertools::structs::IntoChunks">IntoChunks</a></div><div class="desc docblock-short"><code>ChunkLazy</code> is the storage for a lazy chunking operation.</div></li><li><div class="item-name"><a class="struct" href="struct.Iterate.html" title="struct itertools::structs::Iterate">Iterate</a></div><div class="desc docblock-short">An iterator that infinitely applies function to value and yields results.</div></li><li><div class="item-name"><a class="struct" href="struct.KMergeBy.html" title="struct itertools::structs::KMergeBy">KMergeBy</a></div><div class="desc docblock-short">An iterator adaptor that merges an abitrary number of base iterators
according to an ordering function.</div></li><li><div class="item-name"><a class="struct" href="struct.MergeBy.html" title="struct itertools::structs::MergeBy">MergeBy</a></div><div class="desc docblock-short">An iterator adaptor that merges the two base iterators in ascending order.
If both base iterators are sorted (ascending), the result is sorted.</div></li><li><div class="item-name"><a class="struct" href="struct.MultiPeek.html" title="struct itertools::structs::MultiPeek">MultiPeek</a></div><div class="desc docblock-short">See <a href="../fn.multipeek.html" title="fn itertools::multipeek"><code>multipeek()</code></a> for more information.</div></li><li><div class="item-name"><a class="struct" href="struct.MultiProduct.html" title="struct itertools::structs::MultiProduct">MultiProduct</a></div><div class="desc docblock-short">An iterator adaptor that iterates over the cartesian product of
multiple iterators of type <code>I</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.PadUsing.html" title="struct itertools::structs::PadUsing">PadUsing</a></div><div class="desc docblock-short">An iterator adaptor that pads a sequence to a minimum length by filling
missing elements using a closure.</div></li><li><div class="item-name"><a class="struct" href="struct.PeekNth.html" title="struct itertools::structs::PeekNth">PeekNth</a></div><div class="desc docblock-short">See <a href="../fn.peek_nth.html" title="fn itertools::peek_nth"><code>peek_nth()</code></a> for more information.</div></li><li><div class="item-name"><a class="struct" href="struct.PeekingTakeWhile.html" title="struct itertools::structs::PeekingTakeWhile">PeekingTakeWhile</a></div><div class="desc docblock-short">An iterator adaptor that takes items while a closure returns <code>true</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.Permutations.html" title="struct itertools::structs::Permutations">Permutations</a></div><div class="desc docblock-short">An iterator adaptor that iterates through all the <code>k</code>-permutations of the
elements from an iterator.</div></li><li><div class="item-name"><a class="struct" href="struct.Positions.html" title="struct itertools::structs::Positions">Positions</a></div><div class="desc docblock-short">An iterator adapter to get the positions of each element that matches a predicate.</div></li><li><div class="item-name"><a class="struct" href="struct.Powerset.html" title="struct itertools::structs::Powerset">Powerset</a></div><div class="desc docblock-short">An iterator to iterate through the powerset of the elements from an iterator.</div></li><li><div class="item-name"><a class="struct" href="struct.ProcessResults.html" title="struct itertools::structs::ProcessResults">ProcessResults</a></div><div class="desc docblock-short">An iterator that produces only the <code>T</code> values as long as the
inner iterator produces <code>Ok(T)</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.Product.html" title="struct itertools::structs::Product">Product</a></div><div class="desc docblock-short">An iterator adaptor that iterates over the cartesian product of
the element sets of two iterators <code>I</code> and <code>J</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.PutBack.html" title="struct itertools::structs::PutBack">PutBack</a></div><div class="desc docblock-short">An iterator adaptor that allows putting back a single
item to the front of the iterator.</div></li><li><div class="item-name"><a class="struct" href="struct.PutBackN.html" title="struct itertools::structs::PutBackN">PutBackN</a></div><div class="desc docblock-short">An iterator adaptor that allows putting multiple
items in front of the iterator.</div></li><li><div class="item-name"><a class="struct" href="struct.RcIter.html" title="struct itertools::structs::RcIter">RcIter</a></div><div class="desc docblock-short">A wrapper for <code>Rc&lt;RefCell&lt;I&gt;&gt;</code>, that implements the <code>Iterator</code> trait.</div></li><li><div class="item-name"><a class="struct" href="struct.RepeatCall.html" title="struct itertools::structs::RepeatCall">RepeatCall</a><span class="stab deprecated" title="">Deprecated</span></div><div class="desc docblock-short">See <a href="../fn.repeat_call.html" title="fn itertools::repeat_call"><code>repeat_call</code></a> for more information.</div></li><li><div class="item-name"><a class="struct" href="struct.RepeatN.html" title="struct itertools::structs::RepeatN">RepeatN</a></div><div class="desc docblock-short">An iterator that produces <em>n</em> repetitions of an element.</div></li><li><div class="item-name"><a class="struct" href="struct.Step.html" title="struct itertools::structs::Step">Step</a><span class="stab deprecated" title="">Deprecated</span></div><div class="desc docblock-short">An iterator adaptor that steps a number elements in the base iterator
for each iteration.</div></li><li><div class="item-name"><a class="struct" href="struct.TakeWhileInclusive.html" title="struct itertools::structs::TakeWhileInclusive">TakeWhileInclusive</a></div><div class="desc docblock-short">An iterator adaptor that consumes elements while the given predicate is
<code>true</code>, including the element for which the predicate first returned
<code>false</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.TakeWhileRef.html" title="struct itertools::structs::TakeWhileRef">TakeWhileRef</a></div><div class="desc docblock-short">An iterator adaptor that borrows from a <code>Clone</code>-able iterator
to only pick off elements while the predicate returns <code>true</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.Tee.html" title="struct itertools::structs::Tee">Tee</a></div><div class="desc docblock-short">One half of an iterator pair where both return the same elements.</div></li><li><div class="item-name"><a class="struct" href="struct.TupleBuffer.html" title="struct itertools::structs::TupleBuffer">TupleBuffer</a></div><div class="desc docblock-short">An iterator over a incomplete tuple.</div></li><li><div class="item-name"><a class="struct" href="struct.TupleCombinations.html" title="struct itertools::structs::TupleCombinations">TupleCombinations</a></div><div class="desc docblock-short">An iterator to iterate through all combinations in a <code>Clone</code>-able iterator that produces tuples
of a specific size.</div></li><li><div class="item-name"><a class="struct" href="struct.TupleWindows.html" title="struct itertools::structs::TupleWindows">TupleWindows</a></div><div class="desc docblock-short">An iterator over all contiguous windows that produces tuples of a specific size.</div></li><li><div class="item-name"><a class="struct" href="struct.Tuples.html" title="struct itertools::structs::Tuples">Tuples</a></div><div class="desc docblock-short">An iterator that groups the items in tuples of a specific size.</div></li><li><div class="item-name"><a class="struct" href="struct.Unfold.html" title="struct itertools::structs::Unfold">Unfold</a></div><div class="desc docblock-short">See <a href="../fn.unfold.html" title="fn itertools::unfold"><code>unfold</code></a> for more information.</div></li><li><div class="item-name"><a class="struct" href="struct.Unique.html" title="struct itertools::structs::Unique">Unique</a></div><div class="desc docblock-short">An iterator adapter to filter out duplicate elements.</div></li><li><div class="item-name"><a class="struct" href="struct.UniqueBy.html" title="struct itertools::structs::UniqueBy">UniqueBy</a></div><div class="desc docblock-short">An iterator adapter to filter out duplicate elements.</div></li><li><div class="item-name"><a class="struct" href="struct.Update.html" title="struct itertools::structs::Update">Update</a></div><div class="desc docblock-short">An iterator adapter to apply a mutating function to each element before yielding it.</div></li><li><div class="item-name"><a class="struct" href="struct.WhileSome.html" title="struct itertools::structs::WhileSome">WhileSome</a></div><div class="desc docblock-short">An iterator adaptor that filters <code>Option&lt;A&gt;</code> iterator elements
and produces <code>A</code>. Stops on the first <code>None</code> encountered.</div></li><li><div class="item-name"><a class="struct" href="struct.WithPosition.html" title="struct itertools::structs::WithPosition">WithPosition</a></div><div class="desc docblock-short">An iterator adaptor that wraps each element in an <a href="../enum.Position.html" title="enum itertools::Position"><code>Position</code></a>.</div></li><li><div class="item-name"><a class="struct" href="struct.Zip.html" title="struct itertools::structs::Zip">Zip</a></div><div class="desc docblock-short">See <a href="../fn.multizip.html" title="fn itertools::multizip"><code>multizip</code></a> for more information.</div></li><li><div class="item-name"><a class="struct" href="struct.ZipEq.html" title="struct itertools::structs::ZipEq">ZipEq</a></div><div class="desc docblock-short">An iterator which iterates two other iterators simultaneously</div></li><li><div class="item-name"><a class="struct" href="struct.ZipLongest.html" title="struct itertools::structs::ZipLongest">ZipLongest</a></div><div class="desc docblock-short">An iterator which iterates two other iterators simultaneously</div></li></ul><h2 id="types" class="section-header"><a href="#types">Type Aliases</a></h2><ul class="item-table"><li><div class="item-name"><a class="type" href="type.Coalesce.html" title="type itertools::structs::Coalesce">Coalesce</a></div><div class="desc docblock-short">An iterator adaptor that may join together adjacent elements.</div></li><li><div class="item-name"><a class="type" href="type.Dedup.html" title="type itertools::structs::Dedup">Dedup</a></div><div class="desc docblock-short">An iterator adaptor that removes repeated duplicates.</div></li><li><div class="item-name"><a class="type" href="type.DedupBy.html" title="type itertools::structs::DedupBy">DedupBy</a></div><div class="desc docblock-short">An iterator adaptor that removes repeated duplicates, determining equality using a comparison function.</div></li><li><div class="item-name"><a class="type" href="type.DedupByWithCount.html" title="type itertools::structs::DedupByWithCount">DedupByWithCount</a></div><div class="desc docblock-short">An iterator adaptor that removes repeated duplicates, while keeping a count of how many
repeated elements were present. This will determine equality using a comparison function.</div></li><li><div class="item-name"><a class="type" href="type.DedupWithCount.html" title="type itertools::structs::DedupWithCount">DedupWithCount</a></div><div class="desc docblock-short">An iterator adaptor that removes repeated duplicates, while keeping a count of how many
repeated elements were present.</div></li><li><div class="item-name"><a class="type" href="type.Duplicates.html" title="type itertools::structs::Duplicates">Duplicates</a></div><div class="desc docblock-short">An iterator adapter to filter out duplicate elements.</div></li><li><div class="item-name"><a class="type" href="type.DuplicatesBy.html" title="type itertools::structs::DuplicatesBy">DuplicatesBy</a></div><div class="desc docblock-short">An iterator adapter to filter for duplicate elements.</div></li><li><div class="item-name"><a class="type" href="type.GroupingMapBy.html" title="type itertools::structs::GroupingMapBy">GroupingMapBy</a></div><div class="desc docblock-short"><code>GroupingMapBy</code> is an intermediate struct for efficient group-and-fold operations.</div></li><li><div class="item-name"><a class="type" href="type.Intersperse.html" title="type itertools::structs::Intersperse">Intersperse</a></div><div class="desc docblock-short">An iterator adaptor to insert a particular value
between each element of the adapted iterator.</div></li><li><div class="item-name"><a class="type" href="type.KMerge.html" title="type itertools::structs::KMerge">KMerge</a></div><div class="desc docblock-short">An iterator adaptor that merges an abitrary number of base iterators in ascending order.
If all base iterators are sorted (ascending), the result is sorted.</div></li><li><div class="item-name"><a class="type" href="type.MapInto.html" title="type itertools::structs::MapInto">MapInto</a></div><div class="desc docblock-short">An iterator adapter to apply <code>Into</code> conversion to each element.</div></li><li><div class="item-name"><a class="type" href="type.MapOk.html" title="type itertools::structs::MapOk">MapOk</a></div><div class="desc docblock-short">An iterator adapter to apply a transformation within a nested <code>Result::Ok</code>.</div></li><li><div class="item-name"><a class="type" href="type.MapResults.html" title="type itertools::structs::MapResults">MapResults</a><span class="stab deprecated" title="">Deprecated</span></div><div class="desc docblock-short">See <a href="type.MapOk.html" title="type itertools::structs::MapOk"><code>MapOk</code></a>.</div></li><li><div class="item-name"><a class="type" href="type.Merge.html" title="type itertools::structs::Merge">Merge</a></div><div class="desc docblock-short">An iterator adaptor that merges the two base iterators in ascending order.
If both base iterators are sorted (ascending), the result is sorted.</div></li><li><div class="item-name"><a class="type" href="type.MergeJoinBy.html" title="type itertools::structs::MergeJoinBy">MergeJoinBy</a></div><div class="desc docblock-short">An iterator adaptor that merge-joins items from the two base iterators in ascending order.</div></li></ul></section></div></main></body></html>