Files
greptimedb/object_store/trait.ObjectStoreBuilder.html
2025-12-23 10:07:07 +00:00

31 lines
18 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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="Builder is used to set up underlying services."><title>ObjectStoreBuilder in object_store - 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-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="object_store" data-themes="" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (fa3155a64 2025-09-30)" data-channel="nightly" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.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"><!--[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="#">ObjectStoreBuilder</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../object_store/index.html">object_<wbr>store</a><span class="version">1.0.0-beta.3</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Object<wbr>Store<wbr>Builder</a></h2><h3><a href="#required-associated-consts">Required Associated Constants</a></h3><ul class="block"><li><a href="#associatedconstant.SCHEME" title="SCHEME">SCHEME</a></li></ul><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Config" title="Config">Config</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.build" title="build">build</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Builder-for-()" title="()">()</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 class="in-crate"><a href="index.html">In crate object_<wbr>store</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"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="index.html">object_store</a></div><h1>Trait <span class="trait">Object<wbr>Store<wbr>Builder</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"></span></div><pre class="rust item-decl"><code>pub trait ObjectStoreBuilder: <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> + 'static {
type <a href="#associatedtype.Config" class="associatedtype">Config</a>: Configurator;
const <a href="#associatedconstant.SCHEME" class="constant">SCHEME</a>: <a class="enum" href="enum.Scheme.html" title="enum object_store::Scheme">Scheme</a>;
// Required method
fn <a href="#tymethod.build" class="fn">build</a>(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;impl <a class="trait" href="trait.Access.html" title="trait object_store::Access">Access</a>, <a class="struct" href="struct.Error.html" title="struct object_store::Error">Error</a>&gt;;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Builder is used to set up underlying services.</p>
<p>This trait allows the developer to define a builder struct that can:</p>
<ul>
<li>build a service via builder style API.</li>
<li>configure in-memory options like <code>http_client</code> or <code>customized_credential_load</code>.</li>
</ul>
<p>Usually, users dont need to use or import this trait directly, they can use <code>Operator</code> API instead.</p>
<p>For example:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>opendal::services::Fs;
<span class="kw">use </span>opendal::Operator;
<span class="kw">async fn </span>test() -&gt; <span class="prelude-ty">Result</span>&lt;()&gt; {
<span class="comment">// Create fs backend builder.
</span><span class="kw">let </span><span class="kw-2">mut </span>builder = Fs::default().root(<span class="string">"/tmp"</span>);
<span class="comment">// Build an `Operator` to start operating the storage.
</span><span class="kw">let </span>op: Operator = Operator::new(builder)<span class="question-mark">?</span>.finish();
<span class="prelude-val">Ok</span>(())
}</code></pre></div></div></details><h2 id="required-associated-consts" class="section-header">Required Associated Constants<a href="#required-associated-consts" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedconstant.SCHEME" class="method"><h4 class="code-header">const <a href="#associatedconstant.SCHEME" class="constant">SCHEME</a>: <a class="enum" href="enum.Scheme.html" title="enum object_store::Scheme">Scheme</a></h4></section></summary><div class="docblock"><p>Associated scheme for this builder. It indicates what underlying service is.</p>
</div></details></div><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.Config" class="method"><h4 class="code-header">type <a href="#associatedtype.Config" class="associatedtype">Config</a>: Configurator</h4></section></summary><div class="docblock"><p>Associated configuration for this builder.</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.build" class="method"><h4 class="code-header">fn <a href="#tymethod.build" class="fn">build</a>(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;impl <a class="trait" href="trait.Access.html" title="trait object_store::Access">Access</a>, <a class="struct" href="struct.Error.html" title="struct object_store::Error">Error</a>&gt;</h4></section></summary><div class="docblock"><p>Consume the accessor builder to build a service.</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="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-Builder-for-()" class="impl"><a href="#impl-Builder-for-()" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.ObjectStoreBuilder.html" title="trait object_store::ObjectStoreBuilder">Builder</a> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h3><div class="docblock"><p>Dummy implementation of builder</p>
</div></section></summary><div class="impl-items"><section id="associatedconstant.SCHEME-1" class="associatedconstant trait-impl"><a href="#associatedconstant.SCHEME-1" class="anchor">§</a><h4 class="code-header">const <a class="constant">SCHEME</a>: <a class="enum" href="enum.Scheme.html" title="enum object_store::Scheme">Scheme</a></h4></section><section id="associatedtype.Config-1" class="associatedtype trait-impl"><a href="#associatedtype.Config-1" class="anchor">§</a><h4 class="code-header">type <a class="associatedtype">Config</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h4></section><section id="method.build" class="method trait-impl"><a href="#method.build" class="anchor">§</a><h4 class="code-header">fn <a class="fn">build</a>(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;impl <a class="trait" href="trait.Access.html" title="trait object_store::Access">Access</a>, <a class="struct" href="struct.Error.html" title="struct object_store::Error">Error</a>&gt;</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-Builder-for-Azblob" class="impl"><a href="#impl-Builder-for-Azblob" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.ObjectStoreBuilder.html" title="trait object_store::ObjectStoreBuilder">Builder</a> for <a class="struct" href="services/struct.Azblob.html" title="struct object_store::services::Azblob">AzblobBuilder</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.SCHEME-2" class="associatedconstant trait-impl"><a href="#associatedconstant.SCHEME-2" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.SCHEME" class="constant">SCHEME</a>: <a class="enum" href="enum.Scheme.html" title="enum object_store::Scheme">Scheme</a> = Scheme::Azblob</h4></section><section id="associatedtype.Config-2" class="associatedtype trait-impl"><a href="#associatedtype.Config-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Config" class="associatedtype">Config</a> = <a class="struct" href="services/struct.AzblobConfig.html" title="struct object_store::services::AzblobConfig">AzblobConfig</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Builder-for-Fs" class="impl"><a href="#impl-Builder-for-Fs" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.ObjectStoreBuilder.html" title="trait object_store::ObjectStoreBuilder">Builder</a> for <a class="struct" href="services/struct.Fs.html" title="struct object_store::services::Fs">FsBuilder</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.SCHEME-3" class="associatedconstant trait-impl"><a href="#associatedconstant.SCHEME-3" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.SCHEME" class="constant">SCHEME</a>: <a class="enum" href="enum.Scheme.html" title="enum object_store::Scheme">Scheme</a> = Scheme::Fs</h4></section><section id="associatedtype.Config-3" class="associatedtype trait-impl"><a href="#associatedtype.Config-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Config" class="associatedtype">Config</a> = <a class="struct" href="services/struct.FsConfig.html" title="struct object_store::services::FsConfig">FsConfig</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Builder-for-Gcs" class="impl"><a href="#impl-Builder-for-Gcs" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.ObjectStoreBuilder.html" title="trait object_store::ObjectStoreBuilder">Builder</a> for <a class="struct" href="services/struct.Gcs.html" title="struct object_store::services::Gcs">GcsBuilder</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.SCHEME-4" class="associatedconstant trait-impl"><a href="#associatedconstant.SCHEME-4" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.SCHEME" class="constant">SCHEME</a>: <a class="enum" href="enum.Scheme.html" title="enum object_store::Scheme">Scheme</a> = Scheme::Gcs</h4></section><section id="associatedtype.Config-4" class="associatedtype trait-impl"><a href="#associatedtype.Config-4" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Config" class="associatedtype">Config</a> = <a class="struct" href="services/struct.GcsConfig.html" title="struct object_store::services::GcsConfig">GcsConfig</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Builder-for-Http" class="impl"><a href="#impl-Builder-for-Http" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.ObjectStoreBuilder.html" title="trait object_store::ObjectStoreBuilder">Builder</a> for <a class="struct" href="services/struct.Http.html" title="struct object_store::services::Http">HttpBuilder</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.SCHEME-5" class="associatedconstant trait-impl"><a href="#associatedconstant.SCHEME-5" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.SCHEME" class="constant">SCHEME</a>: <a class="enum" href="enum.Scheme.html" title="enum object_store::Scheme">Scheme</a> = Scheme::Http</h4></section><section id="associatedtype.Config-5" class="associatedtype trait-impl"><a href="#associatedtype.Config-5" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Config" class="associatedtype">Config</a> = <a class="struct" href="services/struct.HttpConfig.html" title="struct object_store::services::HttpConfig">HttpConfig</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Builder-for-Memory" class="impl"><a href="#impl-Builder-for-Memory" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.ObjectStoreBuilder.html" title="trait object_store::ObjectStoreBuilder">Builder</a> for <a class="struct" href="services/struct.Memory.html" title="struct object_store::services::Memory">MemoryBuilder</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.SCHEME-6" class="associatedconstant trait-impl"><a href="#associatedconstant.SCHEME-6" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.SCHEME" class="constant">SCHEME</a>: <a class="enum" href="enum.Scheme.html" title="enum object_store::Scheme">Scheme</a> = Scheme::Memory</h4></section><section id="associatedtype.Config-6" class="associatedtype trait-impl"><a href="#associatedtype.Config-6" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Config" class="associatedtype">Config</a> = <a class="struct" href="services/struct.MemoryConfig.html" title="struct object_store::services::MemoryConfig">MemoryConfig</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Builder-for-Oss" class="impl"><a href="#impl-Builder-for-Oss" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.ObjectStoreBuilder.html" title="trait object_store::ObjectStoreBuilder">Builder</a> for <a class="struct" href="services/struct.Oss.html" title="struct object_store::services::Oss">OssBuilder</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.SCHEME-7" class="associatedconstant trait-impl"><a href="#associatedconstant.SCHEME-7" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.SCHEME" class="constant">SCHEME</a>: <a class="enum" href="enum.Scheme.html" title="enum object_store::Scheme">Scheme</a> = Scheme::Oss</h4></section><section id="associatedtype.Config-7" class="associatedtype trait-impl"><a href="#associatedtype.Config-7" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Config" class="associatedtype">Config</a> = <a class="struct" href="services/struct.OssConfig.html" title="struct object_store::services::OssConfig">OssConfig</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Builder-for-S3" class="impl"><a href="#impl-Builder-for-S3" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.ObjectStoreBuilder.html" title="trait object_store::ObjectStoreBuilder">Builder</a> for <a class="struct" href="services/struct.S3.html" title="struct object_store::services::S3">S3Builder</a></h3></section></summary><div class="impl-items"><section id="associatedconstant.SCHEME-8" class="associatedconstant trait-impl"><a href="#associatedconstant.SCHEME-8" class="anchor">§</a><h4 class="code-header">const <a href="#associatedconstant.SCHEME" class="constant">SCHEME</a>: <a class="enum" href="enum.Scheme.html" title="enum object_store::Scheme">Scheme</a> = Scheme::S3</h4></section><section id="associatedtype.Config-8" class="associatedtype trait-impl"><a href="#associatedtype.Config-8" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Config" class="associatedtype">Config</a> = <a class="struct" href="services/struct.S3Config.html" title="struct object_store::services::S3Config">S3Config</a></h4></section></div></details></div><script src="../trait.impl/opendal/types/builder/trait.Builder.js" data-ignore-extern-crates="std,opendal" async></script></section></div></main></body></html>