Files
greptimedb/puffin/puffin_manager/trait.PuffinReader.html
2026-05-15 04:01:35 +00:00

53 lines
19 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The `PuffinReader` trait provides methods for reading blobs and directories from a Puffin file."><title>PuffinReader in puffin::puffin_manager - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="puffin" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../static.files/storage-41dd4d93.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">PuffinReader</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../puffin/index.html">puffin</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Puffin<wbr>Reader</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Blob" title="Blob">Blob</a></li><li><a href="#associatedtype.Dir" title="Dir">Dir</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.blob" title="blob">blob</a></li><li><a href="#tymethod.dir" title="dir">dir</a></li><li><a href="#tymethod.metadata" title="metadata">metadata</a></li><li><a href="#tymethod.with_file_size_hint" title="with_file_size_hint">with_file_size_hint</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In puffin::<wbr>puffin_<wbr>manager</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">puffin</a>::<wbr><a href="index.html">puffin_manager</a></div><h1>Trait <span class="trait">Puffin<wbr>Reader</span>&nbsp;<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/puffin/puffin_manager.rs.html#101-122">Source</a> </span></div><pre class="rust item-decl"><code>pub trait PuffinReader {
type <a href="#associatedtype.Blob" class="associatedtype">Blob</a>: <a class="trait" href="trait.BlobGuard.html" title="trait puffin::puffin_manager::BlobGuard">BlobGuard</a>;
type <a href="#associatedtype.Dir" class="associatedtype">Dir</a>: <a class="trait" href="trait.DirGuard.html" title="trait puffin::puffin_manager::DirGuard">DirGuard</a>;
// Required methods
fn <a href="#tymethod.with_file_size_hint" class="fn">with_file_size_hint</a>(self, file_size_hint: <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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>&gt;) -&gt; Self;
<span class="item-spacer"></span> fn <a href="#tymethod.metadata" class="fn">metadata</a>&lt;'life0, 'async_trait&gt;(
&amp;'life0 self,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<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="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="type" href="../error/type.Result.html" title="type puffin::error::Result">Result</a>&lt;<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="../file_metadata/struct.FileMetadata.html" title="struct puffin::file_metadata::FileMetadata">FileMetadata</a>&gt;&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait&gt;&gt;
<span class="where">where Self: 'async_trait,
'life0: 'async_trait</span>;
<span class="item-spacer"></span> fn <a href="#tymethod.blob" class="fn">blob</a>&lt;'life0, 'life1, 'async_trait&gt;(
&amp;'life0 self,
key: &amp;'life1 <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<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="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="type" href="../error/type.Result.html" title="type puffin::error::Result">Result</a>&lt;<a class="struct" href="struct.GuardWithMetadata.html" title="struct puffin::puffin_manager::GuardWithMetadata">GuardWithMetadata</a>&lt;Self::<a class="associatedtype" href="trait.PuffinReader.html#associatedtype.Blob" title="type puffin::puffin_manager::PuffinReader::Blob">Blob</a>&gt;&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait&gt;&gt;
<span class="where">where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait</span>;
<span class="item-spacer"></span> fn <a href="#tymethod.dir" class="fn">dir</a>&lt;'life0, 'life1, 'async_trait&gt;(
&amp;'life0 self,
key: &amp;'life1 <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<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="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="type" href="../error/type.Result.html" title="type puffin::error::Result">Result</a>&lt;(<a class="struct" href="struct.GuardWithMetadata.html" title="struct puffin::puffin_manager::GuardWithMetadata">GuardWithMetadata</a>&lt;Self::<a class="associatedtype" href="trait.PuffinReader.html#associatedtype.Dir" title="type puffin::puffin_manager::PuffinReader::Dir">Dir</a>&gt;, <a class="struct" href="struct.DirMetrics.html" title="struct puffin::puffin_manager::DirMetrics">DirMetrics</a>)&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait&gt;&gt;
<span class="where">where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait</span>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The <code>PuffinReader</code> trait provides methods for reading blobs and directories from a Puffin file.</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"><section id="associatedtype.Blob" class="method"><a class="src rightside" href="../../src/puffin/puffin_manager.rs.html#102">Source</a><h4 class="code-header">type <a href="#associatedtype.Blob" class="associatedtype">Blob</a>: <a class="trait" href="trait.BlobGuard.html" title="trait puffin::puffin_manager::BlobGuard">BlobGuard</a></h4></section><section id="associatedtype.Dir" class="method"><a class="src rightside" href="../../src/puffin/puffin_manager.rs.html#103">Source</a><h4 class="code-header">type <a href="#associatedtype.Dir" class="associatedtype">Dir</a>: <a class="trait" href="trait.DirGuard.html" title="trait puffin::puffin_manager::DirGuard">DirGuard</a></h4></section></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><section id="tymethod.with_file_size_hint" class="method"><a class="src rightside" href="../../src/puffin/puffin_manager.rs.html#105">Source</a><h4 class="code-header">fn <a href="#tymethod.with_file_size_hint" class="fn">with_file_size_hint</a>(self, file_size_hint: <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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>&gt;) -&gt; Self</h4></section><details class="toggle method-toggle" open><summary><section id="tymethod.metadata" class="method"><a class="src rightside" href="../../src/puffin/puffin_manager.rs.html#108">Source</a><h4 class="code-header">fn <a href="#tymethod.metadata" class="fn">metadata</a>&lt;'life0, 'async_trait&gt;(
&amp;'life0 self,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<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="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="type" href="../error/type.Result.html" title="type puffin::error::Result">Result</a>&lt;<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="../file_metadata/struct.FileMetadata.html" title="struct puffin::file_metadata::FileMetadata">FileMetadata</a>&gt;&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait&gt;&gt;<div class="where">where
Self: 'async_trait,
'life0: 'async_trait,</div></h4></section></summary><div class="docblock"><p>Returns the metadata of the Puffin file.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.blob" class="method"><a class="src rightside" href="../../src/puffin/puffin_manager.rs.html#114">Source</a><h4 class="code-header">fn <a href="#tymethod.blob" class="fn">blob</a>&lt;'life0, 'life1, 'async_trait&gt;(
&amp;'life0 self,
key: &amp;'life1 <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<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="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="type" href="../error/type.Result.html" title="type puffin::error::Result">Result</a>&lt;<a class="struct" href="struct.GuardWithMetadata.html" title="struct puffin::puffin_manager::GuardWithMetadata">GuardWithMetadata</a>&lt;Self::<a class="associatedtype" href="trait.PuffinReader.html#associatedtype.Blob" title="type puffin::puffin_manager::PuffinReader::Blob">Blob</a>&gt;&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait&gt;&gt;<div class="where">where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,</div></h4></section></summary><div class="docblock"><p>Reads a blob from the Puffin file.</p>
<p>The returned <code>GuardWithMetadata</code> is used to access the blob data and its metadata.
Users should hold the <code>GuardWithMetadata</code> until they are done with the blob data.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.dir" class="method"><a class="src rightside" href="../../src/puffin/puffin_manager.rs.html#121">Source</a><h4 class="code-header">fn <a href="#tymethod.dir" class="fn">dir</a>&lt;'life0, 'life1, 'async_trait&gt;(
&amp;'life0 self,
key: &amp;'life1 <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>,
) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a>&lt;<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="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="type" href="../error/type.Result.html" title="type puffin::error::Result">Result</a>&lt;(<a class="struct" href="struct.GuardWithMetadata.html" title="struct puffin::puffin_manager::GuardWithMetadata">GuardWithMetadata</a>&lt;Self::<a class="associatedtype" href="trait.PuffinReader.html#associatedtype.Dir" title="type puffin::puffin_manager::PuffinReader::Dir">Dir</a>&gt;, <a class="struct" href="struct.DirMetrics.html" title="struct puffin::puffin_manager::DirMetrics">DirMetrics</a>)&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + 'async_trait&gt;&gt;<div class="where">where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,</div></h4></section></summary><div class="docblock"><p>Reads a directory from the Puffin file.</p>
<p>The returned tuple contains <code>GuardWithMetadata</code> and <code>DirMetrics</code>.
The <code>GuardWithMetadata</code> is used to access the directory data and its metadata.
Users should hold the <code>GuardWithMetadata</code> until they are done with the directory data.</p>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><div class="negative-marker"></div><details class="toggle implementors-toggle"><summary><section id="impl-PuffinReader-for-FsPuffinReader%3CS,+F%3E" class="impl"><a class="src rightside" href="../../src/puffin/puffin_manager/fs_puffin_manager/reader.rs.html#85-158">Source</a><a href="#impl-PuffinReader-for-FsPuffinReader%3CS,+F%3E" class="anchor">§</a><h3 class="code-header">impl&lt;S, F&gt; <a class="trait" href="trait.PuffinReader.html" title="trait puffin::puffin_manager::PuffinReader">PuffinReader</a> for <a class="struct" href="fs_puffin_manager/struct.FsPuffinReader.html" title="struct puffin::puffin_manager::fs_puffin_manager::FsPuffinReader">FsPuffinReader</a>&lt;S, F&gt;<div class="where">where
F: <a class="trait" href="file_accessor/trait.PuffinFileAccessor.html" title="trait puffin::puffin_manager::file_accessor::PuffinFileAccessor">PuffinFileAccessor</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
S: <a class="trait" href="stager/trait.Stager.html" title="trait puffin::puffin_manager::stager::Stager">Stager</a>&lt;FileHandle = F::<a class="associatedtype" href="file_accessor/trait.PuffinFileAccessor.html#associatedtype.FileHandle" title="type puffin::puffin_manager::file_accessor::PuffinFileAccessor::FileHandle">FileHandle</a>&gt; + 'static,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Blob-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/puffin/puffin_manager/fs_puffin_manager/reader.rs.html#90">Source</a><a href="#associatedtype.Blob-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Blob" class="associatedtype">Blob</a> = <a class="enum" href="fs_puffin_manager/reader/enum.Either.html" title="enum puffin::puffin_manager::fs_puffin_manager::reader::Either">Either</a>&lt;<a class="struct" href="fs_puffin_manager/reader/struct.RandomReadBlob.html" title="struct puffin::puffin_manager::fs_puffin_manager::reader::RandomReadBlob">RandomReadBlob</a>&lt;F&gt;, &lt;S as <a class="trait" href="stager/trait.Stager.html" title="trait puffin::puffin_manager::stager::Stager">Stager</a>&gt;::<a class="associatedtype" href="stager/trait.Stager.html#associatedtype.Blob" title="type puffin::puffin_manager::stager::Stager::Blob">Blob</a>&gt;</h4></section><section id="associatedtype.Dir-1" class="associatedtype trait-impl"><a class="src rightside" href="../../src/puffin/puffin_manager/fs_puffin_manager/reader.rs.html#91">Source</a><a href="#associatedtype.Dir-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Dir" class="associatedtype">Dir</a> = &lt;S as <a class="trait" href="stager/trait.Stager.html" title="trait puffin::puffin_manager::stager::Stager">Stager</a>&gt;::<a class="associatedtype" href="stager/trait.Stager.html#associatedtype.Dir" title="type puffin::puffin_manager::stager::Stager::Dir">Dir</a></h4></section></div></details></div><script src="../../trait.impl/puffin/puffin_manager/trait.PuffinReader.js" async></script></section></div></main></body></html>