mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-15 08:22:38 +00:00
45 lines
18 KiB
HTML
45 lines
18 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="Layer intercepts an operator’s composed runtime resources."><title>Layer in object_store::layers::mock - 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-1ed95124.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.98.1 (48a229cea 2026-09-01)" data-channel="1.98.1" data-search-js="search-9944d736.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-417ebf0a.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="#">Layer</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.4.0-alpha.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Layer</a></h2><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.apply_context" title="apply_context">apply_context</a></li><li><a href="#method.apply_service" title="apply_service">apply_service</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Layer-for-MetricsLayer%3CI%3E" title="MetricsLayer<I>">MetricsLayer<I></a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In object_<wbr>store::<wbr>layers::<wbr>mock</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">object_store</a>::<wbr><a href="../index.html">layers</a>::<wbr><a href="index.html">mock</a></div><h1>Trait <span class="trait">Layer</span> <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 Layer:
|
||
<a class="trait" href="https://doc.rust-lang.org/1.98.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>
|
||
+ <a class="trait" href="https://doc.rust-lang.org/1.98.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>
|
||
+ <a class="trait" href="https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>
|
||
+ <a class="trait" href="https://doc.rust-lang.org/1.98.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>
|
||
+ 'static {
|
||
// Provided methods
|
||
fn <a href="#method.apply_service" class="fn">apply_service</a>(&self, srv: <a class="struct" href="https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn ServiceDyn>) -> <a class="struct" href="https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn ServiceDyn> <a href="#" class="tooltip" data-notable-ty="Arc<dyn ServiceDyn>">ⓘ</a> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.apply_context" class="fn">apply_context</a>(
|
||
&self,
|
||
srv: <a class="struct" href="https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn ServiceDyn>,
|
||
inner: <a class="struct" href="../../struct.OperationContext.html" title="struct object_store::OperationContext">OperationContext</a>,
|
||
) -> <a class="struct" href="../../struct.OperationContext.html" title="struct object_store::OperationContext">OperationContext</a> { ... }
|
||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Layer intercepts an operator’s composed runtime resources.</p>
|
||
<p>A layer receives the current stack for each plane and returns the stack that
|
||
should be used by operators built with this layer. Implementations can wrap
|
||
the operation service, the operation context (HTTP transport and executor),
|
||
or both.</p>
|
||
<p><a href="../../struct.ObjectStore.html" title="struct object_store::ObjectStore"><code>Operator</code></a> applies layers by first composing the service
|
||
stack with <a href="trait.Layer.html#method.apply_service" title="method object_store::layers::mock::Layer::apply_service"><code>Layer::apply_service</code></a>, then composing <a href="../../struct.OperationContext.html" title="struct object_store::OperationContext"><code>OperationContext</code></a> with
|
||
<a href="trait.Layer.html#method.apply_context" title="method object_store::layers::mock::Layer::apply_context"><code>Layer::apply_context</code></a>. The context hook receives the final service stack
|
||
so resource wrappers can observe service identity or capability when needed.</p>
|
||
<p>Hooks take <code>&self</code>, so layers that keep mutable state must use interior
|
||
mutability. That state must remain <code>Send</code> and <code>Sync</code> because layers are
|
||
shared across cloned operators and concurrent operations.</p>
|
||
</div></details><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.apply_service" class="method"><h4 class="code-header">fn <a href="#method.apply_service" class="fn">apply_service</a>(&self, srv: <a class="struct" href="https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn ServiceDyn>) -> <a class="struct" href="https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn ServiceDyn> <a href="#" class="tooltip" data-notable-ty="Arc<dyn ServiceDyn>">ⓘ</a></h4></section></summary><div class="docblock"><p>Intercept the operation service stack.</p>
|
||
<p>Operation layers should return a service that forwards unchanged
|
||
operations to <code>inner</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="method.apply_context" class="method"><h4 class="code-header">fn <a href="#method.apply_context" class="fn">apply_context</a>(
|
||
&self,
|
||
srv: <a class="struct" href="https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn ServiceDyn>,
|
||
inner: <a class="struct" href="../../struct.OperationContext.html" title="struct object_store::OperationContext">OperationContext</a>,
|
||
) -> <a class="struct" href="../../struct.OperationContext.html" title="struct object_store::OperationContext">OperationContext</a></h4></section></summary><div class="docblock"><p>Intercept the operation context (HTTP transport and executor).</p>
|
||
<p>Return <code>inner</code> unchanged for layers that do not affect HTTP requests or
|
||
spawned tasks.</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 <b>is</b> <a href="https://doc.rust-lang.org/1.98.1/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety".</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-Layer-for-MetricsLayer%3CI%3E" class="impl"><a href="#impl-Layer-for-MetricsLayer%3CI%3E" class="anchor">§</a><h3 class="code-header">impl<I> <a class="trait" href="trait.Layer.html" title="trait object_store::layers::mock::Layer">Layer</a> for MetricsLayer<I><div class="where">where
|
||
I: MetricsIntercept,</div></h3></section></summary><div class="impl-items"><section id="method.apply_service-1" class="method trait-impl"><a href="#method.apply_service-1" class="anchor">§</a><h4 class="code-header">fn <a class="fn">apply_service</a>(&self, inner: <a class="struct" href="https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn ServiceDyn>) -> <a class="struct" href="https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn ServiceDyn> <a href="#" class="tooltip" data-notable-ty="Arc<dyn ServiceDyn>">ⓘ</a></h4></section><section id="method.apply_context-1" class="method trait-impl"><a href="#method.apply_context-1" class="anchor">§</a><h4 class="code-header">fn <a class="fn">apply_context</a>(
|
||
&self,
|
||
srv: <a class="struct" href="https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn ServiceDyn>,
|
||
inner: <a class="struct" href="../../struct.OperationContext.html" title="struct object_store::OperationContext">OperationContext</a>,
|
||
) -> <a class="struct" href="../../struct.OperationContext.html" title="struct object_store::OperationContext">OperationContext</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><div class="negative-marker"></div><section id="impl-Layer-for-CapabilityOverrideLayer" class="impl"><a href="#impl-Layer-for-CapabilityOverrideLayer" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Layer.html" title="trait object_store::layers::mock::Layer">Layer</a> for <a class="struct" href="../struct.CapabilityOverrideLayer.html" title="struct object_store::layers::CapabilityOverrideLayer">CapabilityOverrideLayer</a></h3></section><section id="impl-Layer-for-HdfsCompatibilityLayer" class="impl"><a class="src rightside" href="../../../src/object_store/layers/hdfs.rs.html#131-138">Source</a><a href="#impl-Layer-for-HdfsCompatibilityLayer" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Layer.html" title="trait object_store::layers::mock::Layer">Layer</a> for <a class="struct" href="../struct.HdfsCompatibilityLayer.html" title="struct object_store::layers::HdfsCompatibilityLayer">HdfsCompatibilityLayer</a></h3></section><section id="impl-Layer-for-MockLayer" class="impl"><a class="src rightside" href="../../../src/object_store/layers/mock.rs.html#63-74">Source</a><a href="#impl-Layer-for-MockLayer" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Layer.html" title="trait object_store::layers::mock::Layer">Layer</a> for <a class="struct" href="struct.MockLayer.html" title="struct object_store::layers::mock::MockLayer">MockLayer</a></h3></section><section id="impl-Layer-for-PrometheusLayer" class="impl"><a href="#impl-Layer-for-PrometheusLayer" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Layer.html" title="trait object_store::layers::mock::Layer">Layer</a> for <a class="struct" href="../struct.PrometheusLayer.html" title="struct object_store::layers::PrometheusLayer">PrometheusLayer</a></h3></section><section id="impl-Layer-for-SimulateLayer" class="impl"><a href="#impl-Layer-for-SimulateLayer" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Layer.html" title="trait object_store::layers::mock::Layer">Layer</a> for <a class="struct" href="../struct.SimulateLayer.html" title="struct object_store::layers::SimulateLayer">SimulateLayer</a></h3></section><section id="impl-Layer-for-TimeoutLayer" class="impl"><a href="#impl-Layer-for-TimeoutLayer" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Layer.html" title="trait object_store::layers::mock::Layer">Layer</a> for <a class="struct" href="../struct.TimeoutLayer.html" title="struct object_store::layers::TimeoutLayer">TimeoutLayer</a></h3></section><section id="impl-Layer-for-TracingLayer" class="impl"><a href="#impl-Layer-for-TracingLayer" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Layer.html" title="trait object_store::layers::mock::Layer">Layer</a> for <a class="struct" href="../struct.TracingLayer.html" title="struct object_store::layers::TracingLayer">TracingLayer</a></h3></section><section id="impl-Layer-for-LoggingLayer%3CI%3E" class="impl"><a href="#impl-Layer-for-LoggingLayer%3CI%3E" class="anchor">§</a><h3 class="code-header">impl<I> <a class="trait" href="trait.Layer.html" title="trait object_store::layers::mock::Layer">Layer</a> for <a class="struct" href="../struct.LoggingLayer.html" title="struct object_store::layers::LoggingLayer">LoggingLayer</a><I><div class="where">where
|
||
I: <a class="trait" href="../trait.LoggingInterceptor.html" title="trait object_store::layers::LoggingInterceptor">LoggingInterceptor</a>,</div></h3></section><section id="impl-Layer-for-RetryLayer%3CI%3E" class="impl"><a href="#impl-Layer-for-RetryLayer%3CI%3E" class="anchor">§</a><h3 class="code-header">impl<I> <a class="trait" href="trait.Layer.html" title="trait object_store::layers::mock::Layer">Layer</a> for <a class="struct" href="../struct.RetryLayer.html" title="struct object_store::layers::RetryLayer">RetryLayer</a><I><div class="where">where
|
||
I: <a class="trait" href="../trait.RetryInterceptor.html" title="trait object_store::layers::RetryInterceptor">RetryInterceptor</a>,</div></h3></section><section id="impl-Layer-for-ConcurrentLimitLayer%3CS%3E" class="impl"><a href="#impl-Layer-for-ConcurrentLimitLayer%3CS%3E" class="anchor">§</a><h3 class="code-header">impl<S> <a class="trait" href="trait.Layer.html" title="trait object_store::layers::mock::Layer">Layer</a> for <a class="struct" href="../struct.ConcurrentLimitLayer.html" title="struct object_store::layers::ConcurrentLimitLayer">ConcurrentLimitLayer</a><S><div class="where">where
|
||
S: <a class="trait" href="../trait.ConcurrentLimitSemaphore.html" title="trait object_store::layers::ConcurrentLimitSemaphore">ConcurrentLimitSemaphore</a>,
|
||
<S as <a class="trait" href="../trait.ConcurrentLimitSemaphore.html" title="trait object_store::layers::ConcurrentLimitSemaphore">ConcurrentLimitSemaphore</a>>::<a class="associatedtype" href="../trait.ConcurrentLimitSemaphore.html#associatedtype.Permit" title="type object_store::layers::ConcurrentLimitSemaphore::Permit">Permit</a>: <a class="trait" href="https://doc.rust-lang.org/1.98.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/1.98.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + 'static + <a class="trait" href="https://doc.rust-lang.org/1.98.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a>,</div></h3></section></div><script src="../../../trait.impl/opendal_core/raw/layer/trait.Layer.js" data-ignore-extern-crates="opendal_core,opendal_layer_concurrent_limit,opendal_layer_logging,opendal_layer_prometheus,opendal_layer_observe_metrics_common,opendal_layer_retry,opendal_layer_timeout,opendal_layer_tracing" async></script><script type="text/json" id="notable-traits-data">{"Arc<dyn ServiceDyn>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html\" title=\"struct alloc::sync::Arc\">Arc</a><R></code></h3><pre><code><div class=\"where\">impl<R> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.98.1/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for <a class=\"struct\" href=\"https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html\" title=\"struct alloc::sync::Arc\">Arc</a><R><div class=\"where\">where\n R: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.98.1/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> + <a class=\"trait\" href=\"https://doc.rust-lang.org/1.98.1/std/io/trait.IoHandle.html\" title=\"trait std::io::IoHandle\">IoHandle</a> + ?<a class=\"trait\" href=\"https://doc.rust-lang.org/1.98.1/core/marker/trait.Sized.html\" title=\"trait core::marker::Sized\">Sized</a>,\n <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.98.1/std/primitive.reference.html\">&'a R</a>: for<'a> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.98.1/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a>,</div></div><div class=\"where\">impl<W> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.98.1/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a> for <a class=\"struct\" href=\"https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html\" title=\"struct alloc::sync::Arc\">Arc</a><W><div class=\"where\">where\n W: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.98.1/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a> + <a class=\"trait\" href=\"https://doc.rust-lang.org/1.98.1/std/io/trait.IoHandle.html\" title=\"trait std::io::IoHandle\">IoHandle</a> + ?<a class=\"trait\" href=\"https://doc.rust-lang.org/1.98.1/core/marker/trait.Sized.html\" title=\"trait core::marker::Sized\">Sized</a>,\n <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.98.1/std/primitive.reference.html\">&'a W</a>: for<'a> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.98.1/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a>,</div></div>"}</script></section></div></main></body></html> |