blob: 506c3894dbd04ad1386b971e999889b28c4308cc [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="Read is the trait that OpenDAL returns to callers."><title>BlockingRead in opendal::raw::oio - 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" crossorigin href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-916cea96.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="opendal" data-themes="" data-resource-suffix="" data-rustdoc-version="1.87.0-nightly (43a2e9d2c 2025-03-17)" data-channel="nightly" data-search-js="search-e7298875.js" data-settings-js="settings-d72f25bb.js"><script src="../../../static.files/storage-d8ac8691.js"></script><script defer="" src="sidebar-items.js"></script><script defer="" src="../../../static.files/main-fb8c74a8.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.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><a class="logo-container" href="../../../opendal/index.html"><img src="/img/external/71c0d8847d34b7f8ce3fd204c652c6f9.svg" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../../opendal/index.html"><img src="/img/external/71c0d8847d34b7f8ce3fd204c652c6f9.svg" alt="logo"></a><h2><a href="../../../opendal/index.html">opendal</a><span class="version">0.53.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Blocking<wbr>Read</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.read" title="read">read</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-BlockingRead-for-()" title="()">()</a></li><li><a href="#impl-BlockingRead-for-Box%3CT%3E" title="Box<T>">Box&lt;T&gt;</a></li><li><a href="#impl-BlockingRead-for-Bytes" title="Bytes">Bytes</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In opendal::<wbr>raw::<wbr>oio</a></h2></div></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"><div class="rustdoc-breadcrumbs"><a href="../../index.html">opendal</a>::<wbr><a href="../index.html">raw</a>::<wbr><a href="index.html">oio</a></div><h1>Trait <span class="trait">BlockingRead</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/opendal/raw/oio/read/api.rs.html#125-128">Source</a> </span></div><pre class="rust item-decl"><code>pub trait BlockingRead: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> {
// Required method
fn <a href="#tymethod.read" class="fn">read</a>(&amp;mut self) -&gt; <a class="type" href="../../type.Result.html" title="type opendal::Result">Result</a>&lt;<a class="struct" href="../../struct.Buffer.html" title="struct opendal::Buffer">Buffer</a>&gt;;
}</code></pre><details class="toggle top-doc" open=""><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Read is the trait that OpenDAL returns to callers.</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.read" class="method"><a class="src rightside" href="../../../src/opendal/raw/oio/read/api.rs.html#127">Source</a><h4 class="code-header">fn <a href="#tymethod.read" class="fn">read</a>(&amp;mut self) -&gt; <a class="type" href="../../type.Result.html" title="type opendal::Result">Result</a>&lt;<a class="struct" href="../../struct.Buffer.html" title="struct opendal::Buffer">Buffer</a>&gt;</h4></section></summary><div class="docblock"><p>Read data from the reader at the given offset with the given size.</p>
</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-BlockingRead-for-()" class="impl"><a class="src rightside" href="../../../src/opendal/raw/oio/read/api.rs.html#130-134">Source</a><a href="#impl-BlockingRead-for-()" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h3></section></summary><div class="impl-items"><section id="method.read" class="method trait-impl"><a class="src rightside" href="../../../src/opendal/raw/oio/read/api.rs.html#131-133">Source</a><a href="#method.read" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.read" class="fn">read</a>(&amp;mut self) -&gt; <a class="type" href="../../type.Result.html" title="type opendal::Result">Result</a>&lt;<a class="struct" href="../../struct.Buffer.html" title="struct opendal::Buffer">Buffer</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BlockingRead-for-Bytes" class="impl"><a class="src rightside" href="../../../src/opendal/raw/oio/read/api.rs.html#136-140">Source</a><a href="#impl-BlockingRead-for-Bytes" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a> for Bytes</h3></section></summary><div class="impl-items"><section id="method.read-1" class="method trait-impl"><a class="src rightside" href="../../../src/opendal/raw/oio/read/api.rs.html#137-139">Source</a><a href="#method.read-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.read" class="fn">read</a>(&amp;mut self) -&gt; <a class="type" href="../../type.Result.html" title="type opendal::Result">Result</a>&lt;<a class="struct" href="../../struct.Buffer.html" title="struct opendal::Buffer">Buffer</a>&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BlockingRead-for-Box%3CT%3E" class="impl"><a class="src rightside" href="../../../src/opendal/raw/oio/read/api.rs.html#150-154">Source</a><a href="#impl-BlockingRead-for-Box%3CT%3E" class="anchor">§</a><h3 class="code-header">impl&lt;T: <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a> + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>&gt; <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</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;T&gt;</h3><div class="docblock"><p><code>Arc&lt;dyn BlockingRead&gt;</code> won’t implement <code>BlockingRead</code> automatically.
To make BlockingReader work as expected, we must add this impl.</p>
</div></section></summary><div class="impl-items"><section id="method.read-2" class="method trait-impl"><a class="src rightside" href="../../../src/opendal/raw/oio/read/api.rs.html#151-153">Source</a><a href="#method.read-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.read" class="fn">read</a>(&amp;mut self) -&gt; <a class="type" href="../../type.Result.html" title="type opendal::Result">Result</a>&lt;<a class="struct" href="../../struct.Buffer.html" title="struct opendal::Buffer">Buffer</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-BlockingRead-for-Buffer" class="impl"><a class="src rightside" href="../../../src/opendal/raw/oio/read/api.rs.html#142-146">Source</a><a href="#impl-BlockingRead-for-Buffer" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a> for <a class="struct" href="../../struct.Buffer.html" title="struct opendal::Buffer">Buffer</a></h3></section><section id="impl-BlockingRead-for-FourWays%3CONE,+TWO,+THREE,+FOUR%3E" class="impl"><a class="src rightside" href="../../../src/opendal/raw/enum_utils.rs.html#207-222">Source</a><a href="#impl-BlockingRead-for-FourWays%3CONE,+TWO,+THREE,+FOUR%3E" class="anchor">§</a><h3 class="code-header">impl&lt;ONE, TWO, THREE, FOUR&gt; <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a> for <a class="enum" href="../enum.FourWays.html" title="enum opendal::raw::FourWays">FourWays</a>&lt;ONE, TWO, THREE, FOUR&gt;<div class="where">where
ONE: <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a>,
TWO: <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a>,
THREE: <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a>,
FOUR: <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a>,</div></h3></section><section id="impl-BlockingRead-for-TwoWays%3CONE,+TWO%3E" class="impl"><a class="src rightside" href="../../../src/opendal/raw/enum_utils.rs.html#63-70">Source</a><a href="#impl-BlockingRead-for-TwoWays%3CONE,+TWO%3E" class="anchor">§</a><h3 class="code-header">impl&lt;ONE: <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a>, TWO: <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a>&gt; <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a> for <a class="enum" href="../enum.TwoWays.html" title="enum opendal::raw::TwoWays">TwoWays</a>&lt;ONE, TWO&gt;</h3></section><section id="impl-BlockingRead-for-ThreeWays%3CONE,+TWO,+THREE%3E" class="impl"><a class="src rightside" href="../../../src/opendal/raw/enum_utils.rs.html#126-136">Source</a><a href="#impl-BlockingRead-for-ThreeWays%3CONE,+TWO,+THREE%3E" class="anchor">§</a><h3 class="code-header">impl&lt;ONE: <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a>, TWO: <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a>, THREE: <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a>&gt; <a class="trait" href="trait.BlockingRead.html" title="trait opendal::raw::oio::BlockingRead">BlockingRead</a> for <a class="enum" href="../enum.ThreeWays.html" title="enum opendal::raw::ThreeWays">ThreeWays</a>&lt;ONE, TWO, THREE&gt;</h3></section></div><script src="../../../trait.impl/opendal/raw/oio/read/api/trait.BlockingRead.js" data-ignore-extern-crates="std,bytes,alloc" async=""></script></section></div></main></body></html>