mirror of
https://github.com/Rust-GPU/rust-gpu.git
synced 2026-06-07 01:59:51 +09:00
19 lines
7.0 KiB
HTML
19 lines
7.0 KiB
HTML
<!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="Extension trait to add conversion to `InternalIterator` for regular iterators."><title>IteratorExt in internal_iterator - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="internal_iterator" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (02c7f9bec 2026-04-10)" data-channel="nightly" data-search-js="search-b5634cc7.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../static.files/storage-41dd4d93.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">IteratorExt</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../internal_iterator/index.html">internal_<wbr>iterator</a><span class="version">0.2.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Iterator<wbr>Ext</a></h2><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.into_internal" title="into_internal">into_internal</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate internal_<wbr>iterator</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">internal_iterator</a></div><h1>Trait <span class="trait">Iterator<wbr>Ext</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/internal_iterator/lib.rs.html#769-791">Source</a> </span></div><pre class="rust item-decl"><code>pub trait IteratorExt: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> {
|
|
// Provided method
|
|
fn <a href="#method.into_internal" class="fn">into_internal</a>(self) -> <a class="struct" href="struct.Internal.html" title="struct internal_iterator::Internal">Internal</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a>>
|
|
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
|
|
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Extension trait to add conversion to <a href="trait.InternalIterator.html" title="trait internal_iterator::InternalIterator"><code>InternalIterator</code></a> for regular
|
|
iterators.</p>
|
|
</div></details><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">ยง</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.into_internal" class="method"><a class="src rightside" href="../src/internal_iterator/lib.rs.html#785-790">Source</a><h4 class="code-header">fn <a href="#method.into_internal" class="fn">into_internal</a>(self) -> <a class="struct" href="struct.Internal.html" title="struct internal_iterator::Internal">Internal</a><Self::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter" title="type core::iter::traits::collect::IntoIterator::IntoIter">IntoIter</a>><div class="where">where
|
|
Self: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Convert an <a href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator"><code>std::iter::Iterator</code></a> to an <a href="trait.InternalIterator.html" title="trait internal_iterator::InternalIterator"><code>InternalIterator</code></a>.</p>
|
|
<p>Composing internal iterators together requires all used iterators to be
|
|
internal iterators. Given that regular iterators are far more prevalent,
|
|
this function can be used to allow them to be used together with
|
|
internal iterators.</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>
|
|
<span class="kw">fn </span>flatten_ranges(
|
|
ranges: <span class="kw">impl </span>InternalIterator<Item = (i32, i32)>,
|
|
) -> <span class="kw">impl </span>InternalIterator<Item = i32> {
|
|
ranges.flat_map(|(from, to)| (from..to).into_internal())
|
|
}</code></pre></div></div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">ยง</a></h2><div id="implementors-list"><div class="negative-marker"></div><section id="impl-IteratorExt-for-I" class="impl"><a class="src rightside" href="../src/internal_iterator/lib.rs.html#793">Source</a><a href="#impl-IteratorExt-for-I" class="anchor">ยง</a><h3 class="code-header">impl<I: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html" title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a>> <a class="trait" href="trait.IteratorExt.html" title="trait internal_iterator::IteratorExt">IteratorExt</a> for I</h3></section></div><script src="../trait.impl/internal_iterator/trait.IteratorExt.js" async></script></section></div></main></body></html> |