blob: 58750d5d8855b01808c6c49aa3be9b1943e69ff6 [file] [log] [blame]
<!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="Trait for types that can read `RecordBatch`’s."><title>RecordBatchReader in arrow::array - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="arrow" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0-nightly (b92758a9a 2024-05-20)" data-channel="nightly" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-118b08c4c78b968e.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-df360f571f6edeae.css"></noscript><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="../../arrow/index.html">arrow</a><span class="version">51.0.0</span></h2></div><h2 class="location"><a href="#">RecordBatchReader</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.schema">schema</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.next_batch">next_batch</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-RecordBatchReader-for-Box%3CR%3E">Box&lt;R&gt;</a></li><li><a href="#impl-RecordBatchReader-for-BufReader%3CR%3E">BufReader&lt;R&gt;</a></li><li><a href="#impl-RecordBatchReader-for-FileReader%3CR%3E">FileReader&lt;R&gt;</a></li><li><a href="#impl-RecordBatchReader-for-Reader%3CR%3E">Reader&lt;R&gt;</a></li><li><a href="#impl-RecordBatchReader-for-StreamReader%3CR%3E">StreamReader&lt;R&gt;</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-IntoPyArrow-for-Box%3Cdyn+RecordBatchReader+%2B+Send%3E">IntoPyArrow</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In arrow::array</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Trait <a href="../index.html">arrow</a>::<wbr><a href="index.html">array</a>::<wbr><a class="trait" href="#">RecordBatchReader</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><pre class="rust item-decl"><code>pub trait RecordBatchReader: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a>&lt;Item = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../record_batch/struct.RecordBatch.html" title="struct arrow::record_batch::RecordBatch">RecordBatch</a>, <a class="enum" href="../error/enum.ArrowError.html" title="enum arrow::error::ArrowError">ArrowError</a>&gt;&gt; {
// Required method
fn <a href="#tymethod.schema" class="fn">schema</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;<a class="struct" href="../datatypes/struct.Schema.html" title="struct arrow::datatypes::Schema">Schema</a>&gt;;
// Provided method
fn <a href="#method.next_batch" class="fn">next_batch</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../record_batch/struct.RecordBatch.html" title="struct arrow::record_batch::RecordBatch">RecordBatch</a>&gt;, <a class="enum" href="../error/enum.ArrowError.html" title="enum arrow::error::ArrowError">ArrowError</a>&gt; { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Trait for types that can read <code>RecordBatch</code>’s.</p>
<p>To create from an iterator, see <a href="../record_batch/struct.RecordBatchIterator.html" title="struct arrow::record_batch::RecordBatchIterator">RecordBatchIterator</a>.</p>
</div></details><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.schema" class="method"><h4 class="code-header">fn <a href="#tymethod.schema" class="fn">schema</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;<a class="struct" href="../datatypes/struct.Schema.html" title="struct arrow::datatypes::Schema">Schema</a>&gt;</h4></section></summary><div class="docblock"><p>Returns the schema of this <code>RecordBatchReader</code>.</p>
<p>Implementation of this trait should guarantee that all <code>RecordBatch</code>’s returned by this
reader should have the same schema as returned from this method.</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.next_batch" class="method"><h4 class="code-header">fn <a href="#method.next_batch" class="fn">next_batch</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="../record_batch/struct.RecordBatch.html" title="struct arrow::record_batch::RecordBatch">RecordBatch</a>&gt;, <a class="enum" href="../error/enum.ArrowError.html" title="enum arrow::error::ArrowError">ArrowError</a>&gt;</h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 2.0.0: This method is deprecated in favour of <code>next</code> from the trait Iterator.</span></div></span></summary><div class="docblock"><p>Reads the next <code>RecordBatch</code>.</p>
</div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-IntoPyArrow-for-Box%3Cdyn+RecordBatchReader+%2B+Send%3E" class="impl"><a class="src rightside" href="../../src/arrow/pyarrow.rs.html#448-462">source</a><a href="#impl-IntoPyArrow-for-Box%3Cdyn+RecordBatchReader+%2B+Send%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../pyarrow/trait.IntoPyArrow.html" title="trait arrow::pyarrow::IntoPyArrow">IntoPyArrow</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="../record_batch/trait.RecordBatchReader.html" title="trait arrow::record_batch::RecordBatchReader">RecordBatchReader</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>&gt;</h3></section></summary><div class="docblock"><p>Convert a <a href="../record_batch/trait.RecordBatchReader.html" title="trait arrow::record_batch::RecordBatchReader"><code>RecordBatchReader</code></a> into a <code>pyarrow.RecordBatchReader</code>.</p>
</div><div class="impl-items"><section id="method.into_pyarrow" class="method trait-impl"><a class="src rightside" href="../../src/arrow/pyarrow.rs.html#451-461">source</a><a href="#method.into_pyarrow" class="anchor">§</a><h4 class="code-header">fn <a href="../pyarrow/trait.IntoPyArrow.html#tymethod.into_pyarrow" class="fn">into_pyarrow</a>(self, py: Python&lt;'_&gt;) -&gt; PyResult&lt;PyObject&gt;</h4></section></div></details></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-RecordBatchReader-for-Box%3CR%3E" class="impl"><a href="#impl-RecordBatchReader-for-Box%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <a class="trait" href="../record_batch/trait.RecordBatchReader.html" title="trait arrow::record_batch::RecordBatchReader">RecordBatchReader</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;R&gt;<div class="where">where
R: <a class="trait" href="../record_batch/trait.RecordBatchReader.html" title="trait arrow::record_batch::RecordBatchReader">RecordBatchReader</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><div class="impl-items"><section id="method.schema" class="method trait-impl"><a href="#method.schema" class="anchor">§</a><h4 class="code-header">fn <a class="fn">schema</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;<a class="struct" href="../datatypes/struct.Schema.html" title="struct arrow::datatypes::Schema">Schema</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-RecordBatchReader-for-BufReader%3CR%3E" class="impl"><a href="#impl-RecordBatchReader-for-BufReader%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <a class="trait" href="../record_batch/trait.RecordBatchReader.html" title="trait arrow::record_batch::RecordBatchReader">RecordBatchReader</a> for BufReader&lt;R&gt;<div class="where">where
R: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.BufRead.html" title="trait std::io::BufRead">BufRead</a>,</div></h3></section></summary><div class="impl-items"><section id="method.schema-1" class="method trait-impl"><a href="#method.schema-1" class="anchor">§</a><h4 class="code-header">fn <a class="fn">schema</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;<a class="struct" href="../datatypes/struct.Schema.html" title="struct arrow::datatypes::Schema">Schema</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-RecordBatchReader-for-FileReader%3CR%3E" class="impl"><a href="#impl-RecordBatchReader-for-FileReader%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <a class="trait" href="../record_batch/trait.RecordBatchReader.html" title="trait arrow::record_batch::RecordBatchReader">RecordBatchReader</a> for FileReader&lt;R&gt;<div class="where">where
R: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Seek.html" title="trait std::io::Seek">Seek</a>,</div></h3></section></summary><div class="impl-items"><section id="method.schema-2" class="method trait-impl"><a href="#method.schema-2" class="anchor">§</a><h4 class="code-header">fn <a class="fn">schema</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;<a class="struct" href="../datatypes/struct.Schema.html" title="struct arrow::datatypes::Schema">Schema</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-RecordBatchReader-for-Reader%3CR%3E" class="impl"><a href="#impl-RecordBatchReader-for-Reader%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <a class="trait" href="../record_batch/trait.RecordBatchReader.html" title="trait arrow::record_batch::RecordBatchReader">RecordBatchReader</a> for Reader&lt;R&gt;<div class="where">where
R: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.BufRead.html" title="trait std::io::BufRead">BufRead</a>,</div></h3></section></summary><div class="impl-items"><section id="method.schema-3" class="method trait-impl"><a href="#method.schema-3" class="anchor">§</a><h4 class="code-header">fn <a class="fn">schema</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;<a class="struct" href="../datatypes/struct.Schema.html" title="struct arrow::datatypes::Schema">Schema</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-RecordBatchReader-for-StreamReader%3CR%3E" class="impl"><a href="#impl-RecordBatchReader-for-StreamReader%3CR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;R&gt; <a class="trait" href="../record_batch/trait.RecordBatchReader.html" title="trait arrow::record_batch::RecordBatchReader">RecordBatchReader</a> for StreamReader&lt;R&gt;<div class="where">where
R: <a class="trait" href="https://doc.rust-lang.org/nightly/std/io/trait.Read.html" title="trait std::io::Read">Read</a>,</div></h3></section></summary><div class="impl-items"><section id="method.schema-4" class="method trait-impl"><a href="#method.schema-4" class="anchor">§</a><h4 class="code-header">fn <a class="fn">schema</a>(&amp;self) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;<a class="struct" href="../datatypes/struct.Schema.html" title="struct arrow::datatypes::Schema">Schema</a>&gt;</h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-RecordBatchReader-for-ArrowArrayStreamReader" class="impl"><a href="#impl-RecordBatchReader-for-ArrowArrayStreamReader" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="../record_batch/trait.RecordBatchReader.html" title="trait arrow::record_batch::RecordBatchReader">RecordBatchReader</a> for <a class="struct" href="../ffi_stream/struct.ArrowArrayStreamReader.html" title="struct arrow::ffi_stream::ArrowArrayStreamReader">ArrowArrayStreamReader</a></h3></section><section id="impl-RecordBatchReader-for-RecordBatchIterator%3CI%3E" class="impl"><a href="#impl-RecordBatchReader-for-RecordBatchIterator%3CI%3E" class="anchor">§</a><h3 class="code-header">impl&lt;I&gt; <a class="trait" href="../record_batch/trait.RecordBatchReader.html" title="trait arrow::record_batch::RecordBatchReader">RecordBatchReader</a> for <a class="struct" href="../record_batch/struct.RecordBatchIterator.html" title="struct arrow::record_batch::RecordBatchIterator">RecordBatchIterator</a>&lt;I&gt;<div class="where">where
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>&lt;Item = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../record_batch/struct.RecordBatch.html" title="struct arrow::record_batch::RecordBatch">RecordBatch</a>, <a class="enum" href="../error/enum.ArrowError.html" title="enum arrow::error::ArrowError">ArrowError</a>&gt;&gt;,</div></h3></section></div><script src="../../trait.impl/arrow_array/record_batch/trait.RecordBatchReader.js" data-ignore-extern-crates="alloc,arrow_array,arrow_csv,arrow_ipc,arrow_json" async></script></section></div></main></body></html>