edlang/winnow/stream/trait.Stream.html

75 lines
62 KiB
HTML
Raw Normal View History

<!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="Core definition for parser input state"><title>Stream in winnow::stream - Rust</title><script> if (window.location.protocol !== "file:") document.write(`<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">`)</script><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-e935ef01ae1c1829.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="winnow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.78.0 (9b00956e5 2024-04-29)" data-channel="1.78.0" data-search-js="search-42d8da7a6b9792c2.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-4c98445ec4002617.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-12cf3b4f4f9dc36d.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-04d5337699b92874.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 trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../winnow/index.html">winnow</a><span class="version">0.6.8</span></h2></div><h2 class="location"><a href="#">Stream</a></h2><div class="sidebar-elems"><section><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Checkpoint">Checkpoint</a></li><li><a href="#associatedtype.IterOffsets">IterOffsets</a></li><li><a href="#associatedtype.Slice">Slice</a></li><li><a href="#associatedtype.Token">Token</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.checkpoint">checkpoint</a></li><li><a href="#tymethod.eof_offset">eof_offset</a></li><li><a href="#tymethod.iter_offsets">iter_offsets</a></li><li><a href="#tymethod.next_slice">next_slice</a></li><li><a href="#tymethod.next_token">next_token</a></li><li><a href="#tymethod.offset_at">offset_at</a></li><li><a href="#tymethod.offset_for">offset_for</a></li><li><a href="#tymethod.raw">raw</a></li><li><a href="#tymethod.reset">reset</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.finish">finish</a></li><li><a href="#method.peek_finish">peek_finish</a></li><li><a href="#method.peek_slice">peek_slice</a></li><li><a href="#method.peek_token">peek_token</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Stream-for-%26%5BT%5D">&amp;&#x27;i [T]</a></li><li><a href="#impl-Stream-for-%26str">&amp;&#x27;i str</a></li><li><a href="#impl-Stream-for-(I,+usize)">(I, usize)</a></li></ul><h3><a href="#object-safety">Object Safety</a></h3><h3><a href="#implem
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../winnow/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>Trait <a href="../index.html">winnow</a>::<wbr><a href="index.html">stream</a>::<wbr><a class="trait" href="#">Stream</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/winnow/stream/mod.rs.html#601-700">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub trait Stream: <a class="trait" href="trait.Offset.html" title="trait winnow::stream::Offset">Offset</a>&lt;Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Checkpoint" title="type winnow::stream::Stream::Checkpoint">Checkpoint</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> {
type <a href="#associatedtype.Token" class="associatedtype">Token</a>: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>;
type <a href="#associatedtype.Slice" class="associatedtype">Slice</a>: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>;
type <a href="#associatedtype.IterOffsets" class="associatedtype">IterOffsets</a>: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = (<a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>, Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Token" title="type winnow::stream::Stream::Token">Token</a>)&gt;;
type <a href="#associatedtype.Checkpoint" class="associatedtype">Checkpoint</a>: <a class="trait" href="trait.Offset.html" title="trait winnow::stream::Offset">Offset</a> + <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>;
<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 13 methods</span></summary> // Required methods
fn <a href="#tymethod.iter_offsets" class="fn">iter_offsets</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.IterOffsets" title="type winnow::stream::Stream::IterOffsets">IterOffsets</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.eof_offset" class="fn">eof_offset</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.next_token" class="fn">next_token</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Token" title="type winnow::stream::Stream::Token">Token</a>&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.offset_for" class="fn">offset_for</a>&lt;P&gt;(&amp;self, predicate: P) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>&gt;
<span class="where">where P: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Token" title="type winnow::stream::Stream::Token">Token</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.bool.html">bool</a></span>;
<span class="item-spacer"></span> fn <a href="#tymethod.offset_at" class="fn">offset_at</a>(&amp;self, tokens: <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>, <a class="enum" href="../error/enum.Needed.html" title="enum winnow::error::Needed">Needed</a>&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.next_slice" class="fn">next_slice</a>(&amp;mut self, offset: <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Slice" title="type winnow::stream::Stream::Slice">Slice</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.checkpoint" class="fn">checkpoint</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Checkpoint" title="type winnow::stream::Stream::Checkpoint">Checkpoint</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.reset" class="fn">reset</a>(&amp;mut self, checkpoint: &amp;Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Checkpoint" title="type winnow::stream::Stream::Checkpoint">Checkpoint</a>);
<span class="item-spacer"></span> fn <a href="#tymethod.raw" class="fn">raw</a>(&amp;self) -&gt; &amp;dyn <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>;
// Provided methods
fn <a href="#method.peek_token" class="fn">peek_token</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(Self, Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Token" title="type winnow::stream::Stream::Token">Token</a>)&gt;
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.peek_slice" class="fn">peek_slice</a>(&amp;self, offset: <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>) -&gt; (Self, Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Slice" title="type winnow::stream::Stream::Slice">Slice</a>)
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span> { ... }
<span class="item-spacer"></span> fn <a href="#method.finish" class="fn">finish</a>(&amp;mut self) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Slice" title="type winnow::stream::Stream::Slice">Slice</a> { ... }
<span class="item-spacer"></span> fn <a href="#method.peek_finish" class="fn">peek_finish</a>(&amp;self) -&gt; (Self, Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Slice" title="type winnow::stream::Stream::Slice">Slice</a>)
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></span> { ... }
</details>}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Core definition for parser input state</p>
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Token" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#605">source</a><h4 class="code-header">type <a href="#associatedtype.Token" class="associatedtype">Token</a>: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a></h4></section></summary><div class="docblock"><p>The smallest unit being parsed</p>
<p>Example: <code>u8</code> for <code>&amp;[u8]</code> or <code>char</code> for <code>&amp;str</code></p>
</div></details><details class="toggle" open><summary><section id="associatedtype.Slice" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#609">source</a><h4 class="code-header">type <a href="#associatedtype.Slice" class="associatedtype">Slice</a>: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a></h4></section></summary><div class="docblock"><p>Sequence of <code>Token</code>s</p>
<p>Example: <code>&amp;[u8]</code> for <code>Located&lt;&amp;[u8]&gt;</code> or <code>&amp;str</code> for <code>Located&lt;&amp;str&gt;</code></p>
</div></details><details class="toggle" open><summary><section id="associatedtype.IterOffsets" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#612">source</a><h4 class="code-header">type <a href="#associatedtype.IterOffsets" class="associatedtype">IterOffsets</a>: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = (<a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>, Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Token" title="type winnow::stream::Stream::Token">Token</a>)&gt;</h4></section></summary><div class="docblock"><p>Iterate with the offset from the current location</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.Checkpoint" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#615">source</a><h4 class="code-header">type <a href="#associatedtype.Checkpoint" class="associatedtype">Checkpoint</a>: <a class="trait" href="trait.Offset.html" title="trait winnow::stream::Offset">Offset</a> + <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a></h4></section></summary><div class="docblock"><p>A parse location within the stream</p>
</div></details></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.iter_offsets" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#618">source</a><h4 class="code-header">fn <a href="#tymethod.iter_offsets" class="fn">iter_offsets</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.IterOffsets" title="type winnow::stream::Stream::IterOffsets">IterOffsets</a></h4></section></summary><div class="docblock"><p>Iterate with the offset from the current location</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.eof_offset" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#621">source</a><h4 class="code-header">fn <a href="#tymethod.eof_offset" class="fn">eof_offset</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Returns the offset to the end of the input</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.next_token" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#624">source</a><h4 class="code-header">fn <a href="#tymethod.next_token" class="fn">next_token</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Token" title="type winnow::stream::Stream::Token">Token</a>&gt;</h4></section></summary><div class="docblock"><p>Split off the next token from the input</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.offset_for" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#637-639">source</a><h4 class="code-header">fn <a href="#tymethod.offset_for" class="fn">offset_for</a>&lt;P&gt;(&amp;self, predicate: P) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>&gt;<div class="where">where
P: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Token" title="type winnow::stream::Stream::Token">Token</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.bool.html">bool</a>,</div></h4></section></summary><div class="docblock"><p>Finds the offset of the next matching token</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.offset_at" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#643">source</a><h4 class="code-header">fn <a href="#tymethod.offset_at" class="fn">offset_at</a>(&amp;self, tokens: <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>, <a class="enum" href="../error/enum.Needed.html" title="enum winnow::error::Needed">Needed</a>&gt;</h4></section></summary><div class="docblock"><p>Get the offset for the number of <code>tokens</code> into the stream</p>
<p>This means “0 tokens” will return <code>0</code> offset</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.next_slice" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#661">source</a><h4 class="code-header">fn <a href="#tymethod.next_slice" class="fn">next_slice</a>(&amp;mut self, offset: <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Slice" title="type winnow::stream::Stream::Slice">Slice</a></h4></section></summary><div class="docblock"><p>Split off a slice of tokens from the input</p>
<p><strong>NOTE:</strong> For inputs with variable width tokens, like <code>&amp;str</code>s <code>char</code>, <code>offset</code> might not correspond
with the number of tokens. To get a valid offset, use:</p>
<ul>
<li><a href="trait.Stream.html#tymethod.eof_offset" title="method winnow::stream::Stream::eof_offset"><code>Stream::eof_offset</code></a></li>
<li><a href="trait.Stream.html#tymethod.iter_offsets" title="method winnow::stream::Stream::iter_offsets"><code>Stream::iter_offsets</code></a></li>
<li><a href="trait.Stream.html#tymethod.offset_for" title="method winnow::stream::Stream::offset_for"><code>Stream::offset_for</code></a></li>
<li><a href="trait.Stream.html#tymethod.offset_at" title="method winnow::stream::Stream::offset_at"><code>Stream::offset_at</code></a></li>
</ul>
<h5 id="panic"><a class="doc-anchor" href="#panic">§</a>Panic</h5>
<p>This will panic if</p>
<ul>
<li>Indexes must be within bounds of the original input;</li>
<li>Indexes must uphold invariants of the stream, like for <code>str</code> they must lie on UTF-8
sequence boundaries.</li>
</ul>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.checkpoint" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#690">source</a><h4 class="code-header">fn <a href="#tymethod.checkpoint" class="fn">checkpoint</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Checkpoint" title="type winnow::stream::Stream::Checkpoint">Checkpoint</a></h4></section></summary><div class="docblock"><p>Save the current parse location within the stream</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.reset" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#696">source</a><h4 class="code-header">fn <a href="#tymethod.reset" class="fn">reset</a>(&amp;mut self, checkpoint: &amp;Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Checkpoint" title="type winnow::stream::Stream::Checkpoint">Checkpoint</a>)</h4></section></summary><div class="docblock"><p>Revert the stream to a prior <a href="trait.Stream.html#associatedtype.Checkpoint"><code>Self::Checkpoint</code></a></p>
<h5 id="panic-1"><a class="doc-anchor" href="#panic-1">§</a>Panic</h5>
<p>May panic if an invalid <a href="trait.Stream.html#associatedtype.Checkpoint"><code>Self::Checkpoint</code></a> is provided</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.raw" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#699">source</a><h4 class="code-header">fn <a href="#tymethod.raw" class="fn">raw</a>(&amp;self) -&gt; &amp;dyn <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a></h4></section></summary><div class="docblock"><p>Return the inner-most stream</p>
</div></details></div><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.peek_token" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#627-634">source</a><h4 class="code-header">fn <a href="#method.peek_token" class="fn">peek_token</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;(Self, Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Token" title="type winnow::stream::Stream::Token">Token</a>)&gt;<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Split off the next token from the input</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.peek_slice" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#664-671">source</a><h4 class="code-header">fn <a href="#method.peek_slice" class="fn">peek_slice</a>(&amp;self, offset: <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>) -&gt; (Self, Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Slice" title="type winnow::stream::Stream::Slice">Slice</a>)<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Split off a slice of tokens from the input</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.finish" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#675-677">source</a><h4 class="code-header">fn <a href="#method.finish" class="fn">finish</a>(&amp;mut self) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Slice" title="type winnow::stream::Stream::Slice">Slice</a></h4></section></summary><div class="docblock"><p>Advance to the end of the stream</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.peek_finish" class="method"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#680-687">source</a><h4 class="code-header">fn <a href="#method.peek_finish" class="fn">peek_finish</a>(&amp;self) -&gt; (Self, Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Slice" title="type winnow::stream::Stream::Slice">Slice</a>)<div class="where">where
Self: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h4></section></summary><div class="docblock"><p>Advance to the end of the stream</p>
</div></details></div><h2 id="object-safety" class="section-header">Object Safety<a href="#object-safety" class="anchor">§</a></h2><div class="object-safety-info">This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.78.0/reference/items/traits.html#object-safety">object safe</a>.</div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-Stream-for-%26str" class="impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#766-839">source</a><a href="#impl-Stream-for-%26str" class="anchor">§</a><h3 class="code-header">impl&lt;'i&gt; <a class="trait" href="trait.Stream.html" title="trait winnow::stream::Stream">Stream</a> for &amp;'i <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.str.html">str</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Token-1" class="associatedtype trait-impl"><a href="#associatedtype.Token-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Token" class="associatedtype">Token</a> = <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.char.html">char</a></h4></section><section id="associatedtype.Slice-1" class="associatedtype trait-impl"><a href="#associatedtype.Slice-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Slice" class="associatedtype">Slice</a> = &amp;'i <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.str.html">str</a></h4></section><section id="associatedtype.IterOffsets-1" class="associatedtype trait-impl"><a href="#associatedtype.IterOffsets-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.IterOffsets" class="associatedtype">IterOffsets</a> = <a class="struct" href="https://doc.rust-lang.org/1.78.0/core/str/iter/struct.CharIndices.html" title="struct core::str::iter::CharIndices">CharIndices</a>&lt;'i&gt;</h4></section><section id="associatedtype.Checkpoint-1" class="associatedtype trait-impl"><a href="#associatedtype.Checkpoint-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Checkpoint" class="associatedtype">Checkpoint</a> = <a class="struct" href="struct.Checkpoint.html" title="struct winnow::stream::Checkpoint">Checkpoint</a>&lt;&amp;'i <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.str.html">str</a>, &amp;'i <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.str.html">str</a>&gt;</h4></section><section id="method.iter_offsets" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#775-777">source</a><a href="#method.iter_offsets" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.iter_offsets" class="fn">iter_offsets</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.IterOffsets" title="type winnow::stream::Stream::IterOffsets">IterOffsets</a></h4></section><section id="method.eof_offset" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#779-781">source</a><a href="#method.eof_offset" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.eof_offset" class="fn">eof_offset</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a></h4></section><section id="method.next_token" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#784-789">source</a><a href="#method.next_token" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.next_token" class="fn">next_token</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Token" title="type winnow::stream::Stream::Token">Token</a>&gt;</h4></section><section id="method.offset_for"
P: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Token" title="type winnow::stream::Stream::Token">Token</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.bool.html">bool</a>,</div></h4></section><section id="method.offset_at" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#804-818">source</a><a href="#method.offset_at" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.offset_at" class="fn">offset_at</a>(&amp;self, tokens: <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>, <a class="enum" href="../error/enum.Needed.html" title="enum winnow::error::Needed">Needed</a>&gt;</h4></section><section id="method.next_slice" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#820-824">source</a><a href="#method.next_slice" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.next_slice" class="fn">next_slice</a>(&amp;mut self, offset: <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Slice" title="type winnow::stream::Stream::Slice">Slice</a></h4></section><section id="method.checkpoint" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#827-829">source</a><a href="#method.checkpoint" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.checkpoint" class="fn">checkpoint</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Checkpoint" title="type winnow::stream::Stream::Checkpoint">Checkpoint</a></h4></section><section id="method.reset" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#831-833">source</a><a href="#method.reset" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.reset" class="fn">reset</a>(&amp;mut self, checkpoint: &amp;Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Checkpoint" title="type winnow::stream::Stream::Checkpoint">Checkpoint</a>)</h4></section><section id="method.raw" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#836-838">source</a><a href="#method.raw" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.raw" class="fn">raw</a>(&amp;self) -&gt; &amp;dyn <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Stream-for-%26%5BT%5D" class="impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#702-764">source</a><a href="#impl-Stream-for-%26%5BT%5D" class="anchor">§</a><h3 class="code-header">impl&lt;'i, T&gt; <a class="trait" href="trait.Stream.html" title="trait winnow::stream::Stream">Stream</a> for &amp;'i <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.slice.html">[T]</a><div class="where">where
T: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Token-2" class="associatedtype trait-impl"><a href="#associatedtype.Token-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Token" class="associatedtype">Token</a> = T</h4></section><section id="associatedtype.Slice-2" class="associatedtype trait-impl"><a href="#associatedtype.Slice-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Slice" class="associatedtype">Slice</a> = &amp;'i <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.slice.html">[T]</a></h4></section><section id="associatedtype.IterOffsets-2" class="associatedtype trait-impl"><a href="#associatedtype.IterOffsets-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.IterOffsets" class="associatedtype">IterOffsets</a> = <a class="struct" href="https://doc.rust-lang.org/1.78.0/core/iter/adapters/enumerate/struct.Enumerate.html" title="struct core::iter::adapters::enumerate::Enumerate">Enumerate</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.78.0/core/iter/adapters/cloned/struct.Cloned.html" title="struct core::iter::adapters::cloned::Cloned">Cloned</a>&lt;<a class="struct" href="https://doc.rust-lang.org/1.78.0/core/slice/iter/struct.Iter.html" title="struct core::slice::iter::Iter">Iter</a>&lt;'i, T&gt;&gt;&gt;</h4></section><section id="associatedtype.Checkpoint-2" class="associatedtype trait-impl"><a href="#associatedtype.Checkpoint-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Checkpoint" class="associatedtype">Checkpoint</a> = <a class="struct" href="struct.Checkpoint.html" title="struct winnow::stream::Checkpoint">Checkpoint</a>&lt;&amp;'i <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.slice.html">[T]</a>, &amp;'i <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.slice.html">[T]</a>&gt;</h4></section><section id="method.iter_offsets-1" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#714-716">source</a><a href="#method.iter_offsets-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.iter_offsets" class="fn">iter_offsets</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.IterOffsets" title="type winnow::stream::Stream::IterOffsets">IterOffsets</a></h4></section><section id="method.eof_offset-1" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#718-720">source</a><a href="#method.eof_offset-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.eof_offset" class="fn">eof_offset</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a></h4></section><section id="method.next_token-1" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#723-727">source</a><a href="#method.next_token-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.next_token" class="fn">next_token</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Token" title="type winnow::stream::Stream::Token">Token</a>&gt;</h4></section><section id="method.offset_for-1" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#730-735">source</a><a href="#method.offset_for-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.offset_for" class="fn">offset_for</a>&lt;P&gt;(&amp;self, predicate: P) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/option/enum
P: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Token" title="type winnow::stream::Stream::Token">Token</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.bool.html">bool</a>,</div></h4></section><section id="method.offset_at-1" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#737-743">source</a><a href="#method.offset_at-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.offset_at" class="fn">offset_at</a>(&amp;self, tokens: <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>, <a class="enum" href="../error/enum.Needed.html" title="enum winnow::error::Needed">Needed</a>&gt;</h4></section><section id="method.next_slice-1" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#745-749">source</a><a href="#method.next_slice-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.next_slice" class="fn">next_slice</a>(&amp;mut self, offset: <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Slice" title="type winnow::stream::Stream::Slice">Slice</a></h4></section><section id="method.checkpoint-1" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#752-754">source</a><a href="#method.checkpoint-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.checkpoint" class="fn">checkpoint</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Checkpoint" title="type winnow::stream::Stream::Checkpoint">Checkpoint</a></h4></section><section id="method.reset-1" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#756-758">source</a><a href="#method.reset-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.reset" class="fn">reset</a>(&amp;mut self, checkpoint: &amp;Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Checkpoint" title="type winnow::stream::Stream::Checkpoint">Checkpoint</a>)</h4></section><section id="method.raw-1" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#761-763">source</a><a href="#method.raw-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.raw" class="fn">raw</a>(&amp;self) -&gt; &amp;dyn <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Stream-for-(I,+usize)" class="impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#971-1047">source</a><a href="#impl-Stream-for-(I,+usize)" class="anchor">§</a><h3 class="code-header">impl&lt;I&gt; <a class="trait" href="trait.Stream.html" title="trait winnow::stream::Stream">Stream</a> for (I, <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>)<div class="where">where
I: <a class="trait" href="trait.Stream.html" title="trait winnow::stream::Stream">Stream</a>&lt;Token = <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.u8.html">u8</a>&gt; + <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Token-3" class="associatedtype trait-impl"><a href="#associatedtype.Token-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Token" class="associatedtype">Token</a> = <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.bool.html">bool</a></h4></section><section id="associatedtype.Slice-3" class="associatedtype trait-impl"><a href="#associatedtype.Slice-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Slice" class="associatedtype">Slice</a> = (&lt;I as <a class="trait" href="trait.Stream.html" title="trait winnow::stream::Stream">Stream</a>&gt;::<a class="associatedtype" href="trait.Stream.html#associatedtype.Slice" title="type winnow::stream::Stream::Slice">Slice</a>, <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>)</h4></section><section id="associatedtype.IterOffsets-3" class="associatedtype trait-impl"><a href="#associatedtype.IterOffsets-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.IterOffsets" class="associatedtype">IterOffsets</a> = <a class="struct" href="struct.BitOffsets.html" title="struct winnow::stream::BitOffsets">BitOffsets</a>&lt;I&gt;</h4></section><section id="associatedtype.Checkpoint-3" class="associatedtype trait-impl"><a href="#associatedtype.Checkpoint-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Checkpoint" class="associatedtype">Checkpoint</a> = <a class="struct" href="struct.Checkpoint.html" title="struct winnow::stream::Checkpoint">Checkpoint</a>&lt;(&lt;I as <a class="trait" href="trait.Stream.html" title="trait winnow::stream::Stream">Stream</a>&gt;::<a class="associatedtype" href="trait.Stream.html#associatedtype.Checkpoint" title="type winnow::stream::Stream::Checkpoint">Checkpoint</a>, <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>), (I, <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>)&gt;</h4></section><section id="method.iter_offsets-2" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#983-988">source</a><a href="#method.iter_offsets-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.iter_offsets" class="fn">iter_offsets</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.IterOffsets" title="type winnow::stream::Stream::IterOffsets">IterOffsets</a></h4></section><section id="method.eof_offset-2" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#990-997">source</a><a href="#method.eof_offset-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.eof_offset" class="fn">eof_offset</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a></h4></section><section id="method.next_token-2" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#1000-1002">source</a><a href="#method.next_token-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.next_token" class="fn">next_token</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Token" title="type winnow::stream::Stream::Token">Token</a>&gt;</h4></section><section id="method.offset_for-2" class="method trait-impl"><a c
P: <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Token" title="type winnow::stream::Stream::Token">Token</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.bool.html">bool</a>,</div></h4></section><section id="method.offset_at-2" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#1013-1022">source</a><a href="#method.offset_at-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.offset_at" class="fn">offset_at</a>(&amp;self, tokens: <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.78.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>, <a class="enum" href="../error/enum.Needed.html" title="enum winnow::error::Needed">Needed</a>&gt;</h4></section><section id="method.next_slice-2" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#1024-1031">source</a><a href="#method.next_slice-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.next_slice" class="fn">next_slice</a>(&amp;mut self, offset: <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.usize.html">usize</a>) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Slice" title="type winnow::stream::Stream::Slice">Slice</a></h4></section><section id="method.checkpoint-2" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#1034-1036">source</a><a href="#method.checkpoint-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.checkpoint" class="fn">checkpoint</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Checkpoint" title="type winnow::stream::Stream::Checkpoint">Checkpoint</a></h4></section><section id="method.reset-2" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#1038-1041">source</a><a href="#method.reset-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.reset" class="fn">reset</a>(&amp;mut self, checkpoint: &amp;Self::<a class="associatedtype" href="trait.Stream.html#associatedtype.Checkpoint" title="type winnow::stream::Stream::Checkpoint">Checkpoint</a>)</h4></section><section id="method.raw-2" class="method trait-impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#1044-1046">source</a><a href="#method.raw-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.raw" class="fn">raw</a>(&amp;self) -&gt; &amp;dyn <a class="trait" href="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-Stream-for-%26BStr" class="impl"><a class="src rightside" href="../../src/winnow/stream/mod.rs.html#906-969">source</a><a href="#impl-Stream-for-%26BStr" class="anchor">§</a><h3 class="code-header">impl&lt;'i&gt; <a class="trait" href="trait.Stream.html" title="trait winnow::stream::Stream">Stream</a> for &amp;'i <a class="struct" href="struct.BStr.html" title="struct winnow::stream::BStr">BStr</a></h3></section></summary><div class="impl-items"><section id="associatedtype.Token-4" class="associatedtype trait-impl"><a href="#associatedtype.Token-4" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Token" class="associatedtype">Token</a> = <a class="primitive" href="https://doc.rust-lang.org/1.78.0/std/primitive.u8.html">u8</a></h4></section><section id="associatedtype.Slice-4" class="associatedtype trait