You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
20 KiB
HTML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!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 `TendrilSink` trait in crate `kuchiki`."><meta name="keywords" content="rust, rustlang, rust-lang, TendrilSink"><title>kuchiki::traits::TendrilSink - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../ayu.css" disabled ><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc trait"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../kuchiki/index.html'><div class='logo-container rust-logo'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Trait TendrilSink</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#associated-types">Associated Types</a><div class="sidebar-links"><a href="#associatedtype.Output">Output</a></div><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.error">error</a><a href="#tymethod.finish">finish</a><a href="#tymethod.process">process</a></div><a class="sidebar-title" href="#provided-methods">Provided Methods</a><div class="sidebar-links"><a href="#method.from_file">from_file</a><a href="#method.from_iter">from_iter</a><a href="#method.one">one</a><a href="#method.read_from">read_from</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-TendrilSink%3CUTF8%2C%20NonAtomic%3E-for-Parser%3CSink%3E">Parser&lt;Sink&gt;</a><a href="#impl-TendrilSink%3CBytes%2C%20A%3E-for-Utf8LossyDecoder%3CSink%2C%20A%3E">Utf8LossyDecoder&lt;Sink, A&gt;</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='../index.html'>kuchiki</a>::<wbr><a href='index.html'>traits</a></p><script>window.sidebarCurrent = {name: 'TendrilSink', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" disabled autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><span class="help-button">?</span>
<a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span></span><span class='in-band'>Trait <a href='../index.html'>kuchiki</a>::<wbr><a href='index.html'>traits</a>::<wbr><a class="trait" href=''>TendrilSink</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust trait'>pub trait TendrilSink&lt;F, A&nbsp;=&nbsp;NonAtomic&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;A: Atomicity,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: Format,&nbsp;</span>{
type <a href='#associatedtype.Output' class="type">Output</a>;
fn <a href='#tymethod.process' class='fnname'>process</a>(&amp;mut self, t: Tendril&lt;F, A&gt;);
<div class='item-spacer'></div> fn <a href='#tymethod.error' class='fnname'>error</a>(&amp;mut self, desc: <a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;);
<div class='item-spacer'></div> fn <a href='#tymethod.finish' class='fnname'>finish</a>(self) -&gt; Self::<a class="type" href="../../kuchiki/traits/trait.TendrilSink.html#associatedtype.Output" title="type kuchiki::traits::TendrilSink::Output">Output</a>;
fn <a href='#method.one' class='fnname'>one</a>&lt;T&gt;(self, t: T) -&gt; Self::<a class="type" href="../../kuchiki/traits/trait.TendrilSink.html#associatedtype.Output" title="type kuchiki::traits::TendrilSink::Output">Output</a><br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Tendril&lt;F, A&gt;&gt;</span>,
{ ... }
<div class='item-spacer'></div> fn <a href='#method.from_iter' class='fnname'>from_iter</a>&lt;I&gt;(self, i: I) -&gt; Self::<a class="type" href="../../kuchiki/traits/trait.TendrilSink.html#associatedtype.Output" title="type kuchiki::traits::TendrilSink::Output">Output</a><br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;I as <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>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Tendril&lt;F, A&gt;&gt;</span>,
{ ... }
<div class='item-spacer'></div> fn <a href='#method.read_from' class='fnname'>read_from</a>&lt;R&gt;(self, r: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>R) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="type" href="../../kuchiki/traits/trait.TendrilSink.html#associatedtype.Output" title="type kuchiki::traits::TendrilSink::Output">Output</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F: SliceFormat&lt;Slice = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a></span>,
{ ... }
<div class='item-spacer'></div> fn <a href='#method.from_file' class='fnname'>from_file</a>&lt;P&gt;(self, path: P) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="type" href="../../kuchiki/traits/trait.TendrilSink.html#associatedtype.Output" title="type kuchiki::traits::TendrilSink::Output">Output</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F: SliceFormat&lt;Slice = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;</span>,
{ ... }
}</pre></div><div class='docblock'><p>Trait for types that can process a tendril.</p>
<p>This is a &quot;push&quot; interface, unlike the &quot;pull&quot; interface of
<code>Iterator&lt;Item=Tendril&lt;F&gt;&gt;</code>. The push interface matches
<a href="https://github.com/servo/html5ever">html5ever</a> and other incremental parsers with a similar
architecture.</p>
</div>
<h2 id='associated-types' class='small-section-header'>Associated Types<a href='#associated-types' class='anchor'></a></h2><div class='methods'><h3 id='associatedtype.Output' class='method'><code>type <a href='#associatedtype.Output' class="type">Output</a></code></h3><div class='docblock'><p>What the overall result of processing is.</p>
</div></div><span class='loading-content'>Loading content...</span>
<h2 id='required-methods' class='small-section-header'>Required methods<a href='#required-methods' class='anchor'></a></h2><div class='methods'><h3 id='tymethod.process' class='method'><code>fn <a href='#tymethod.process' class='fnname'>process</a>(&amp;mut self, t: Tendril&lt;F, A&gt;)</code></h3><div class='docblock'><p>Process this tendril.</p>
</div><h3 id='tymethod.error' class='method'><code>fn <a href='#tymethod.error' class='fnname'>error</a>(&amp;mut self, desc: <a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;)</code></h3><div class='docblock'><p>Indicates that an error has occurred.</p>
</div><h3 id='tymethod.finish' class='method'><code>fn <a href='#tymethod.finish' class='fnname'>finish</a>(self) -&gt; Self::<a class="type" href="../../kuchiki/traits/trait.TendrilSink.html#associatedtype.Output" title="type kuchiki::traits::TendrilSink::Output">Output</a></code></h3><div class='docblock'><p>Indicates the end of the stream.</p>
</div></div><span class='loading-content'>Loading content...</span>
<h2 id='provided-methods' class='small-section-header'>Provided methods<a href='#provided-methods' class='anchor'></a></h2><div class='methods'><h3 id='method.one' class='method'><code>fn <a href='#method.one' class='fnname'>one</a>&lt;T&gt;(self, t: T) -&gt; Self::<a class="type" href="../../kuchiki/traits/trait.TendrilSink.html#associatedtype.Output" title="type kuchiki::traits::TendrilSink::Output">Output</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Tendril&lt;F, A&gt;&gt;,&nbsp;</span></code></h3><div class='docblock'><p>Process one tendril and finish.</p>
</div><h3 id='method.from_iter' class='method'><code>fn <a href='#method.from_iter' class='fnname'>from_iter</a>&lt;I&gt;(self, i: I) -&gt; Self::<a class="type" href="../../kuchiki/traits/trait.TendrilSink.html#associatedtype.Output" title="type kuchiki::traits::TendrilSink::Output">Output</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;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>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;I as <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>&gt;::<a class="type" href="https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item" title="type core::iter::traits::collect::IntoIterator::Item">Item</a>: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Tendril&lt;F, A&gt;&gt;,&nbsp;</span></code></h3><div class='docblock'><p>Consume an iterator of tendrils, processing each item, then finish.</p>
</div><h3 id='method.read_from' class='method'><code>fn <a href='#method.read_from' class='fnname'>read_from</a>&lt;R&gt;(self, r: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>R) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="type" href="../../kuchiki/traits/trait.TendrilSink.html#associatedtype.Output" title="type kuchiki::traits::TendrilSink::Output">Output</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: SliceFormat&lt;Slice = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;R: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a>,&nbsp;</span></code></h3><div class='docblock'><p>Read from the given stream of bytes until exhaustion and process incrementally,
then finish. Return <code>Err</code> at the first I/O error.</p>
</div><h3 id='method.from_file' class='method'><code>fn <a href='#method.from_file' class='fnname'>from_file</a>&lt;P&gt;(self, path: P) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="type" href="../../kuchiki/traits/trait.TendrilSink.html#associatedtype.Output" title="type kuchiki::traits::TendrilSink::Output">Output</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/std/io/error/struct.Error.html" title="struct std::io::error::Error">Error</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: SliceFormat&lt;Slice = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;P: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>&gt;,&nbsp;</span></code></h3><div class='docblock'><p>Read from the file at the given path and process incrementally,
then finish. Return <code>Err</code> at the first I/O error.</p>
</div></div><span class='loading-content'>Loading content...</span>
<h2 id='foreign-impls' class='small-section-header'>Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a></h2><h3 id='impl-TendrilSink%3CUTF8%2C%20NonAtomic%3E-for-Parser%3CSink%3E' class='impl'><code class='in-band'>impl&lt;Sink&gt; <a class="trait" href="../../kuchiki/traits/trait.TendrilSink.html" title="trait kuchiki::traits::TendrilSink">TendrilSink</a>&lt;UTF8, NonAtomic&gt; for Parser&lt;Sink&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Sink: TreeSink,&nbsp;</span></code><a href='#impl-TendrilSink%3CUTF8%2C%20NonAtomic%3E-for-Parser%3CSink%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.process' class="method hidden"><code>fn <a href='#method.process' class='fnname'>process</a>(&amp;mut self, t: Tendril&lt;UTF8, NonAtomic&gt;)</code></h4><h4 id='method.error' class="method hidden"><code>fn <a href='#method.error' class='fnname'>error</a>(&amp;mut self, desc: <a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;)</code></h4><h4 id='associatedtype.Output-1' class="type"><code>type <a href='#associatedtype.Output' class="type">Output</a> = &lt;Sink as TreeSink&gt;::Output</code></h4><h4 id='method.finish' class="method hidden"><code>fn <a href='#method.finish' class='fnname'>finish</a>(self) -&gt; &lt;Parser&lt;Sink&gt; as <a class="trait" href="../../kuchiki/traits/trait.TendrilSink.html" title="trait kuchiki::traits::TendrilSink">TendrilSink</a>&lt;UTF8, NonAtomic&gt;&gt;::<a class="type" href="../../kuchiki/traits/trait.TendrilSink.html#associatedtype.Output" title="type kuchiki::traits::TendrilSink::Output">Output</a></code></h4></div><h3 id='impl-TendrilSink%3CBytes%2C%20A%3E-for-Utf8LossyDecoder%3CSink%2C%20A%3E' class='impl'><code class='in-band'>impl&lt;Sink, A&gt; <a class="trait" href="../../kuchiki/traits/trait.TendrilSink.html" title="trait kuchiki::traits::TendrilSink">TendrilSink</a>&lt;Bytes, A&gt; for Utf8LossyDecoder&lt;Sink, A&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;A: Atomicity,<br>&nbsp;&nbsp;&nbsp;&nbsp;Sink: <a class="trait" href="../../kuchiki/traits/trait.TendrilSink.html" title="trait kuchiki::traits::TendrilSink">TendrilSink</a>&lt;UTF8, A&gt;,&nbsp;</span></code><a href='#impl-TendrilSink%3CBytes%2C%20A%3E-for-Utf8LossyDecoder%3CSink%2C%20A%3E' class='anchor'></a></h3><div class='impl-items'><h4 id='method.process-1' class="method hidden"><code>fn <a href='#method.process' class='fnname'>process</a>(&amp;mut self, t: Tendril&lt;Bytes, A&gt;)</code></h4><h4 id='method.error-1' class="method hidden"><code>fn <a href='#method.error' class='fnname'>error</a>(&amp;mut self, desc: <a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;)</code></h4><h4 id='associatedtype.Output-2' class="type"><code>type <a href='#associatedtype.Output' class="type">Output</a> = &lt;Sink as <a class="trait" href="../../kuchiki/traits/trait.TendrilSink.html" title="trait kuchiki::traits::TendrilSink">TendrilSink</a>&lt;UTF8, A&gt;&gt;::<a class="type" href="../../kuchiki/traits/trait.TendrilSink.html#associatedtype.Output" title="type kuchiki::traits::TendrilSink::Output">Output</a></code></h4><h4 id='method.finish-1' class="method hidden"><code>fn <a href='#method.finish' class='fnname'>finish</a>(self) -&gt; &lt;Sink as <a class="trait" href="../../kuchiki/traits/trait.TendrilSink.html" title="trait kuchiki::traits::TendrilSink">TendrilSink</a>&lt;UTF8, A&gt;&gt;::<a class="type" href="../../kuchiki/traits/trait.TendrilSink.html#associatedtype.Output" title="type kuchiki::traits::TendrilSink::Output">Output</a></code></h4></div><span class='loading-content'>Loading content...</span>
<h2 id='implementors' class='small-section-header'>Implementors<a href='#implementors' class='anchor'></a></h2><div class='item-list' id='implementors-list'></div><span class='loading-content'>Loading content...</span><script type="text/javascript" src="../../implementors/tendril/stream/trait.TendrilSink.js" async></script></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../";window.currentCrate = "kuchiki";</script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>